
    'h                     n    S SK Jr  S SKJr  S SKJr  SSKJr  SSK	J
r
  SSKJr  SS	KJr   " S
 S\5      rg)    )Optional)WebDriverException)	WebDriver   )DriverFinder   )Options)SafariRemoteConnection)Servicec                   |   ^  \ rS rSrSr   SS\\   S\\   SS4U 4S jjjrU 4S jr	S	 r
S
 rS rS rS rSrU =r$ )r      z>Controls the SafariDriver and allows you to drive the browser.Noptionsservicereturnc                 (  > U(       a  UO	[        5       U l        U(       a  UO	[        5       nU R                  R                  5       =(       d$    [	        U R                  U5      R                  5       U R                  l        U R                  R                  (       d  U R                  R                  5         [        U R                  R                  UUR                  S9n [        TU ]5  XBS9  SU l        g! [         a    U R                  5         e f = f)aZ  Creates a new Safari driver instance and launches or finds a running
safaridriver service.

:Args:
 - keep_alive - Whether to configure SafariRemoteConnection to use
     HTTP keep-alive. Defaults to True.
 - options - Instance of ``options.Options``.
 - service - Service object for handling the browser driver if you need to pass extra details
)remote_server_addr
keep_aliveignore_proxy)command_executorr   FN)r   r   r	   env_pathr   get_driver_pathpathreuse_servicestartr
   service_url_ignore_local_proxysuper__init__	Exceptionquit
_is_remote)selfr   r   r   executor	__class__s        l/var/www/home/psychics-availability/venv/lib/python3.13/site-packages/selenium/webdriver/safari/webdriver.pyr   WebDriver.__init__    s     #*wwy$'') LL113l|DLLRY7Z7j7j7l||))LL )#||77! 44
	GhH
  	  	IIK	s    C5 5Dc                 &  >  [         TU ]  5         U R                  R                  (       d  U R                  R                  5         gg! [         a     NCf = f! U R                  R                  (       d  U R                  R                  5         f f = f)z>Closes the browser and shuts down the SafariDriver executable.N)r   r    r   r   r   stop)r"   r$   s    r%   r    WebDriver.quitE   sn    	$GLN
 <<--!!# .	  		 <<--!!# .s#   A 
AA AA 8Bc                 r    [        U[        5      (       d  [        S5      eX0nU R                  SSU05        g )Nz;Value of a session permission must be set to True or False.SET_PERMISSIONSpermissions)
isinstanceboolr   execute)r"   
permissionvaluepayloads       r%   set_permissionWebDriver.set_permissionT   s7    %&&$%bcc%&(@A    c                     U R                  S5      S   nUS   nU(       d  g X;  a  g X1   n[        U[        5      (       d  g U$ )NGET_PERMISSIONSr1   r,   )r/   r-   r.   )r"   r0   r2   r,   r1   s        r%   get_permissionWebDriver.get_permission\   sL    ,,01':m,('%&&r5   c                 H    U R                  S5        U R                  S5        g )NATTACH_DEBUGGERz	debugger;)r/   execute_script)r"   s    r%   debugWebDriver.debugl   s    &'K(r5   c                     [         eNNotImplementedErrorr"   argskwargss      r%   download_fileWebDriver.download_filep       !!r5   c                     [         er@   rA   rC   s      r%   get_downloadable_files WebDriver.get_downloadable_filess   rH   r5   )r!   r   )TNN)__name__
__module____qualname____firstlineno____doc__r   r	   r   r   r    r3   r8   r=   rF   rJ   __static_attributes____classcell__)r$   s   @r%   r   r      sh    H %)%)	#  '"#  '"	# 
 
#  # J	$B )"" "r5   r   N)typingr   selenium.common.exceptionsr   #selenium.webdriver.remote.webdriverr   RemoteWebDrivercommon.driver_finderr   r   r	   remote_connectionr
   r   r    r5   r%   <module>rZ      s*   $  9 L /  5 W" W"r5   