o
    M,h                     @  s   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G dd dej	Z
d!ddZd"ddZ	d#d$ddZd%ddZd&ddZd'dd ZdS )(    )annotations   )event_classT_JSON_DICT)	dataclassNc                   @  s4   e Zd ZdZdZdZdZdZdd Ze	dd	 Z
d
S )StorageAreaz
    Storage areas.
    sessionlocalsyncmanagedc                 C  s   | j S N)value)self r   ~/var/www/www-root/data/www/bot.pdev.uz/venv/lib/python3.10/site-packages/selenium/webdriver/common/devtools/v141/extensions.pyto_json   s   zStorageArea.to_jsonc                 C  s   | |S r   r   )clsjsonr   r   r   	from_json   s   zStorageArea.from_jsonN)__name__
__module____qualname____doc__SESSIONLOCALSYNCMANAGEDr   classmethodr   r   r   r   r   r      s    r   pathstrreturn/typing.Generator[T_JSON_DICT, T_JSON_DICT, str]c                 c  s,    t  }| |d< d|d}|V }t|d S )av  
    Installs an unpacked extension from the filesystem similar to
    --load-extension CLI flags. Returns extension ID once the extension
    has been installed. Available if the client is connected using the
    --remote-debugging-pipe flag and the --enable-unsafe-extension-debugging
    flag is set.

    :param path: Absolute file path.
    :returns: Extension id.
    r   zExtensions.loadUnpackedmethodparamsid)dictr   )r   r$   cmd_dictr   r   r   r   load_unpacked   s   r(   id_0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]c                 c  s$    t  }| |d< d|d}|V }dS )z
    Uninstalls an unpacked extension (others not supported) from the profile.
    Available if the client is connected using the --remote-debugging-pipe flag
    and the --enable-unsafe-extension-debugging.

    :param id_: Extension id.
    r%   zExtensions.uninstallr"   N)r&   )r)   r$   r'   r   r   r   r   	uninstall5   s   

r+   storage_areakeys!typing.Optional[typing.List[str]]0typing.Generator[T_JSON_DICT, T_JSON_DICT, dict]c                 c  sR    t  }| |d< | |d< |durdd |D |d< d|d}|V }t |d	 S )
a(  
    Gets data from extension storage in the given ``storageArea``. If ``keys`` is
    specified, these are used to filter the result.

    :param id_: ID of extension.
    :param storage_area: StorageArea to retrieve data from.
    :param keys: *(Optional)* Keys to retrieve.
    :returns: 
    r%   storageAreaNc                 S     g | ]}|qS r   r   .0ir   r   r   
<listcomp>Z       z%get_storage_items.<locals>.<listcomp>r-   zExtensions.getStorageItemsr"   datar&   r   r)   r,   r-   r$   r'   r   r   r   r   get_storage_itemsH   s   r:   typing.List[str]c                 c  sB    t  }| |d< | |d< dd |D |d< d|d}|V }dS )	z
    Removes ``keys`` from extension storage in the given ``storageArea``.

    :param id_: ID of extension.
    :param storage_area: StorageArea to remove data from.
    :param keys: Keys to remove.
    r%   r0   c                 S  r1   r   r   r2   r   r   r   r5   r   r6   z(remove_storage_items.<locals>.<listcomp>r-   zExtensions.removeStorageItemsr"   Nr8   r9   r   r   r   remove_storage_itemsc   s   
r<   c                 c  s0    t  }| |d< | |d< d|d}|V }dS )z
    Clears extension storage in the given ``storageArea``.

    :param id_: ID of extension.
    :param storage_area: StorageArea to remove data from.
    r%   r0   zExtensions.clearStorageItemsr"   Nr8   )r)   r,   r$   r'   r   r   r   r   clear_storage_itemsz   s   

r=   valuesr&   c                 c  s8    t  }| |d< | |d< ||d< d|d}|V }dS )a  
    Sets ``values`` in extension storage in the given ``storageArea``. The provided ``values``
    will be merged with existing values in the storage area.

    :param id_: ID of extension.
    :param storage_area: StorageArea to set data in.
    :param values: Values to set.
    r%   r0   r>   zExtensions.setStorageItemsr"   Nr8   )r)   r,   r>   r$   r'   r   r   r   r   set_storage_items   s   
r?   )r   r   r    r!   )r)   r   r    r*   r   )r)   r   r,   r   r-   r.   r    r/   )r)   r   r,   r   r-   r;   r    r*   )r)   r   r,   r   r    r*   )r)   r   r,   r   r>   r&   r    r*   )
__future__r   utilr   r   dataclassesr   enumtypingEnumr   r(   r+   r:   r<   r=   r?   r   r   r   r   <module>   s   



