
     f'Q                    v   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
 ddl	mZ ddl	mZ e G d	 d
                      Ze G d d                      Z G d dej                  Ze G d d                      Ze G d d                      ZdedZdfdZdfdZdfdZdgdZdhdZ	 didjd"Z	 	 	 	 	 	 	 	 dkdld5Zdmd7Zdnd9Z	 didod<Z	 	 dpdqd@ZdrdCZ	 	 	 dsdtdGZ dudIZ!dvdKZ"dwdMZ#	 didxdOZ$	 	 	 	 dydzdWZ%	 did{dYZ&d|d[Z'd}d\Z(	 	 	 dsd~daZ) edb          e G dc dd                                  Z*dS )    )annotations   )event_classT_JSON_DICT)	dataclassN)dom)network)pagec                  D    e Zd ZU dZded<   ded<   d Zed             ZdS )	ScreenOrientationz
    Screen orientation.
    strtype_intanglec                J    t                      }| j        |d<   | j        |d<   |S )Ntyper   )dictr   r   selfjsons     s/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/selenium/webdriver/common/devtools/v85/emulation.pyto_jsonzScreenOrientation.to_json   s&    vvzV
W    c                h     | t          |d                   t          |d                             S )Nr   r   )r   r   )r   r   clsr   s     r   	from_jsonzScreenOrientation.from_json"   s9    sd6l##d7m$$
 
 
 	
r   N__name__
__module____qualname____doc____annotations__r   classmethodr    r   r   r   r      s`           JJJ JJJ   
 
 [
 
 
r   r   c                  @    e Zd ZU ded<   ded<   d Zed             ZdS )MediaFeaturer   namevaluec                J    t                      }| j        |d<   | j        |d<   |S )Nr(   r)   )r   r(   r)   r   s     r   r   zMediaFeature.to_json0   s&    vvyV
Wr   c                h     | t          |d                   t          |d                             S )Nr(   r)   )r(   r)   r   r   s     r   r   zMediaFeature.from_json6   s9    sT&\""d7m$$
 
 
 	
r   N)r   r    r!   r#   r   r$   r   r%   r   r   r'   r'   *   sR         IIIJJJ   
 
 [
 
 
r   r'   c                  :    e Zd ZdZdZdZdZd Zed             Z	dS )VirtualTimePolicya?  
    advance: If the scheduler runs out of immediate work, the virtual time base may fast forward to
    allow the next delayed task (if any) to run; pause: The virtual time base may not advance;
    pauseIfNetworkFetchesPending: The virtual time base may not advance if there are any pending
    resource fetches.
    advancepausepauseIfNetworkFetchesPendingc                    | j         S N)r)   )r   s    r   r   zVirtualTimePolicy.to_jsonI   s
    zr   c                     | |          S r3   r%   r   s     r   r   zVirtualTimePolicy.from_jsonL   s    s4yyr   N)
r   r    r!   r"   ADVANCEPAUSE PAUSE_IF_NETWORK_FETCHES_PENDINGr   r$   r   r%   r   r   r.   r.   >   sZ          GE'E$     [  r   r.   c                  D    e Zd ZU dZded<   ded<   d Zed             ZdS )UserAgentBrandVersiong
    Used to specify User Agent Cient Hints to emulate. See https://wicg.github.io/ua-client-hints
    r   brandversionc                J    t                      }| j        |d<   | j        |d<   |S )Nr;   r<   )r   r;   r<   r   s     r   r   zUserAgentBrandVersion.to_jsonZ   s&    vv
W,Yr   c                h     | t          |d                   t          |d                             S )Nr;   r<   )r;   r<   r,   r   s     r   r   zUserAgentBrandVersion.from_json`   s9    sd7m$$Y((
 
 
 	
r   Nr   r%   r   r   r9   r9   Q   s^           JJJLLL   
 
 [
 
 
r   r9   c                  v    e Zd ZU dZded<   ded<   ded<   ded<   ded<   ded	<   d
ed<   d Zed             ZdS )UserAgentMetadatar:   z"typing.List[UserAgentBrandVersion]brandsr   full_versionplatformplatform_versionarchitecturemodelboolmobilec                    t                      }d | j        D             |d<   | j        |d<   | j        |d<   | j        |d<   | j        |d<   | j        |d<   | j        |d<   |S )	Nc                6    g | ]}|                                 S r%   r   .0is     r   
<listcomp>z-UserAgentMetadata.to_json.<locals>.<listcomp>}   s     ;;;!!))++;;;r   rA   fullVersionrC   platformVersionrE   rF   rH   )r   rA   rB   rC   rD   rE   rF   rH   r   s     r   r   zUserAgentMetadata.to_json{   ss    vv;;t{;;;X"/]=Z"&"7#0^
WXr   c                *    | d |d         D             t          |d                   t          |d                   t          |d                   t          |d                   t          |d                   t          |d                   	          S )
Nc                B    g | ]}t                               |          S r%   )r9   r   rL   s     r   rO   z/UserAgentMetadata.from_json.<locals>.<listcomp>   s'    OOO1)33A66OOOr   rA   rP   rC   rQ   rE   rF   rH   )rA   rB   rC   rD   rE   rF   rH   )r   rG   r   s     r   r   zUserAgentMetadata.from_json   s    sOOXOOOT-011j)** &7!899T.122d7m$$X''
 
 
 	
r   Nr   r%   r   r   r@   r@   h   s           /...MMMJJJLLL	 	 	 	
 	
 [	
 	
 	
r   r@   return0typing.Generator[T_JSON_DICT, T_JSON_DICT, bool]c               #  @   K   ddi} | V }t          |d                   S )z^
    Tells whether emulation is supported.

    :returns: True if emulation is supported.
    methodzEmulation.canEmulateresult)rG   cmd_dictr   s     r   can_emulater[      s2       	(H >>DXr   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]c               #     K   ddi} | V }dS )z/
    Clears the overridden device metrics.
    rW   z$Emulation.clearDeviceMetricsOverrideNr%   rY   s     r   clear_device_metrics_overrider^      s$      
 	8H >>DDDr   c               #     K   ddi} | V }dS )z?
    Clears the overridden Geolocation Position and Error.
    rW   z"Emulation.clearGeolocationOverrideNr%   rY   s     r   clear_geolocation_overrider`      s$      
 	6H >>DDDr   c               #     K   ddi} | V }dS )z[
    Requests that page scale factor is reset to initial values.

    **EXPERIMENTAL**
    rW   zEmulation.resetPageScaleFactorNr%   rY   s     r   reset_page_scale_factorrb      s$       	2H >>DDDr   enabledrG   c              #  B   K   t                      }| |d<   d|d}|V }dS )z
    Enables or disables simulating a focused and active page.

    **EXPERIMENTAL**

    :param enabled: Whether to enable to disable focus emulation.
    rc   z"Emulation.setFocusEmulationEnabledrW   paramsNr   )rc   rf   rZ   r   s       r   set_focus_emulation_enabledrh      s<       &&FF96 H >>DDDr   ratefloatc              #  B   K   t                      }| |d<   d|d}|V }dS )z
    Enables CPU throttling to emulate slow CPUs.

    **EXPERIMENTAL**

    :param rate: Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
    ri   zEmulation.setCPUThrottlingRatere   Nrg   )ri   rf   rZ   r   s       r   set_cpu_throttling_raterl      s;       &&FF6N2 H >>DDDr   colortyping.Optional[dom.RGBA]c              #  j   K   t                      }| |                                 |d<   d|d}|V }dS )a  
    Sets or clears an override of the default background color of the frame. This override is used
    if the content does not specify one.

    :param color: *(Optional)* RGBA of the default background color. If not specified, any existing override will be cleared.
    Nrm   z+Emulation.setDefaultBackgroundColorOverridere   r   r   )rm   rf   rZ   r   s       r   %set_default_background_color_overriderq      sI       &&F--//w? H >>DDDr   widthr   heightdevice_scale_factorrH   scaletyping.Optional[float]screen_widthtyping.Optional[int]screen_height
position_x
position_ydont_set_visible_sizetyping.Optional[bool]screen_orientation"typing.Optional[ScreenOrientation]viewporttyping.Optional[page.Viewport]c              #    K   t                      }| |d<   ||d<   ||d<   ||d<   |||d<   |||d<   |||d<   |||d	<   |||d
<   |	|	|d<   |
|
                                |d<   ||                                |d<   d|d}|V }dS )a  
    Overrides the values of device screen dimensions (window.screen.width, window.screen.height,
    window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media
    query results).

    :param width: Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
    :param height: Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
    :param device_scale_factor: Overriding device scale factor value. 0 disables the override.
    :param mobile: Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
    :param scale: **(EXPERIMENTAL)** *(Optional)* Scale to apply to resulting view image.
    :param screen_width: **(EXPERIMENTAL)** *(Optional)* Overriding screen width value in pixels (minimum 0, maximum 10000000).
    :param screen_height: **(EXPERIMENTAL)** *(Optional)* Overriding screen height value in pixels (minimum 0, maximum 10000000).
    :param position_x: **(EXPERIMENTAL)** *(Optional)* Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
    :param position_y: **(EXPERIMENTAL)** *(Optional)* Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
    :param dont_set_visible_size: **(EXPERIMENTAL)** *(Optional)* Do not set visible view size, rely upon explicit setVisibleSize call.
    :param screen_orientation: *(Optional)* Screen orientation override.
    :param viewport: **(EXPERIMENTAL)** *(Optional)* If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions.
    rr   rs   deviceScaleFactorrH   Nru   screenWidthscreenHeight	positionX	positionYdontSetVisibleSizescreenOrientationr   z"Emulation.setDeviceMetricsOverridere   rp   )rr   rs   rt   rH   ru   rw   ry   rz   r{   r|   r~   r   rf   rZ   r   s                  r   set_device_metrics_overrider      s      @ &&FF7OF8"5FF8w ,} !.~({({('<#$%&8&@&@&B&B"#%--//z6 H >>DDDr   hiddenc              #  B   K   t                      }| |d<   d|d}|V }dS )z\


    **EXPERIMENTAL**

    :param hidden: Whether scrollbars should be always hidden.
    r   zEmulation.setScrollbarsHiddenre   Nrg   )r   rf   rZ   r   s       r   set_scrollbars_hiddenr   5  s<       &&FF81 H >>DDDr   disabledc              #  B   K   t                      }| |d<   d|d}|V }dS )zc


    **EXPERIMENTAL**

    :param disabled: Whether document.coookie API should be disabled.
    r   z#Emulation.setDocumentCookieDisabledre   Nrg   )r   rf   rZ   r   s       r   set_document_cookie_disabledr   H  s<       &&F!F:7 H >>DDDr   configurationtyping.Optional[str]c              #  P   K   t                      }| |d<   |||d<   d|d}|V }dS )z


    **EXPERIMENTAL**

    :param enabled: Whether touch emulation based on mouse input should be enabled.
    :param configuration: *(Optional)* Touch/gesture events configuration. Default: current platform.
    rc   Nr   z$Emulation.setEmitTouchEventsForMousere   rg   )rc   r   rf   rZ   r   s        r   set_emit_touch_events_for_mouser   [  sL       &&FF9 "/8 H >>DDDr   mediafeatures*typing.Optional[typing.List[MediaFeature]]c              #  h   K   t                      }| | |d<   |d |D             |d<   d|d}|V }dS )z
    Emulates the given media type or media feature for CSS media queries.

    :param media: *(Optional)* Media type to emulate. Empty string disables the override.
    :param features: *(Optional)* Media features to emulate.
    Nr   c                6    g | ]}|                                 S r%   rK   rL   s     r   rO   z&set_emulated_media.<locals>.<listcomp>  s     <<<aaiikk<<<r   r   zEmulation.setEmulatedMediare   rg   )r   r   rf   rZ   r   s        r   set_emulated_mediar   r  s_       &&Fw<<8<<<z. H >>DDDr   r   r   c              #  B   K   t                      }| |d<   d|d}|V }dS )zv
    Emulates the given vision deficiency.

    **EXPERIMENTAL**

    :param type_: Vision deficiency to emulate.
    r   z%Emulation.setEmulatedVisionDeficiencyre   Nrg   )r   rf   rZ   r   s       r   set_emulated_vision_deficiencyr     s;       &&FF6N9 H >>DDDr   latitude	longitudeaccuracyc              #  b   K   t                      }| | |d<   |||d<   |||d<   d|d}|V }dS )a  
    Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position
    unavailable.

    :param latitude: *(Optional)* Mock latitude
    :param longitude: *(Optional)* Mock longitude
    :param accuracy: *(Optional)* Mock accuracy
    Nr   r   r   z Emulation.setGeolocationOverridere   rg   )r   r   r   rf   rZ   r   s         r   set_geolocation_overrider     sb       &&F%z'{%z4 H >>DDDr   rC   c              #  B   K   t                      }| |d<   d|d}|V }dS )z
    Overrides value returned by the javascript navigator object.

    **EXPERIMENTAL**

    :param platform: The platform navigator.platform should return.
    rC   zEmulation.setNavigatorOverridesre   Nrg   )rC   rf   rZ   r   s       r   set_navigator_overridesr     s<       &&F!F:3 H >>DDDr   page_scale_factorc              #  B   K   t                      }| |d<   d|d}|V }dS )zu
    Sets a specified page scale factor.

    **EXPERIMENTAL**

    :param page_scale_factor: Page scale factor.
    pageScaleFactorzEmulation.setPageScaleFactorre   Nrg   )r   rf   rZ   r   s       r   set_page_scale_factorr     s=       &&F 1F0 H >>DDDr   r)   c              #  B   K   t                      }| |d<   d|d}|V }dS )z|
    Switches script execution in the page.

    :param value: Whether script execution should be disabled in the page.
    r)   z$Emulation.setScriptExecutionDisabledre   Nrg   )r)   rf   rZ   r   s       r   set_script_execution_disabledr     s;       &&FF7O8 H >>DDDr   max_touch_pointsc              #  P   K   t                      }| |d<   |||d<   d|d}|V }dS )z
    Enables touch on platforms which do not support them.

    :param enabled: Whether the touch event emulation should be enabled.
    :param max_touch_points: *(Optional)* Maximum touch points supported. Defaults to one.
    rc   NmaxTouchPointsz"Emulation.setTouchEmulationEnabledre   rg   )rc   r   rf   rZ   r   s        r   set_touch_emulation_enabledr     sM       &&FF9##3 6 H >>DDDr   policybudget&max_virtual_time_task_starvation_countwait_for_navigationinitial_virtual_time'typing.Optional[network.TimeSinceEpoch]1typing.Generator[T_JSON_DICT, T_JSON_DICT, float]c              #     K   t                      }|                                 |d<   |||d<   |||d<   |||d<   ||                                |d<   d|d}|V }t          |d	                   S )
a  
    Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets
    the current virtual time policy.  Note this supersedes any previous time budget.

    **EXPERIMENTAL**

    :param policy:
    :param budget: *(Optional)* If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent.
    :param max_virtual_time_task_starvation_count: *(Optional)* If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock.
    :param wait_for_navigation: *(Optional)* If set the virtual time policy change should be deferred until any frame starts navigating. Note any previous deferred policy change is superseded.
    :param initial_virtual_time: *(Optional)* If set, base::Time::Now will be overridden to initially return this value.
    :returns: Absolute timestamp at which virtual time was first enabled (up time in milliseconds).
    r   Nr   !maxVirtualTimeTaskStarvationCountwaitForNavigationinitialVirtualTimezEmulation.setVirtualTimePolicyre   virtualTimeTicksBase)r   r   rj   )r   r   r   r   r   rf   rZ   r   s           r   set_virtual_time_policyr     s      ( &&F~~''F8!x-96\23&&9"#'';'C'C'E'E#$2 H >>D,-...r   localec              #  F   K   t                      }| | |d<   d|d}|V }dS )z
    Overrides default host system locale with the specified one.

    **EXPERIMENTAL**

    :param locale: *(Optional)* ICU style C locale (e.g. "en_US"). If not specified or empty, disables the override and restores default host system locale.
    Nr   zEmulation.setLocaleOverridere   rg   )r   rf   rZ   r   s       r   set_locale_overrider   (  sB       &&F!x/ H >>DDDr   timezone_idc              #  B   K   t                      }| |d<   d|d}|V }dS )z
    Overrides default host system timezone with the specified one.

    **EXPERIMENTAL**

    :param timezone_id: The timezone identifier. If empty, disables the override and restores default host system timezone.
    
timezoneIdzEmulation.setTimezoneOverridere   Nrg   )r   rf   rZ   r   s       r   set_timezone_overrider   <  s<       &&F&F<1 H >>DDDr   c              #  L   K   t                      }| |d<   ||d<   d|d}|V }dS )a<  
    Resizes the frame/viewport of the page. Note that this does not affect the frame's container
    (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported
    on Android.

    **EXPERIMENTAL**

    :param width: Frame width (DIP).
    :param height: Frame height (DIP).
    rr   rs   zEmulation.setVisibleSizere   Nrg   )rr   rs   rf   rZ   r   s        r   set_visible_sizer   O  sE       &&FF7OF8, H >>DDDr   
user_agentaccept_languageuser_agent_metadata"typing.Optional[UserAgentMetadata]c              #     K   t                      }| |d<   |||d<   |||d<   ||                                |d<   d|d}|V }dS )a  
    Allows overriding user agent with the given string.

    :param user_agent: User agent to use.
    :param accept_language: *(Optional)* Browser langugage to emulate.
    :param platform: *(Optional)* The platform navigator.platform should return.
    :param user_agent_metadata: **(EXPERIMENTAL)** *(Optional)* To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
    	userAgentNacceptLanguagerC   userAgentMetadatazEmulation.setUserAgentOverridere   rp   )r   r   rC   r   rf   rZ   r   s          r   set_user_agent_overrider   g  sz       &&F$F;"#2 %z&&9&A&A&C&C"#2 H >>DDDr   z"Emulation.virtualTimeBudgetExpiredc                  *    e Zd ZdZedd            ZdS )VirtualTimeBudgetExpiredz~
    **EXPERIMENTAL**

    Notification sent after the virtual time budget for the current VirtualTimePolicy has run out.
    r   r   rT   c                     |             S r3   r%   r   s     r   r   z"VirtualTimeBudgetExpired.from_json  s    s 
 
 	
r   N)r   r   rT   r   )r   r    r!   r"   r$   r   r%   r   r   r   r     s>          
 
 
 [
 
 
r   r   )rT   rU   )rT   r\   )rc   rG   rT   r\   )ri   rj   rT   r\   r3   )rm   rn   rT   r\   )NNNNNNNN)rr   r   rs   r   rt   rj   rH   rG   ru   rv   rw   rx   ry   rx   rz   rx   r{   rx   r|   r}   r~   r   r   r   rT   r\   )r   rG   rT   r\   )r   rG   rT   r\   )rc   rG   r   r   rT   r\   )NN)r   r   r   r   rT   r\   )r   r   rT   r\   )NNN)r   rv   r   rv   r   rv   rT   r\   )rC   r   rT   r\   )r   rj   rT   r\   )r)   rG   rT   r\   )rc   rG   r   rx   rT   r\   )NNNN)r   r.   r   rv   r   rx   r   r}   r   r   rT   r   )r   r   rT   r\   )r   r   rT   r\   )rr   r   rs   r   rT   r\   )
r   r   r   r   rC   r   r   r   rT   r\   )+
__future__r   utilr   r   dataclassesr   enumtyping r   r	   r
   r   r'   Enumr.   r9   r@   r[   r^   r`   rb   rh   rl   rq   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r%   r   r   <module>r      s1   # " " " " " * * * * * * * * ! ! ! ! ! !                     
 
 
 
 
 
 
 
0 
 
 
 
 
 
 
 
&    	   & 
 
 
 
 
 
 
 
, '
 '
 '
 '
 '
 '
 '
 '
T
  
  
  
       	 	 	 	   &   ( ,0    0 )--1.2+/+/7;AE379 9 9 9 9x   &   * /3    0 '+?C    ,   ( ,0,0+/    6   &   &   & 26    . *.GK59HL#/ #/ #/ #/ #/N (,    (   &   4 15)-BF	    : 122

 
 
 
 
 
 
  32
 
 
r   