
    ]jB                    l   d dl mZ d dlmZmZ d dlmZ d dlmZ  G d d      Z	 G d d      Z
 G d	 d
      Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d              Ze G d! d"             Ze G d# d$             Ze G d% d&             Ze G d' d(             Ze G d) d*             ZeZ G d+ d,      Zy-).    )annotations)	dataclassfield)Any)command_builderc                      e Zd ZdZdZdZy)ForcedColorsModeThemezForcedColorsModeTheme.lightdarkN)__name__
__module____qualname____doc__LIGHTDARK     \/home/ubuntu/.local/lib/python3.12/site-packages/selenium/webdriver/common/bidi/emulation.pyr	   r	      s     EDr   r	   c                      e Zd ZdZdZdZy)ScreenOrientationNaturalzScreenOrientationNatural.portrait	landscapeN)r   r   r   r   PORTRAIT	LANDSCAPEr   r   r   r   r      s    #HIr   r   c                       e Zd ZdZdZdZdZdZy)ScreenOrientationTypezScreenOrientationType.zportrait-primaryzportrait-secondaryzlandscape-primaryzlandscape-secondaryN)r   r   r   r   PORTRAIT_PRIMARYPORTRAIT_SECONDARYLANDSCAPE_PRIMARYLANDSCAPE_SECONDARYr   r   r   r   r      s     )-+/r   r   c                  X    e Zd ZU dZdZded<    ee      Zded<    ee      Z	ded<   y)	*SetForcedColorsModeThemeOverrideParametersz+SetForcedColorsModeThemeOverrideParameters.N
Any | Nonethemedefault_factory	list[Any]contextsuser_contexts)
r   r   r   r   r$   __annotations__r   listr(   r)   r   r   r   r"   r"   %   s-    5E:5Hi5$T:M9:r   r"   c                  J    e Zd ZU dZ ee      Zded<    ee      Zded<   y) SetGeolocationOverrideParametersz!SetGeolocationOverrideParameters.r%   r'   r(   r)   N	r   r   r   r   r   r+   r(   r*   r)   r   r   r   r-   r-   .   s#    +5Hi5$T:M9:r   r-   c                  t    e Zd ZU dZ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
<   y)GeolocationCoordinateszGeolocationCoordinates.Nr#   latitude	longitudeaccuracyaltitudealtitude_accuracyheadingspeed)r   r   r   r   r1   r*   r2   r3   r4   r5   r6   r7   r   r   r   r0   r0   6   sL    !Hj Iz HjHj$(z(GZE:r   r0   c                  0    e Zd ZU dZ edd      Zded<   y)GeolocationPositionErrorzGeolocationPositionError.positionUnavailableFdefaultinitstrtypeNr   r   r   r   r   r?   r*   r   r   r   r9   r9   C   s    #3%@D#@r   r9   c                  X    e Zd ZU dZdZded<    ee      Zded<    ee      Z	ded<   y)	SetLocaleOverrideParameterszSetLocaleOverrideParameters.Nr#   localer%   r'   r(   r)   )
r   r   r   r   rC   r*   r   r+   r(   r)   r   r   r   rB   rB   J   s-    &FJ5Hi5$T:M9:r   rB   c                  0    e Zd ZU dZ edd      Zded<   y)NetworkConditionsOfflinezNetworkConditionsOffline.offlineFr;   r>   r?   Nr@   r   r   r   rE   rE   S   s    #ie4D#4r   rE   c                  .    e Zd ZU dZdZded<   dZded<   y)
ScreenAreazScreenArea.Nr#   widthheight)r   r   r   r   rI   r*   rJ   r   r   r   rH   rH   Z   s    E:FJr   rH   c                  X    e Zd ZU dZdZded<    ee      Zded<    ee      Z	ded<   y)	#SetScreenSettingsOverrideParametersz$SetScreenSettingsOverrideParameters.Nr#   screen_arear%   r'   r(   r)   )
r   r   r   r   rM   r*   r   r+   r(   r)   r   r   r   rL   rL   b   s-    ."K"5Hi5$T:M9:r   rL   c                  .    e Zd ZU dZdZded<   dZded<   y)ScreenOrientationzScreenOrientation.Nr#   naturalr?   )r   r   r   r   rP   r*   r?   r   r   r   rO   rO   k   s    GZD*r   rO   c                  X    e Zd ZU dZdZded<    ee      Zded<    ee      Z	ded<   y)	&SetScreenOrientationOverrideParametersz'SetScreenOrientationOverrideParameters.Nr#   screen_orientationr%   r'   r(   r)   )
r   r   r   r   rS   r*   r   r+   r(   r)   r   r   r   rR   rR   s   s.    1%)
)5Hi5$T:M9:r   rR   c                  X    e Zd ZU dZdZded<    ee      Zded<    ee      Z	ded<   y)	SetUserAgentOverrideParameterszSetUserAgentOverrideParameters.Nr#   
user_agentr%   r'   r(   r)   )
r   r   r   r   rV   r*   r   r+   r(   r)   r   r   r   rU   rU   |   s-    )!J
!5Hi5$T:M9:r   rU   c                  X    e Zd ZU dZdZded<    ee      Zded<    ee      Z	ded<   y)	SetScriptingEnabledParameterszSetScriptingEnabledParameters.Nr#   enabledr%   r'   r(   r)   )
r   r   r   r   rY   r*   r   r+   r(   r)   r   r   r   rX   rX      s-    (GZ5Hi5$T:M9:r   rX   c                  X    e Zd ZU dZdZded<    ee      Zded<    ee      Z	ded<   y)	"SetScrollbarTypeOverrideParametersz#SetScrollbarTypeOverrideParameters.Nr#   scrollbar_typer%   r'   r(   r)   )
r   r   r   r   r\   r*   r   r+   r(   r)   r   r   r   r[   r[      s-    -!%NJ%5Hi5$T:M9:r   r[   c                  X    e Zd ZU dZdZded<    ee      Zded<    ee      Z	ded<   y)	SetTimezoneOverrideParameterszSetTimezoneOverrideParameters.Nr#   timezoner%   r'   r(   r)   )
r   r   r   r   r_   r*   r   r+   r(   r)   r   r   r   r^   r^      s-    (Hj5Hi5$T:M9:r   r^   c                  J    e Zd ZU dZ ee      Zded<    ee      Zded<   y)SetTouchOverrideParameterszSetTouchOverrideParameters.r%   r'   r(   r)   Nr.   r   r   r   ra   ra      s#    %5Hi5$T:M9:r   ra   c                  X    e Zd ZU dZdZded<    ee      Zded<    ee      Z	ded<   y)	SetNetworkConditionsParameterszSetNetworkConditionsParameters.Nr#   network_conditionsr%   r'   r(   r)   )
r   r   r   r   rd   r*   r   r+   r(   r)   r   r   r   rc   rc      s.    )%)
)5Hi5$T:M9:r   rc   c                     e Zd ZdZddZ	 	 	 d	 	 	 	 	 ddZ	 	 	 d	 	 	 	 	 ddZ	 	 	 d	 	 	 	 	 ddZdddZ	 	 	 	 d	 	 	 ddZ		 	 	 d	 	 	 dd	Z
	 	 	 d	 	 	 dd
Z	 	 	 d	 	 	 ddZ	 	 	 d	 	 	 ddZ	 	 	 	 d	 	 	 	 	 ddZ	 	 	 	 d	 	 	 	 	 	 	 ddZy)	Emulationz WebDriver BiDi emulation module.c                    || _         y )N)_conn)selfconns     r   __init__zEmulation.__init__   s	    
r   Nc                    |t        d      |||d}|j                         D ci c]  \  }}|	|| }}}t        d|      }| j                  j	                  |      }|S c c}}w )z2Execute emulation.setForcedColorsModeThemeOverridezJset_forced_colors_mode_theme_override() missing required argument: 'theme')r$   r(   userContextsz*emulation.setForcedColorsModeThemeOverride	TypeErroritemsr   rh   execute)	ri   r$   r(   r)   paramskvcmdresults	            r   %set_forced_colors_mode_theme_overridez/Emulation.set_forced_colors_mode_theme_override   sz     =hii  )

 $*<<>C41aQ]!Q$CCJFS##C( D
   
A#A#c                    |t        d      |||d}|j                         D ci c]  \  }}|	|| }}}t        d|      }| j                  j	                  |      }|S c c}}w )z#Execute emulation.setLocaleOverridez9set_locale_override() missing required argument: 'locale')rC   r(   rm   zemulation.setLocaleOverridern   )	ri   rC   r(   r)   rr   rs   rt   ru   rv   s	            r   set_locale_overridezEmulation.set_locale_override   sz     >WXX  )

 $*<<>C41aQ]!Q$CC;VD##C( Drx   c                    |t        d      |||d}|j                         D ci c]  \  }}|	|| }}}t        d|      }| j                  j	                  |      }|S c c}}w )z*Execute emulation.setScrollbarTypeOverridezIset_scrollbar_type_override() missing required argument: 'scrollbar_type')scrollbarTyper(   rm   z"emulation.setScrollbarTypeOverridern   )	ri   r\   r(   r)   rr   rs   rt   ru   rv   s	            r   set_scrollbar_type_overridez%Emulation.set_scrollbar_type_override   s{     !ghh , )

 $*<<>C41aQ]!Q$CCBFK##C( Drx   c                    ||d}|j                         D ci c]  \  }}|	|| }}}t        d|      }| j                  j                  |      }|S c c}}w )z"Execute emulation.setTouchOverride)r(   rm   zemulation.setTouchOverride)rp   r   rh   rq   )ri   r(   r)   rr   rs   rt   ru   rv   s           r   set_touch_overridezEmulation.set_touch_override   sd     !)
 $*<<>C41aQ]!Q$CC:FC##C( Ds
   
AAc                   i }|t        |t              r|}ni }|j                  |j                  |d<   |j                  |j                  |d<   |j                  |j                  |d<   |j
                  |j
                  |d<   |j                  |j                  |d<   |j                  |j                  |d<   |j                  |j                  |d<   ||d<   |5t        |t              r||d	<   nd
|j                  |j                  ndi|d	<   |||d<   |||d<   t        d|      }| j                  j                  |      }|S )aZ  Execute emulation.setGeolocationOverride.

        Sets or clears the geolocation override for specified browsing or user contexts.

        Args:
            coordinates: A GeolocationCoordinates instance (or dict) to override the
                position, or ``None`` to clear a previously-set override.
            error: A GeolocationPositionError instance (or dict) to simulate a
                position-unavailable error.  Mutually exclusive with *coordinates*.
            contexts: List of browsing context IDs to target.
            user_contexts: List of user context IDs to target.
        r1   r2   r3   r4   altitudeAccuracyr6   r7   coordinateserrorr?   r:   r(   rm   z emulation.setGeolocationOverride)
isinstancedictr1   r2   r3   r4   r5   r6   r7   r?   r   rh   rq   )	ri   r   r   r(   r)   rr   coords_dictru   rv   s	            r   set_geolocation_overridez"Emulation.set_geolocation_override  su   & "$"+t,) ''3.9.B.BK
+((4/:/D/DK,''3.9.B.BK
+''3.9.B.BK
+00<6A6S6SK 23&&2-8-@-@K	*$$0+6+<+<K($/F=!%&"'w %***@EJJF[#w !)F:$%2F>"@&I##C(r   c                t    d|i}|||d<   |||d<   t        d|      }| j                  j                  |      S )a  Execute emulation.setTimezoneOverride.

        Sets or clears the timezone override for specified browsing or user contexts.
        Pass ``timezone=None`` (or omit it) to clear a previously-set override.

        Args:
            timezone: IANA timezone string (e.g. ``"America/New_York"``) or ``None``
                to clear the override.
            contexts: List of browsing context IDs to target.
            user_contexts: List of user context IDs to target.
        r_   r(   rm   zemulation.setTimezoneOverrider   rh   rq   )ri   r_   r(   r)   rr   ru   s         r   set_timezone_overridezEmulation.set_timezone_override7  sP    " #-h!7!)F:$%2F>"=vFzz!!#&&r   c                t    d|i}|||d<   |||d<   t        d|      }| j                  j                  |      S )a  Execute emulation.setScriptingEnabled.

        Enables or disables scripting for specified browsing or user contexts.
        Pass ``enabled=None`` to restore the default behaviour.

        Args:
            enabled: ``True`` to enable scripting, ``False`` to disable it, or
                ``None`` to clear the override.
            contexts: List of browsing context IDs to target.
            user_contexts: List of user context IDs to target.
        rY   r(   rm   zemulation.setScriptingEnabledr   )ri   rY   r(   r)   rr   ru   s         r   set_scripting_enabledzEmulation.set_scripting_enabledO  sP    " #,W!5!)F:$%2F>"=vFzz!!#&&r   c                t    d|i}|||d<   |||d<   t        d|      }| j                  j                  |      S )a  Execute emulation.setUserAgentOverride.

        Overrides the User-Agent string for specified browsing or user contexts.
        Pass ``user_agent=None`` to clear a previously-set override.

        Args:
            user_agent: Custom User-Agent string, or ``None`` to clear the override.
            contexts: List of browsing context IDs to target.
            user_contexts: List of user context IDs to target.
        	userAgentr(   rm   zemulation.setUserAgentOverrider   )ri   rV   r(   r)   rr   ru   s         r   set_user_agent_overridez!Emulation.set_user_agent_overrideg  sP      #.z!:!)F:$%2F>">Gzz!!#&&r   c                ^   |d}npt        |t              r|}n]|j                  }|j                  }t        |t              r|j                         n|t        |t              r|j                         n|d}d|i}|||d<   |||d<   t        d|      }| j                  j                  |      S )a	  Execute emulation.setScreenOrientationOverride.

        Sets or clears the screen orientation override for specified browsing or
        user contexts.

        Args:
            screen_orientation: A :class:`ScreenOrientation` instance (or dict with
                ``natural`` and ``type`` keys) to lock the orientation, or ``None``
                to clear a previously-set override.
            contexts: List of browsing context IDs to target.
            user_contexts: List of user context IDs to target.
        N)rP   r?   screenOrientationr(   rm   z&emulation.setScreenOrientationOverride)	r   r   rP   r?   r>   lowerr   rh   rq   )	ri   rS   r(   r)   so_valuerP   orientation_typerr   ru   s	            r   set_screen_orientation_overridez)Emulation.set_screen_orientation_override~  s    $ %H*D1)H(00G166.8#.F7==?G4>?OQT4U(..0[kH #6x!@!)F:$%2F>"FOzz!!#&&r   c                    |	|rddind}n|}d|i}|||d<   |||d<   t        d|      }| j                  j                  |      S )u  Execute emulation.setNetworkConditions.

        Sets or clears network condition emulation for specified browsing or user
        contexts.

        Args:
            network_conditions: A dict with the raw ``networkConditions`` value
                (e.g. ``{"type": "offline"}``), or ``None`` to clear the override.
                Mutually exclusive with *offline*.
            offline: Convenience bool — ``True`` sets offline conditions,
                ``False`` clears them (sends ``null``).  When provided, this takes
                precedence over *network_conditions*.
            contexts: List of browsing context IDs to target.
            user_contexts: List of user context IDs to target.
        Nr?   rF   networkConditionsr(   rm   zemulation.setNetworkConditionsr   )ri   rd   rF   r(   r)   nc_valuerr   ru   s           r   set_network_conditionsz Emulation.set_network_conditions  si    , .5	*4H)H"5x!@!)F:$%2F>">Gzz!!#&&r   c                    d}||i }|||d<   |||d<   d|i}|||d<   |||d<   t        d|      }| j                  j                  |      S )a  Execute emulation.setScreenSettingsOverride.

        Sets or clears the screen settings override for specified browsing or user
        contexts.

        Args:
            width: The screen width in pixels, or ``None`` to clear the override.
            height: The screen height in pixels, or ``None`` to clear the override.
            contexts: List of browsing context IDs to target.
            user_contexts: List of user context IDs to target.
        NrI   rJ   
screenArear(   rm   z#emulation.setScreenSettingsOverrider   )ri   rI   rJ   r(   r)   rM   rr   ru   s           r   set_screen_settings_overridez&Emulation.set_screen_settings_override  s    $  2K ',G$!(.H%".!<!)F:$%2F>"CVLzz!!#&&r   )returnNone)NNN)r$   r#   r(   list[Any] | Noner)   r   )rC   r#   r(   r   r)   r   )r\   r#   r(   r   r)   r   )NN)r(   r   r)   r   )NNNN)rF   zbool | Noner(   r   r)   r   )rI   
int | NonerJ   r   r(   r   r)   r   )r   r   r   r   rk   rw   rz   r}   r   r   r   r   r   r   r   r   r   r   r   rf   rf      s   *
 !%)*.	 # (	, "%)*.	 # (	, &*%)*.	" # (	(	 %)*.5 #	5
 (5p %)*.	' #' (	'4 %)*.	' #' (	'4 %)*.	' #' (	'2  %)*.	#' ##' (	#'L  #%)*. '  ' #	 '
 ( 'F !!%)*.'' ' #	'
 ('r   rf   N)
__future__r   dataclassesr   r   typingr   %selenium.webdriver.common.bidi.commonr   r	   r   r   r"   r-   r0   r9   rB   rE   rH   rL   rO   rR   rU   rX   r[   r^   ra   rc   setNetworkConditionsParametersrf   r   r   r   <module>r      s   # (  A  0 0 ; ; ; ; ; ; 	 	 	 A A A ; ; ; 5 5 5    ; ; ;    ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; "@ n' n'r   