
     f<)                       d dl mZ ddlmZmZ d dlmZ d dlZd dlZddl	m
Z
  G d de          Ze G d	 d
                      Z G d dej                  Z G d dej                  Zd1dZd2dZd3dZ	 d4d5dZ	 	 	 	 	 	 	 d6d7d'Z ed(          e G d) d*                                  Z ed+          e G d, d-                                  Z ed.          e G d/ d0                                  ZdS )8    )annotations   )event_classT_JSON_DICT)	dataclassN)ioc                  B     e Zd ZdZddZed	d            Z fdZ xZS )
MemoryDumpConfigz[
    Configuration for memory dump. Used only when "memory-infra" category is enabled.
    returndictc                    | S N selfs    q/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/selenium/webdriver/common/devtools/v85/tracing.pyto_jsonzMemoryDumpConfig.to_json   s        jsonc                     | |          S r   r   clsr   s     r   	from_jsonzMemoryDumpConfig.from_json       s4yyr   c                j    d                     t                                                                S )NzMemoryDumpConfig({}))formatsuper__repr__)r   	__class__s    r   r   zMemoryDumpConfig.__repr__   s'    %,,UWW-=-=-?-?@@@r   )r   r   )r   r   r   r
   )	__name__
__module____qualname____doc__r   classmethodr   r   __classcell__)r   s   @r   r
   r
      s                [A A A A A A A A Ar   r
   c                      e Zd ZU dZded<   dZded<   dZded<   dZded<   dZded	<   dZ	ded
<   dZ
ded<   dZded<   d Zed             ZdS )TraceConfigNtyping.Optional[str]record_modetyping.Optional[bool]enable_samplingenable_systraceenable_argument_filterz!typing.Optional[typing.List[str]]included_categoriesexcluded_categoriessynthetic_delaysz!typing.Optional[MemoryDumpConfig]memory_dump_configc                   t                      }| j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d<   | j        d | j        D             |d<   | j        d | j        D             |d<   | j        d	 | j        D             |d
<   | j        | j        	                                |d<   |S )N
recordModeenableSamplingenableSystraceenableArgumentFilterc                    g | ]}|S r   r   .0is     r   
<listcomp>z'TraceConfig.to_json.<locals>.<listcomp>C       )N)N)N!)N)N)Nr   includedCategoriesc                    g | ]}|S r   r   r8   s     r   r;   z'TraceConfig.to_json.<locals>.<listcomp>E   r<   r   excludedCategoriesc                    g | ]}|S r   r   r8   s     r   r;   z'TraceConfig.to_json.<locals>.<listcomp>G   s    &H&H&HQq&H&H&Hr   syntheticDelaysmemoryDumpConfig)
r   r)   r+   r,   r-   r.   r/   r0   r1   r   )r   r   s     r   r   zTraceConfig.to_json8   s    vv'!%!1D+%)%9D!"+%)%9D!"&2+/+FD'(#/)N)NT5M)N)N)ND%&#/)N)NT5M)N)N)ND%& ,&H&H$2G&H&H&HD"#".'+'>'F'F'H'HD#$r   c                    | d|v rt          |d                   nd d|v rt          |d                   nd d|v rt          |d                   nd d|v rt          |d                   nd d|v rd |d         D             nd d|v rd |d         D             nd d	|v rd
 |d	         D             nd d|v r t                              |d                   nd           S )Nr3   r4   r5   r6   r=   c                ,    g | ]}t          |          S r   strr8   s     r   r;   z)TraceConfig.from_json.<locals>.<listcomp>S        L L LAQ L L Lr   r?   c                ,    g | ]}t          |          S r   rE   r8   s     r   r;   z)TraceConfig.from_json.<locals>.<listcomp>T   rG   r   rA   c                ,    g | ]}t          |          S r   rE   r8   s     r   r;   z)TraceConfig.from_json.<locals>.<listcomp>U   s    FFFc!ffFFFr   rB   )r)   r+   r,   r-   r.   r/   r0   r1   )rF   boolr
   r   r   s     r   r   zTraceConfig.from_jsonL   sD   s3?43G3GD.///T<LPT<T<TD&6!7888Z^<LPT<T<TD&6!7888Z^I_cgIgIg4-C(D#E#E#EmqPdhlPlPl L L6J1K L L L LrvPdhlPlPl L L6J1K L L L LrvJ[_cJcJcFFd3D.EFFFFimWimqWqWq/99$?Q:RSSSw{	
 	
 	
 		
r   )r    r!   r"   r)   __annotations__r+   r,   r-   r.   r/   r0   r1   r   r$   r   r   r   r   r'   r'      s          )-K,,,, .2O1111 .2O1111 598888 >BAAAA >BAAAA ;?>>>> =A@@@@  ( 

 

 [

 

 

r   r'   c                  6    e Zd ZdZdZdZd Zed             ZdS )StreamFormatz
    Data format of a trace. Can be either the legacy JSON format or the
    protocol buffer format. Note that the JSON format will be deprecated soon.
    r   protoc                    | j         S r   valuer   s    r   r   zStreamFormat.to_jsonb   
    zr   c                     | |          S r   r   r   s     r   r   zStreamFormat.from_jsone   r   r   N)	r    r!   r"   r#   JSONPROTOr   r$   r   r   r   r   rM   rM   Z   sT          DE     [  r   rM   c                  6    e Zd ZdZdZdZd Zed             ZdS )StreamCompressionzB
    Compression type to use for traces returned via streams.
    nonegzipc                    | j         S r   rP   r   s    r   r   zStreamCompression.to_jsonq   rR   r   c                     | |          S r   r   r   s     r   r   zStreamCompression.from_jsont   r   r   N)	r    r!   r"   r#   NONEGZIPr   r$   r   r   r   r   rW   rW   j   sT          DD     [  r   rW   r   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]c               #     K   ddi} | V }dS )z'
    Stop trace events collection.
    methodzTracing.endNr   cmd_dictr   s     r   endrc   y   s#      
 	-H >>DDDr   <typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[str]]c               #  :   K   ddi} | V }d |d         D             S )zc
    Gets supported tracing categories.

    :returns: A list of supported tracing categories.
    r`   zTracing.getCategoriesc                ,    g | ]}t          |          S r   rE   r8   s     r   r;   z"get_categories.<locals>.<listcomp>   s    ///qCFF///r   
categoriesr   ra   s     r   get_categoriesrh      s9       	)H >>D//D.////r   sync_idrF   c              #  B   K   t                      }| |d<   d|d}|V }dS )zh
    Record a clock sync marker in the trace.

    :param sync_id: The ID of this clock sync marker
    syncIdzTracing.recordClockSyncMarkerr`   paramsNr   )ri   rm   rb   r   s       r   record_clock_sync_markerro      s<       &&FF81 H >>DDDr   deterministicr*   Ctyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[str, bool]]c              #     K   t                      }| | |d<   d|d}|V }t          |d                   t          |d                   fS )aI  
    Request a global memory dump.

    :param deterministic: *(Optional)* Enables more deterministic results by forcing garbage collection
    :returns: A tuple with the following items:

        0. **dumpGuid** - GUID of the resulting global memory dump.
        1. **success** - True iff the global memory dump succeeded.
    Nrp   zTracing.requestMemoryDumprl   dumpGuidsuccess)r   rF   rJ   )rp   rm   rb   r   s       r   request_memory_dumpru      sg       &&F "/- H >>DDT)_ r   rg   r(   optionsbuffer_usage_reporting_intervaltyping.Optional[float]transfer_modestream_formattyping.Optional[StreamFormat]stream_compression"typing.Optional[StreamCompression]trace_configtyping.Optional[TraceConfig]c              #    K   t                      }| | |d<   |||d<   |||d<   |||d<   ||                                |d<   ||                                |d<   ||                                |d<   d	|d
}|V }	dS )a7  
    Start trace events collection.

    :param categories: *(Optional)* Category/tag filter
    :param options: *(Optional)* Tracing options
    :param buffer_usage_reporting_interval: *(Optional)* If set, the agent will issue bufferUsage events at this interval, specified in milliseconds
    :param transfer_mode: *(Optional)* Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ```ReportEvents````).
    :param stream_format: *(Optional)* Trace data format to use. This only applies when using ````ReturnAsStream```` transfer mode (defaults to ````json````).
    :param stream_compression: *(Optional)* Compression format to use. This only applies when using ````ReturnAsStream```` transfer mode (defaults to ````none```)
    :param trace_config: *(Optional)*
    Nrg   rv   bufferUsageReportingIntervaltransferModestreamFormatstreamCompressiontraceConfigzTracing.startrl   )r   r   )
rg   rv   rw   ry   rz   r|   r~   rm   rb   r   s
             r   startr      s      ( &&F)|#y&21P-. !.~ !.!6!6!8!8~%&8&@&@&B&B"# , 4 4 6 6}! H >>DDDr   zTracing.bufferUsagec                  F    e Zd ZU ded<   ded<   ded<   ed
d            Zd	S )BufferUsagerx   percent_fullevent_countrQ   r   r   r   c                     | d|v rt          |d                   nd d|v rt          |d                   nd d|v rt          |d                   nd           S )NpercentFull
eventCountrQ   )r   r   rQ   )floatr   s     r   r   zBufferUsage.from_json   sv    s7D7L7LtM2333RV5AT5I5Id<0111t*1T//%W&&&t
 
 
 	
r   N)r   r   r   r   )r    r!   r"   rK   r$   r   r   r   r   r   r      s\         
 )((('''' "!!!
 
 
 [
 
 
r   r   zTracing.dataCollectedc                  6    e Zd ZU dZded<   ed	d            ZdS )
DataCollectedz
    Contains an bucket of collected trace events. When tracing is stopped collected events will be
    send as a sequence of dataCollected events followed by tracingComplete event.
    ztyping.List[dict]rQ   r   r   r   c                :     | d |d         D                       S )Nc                ,    g | ]}t          |          S r   rn   r8   s     r   r;   z+DataCollected.from_json.<locals>.<listcomp>  s    222q477222r   rQ   rP   r   r   s     r   r   zDataCollected.from_json  s0    s22DM222
 
 
 	
r   N)r   r   r   r   r    r!   r"   r#   rK   r$   r   r   r   r   r   r      sL           
 
 
 [
 
 
r   r   zTracing.tracingCompletec                  T    e Zd ZU dZded<   ded<   ded<   ded	<   edd            ZdS )TracingCompletez
    Signals that tracing is stopped and there is no trace buffers pending flush, all data were
    delivered via dataCollected events.
    rJ   data_loss_occurredz typing.Optional[io.StreamHandle]streamr{   trace_formatr}   r|   r   r   r   c           	     (    | t          |d                   d|v r%t          j                            |d                   nd d|v r t                              |d                   nd d|v r t
                              |d                   nd           S )NdataLossOccurredr   traceFormatr   )r   r   r   r|   )rJ   r   StreamHandler   rM   rW   r   s     r   r   zTracingComplete.from_json  s    s#D);$<==@HD@P@P2?,,T(^<<<VZHUY]H]H]//]0CDDDcgYlptYtYt0::4@S;TUUUz~	
 
 
 	
r   N)r   r   r   r   r   r   r   r   r   r   
  sp           ,,,,////::::
 
 
 [
 
 
r   r   )r   r^   )r   rd   )ri   rF   r   r^   r   )rp   r*   r   rq   )NNNNNNN)rg   r(   rv   r(   rw   rx   ry   r(   rz   r{   r|   r}   r~   r   r   r^   )
__future__r   utilr   r   dataclassesr   enumtyping r   r   r
   r'   EnumrM   rW   rc   rh   ro   ru   r   r   r   r   r   r   r   <module>r      s   # " " " " " * * * * * * * * ! ! ! ! ! !        A A A A At A A A 8
 8
 8
 8
 8
 8
 8
 8
v    49        	      
0 
0 
0 
0   $ 04    6 ,0(,BF.27;AE59' ' ' ' 'T "##

 
 
 
 
 
 
  $#
& $%%

 
 
 
 
 
 
  &%
 &''

 
 
 
 
 
 
  ('
 
 
r   