
    iH                     V   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mZmZ d dlZd dlZd dlmZ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m Z m!Z!m"Z"m#Z#m$Z$m%Z% d dl&m'Z' d d	l(m)Z) d d
l*m+Z+m,Z, d dl-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3 d dl4m5Z5m6Z6 d dl7m8Z8 d dl9m:Z: d dl;m<Z< d dl=m>Z> d dl?m@Z@mAZAmBZB d dlCmDZD d dlEmFZF erld dl
mGZG d dl
mHZH d dl
mIZI d dl
mJZJ d dl
mKZK d dl
mLZL d dl
mMZM d dlNmOZOmPZPmQZQmRZRmSZS d dl4mTZT d dlUmVZV d dlWmXZX d dlYmZZZ d d l*m[Z[ d d!l\m]Z] d d"l^m_Z_  eMd#eT$      Z` ed%      Zad&e2d'e2d(gd)Zbd* Zc	 edZe G d+ d,      Zh G d- d.eh      Zi G d/ d0eh      Zjd d1l
mZ er G d2 d3e3eekeGf         Zl G d4 d5e3ej      Zmy d6        Zl d7        Zmy# ef$ r egZeY `w xY w)8    N)Mapping)datetimetimezone)import_module)TYPE_CHECKINGListDictcastoverload)PY37check_uwsgi_thread_support)AnnotatedValue
ContextVarcapture_internal_exceptionscurrent_stacktraceenv_to_boolformat_timestampget_sdk_nameget_type_nameget_default_releasehandle_in_app	is_geventloggerget_before_send_logget_before_send_metrichas_logs_enabledhas_metrics_enabled)	serialize)trace)BaseHttpTransportmake_transport)SPANDATADEFAULT_MAX_VALUE_LENGTHDEFAULT_OPTIONSINSTRUMENTERVERSIONClientConstructor)_DEFAULT_INTEGRATIONSsetup_integrations)DedupeIntegration)SessionFlusher)Envelope)setup_continuous_profiler)has_profiling_enabledProfilesetup_profiler)EventScrubber)Monitor)Any)Callable)Optional)Sequence)Type)Union)TypeVar)EventHintSDKInfoLogMetric)Integration)Scope)Session)SpotlightClient)	Transport
LogBatcherMetricsBatcherI)boundclient_init_debugzsentry.pythonzpypi:sentry-sdk)nameversion)rK   rL   packagesc                     | r)t        | d   t        t        f      s| d   | d   }| dd  } nd }t        |       dkD  rt	        d      t        t              }t        | i |}||j                  d      ||d<   |j                         D ]  \  }}||vrt	        d|      |||<    |d   "t        j                  j                  d      |d<   |d   t               |d<   |d   &t        j                  j                  d	      xs d
|d<   |d   1t        t        j                  j                  d      d      xs d|d<   |d   't        t        d      rt        j                         |d<   |d   t         j"                  |d<   |d   	 t        j$                         }||d<   |d   du r
|d   d|d<   |d   t)        |d   dn|d         |d<   |d   r-t        |d   t*              st-        j.                  d       d |d<   |d   1t        t        j                  j                  d      d      xs d|d<   |d   t1        j2                  dt4        d        |S # t&        $ r d }Y w xY w)!Nr      z+Only single positional argument is expecteddsnzUnknown option 
SENTRY_DSNreleaseenvironmentSENTRY_ENVIRONMENT
productiondebugSENTRY_DEBUGTstrictFserver_namegethostnameinstrumenterproject_rootenable_tracingtraces_sample_rate      ?event_scrubbersend_default_pii)rb   socket_optionszxIgnoring socket_options because of unexpected format. See urllib3.HTTPConnection.socket_options for the expected format.
keep_aliveSENTRY_KEEP_ALIVEzVThe `enable_tracing` parameter is deprecated. Please use `traces_sample_rate` instead.   )
stacklevel)
isinstancebytesstrlen	TypeErrordictr$   getitemsosenvironr   r   hasattrsocketr[   r%   SENTRYgetcwd	Exceptionr1   listr   warningwarningswarnDeprecationWarning)argskwargsrP   rvoptionskeyvaluer]   s           q/var/www/html/hwPaymentPortal-be-dev/hw-payment-portal-api/venv/lib/python3.12/site-packages/sentry_sdk/client.py_get_optionsr   U   s   DGeS\2d1go1gABx
4y1}EFF	o	BD#F#G
7;;u-5mmo 
Ub=38993	 
%yJJNN<05		)}+-9	- JJNN+?@PL=	'{!"**.."@NWRW7	- WV]%C"..0=	.!)00>	.!	 99;L *>	
t#+?(@(H#& 	
#,./7R@R=S 
 

Jr2B/CT$J G	
  $	,

':;DIRU 	< 

'd	
 IC  	 L	 s   I I-,I-c                       e Zd ZdZdZddZd Zd Zed        Z	d Z
d Zd	 Zd
 Zd Zd Zered        Zed        Zd Zd Zd Zd Zd Zy)
BaseClientzp
    .. versionadded:: 2.0.0

    The basic definition of a client that is used for sending data to Sentry.
    Nc                 Z    ||nt         | _        d | _        d | _        d | _        d | _        y N)r$   r   	transportmonitorlog_batchermetrics_batcher)selfr   s     r   __init__zBaseClient.__init__   s.    ")"5w?#    c                 
    di iS Nr    r   r|   r}   s      r   __getstate__zBaseClient.__getstate__   s    2r   c                      y r   r   r   s      r   __setstate__zBaseClient.__setstate__       r   c                      y r   r   r   s    r   rP   zBaseClient.dsn   s     r   c                      y)NFr   r   s    r   should_send_default_piiz"BaseClient.should_send_default_pii   s    r   c                      y)u
        .. versionadded:: 2.0.0

        Returns whether the client is active (able to send data to Sentry)
        Fr   r   s    r   	is_activezBaseClient.is_active   s     r   c                      y r   r   r   s      r   capture_eventzBaseClient.capture_event       r   c                      y r   r   )r   logs     r   _capture_logzBaseClient._capture_log   r   r   c                      y r   r   )r   metrics     r   _capture_metriczBaseClient._capture_metric   r   r   c                      y r   r   r   s      r   capture_sessionzBaseClient.capture_session   r   r   c                      y r   r   r   name_or_classs     r   get_integrationzBaseClient.get_integration        r   c                      y r   r   r   s     r   r   zBaseClient.get_integration   r   r   c                      y r   r   r   s     r   r   zBaseClient.get_integration   r   r   c                      y r   r   r   s      r   closezBaseClient.close   r   r   c                      y r   r   r   s      r   flushzBaseClient.flush   r   r   c                     | S r   r   r   s    r   	__enter__zBaseClient.__enter__       r   c                      y r   r   r   exc_type	exc_valuetbs       r   __exit__zBaseClient.__exit__  r   r   r   )__name__
__module____qualname____doc__	spotlightr   r   r   propertyrP   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r      s     I$   		 
	 
	 
	r   r   c                       e Zd ZdZy)NonRecordingClientz
    .. versionadded:: 2.0.0

    A client that does not send any events to Sentry. This is used as a fallback when the Sentry SDK is not yet initialized.
    N)r   r   r   r   r   r   r   r   r   	  s     	r   r   c                        e Zd ZdZ fdZd Zd Zd Zd Zd Z	d Z
ed	        Zd
 Zd Z	 ddZd Zd Z	 	 ddZd Zd Zd Zered        Zed        Zd Z	 	 ddZ	 	 ddZd Zd Z xZS )_ClientaI  
    The client is internally responsible for capturing the events and
    forwarding them to sentry through the configured transport.  It takes
    the client options as keyword arguments and optionally the DSN as first
    argument.

    Alias of :py:class:`sentry_sdk.Client`. (Was created for better intelisense support)
    c                 `    t         t        |   t        |i |       | j	                          y )Nr   )superr   r   get_options
_init_impl)r   r|   r}   	__class__s      r   r   z_Client.__init__  s)    gt%k4.J6.J%Kr   c                     d| j                   iS r   r   r   s    r   r   z_Client.__getstate__"  s    4<<((r   c                 8    |d   | _         | j                          y r   )r   r   )r   states     r   r   z_Client.__setstate__&  s    Y'r   c                    |D ]b  }d}|d   }|j                  dd      \  }}	 t        |      }t        ||      }t        ||t	        |             t        j                  d|       d y# t        $ r 	 |j                  dd      \  }}t        |      }t        ||      }	t        |	|      }t        |	j                  |         }
t	        |      }|
t        t        fv rt        |      }t        |	||       t        |||	       t        j                  d|       n-# t        $ r!}t        j                  d||       Y d}~nd}~ww xY wY Et        $ r"}t        j                  d||       Y d}~jd}~ww xY w)z
        Instruments the functions given in the list `functions_to_trace` with the `@sentry_sdk.tracing.trace` decorator.
        Nqualified_name.rO   zEnabled tracing for %szWCan not enable tracing for '%s'. (%s) Please check your `functions_to_trace` parameter.)rsplitr   getattrsetattrr   r   rV   module_not_found_errortype__dict__staticmethodclassmethodrv   rx   )r   functions_to_tracefunction
class_namefunction_qualnamemodule_namefunction_name
module_objfunction_obj	class_objfunction_typetraced_functiones                r   _setup_instrumentationz_Client._setup_instrumentation+  sw   
 + ,	HJ ()9 :):)A)A#q)I&K' +;7
&z=A
M53FG57HI,	 *  /:.@.@a.H+K!.{!;J '
J ?I#*9m#DL$(););M)J$KM&+L&9O${(CC*6*GI}oFJ
I>LL!9;LM  NNq)   m% sI   AA))	E23B$DE2	E!D=8E2=EE2E2E--E2c                     t         j                  d      } fd}	 t         j                   j                  d          t	         j                         _        d  _         j
                  r) j                  d   rt         j
                         _        t        |       _	        d  _
        t         j                        rddlm}  ||       _
        d  _        t         j                        rddlm}  ||       _        d	} j                  d
   |vrt%        dj'                  |             j                  d   j                  dd      rOt)        j*                  d       t,        j.                   j                  d<   dt0        vrt1        j2                  d       t5         j                  d    j                  d    j                  d    j                  d          _         j                  j                  d      }|Edt8        j:                  v r3t8        j:                  d   }t=        |d      }||n| j                  d<    j                  j                  d      rkddlm }  | j                         _!         j                  d   s?d }	d j                  d<   |	 j                  d<   |	 j                  d<   |	 j                  d <   tE        tG         j6                  jI                                     }
|
tJ        d!<   t)        j*                  d"|
       tM         j                        r	 tO         j                         n	 tS         j                  tJ        |$       t         j                  |        jU                   j                  j                  d&g               j                  s; j                  s/tM         j                        stW         j
                  tX              rt[                y y # tP        $ r }t)        j*                  d#|       Y d }~d }~ww xY w# tP        $ r }t)        j*                  d%|       Y d }~d }~ww xY w# t         j                  |       w xY w)'NFc                 V    j                   j                   j                  |        y y r   )r   capture_envelope)enveloper   s    r   _capture_envelopez-_Client._init_impl.<locals>._capture_envelopeb  s$    ~~)//9 *r   rV   enable_backpressure_handling)capture_funcr   rD   rF   )alwaysneversmallmediummax_request_body_sizez:Invalid value for max_request_body_size. Must be one of {}_experimentsotel_powered_performancezA[OTel] Enabling experimental OTel-powered performance monitoring.r\   zJsentry_sdk.integrations.opentelemetry.integration.OpenTelemetryIntegrationintegrationsdefault_integrationsauto_enabling_integrationsdisabled_integrations)with_defaultswith_auto_enabling_integrationsr   r   SENTRY_SPOTLIGHTTrX   )setup_spotlightrP   c                       y)Nr`   r   )_args_kwargss     r   <lambda>z$_Client._init_impl.<locals>.<lambda>  s    r   rb   error_samplertraces_samplerprofiles_samplerrK   zSetting SDK name to '%s'zCan not set up profiler. (%s))sdk_infor   z(Can not set up continuous profiler. (%s)r   )._client_init_debugrn   setr   r!   r   r   r2   r+   session_flusherr   r   sentry_sdk._log_batcherrE   r   r   sentry_sdk._metrics_batcherrG   
ValueErrorformatr   rV   r%   OTELr(   appendr)   r   rp   rq   r   sentry_sdk.spotlightr   r   r   rw   keysSDK_INFOr.   r0   rv   r-   r   rh   r    r   )r   	old_debugr   rE   rG   r   spotlight_configspotlight_env_valuer   
sample_allsdk_namer   s   `           r   r   z_Client._init_impl^  s   &**51		:
b	.""4<<#89+DLL9DNDL~~<< >?#*4>>#:DL#1?P#QD #D->#-;L#M #'D "4<<0F'5CT'U$$J!||34<QQ PWW-  ||N+//0JERW 0</@/@^,`01 *00d !3^,"ll+AB0401 '+ll3J&K!D  $||//<',>"**,L&(jj1C&D##./B4#P  (3 %, [) ||, A!0!>||E*!>J7;DLL!344>DLL15?DLL!127ADLL!34#D):):)?)?)A$BCH'HVLL3X>$T\\2E"4<<0P-!)%6 ""9-##DLL$4$45I2$NO LL$T\\2$..*;< '(	 =+ ! ELL!@!DDE ! PLL!KQOOP ""9-sZ   LQ 2O8 Q 	P$ 8	P!PQ P!!Q $	Q-QQ QQ Q'c                      y)r   Tr   r   s    r   r   z_Client.is_active  s     r   c                 @    | j                   j                  d      xs dS )z
        .. versionadded:: 2.0.0

        Returns whether the client should send default PII (Personally Identifiable Information) data to Sentry.
        rb   F)r   rn   r   s    r   r   z_Client.should_send_default_pii  s     || 23<u<r   c                      | j                   d   S )z%Returns the configured DSN as string.rP   r   r   s    r   rP   z_Client.dsn  s     ||E""r   c                    d }d }|j                  d      &t        j                  t        j                        |d<   |j                  d      dk(  }|t        t        t        t        t        t        f      |j                  dg                   }|j                  ||| j                        }|Q| j                  rD| j                  j                  d|rdnd       |r!| j                  j                  dd|d	z   
       y |}|t        t        t        t        t        t        f      |j                  dg                   z
  }	|r/|	dkD  r*| j                  | j                  j                  dd|	
       |j                  dd      |	z   }
|
dkD  r||
z   }|j                   dkD  rN|j                  di       }t#        |t$              s|j                  dg       ng }t        |      |j                   z   }|s}| j                  d   rnd|vrjd|vrfd|vrbt'               5  dt)        | j                  j                  dd      | j                  j                  dt*                    dddgi|d<   d d d        dD ]M  }|j                  |      | j                  |   %t        | j                  |         j-                         ||<   O |j                  d      :t/        t0              }t3        | j4                  j7                               |d<   ||d<   |j                  d      d|d<   t9        || j                  d   | j                  d   | j                  d          }|"| j                  d!   }|r|j;                  |       |!t%        |j                  dg       d"|i      |d<   |!t%        |j                  dg       d"|i      |d<   |nt        d#t=        t        d$|      | j                  j                  d%      | j                  j                  d      | j                  j                  d&      '            }| j                  d(   }|||j                  d      dk7  rd }t'               5   |||xs i       }d d d        |ct?        j@                  d)       | j                  r| j                  j                  d(d       |j                  d      rtC        jD                          |}| j                  d*   }|(|%|j                  d      dk(  rd }t        t        t        t        t        t        f      |j                  dg                   }t'               5   |||xs i       }d d d        |`t?        j@                  d+       | j                  r| j                  j                  d(d,       | j                  j                  d(d|d	z   -       nM|t        |j                  dg             z
  }	|	dkD  r*| j                  | j                  j                  d(d|	-       |}|S # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w).N	timestampr   transactionspansevent_processorerrordata_categoryspanrO   )r!  quantityr   _dropped_spansbreadcrumbsvaluesattach_stacktrace	exception
stacktracethreadsinclude_local_variablesTmax_value_length)r+  r,  F)r)  crashedcurrent)rR   rS   rZ   distsdkr   platformpythonin_app_excludein_app_includer]   ra   rk   r:   zDict[str, Any]r   custom_repr)r   r,  r5  before_sendzbefore send dropped eventbefore_send_transactionz%before send transaction dropped event)reasonr!  )r8  r!  r#  )#rn   r   nowr   utcrk   r
   r   r	   rj   objectapply_to_eventr   r   record_lost_eventpop_n_breadcrumbs_truncatedrh   r   r   r   r#   striprm   r  sortedr   r  r   scrub_eventr   r   infor*   reset_last_seen)r   eventhintscopeprevious_total_spansprevious_total_breadcrumbsis_transactionspans_beforeevent_spans_deltadropped_spansr%  r&  r   r  ra   r6  	new_eventr7  s                      r   _prepare_eventz_Client._prepare_event  s-     $%)"99[!)!)hll!;E+6*m;tDc6k):$;UYYwPR=STUL))%t||DF ~>>NN44)8F}G 5  &88-*0%1A%5 9 
 E&T$sF{+,eii.DE* K +/dnn6P00%Vk 1  "II&6:[HMq '3m'C$--1#iir: &k>B  OOHb1  K%"@"@@ +
 015(E)&,. *<8<8H8H$=t9" 261A1A$68P2"	+ (-'+$i $ C 	<Cyy~%$,,s*;*G c!2399;c
	< 99U#H~H'-d.?.?.D.D.F'GH^$#E%L99Z ( (E*LL)*LL)*LL(	
 !\\*:;N**51++		'2&0D(EE'N &1#1		-,u6P.Q$E- 
 )51*.,,*:*:;R*S%)\\%5%56H%I $ 0 0 ?	E ll=1#!		&!]2I,. ;'tzr:	; 78>>NN44%W 5  99[)%557E"&,,/H"I#/!		&!]2ItDc6k):$;UYYwPR=STUL,. G3E4:2F	G CD>>NN44,M 5  NN44,&,!-!1 5  +Sw1K-LL?t~~'ANN44,F[ 5  Ek J; ;4G Gs%   AX#X)X6X&)X36X?c                     |j                  d      }|y|d   }t        |d         }|d   j                  d|}| j                  d   D ]-  }t	        |t
              r||k(  s||k(  s yt        ||      s- y y)Nexc_infoFr   r   ignore_errorsT)rn   r   r   r   rh   rj   
issubclass)r   rE  rF  rR  r  error_type_nameerror_full_nameignored_errors           r   _is_ignored_errorz_Client._is_ignored_error  s    88J''4%-a[%;%;_M!\\/: 	 M -- O3}7We]3	  r   c                     |j                  d      dk(  }|ry|d uxr |j                   }|ry| j                  ||      }|ryy)Nr   r  TF)rn   _should_capturerX  )r   rE  rF  rG  rJ  ignoring_prevents_recursionignored_by_config_options          r   rZ  z_Client._should_capture  sX     6*m;&+4&7&U@U@U<U#&#'#9#9%#F #r   c                 0   | j                   j                  dd       }t        |      rt               5   |||      }d d d        n| j                   d   }	 dk  xr t	        j                         |k\  }|r*| j                  r| j                  j                  dd       yy# 1 sw Y   UxY w# t
        $ r t        j                  d       d}Y [t        $ r? t        |      rdnd\  }}t        j                  d|d	|d
t              d       d}Y w xY w)Nr  sample_rater`   zMThe provided error_sampler raised an error. Defaulting to sampling the event.F)r  returned)r^  containszThe provided  z an invalid value of zJ. The value should be a float or a bool. Defaulting to sampling the event.r  r   T)r   rn   callabler   random	NameErrorr   rx   rl   reprr   r=  )r   rE  rF  r  r^  not_in_sample_rate	parameterverbs           r   _should_sample_errorz_Client._should_sample_error  s    (($?M",. 9+E489 9 ,,}5K	'!,s!2!Uv}}+7U0 ~~00g0VK9 9  	'NN_ "' 	' M* .0 It
 NNdD$57 "'	's$   
B B,  B), DADDc                 |   d}d}d }|j                  d      xs i j                  d      }|rbd}|D ][  }t        |t              r|j                  xs i }|j                  d      }t        |t              sE|j                  d      du sYd} n |j                  d      }	|j
                  g|j                  d      xs i j                  d	      }
t        |
t              r|
ni }|j                         D ]  \  }}|j                         d
k(  s|} n |j                  |rdnd |	||j                  |xs |z          y )NFr(  r&  T	mechanismhandleduserrequestheadersz
user-agentr-  )statusrm  
user_agenterrors)rn   rh   r   r   r   rq  rm   ro   lowerupdaterr  )r   sessionrE  r-  erroredrq  
exceptionsr  rk  rm  ro  headers_dictkvs                 r   _update_session_from_eventz"_Client._update_session_from_event  s>    
ii,277A
G# e^4!KK-2E!IIk2	i1immI6NRW6W"G yy %yy+1r66yAG&0$&?7RL$**, 1779,!"J
 	 '9T!>>W%78	 	 	
r   c                    t        |xs d      }| j                  |||      sy|j                  dd      }|j                  d      }|#t	        j
                         j                  x|d<   }| j                  |||      }|y|r|j                  nd}|r| j                  ||       |j                  d      dk(  }|j                  d      dk(  }	|s|	s| j                  ||      sy|j                  d      }
|j                  d	i       j                  d
      xs i }|j                  di       }|d   t        t        j                  t        j                              d}|r||d
<   t!        |      }|rMt#        |t$              r+|j'                  |j)                  || j*                               |j-                  |       n%|	r|j/                  |       n|j1                  |       |
xs dD ]!  }|j3                  |j5                                # d}| j6                  r| j6                  j9                  |       |}| j:                  | j:                  j9                  |       |}|S )a  Captures an event.

        :param event: A ready-made event that can be directly sent to Sentry.

        :param hint: Contains metadata about the event that can be read from `before_send`, such as the original exception object or a HTTP request object.

        :param scope: An optional :py:class:`sentry_sdk.Scope` to apply to events.

        :returns: An event ID. May be `None` if there is no DSN set or of if the SDK decided to discard the event for other reasons. In such situations setting `debug=True` on `init()` may help.
        r   Nprofileevent_idr   r  check_inattachmentscontextsr   dynamic_sampling_context)r~  sent_at)ro  )rm   rZ  r>  rn   uuiduuid4hexrP  _sessionr{  ri  r   r   r9  r   r:  r,   rh   r/   add_profileto_jsonr   add_transactionadd_checkin	add_eventadd_itemto_envelope_itemr   r   r   )r   rE  rF  rG  r}  r~  	event_optru  rJ  
is_checkinr  trace_contextr  ro  r   
attachmentreturn_values                    r   r   z_Client.capture_event*  s6   " DJB##E47))It,99Z(+/::<+;+;;E*''tU;	 %*%..t++GU;"v.-?]]6*j8
 --eT:hh}-!j"599'BHb#0#4#45OQS#T  "*-'X\\(BC

 $7GGG,'7+$$W__Y%MN$$Y/  +y)%+ 	=Jj99;<	= >>NN++H5#L>>%NN++H5#Lr   c                    t        | j                        r|y t        j                         }t        j                         }t
        d   |d   d<   t
        d   |d   d<   | j                  j                  d      }|+t        j                  |d   vr||d   t        j                  <   | j                  j                  d      }|d|d   vr||d   d<   | j                  j                  d	      }|d
|d   vr||d   d
<   |j                  }|d|d   vr|j                  |d   d<   |j                  d      ?|j                  }|j                         }	||j                  |d<   n|	|	j                  |d<   |j                  6dD ]1  \  }
}||j                  v s|
|d   vs|j                  |   |d   |
<   3 | j                  j                  dd      }|r9t        j                   d|j                  d       d|j                  d              t#        | j                        }|	 ||i       }|y | j$                  r| j$                  j'                  |       y y )NrK   
attributessentry.sdk.namerL   sentry.sdk.versionrZ   rS   sentry.environmentrR   sentry.releasezsentry.trace.parent_span_idtrace_id)zuser.idid)z	user.nameusername)z
user.emailemailrV   Fz[Sentry Logs] [severity_text] body)r   r   
sentry_sdkget_current_scopeget_isolation_scoper  rn   r"   SERVER_ADDRESSr"  span_idr  get_active_propagation_contextr  _userr   rV   r   r   add)r   r   current_scopeisolation_scoperZ   rS   rR   r"  r  propagation_contextlog_attributeuser_attributerV   before_send_logs                 r   r   z_Client._capture_log  s   -"446$88:/7/?L+,2:92EL./ll&&}5"x'>'>c,FW'W9DCh556ll&&}5"';3|CT'T6AC23,,""9-#33|;L#L29C./!! =SEV V?C||C;<77:&'33K"1"P"P"R&"-"6"6J$0"5">">J   ,2 -~ #o&;&;;%S->>7F7L7L&8C%m4   %0LL!#''/":!;2cggfo=NO .dll;&!#r*C;  % r   c           
         t        | j                        r|y t        j                         }t        d   |d   d<   t        d   |d   d<   | j                  j                  d      }|d|d   vr||d   d<   | j                  j                  d      }|d	|d   vr||d   d	<   t        j                         }d
|d<   |r|j                  |d<   |j                  |d<   n-|j                         }|r|j                  r|j                  |d<   |j                  6dD ]1  \  }}||j                  v s||d   vs|j                  |   |d   |<   3 | j                  j                  dd      }	|	rKt        j                  d|j                  d       d|j                  d       d|j                  d              t        | j                        }
|
	 |
|i       }|y | j                  r| j                  j                  |       y y )NrK   r  r  rL   r  rS   r  rR   r  z$00000000-0000-0000-0000-000000000000r  r  r  rV   Fz[Sentry Metrics] [r   r  z: r   )r   r   r  r  r  rn   get_current_spanr  r  r  r  r   rV   r   r   r  )r   r   r  rS   rR   r"  r  metric_attributer  rV   before_send_metrics              r   r   z_Client._capture_metric  s'   "4<<0FN$88:2:62B|./5=i5H|12ll&&}5"';6,CW'W9DF< !56,,""9-#36,;O#O5<F< !12**,Cz!%F: $F9"1"P"P"R"':'C'C%8%A%Az"  ,5 0 . #o&;&;;(|0DD=L=R=R&>F<()9:   %0LL$VZZ%7$86::f;M:NbQWQ[Q[\cQdPef 4DLLA)'3F>  $$V,  r   c                 ~    |j                   st        j                  d       y | j                  j	                  |       y )Nz3Discarded session update because of missing release)rR   r   rC  r  add_session)r   ru  s     r   r   z_Client.capture_session  s,    
 KKMN  ,,W5r   c                      y r   r   r   s     r   r   z_Client.get_integration	  r   r   c                      y r   r   r   s     r   r   z_Client.get_integration  r   r   c                     t        |t              r|}n$|j                  |j                  }nt        d      | j                  j                  |      S )zReturns the integration for this client by name or class.
        If the client does not have that integration then `None` is returned.
        zIntegration has no name)rh   rj   
identifierr  r   rn   )r   r   integration_names      r   r   z_Client.get_integration  sP     mS),%%1,77677  $$%566r   c                    | j                   | j                  ||       | j                  j                          | j                  | j                  j                          | j
                  | j
                  j                          | j                  r| j                  j                          | j                   j                          d| _         yy)z
        Close the client and shut down the transport. Arguments have the same
        semantics as :py:meth:`Client.flush`.
        Ntimeoutcallback)r   r   r  killr   r   r   r   r  r  s      r   r   z_Client.close$  s     >>%JJwJ:  %%'+  %%'##/$$))+||!!#NN!!DN &r   c                 F   | j                   || j                  d   }| j                  j                          | j                  | j                  j                          | j
                  | j
                  j                          | j                   j                  ||       yy)a#  
        Wait for the current events to be sent.

        :param timeout: Wait for at most `timeout` seconds. If no `timeout` is provided, the `shutdown_timeout` option value is used.

        :param callback: Is invoked with the number of pending events and the configured timeout.
        Nshutdown_timeoutr  )r   r   r  r   r   r   r  s      r   r   z_Client.flush:  s     >>%,,'9:  &&(+  &&(##/$$**,NN  8 D &r   c                     | S r   r   r   s    r   r   z_Client.__enter__Q  r   r   c                 $    | j                          y r   )r   r   s       r   r   z_Client.__exit__U  s    

r   r   )NN)r   r   r   r   r   r   r   r   r   r   r   r   rP   rP  rX  rZ  ri  r{  r   r   r   r   r   r   r   r   r   r   r   __classcell__)r   s   @r   r   r     s    
)
1fw)r= # #
vp4 	,.`%
T 	SjA&F9-v6 		 
	 
	 
	7& "0 E.r   r   )r   c                       e Zd Zy)r   Nr   r   r   r   r   r   r   r   c      r   r   c                       e Zd Zy)ClientNr  r   r   r   r  r  f  r  r   r  c                      t         S r   )r   r   r   r   r  r  o  s    < r   c                      t         S r   )r   r   r   r   r  r  p  s    g r   )nrp   r  rc  rs   collections.abcr   r   r   	importlibr   typingr   r   r	   r
   r   ry   r  sentry_sdk._compatr   r   sentry_sdk.utilsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   sentry_sdk.serializerr   sentry_sdk.tracingr   sentry_sdk.transportr    r!   sentry_sdk.constsr"   r#   r$   r%   r&   r'   sentry_sdk.integrationsr(   r)   sentry_sdk.integrations.deduper*   sentry_sdk.sessionsr+   sentry_sdk.enveloper,   'sentry_sdk.profiler.continuous_profilerr-   (sentry_sdk.profiler.transaction_profilerr.   r/   r0   sentry_sdk.scrubberr1   sentry_sdk.monitorr2   r3   r4   r5   r6   r7   r8   r9   sentry_sdk._typesr:   r;   r<   r=   r>   r?   sentry_sdk.scoper@   sentry_sdk.sessionrA   r  rB   rC   r	  rE   r
  rG   rH   r  r  r   ModuleNotFoundErrorr   rv   ImportErrorr   r   r   rj   r   r  r   r   r   <module>r     sr   	    # ' # < <   ?    $ , $ B  N < . ( M 
 . &CC3&*4.2:;'A 34  +@AL^)0Z Zz	 	Dj DN !'c3h "G  (*K FS  )()s   F F('F(