
    >ig}                       d dl mZ d dlmZmZmZ d dlmZ d dlm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+ d dl,m-Z-m.Z.m/Z/m0Z0 erxd dlm1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z` d dl,maZambZbmcZcmdZdmeZemfZfmgZgmhZh  G d d	      Ziy
)    )annotations)TYPE_CHECKINGLiteralOptional)Command)#AddCompilationCacheParams&AddScriptToEvaluateOnNewDocumentParamsCaptureScreenshotParamsCaptureSnapshotParamsCreateIsolatedWorldParamsEnableParamsGenerateTestReportParamsGetAdScriptAncestryIdsParamsGetAppIdParamsGetAppManifestParamsGetOriginTrialsParamsGetPermissionsPolicyStateParamsGetResourceContentParamsHandleJavaScriptDialogParamsNavigateParamsNavigateToHistoryEntryParams
PageMethodPrintToPDFParamsProduceCompilationCacheParamsReloadParams)RemoveScriptToEvaluateOnNewDocumentParamsScreencastFrameAckParamsSearchInResourceParamsSetAdBlockingEnabledParamsSetBypassCSPParamsSetDocumentContentParamsSetFontFamiliesParamsSetFontSizesParams#SetInterceptFileChooserDialogParamsSetLifecycleEventsEnabledParamsSetPrerenderingAllowedParamsSetRPHRegistrationModeParamsSetSPCTransactionModeParamsSetWebLifecycleStateParamsStartScreencastParams)CompilationCacheParamsFontFamilies	FontSizesScriptFontFamilies)0AddCompilationCacheCommand'AddScriptToEvaluateOnNewDocumentCommandBringToFrontCommandCaptureScreenshotCommandCaptureSnapshotCommandClearCompilationCacheCommandCloseCommandCrashCommandCreateIsolatedWorldCommandDisableCommandEnableCommandGenerateTestReportCommandGetAdScriptAncestryIdsCommandGetAppIdCommandGetAppManifestCommandGetFrameTreeCommandGetInstallabilityErrorsCommandGetLayoutMetricsCommandGetNavigationHistoryCommandGetOriginTrialsCommand GetPermissionsPolicyStateCommandGetResourceContentCommandGetResourceTreeCommandHandleJavaScriptDialogCommandNavigateCommandNavigateToHistoryEntryCommandPrintToPDFCommandProduceCompilationCacheCommandReloadCommand*RemoveScriptToEvaluateOnNewDocumentCommandResetNavigationHistoryCommandScreencastFrameAckCommandSearchInResourceCommandSetAdBlockingEnabledCommandSetBypassCSPCommandSetDocumentContentCommandSetFontFamiliesCommandSetFontSizesCommand$SetInterceptFileChooserDialogCommand SetLifecycleEventsEnabledCommandSetPrerenderingAllowedCommandSetRPHRegistrationModeCommandSetSPCTransactionModeCommandSetWebLifecycleStateCommandStartScreencastCommandStopLoadingCommandStopScreencastCommandWaitForDebuggerCommand)AutoResponseModeReferrerPolicyScreencastFormatScreenshotFormatTransferModeTransitionTypeViewportWebLifecycleStatec                  Z   e Zd ZdZe	 	 	 d3	 	 	 	 	 	 	 	 	 d4d       Zed5d       Ze	 	 	 	 	 	 d6	 	 	 	 	 	 	 	 	 	 	 	 	 d7d       Zed8d       Ze	 	 d9	 	 	 	 	 	 	 d:d       Z	ed;d       Z
e	 d<	 	 	 d=d	       Ze	 d<	 	 	 d>d
       Zed?d       Zed@d       ZedAd       Ze	 d<	 	 	 	 	 dBd       Ze	 	 	 	 dC	 	 	 	 	 	 	 	 	 	 	 dDd       ZedEd       Ze	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dF	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dGd       Ze	 	 	 d3	 	 	 	 	 	 	 dHd       ZedId       Ze	 	 	 	 dJd       ZedKd       ZedLd       ZedMd       ZedNd       ZedOd       ZedPd       Ze	 dQ	 	 	 dRd       ZedSd       ZedTd       Ze	 d<	 	 	 	 	 dUd       Z e	 	 	 	 dVd       Z!e	 d9	 	 	 	 	 dWd        Z"edXd!       Z#edYd"       Z$e	 	 	 	 dZd#       Z%e	 	 	 	 	 	 d[d$       Z&ed\d%       Z'e	 	 	 	 d]d&       Z(e	 	 	 	 d^d'       Z)e	 	 d9	 	 	 	 	 	 	 	 	 	 	 d_d(       Z*e	 	 	 	 d`d)       Z+e	 	 	 	 	 	 dad*       Z,e	 	 	 	 dbd+       Z-e	 	 	 	 dcd,       Z.e	 	 	 	 ddd-       Z/e	 	 	 	 ded.       Z0e	 	 	 	 dfd/       Z1e	 	 	 	 dC	 	 	 	 	 	 	 	 	 	 	 dgd0       Z2edhd1       Z3edid2       Z4y)jPageCommandsa  
    This class encapsulates the page commands of the Chrome DevTools Protocol (CDP).

    CDP's Page domain allows for interacting with browser pages, including navigation,
    content manipulation, and page state monitoring. These commands provide powerful
    capabilities for web automation, testing, and debugging.

    The commands defined in this class provide functionality for:
    - Navigating to URLs and managing page history
    - Capturing screenshots and generating PDFs
    - Handling JavaScript dialogs
    - Enabling and controlling page events
    - Managing download behavior
    - Manipulating page content and state
    Nc                z    t        |       }|||d<   |||d<   |||d<   t        t        j                  |      S )a  
        Creates a command to add a script that will be evaluated when a new document is created.

        Args:
            source (str): Script source to be evaluated when a new document is created.
            world_name (Optional[str]): If specified, creates an isolated world with the given name.
            include_command_line_api (Optional[bool]): Whether to include command line API.
            run_immediately (Optional[bool]): Whether to run the script immediately on
                existing contexts.

        Returns:
            AddScriptToEvaluateOnNewDocumentCommand: Command object with the identifier
                of the added script.
        )source	worldNameincludeCommandLineAPIrunImmediatelymethodparams)r	   r   r   &ADD_SCRIPT_TO_EVALUATE_ON_NEW_DOCUMENT)rj   
world_nameinclude_command_line_apirun_immediatelyrp   s        c/var/www/python/tenders/Scrapper/venv/lib/python3.12/site-packages/pydoll/commands/page_commands.py&add_script_to_evaluate_on_new_documentz3PageCommands.add_script_to_evaluate_on_new_document   sT    * 8vF!",F;#/.FF*+&'6F#$jOOX^__    c                 6    t        t        j                        S )z+
        Brings the page to front.
        ro   )r   r   BRING_TO_FRONT rw   ru   bring_to_frontzPageCommands.bring_to_front   s    
 j7788rw   c                    t               }| | |d<   |||d<   |||d<   |||d<   |||d<   |||d<   t        t        j                  |      S )a  
        Creates a command to capture a screenshot of the current page.

        Args:
            format (Optional[str]): Image compression format (jpeg, png, or webp).
            quality (Optional[int]): Compression quality from 0-100 (jpeg only).
            clip (Optional[Viewport]): Region of the page to capture.
            from_surface (Optional[bool]): Capture from the surface, not the view.
            capture_beyond_viewport (Optional[bool]): Capture beyond the viewport.
            optimize_for_speed (Optional[bool]): Optimize for speed, not for size.

        Returns:
            CaptureScreenshotCommand: Command object with base64-encoded image data.
        formatqualityclipfromSurfacecaptureBeyondViewportoptimizeForSpeedrn   )r
   r   r   CAPTURE_SCREENSHOT)r~   r   r   from_surfacecapture_beyond_viewportoptimize_for_speedrp   s          ru   capture_screenshotzPageCommands.capture_screenshot   s    . )*%F8 'F9!F6N#$0F=!"..EF*+));F%&j;;FKKrw   c                 6    t        t        j                        S )z
        Creates a command to close the current page.

        Returns:
            CloseCommand: Command object to close the page.
        ry   )r   r   CLOSEr{   rw   ru   closezPageCommands.close   s     j..//rw   c                l    t        |       }|||d<   |||d<   t        t        j                  |      S )a  
        Creates a command to create an isolated world for the given frame.

        Args:
            frame_id (str): ID of the frame in which to create the isolated world.
            world_name (Optional[str]): Name to be reported in the Execution Context.
            grant_universal_access (Optional[bool]): Whether to grant universal access.

        Returns:
            CreateIsolatedWorldCommand: Command object with the execution context ID.
        frameIdrk   grantUniveralAccessrn   )r   r   r   CREATE_ISOLATED_WORLD)frame_idrr   grant_universal_accessrp   s       ru   create_isolated_worldz"PageCommands.create_isolated_world   sB    " +8<!",F;!-,BF()j>>vNNrw   c                 6    t        t        j                        S )z
        Creates a command to disable page domain notifications.

        Returns:
            DisableCommand: Command object to disable the Page domain.
        ry   )r   r   DISABLEr{   rw   ru   disablezPageCommands.disable   s     j0011rw   c                Z    t               }| | |d<   t        t        j                  |      S )a+  
        Creates a command to enable page domain notifications.

        Args:
            enable_file_chooser_opened_event (Optional[bool]): Whether to emit
                Page.fileChooserOpened event.

        Returns:
            EnableCommand: Command object to enable the Page domain.
        enableFileChooserOpenedEventrn   )r   r   r   ENABLE) enable_file_chooser_opened_eventrp   s     ru   enablezPageCommands.enable   s/     +75UF12j//??rw   c                Z    t               }| | |d<   t        t        j                  |      S )z
        Creates a command to get the manifest for the current document.

        Returns:
            GetAppManifestCommand: Command object with manifest information.
        
manifestIdrn   )r   r   r   GET_APP_MANIFEST)manifest_idrp   s     ru   get_app_manifestzPageCommands.get_app_manifest  s/     &'"#.F< j99&IIrw   c                 6    t        t        j                        S )z
        Creates a command to get the frame tree for the current page.

        Returns:
            GetFrameTreeCommand: Command object with frame tree information.
        ry   )r   r   GET_FRAME_TREEr{   rw   ru   get_frame_treezPageCommands.get_frame_tree  s     j7788rw   c                 6    t        t        j                        S )z
        Creates a command to get layout metrics for the page.

        Returns:
            GetLayoutMetricsCommand: Command object with layout metrics.
        ry   )r   r   GET_LAYOUT_METRICSr{   rw   ru   get_layout_metricszPageCommands.get_layout_metrics)  s     j;;<<rw   c                 6    t        t        j                        S )z
        Creates a command to get the navigation history for the current page.

        Returns:
            GetNavigationHistoryCommand: Command object with navigation history.
        ry   )r   r   GET_NAVIGATION_HISTORYr{   rw   ru   get_navigation_historyz#PageCommands.get_navigation_history3  s     j??@@rw   c                ^    t        |       }|||d<   t        t        j                  |      S )aJ  
        Creates a command to handle a JavaScript dialog.

        Args:
            accept (bool): Whether to accept or dismiss the dialog.
            prompt_text (Optional[str]): Text to enter in prompt dialogs.

        Returns:
            HandleJavaScriptDialogCommand: Command object to handle a JavaScript dialog.
        )accept
promptTextrn   )r   r   r   HANDLE_JAVASCRIPT_DIALOG)r   prompt_textrp   s      ru   handle_javascript_dialogz%PageCommands.handle_javascript_dialog=  s1     .V<"#.F< jAA&QQrw   c                    t        |       }|||d<   |||d<   |||d<   |||d<   t        t        j                  |      S )a  
        Creates a command to navigate to a specific URL.

        Args:
            url (str): URL to navigate to.
            referrer (Optional[str]): Referrer URL.
            transition_type (Optional[str]): Intended transition type.
            frame_id (Optional[str]): Frame ID to navigate.
            referrer_policy (Optional[str]): Referrer policy.

        Returns:
            NavigateCommand: Command object to navigate to a URL.
        )urlreferrertransitionTyper   referrerPolicyrn   )r   r   r   NAVIGATE)r   r   transition_typer   referrer_policyrp   s         ru   navigatezPageCommands.navigateQ  sc    *  C(!)F:&'6F#$ (F9&'6F#$j11&AArw   c                P    t        |       }t        t        j                  |      S )a  
        Creates a command to navigate to a specific history entry.

        Args:
            entry_id (int): ID of the history entry to navigate to.

        Returns:
            NavigateToHistoryEntryCommand: Command object to navigate to a history entry.
        )entryIdrn   )r   r   r   NAVIGATE_TO_HISTORY_ENTRY)entry_idrp   s     ru   navigate_to_history_entryz&PageCommands.navigate_to_history_entryr  s!     .h?jBB6RRrw   c                :   t               }| | |d<   |||d<   |||d<   |||d<   |||d<   |||d<   |||d<   |||d<   |||d	<   |	|	|d
<   |
|
|d<   |||d<   |||d<   |||d<   |||d<   |||d<   |||d<   t        t        j                  |      S )a  
        Creates a command to print the current page to PDF.

        Args:
            landscape (Optional[bool]): Paper orientation.
            display_header_footer (Optional[bool]): Display header and footer.
            print_background (Optional[bool]): Print background graphics.
            scale (Optional[float]): Scale of the webpage rendering.
            paper_width (Optional[float]): Paper width in inches.
            paper_height (Optional[float]): Paper height in inches.
            margin_top (Optional[float]): Top margin in inches.
            margin_bottom (Optional[float]): Bottom margin in inches.
            margin_left (Optional[float]): Left margin in inches.
            margin_right (Optional[float]): Right margin in inches.
            page_ranges (Optional[str]): Paper ranges to print, e.g., '1-5, 8, 11-13'.
            header_template (Optional[str]): HTML template for the print header.
            footer_template (Optional[str]): HTML template for the print footer.
            prefer_css_page_size (Optional[bool]): Whether to prefer page size as defined by CSS.
            transfer_mode (Optional[str]): Transfer mode.

        Returns:
            PrintToPDFCommand: Command object to print the page to PDF.
        	landscapedisplayHeaderFooterprintBackgroundscale
paperWidthpaperHeight	marginTopmarginBottom
marginLeftmarginRight
pageRangesheaderTemplatefooterTemplatepreferCSSPageSizetransferModegenerateTaggedPDFgenerateDocumentOutlinern   )r   r   r   PRINT_TO_PDF)r   display_header_footerprint_backgroundr   paper_widthpaper_height
margin_topmargin_bottommargin_leftmargin_rightpage_rangesheader_templatefooter_templateprefer_css_page_sizetransfer_modegenerate_tagged_pdfgenerate_document_outlinerp   s                     ru   print_to_pdfzPageCommands.print_to_pdf  s6   V "# "+F; ,,AF()'(8F$%#F7O"#.F< #$0F=!!",F;$%2F>""#.F< #$0F=!"#.F< &'6F#$&'6F#$+*>F&'$%2F>"**=F&'$00IF,-j55fEErw   c                v    t               }| | |d<   |||d<   |||d<   t        t        j                  |      S )aQ  
        Creates a command to reload the current page.

        Args:
            ignore_cache (Optional[bool]): If true, browser cache is ignored.
            script_to_evaluate_on_load (Optional[str]): Script to be injected into the page on load.

        Returns:
            ReloadCommand: Command object to reload the page.
        ignoreCachescriptToEvaluateOnLoadloaderIdrn   )r   r   r   RELOAD)ignore_cachescript_to_evaluate_on_load	loader_idrp   s       ru   reloadzPageCommands.reload  sO      #$0F=!%1/IF+, !*F:j//??rw   c                 6    t        t        j                        S )zD
        Creates a command to reset the navigation history.
        ry   )r   r   RESET_NAVIGATION_HISTORYr{   rw   ru   reset_navigation_historyz%PageCommands.reset_navigation_history  s    
 jAABBrw   c                P    t        |       }t        t        j                  |      S )a%  
        Creates a command to remove a script that was added to be evaluated on new documents.

        Args:
            identifier (str): Identifier of the script to remove.

        Returns:
            RemoveScriptToEvaluateOnNewDocumentCommand: Command object to remove a script.
        )
identifierrn   )r   r   r   )REMOVE_SCRIPT_TO_EVALUATE_ON_NEW_DOCUMENT)r   rp   s     ru   )remove_script_to_evaluate_on_new_documentz6PageCommands.remove_script_to_evaluate_on_new_document  s"     ;jQjRR[abbrw   c                P    t        |       }t        t        j                  |      S )z
        Creates a command to toggle bypassing page CSP.

        Args:
            enabled (bool): Whether to bypass page CSP.

        Returns:
            SetBypassCSPCommand: Command object to toggle bypassing page CSP.
        enabledrn   )r    r   r   SET_BYPASS_CSPr   rp   s     ru   set_bypass_cspzPageCommands.set_bypass_csp  s!     $G4j77GGrw   c                R    t        | |      }t        t        j                  |      S )a2  
        Creates a command to set the document content of a frame.

        Args:
            frame_id (str): Frame ID to set the document content for.
            html (str): HTML content to set.

        Returns:
            SetDocumentContentCommand: Command object to set the document content.
        )r   htmlrn   )r!   r   r   SET_DOCUMENT_CONTENT)r   r   rp   s      ru   set_document_contentz!PageCommands.set_document_content  s#     *(Fj==fMMrw   c                P    t        |       }t        t        j                  |      S )a7  
        Creates a command to set whether to intercept file chooser dialogs.

        Args:
            enabled (bool): Whether to intercept file chooser dialogs.

        Returns:
            SetInterceptFileChooserDialogCommand: Command object to set file chooser dialog
                interception.
        r   rn   )r$   r   r   !SET_INTERCEPT_FILE_CHOOSER_DIALOGr   s     ru   !set_intercept_file_chooser_dialogz.PageCommands.set_intercept_file_chooser_dialog  s"     5WEjJJSYZZrw   c                P    t        |       }t        t        j                  |      S )a	  
        Creates a command to enable/disable lifecycle events.

        Args:
            enabled (bool): Whether to enable lifecycle events.

        Returns:
            SetLifecycleEventsEnabledCommand: Command object to enable/disable lifecycle events.
        r   rn   )r%   r   r   SET_LIFECYCLE_EVENTS_ENABLEDr   s     ru   set_lifecycle_events_enabledz)PageCommands.set_lifecycle_events_enabled.  s!     1AjEEfUUrw   c                 6    t        t        j                        S )z
        Creates a command to stop loading the page.

        Returns:
            StopLoadingCommand: Command object to stop loading the page.
        ry   )r   r   STOP_LOADINGr{   rw   ru   stop_loadingzPageCommands.stop_loading<  s     j5566rw   c                R    t        | |      }t        t        j                  |      S )a  
        Creates a command to add a compilation cache entry.

        Experimental: This method is experimental and may be subject to change.

        Args:
            url (str): URL for which to add the compilation cache entry.
            data (str): Base64-encoded data.

        Returns:
            AddCompilationCacheCommand: Command object to add a compilation cache entry.
        )r   datarn   )r   r   r   ADD_COMPILATION_CACHE)r   r  rp   s      ru   add_compilation_cachez"PageCommands.add_compilation_cacheF  s#     +s>j>>vNNrw   c                P    t        |       }t        t        j                  |      S )a]  
        Creates a command to capture a snapshot of the page.

        Experimental: This method is experimental and may be subject to change.

        Args:
            format (Literal['mhtml']): Format of the snapshot (only 'mhtml' is supported).

        Returns:
            CaptureSnapshotCommand: Command object to capture a snapshot.
        r~   rn   )r   r   r   CAPTURE_SNAPSHOT)r~   rp   s     ru   capture_snapshotzPageCommands.capture_snapshotW  s!     'f5j99&IIrw   c                 6    t        t        j                        S )zC
        Creates a command to clear the compilation cache.
        ry   )r   r   CLEAR_COMPILATION_CACHEr{   rw   ru   clear_compilation_cachez$PageCommands.clear_compilation_cachei  s    
 j@@AArw   c                 6    t        t        j                        S )z6
        Creates a command to crash the page.
        ry   )r   r   CRASHr{   rw   ru   crashzPageCommands.crashp  s    
 j..//rw   c                ^    t        |       }|||d<   t        t        j                  |      S )a  
        Creates a command to generate a test report.

        Experimental: This method is experimental and may be subject to change.

        Args:
            message (str): Message to be displayed in the report.
            group (Optional[str]): Group label for the report.

        Returns:
            GenerateTestReportCommand: Command object to generate a test report.
        )messagegrouprn   )r   r   r   GENERATE_TEST_REPORT)r  r  rp   s      ru   generate_test_reportz!PageCommands.generate_test_reportw  s0      *':#F7Oj==fMMrw   c                P    t        |       }t        t        j                  |      S )ar  
        Creates a command to get the ad script ancestry IDs for a given frame.

        Experimental: This method is experimental and may be subject to change.

        Args:
            frame_id (str): ID of the frame to get ad script ancestry IDs for.

        Returns:
            GetAdScriptAncestryIdsCommand: Command object to get ad script ancestry IDs.
        r   rn   )r   r   r   GET_AD_SCRIPT_ANCESTRY_IDSr   rp   s     ru   get_ad_script_ancestry_idsz'PageCommands.get_ad_script_ancestry_ids  s!     .h?jCCFSSrw   c                h    t               }| | |d<   |||d<   t        t        j                  |      S )ad  
        Creates a command to get the app ID.

        Experimental: This method is experimental and may be subject to change.

        Args:
            app_id (Optional[str]): App ID for verification.
            recommended_id (Optional[str]): Recommended app ID.

        Returns:
            GetAppIdCommand: Command object to get the app ID.
        appIdrecommendedIdrn   )r   r   r   
GET_APP_ID)app_idrecommended_idrp   s      ru   
get_app_idzPageCommands.get_app_id  s>       !$F7O%&4F?#j33FCCrw   c                 6    t        t        j                        S )zE
        Creates a command to get the installability errors.
        ry   )r   r   GET_INSTALLABILITY_ERRORSr{   rw   ru   get_installability_errorsz&PageCommands.get_installability_errors  s    
 jBBCCrw   c                P    t        |       }t        t        j                  |      S )aI  
        Creates a command to get origin trials for a given origin.

        Experimental: This method is experimental and may be subject to change.

        Args:
            frame_id (Optional[str]): Frame ID to get trials for.

        Returns:
            GetOriginTrialsCommand: Command object to get origin trials.
        r   rn   )r   r   r   GET_ORIGIN_TRIALSr  s     ru   get_origin_trialszPageCommands.get_origin_trials  s!     'x8j::6JJrw   c                P    t        |       }t        t        j                  |      S )zH
        Creates a command to get the permissions policy state.
        r   rn   )r   r   r   GET_PERMISSIONS_POLICY_STATEr  s     ru   get_permissions_policy_statez)PageCommands.get_permissions_policy_state  s!     1BjEEfUUrw   c                R    t        | |      }t        t        j                  |      S )z@
        Creates a command to get the resource content.
        )r   r   rn   )r   r   r   GET_RESOURCE_CONTENT)r   r   rp   s      ru   get_resource_contentz!PageCommands.get_resource_content  s#     *(Dj==fMMrw   c                 6    t        t        j                        S )z=
        Creates a command to get the resource tree.
        ry   )r   r   GET_RESOURCE_TREEr{   rw   ru   get_resource_treezPageCommands.get_resource_tree      
 j::;;rw   c                P    t        |       }t        t        j                  |      S )zI
        Creates a command to produce a compilation cache entry.
        )scriptsrn   )r   r   r   PRODUCE_COMPILATION_CACHE)r3  rp   s     ru   produce_compilation_cachez&PageCommands.produce_compilation_cache  s!     /w?jBB6RRrw   c                P    t        |       }t        t        j                  |      S )zF
        Creates a command to acknowledge a screencast frame.
        )	sessionIdrn   )r   r   r   SCREENCAST_FRAME_ACK)
session_idrp   s     ru   screencast_frame_ackz!PageCommands.screencast_frame_ack  s!     *J?j==fMMrw   c                p    t        | ||      }|||d<   |||d<   t        t        j                  |      S )zI
        Creates a command to search for a string in a resource.
        )r   r   querycaseSensitiveisRegexrn   )r   r   r   SEARCH_IN_RESOURCE)r   r   r<  case_sensitiveis_regexrp   s         ru   search_in_resourcezPageCommands.search_in_resource  sE     (cO%&4F?# (F9j;;FKKrw   c                P    t        |       }t        t        j                  |      S )z?
        Creates a command to set ad blocking enabled.
        r   rn   )r   r   r   SET_AD_BLOCKING_ENABLEDr   s     ru   set_ad_blocking_enabledz$PageCommands.set_ad_blocking_enabled  s!     ,G<j@@PPrw   c                R    t        | |      }t        t        j                  |      S )z9
        Creates a command to set font families.
        )fontFamilies
forScriptsrn   )r"   r   r   SET_FONT_FAMILIES)font_familiesfor_scriptsrp   s      ru   set_font_familieszPageCommands.set_font_families  s#     'MkZj::6JJrw   c                P    t        |       }t        t        j                  |      S )z6
        Creates a command to set font sizes.
        )	fontSizesrn   )r#   r   r   SET_FONT_SIZES)
font_sizesrp   s     ru   set_font_sizeszPageCommands.set_font_sizes#  s!     $j9j77GGrw   c                P    t        |       }t        t        j                  |      S )z@
        Creates a command to set prerendering allowed.
        )	isAllowedrn   )r&   r   r   SET_PRERENDERING_ALLOWED)
is_allowedrp   s     ru   set_prerendering_allowedz%PageCommands.set_prerendering_allowed-  s!     .
CjAA&QQrw   c                P    t        |       }t        t        j                  |      S )zE
        Creates a command to set the RPH registration mode.
        modern   )r'   r   r   SET_RPH_REGISTRATION_MODErY  rp   s     ru   set_rph_registration_modez&PageCommands.set_rph_registration_mode7  s!     .48jBB6RRrw   c                P    t        |       }t        t        j                  |      S )zD
        Creates a command to set the SPC transaction mode.
        rX  rn   )r(   r   r   SET_SPC_TRANSACTION_MODEr[  s     ru   set_spc_transaction_modez%PageCommands.set_spc_transaction_modeA  s!     -$7jAA&QQrw   c                P    t        |       }t        t        j                  |      S )zC
        Creates a command to set the web lifecycle state.
        )statern   )r)   r   r   SET_WEB_LIFECYCLE_STATE)ra  rp   s     ru   set_web_lifecycle_statez$PageCommands.set_web_lifecycle_stateK  s!     ,%8j@@PPrw   c                    t        |       }|||d<   |||d<   |||d<   |||d<   t        t        j                  |      S )z:
        Creates a command to start a screencast.
        r	  r   maxWidth	maxHeighteveryNthFramern   )r*   r   r   START_SCREENCAST)r~   r   	max_width
max_heightevery_nth_framerp   s         ru   start_screencastzPageCommands.start_screencastU  sa     'f5 'F9 !*F:!",F;&&5F?#j99&IIrw   c                 6    t        t        j                        S )z9
        Creates a command to stop a screencast.
        ry   )r   r   STOP_SCREENCASTr{   rw   ru   stop_screencastzPageCommands.stop_screencastk  s    
 j8899rw   c                 6    t        t        j                        S )z;
        Creates a command to wait for a debugger.
        ry   )r   r   WAIT_FOR_DEBUGGERr{   rw   ru   wait_for_debuggerzPageCommands.wait_for_debuggerr  r1  rw   )NNN)
rj   strrr   Optional[str]rs   Optional[bool]rt   ru  returnr0   )rv  r1   )NNNNNN)r~   zOptional[ScreenshotFormat]r   Optional[int]r   zOptional[Viewport]r   ru  r   ru  r   ru  rv  r2   )rv  r5   )NN)r   rs  rr   rt  r   ru  rv  r7   )rv  r8   )N)r   ru  rv  r9   )r   rt  rv  r=   )rv  r>   )rv  r@   )rv  rA   )r   boolr   rt  rv  rF   )NNNN)r   rs  r   rt  r   zOptional[TransitionType]r   rt  r   zOptional[ReferrerPolicy]rv  rG   )r   intrv  rH   )NNNNNNNNNNNNNNNNN)$r   ru  r   ru  r   ru  r   Optional[float]r   rz  r   rz  r   rz  r   rz  r   rz  r   rz  r   rt  r   rt  r   rt  r   ru  r   zOptional[TransferMode]r   ru  r   ru  rv  rI   )r   ru  r   rt  r   rt  rv  rK   )rv  rM   )r   rs  rv  rL   )r   rx  rv  rQ   )r   rs  r   rs  rv  rR   )r   rx  rv  rU   )r   rx  rv  rV   )rv  r\   )r   rs  r  rs  rv  r/   )mhtml)r~   zLiteral['mhtml']rv  r3   )rv  r4   )rv  r6   )r  rs  r  rt  rv  r:   )r   rs  rv  r;   )r  rt  r   rt  rv  r<   )rv  r?   )r   rs  rv  rB   )r   rs  rv  rC   )r   rs  r   rs  rv  rD   )rv  rE   )r3  zlist[CompilationCacheParams]rv  rJ   )r9  ry  rv  rN   )r   rs  r   rs  r<  rs  r@  ru  rA  ru  rv  rO   )r   rx  rv  rP   )rJ  r,   rK  zlist[ScriptFontFamilies]rv  rS   )rP  r-   rv  rT   )rU  rx  rv  rW   )rY  r_   rv  rX   )rY  r_   rv  rY   )ra  rf   rv  rZ   )r~   ra   r   rw  ri  rw  rj  rw  rk  rw  rv  r[   )rv  r]   )rv  r^   )5__name__
__module____qualname____doc__staticmethodrv   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-  r0  r5  r:  rB  rE  rL  rQ  rV  r\  r_  rc  rl  ro  rr  r{   rw   ru   rh   rh   q   s      %)37*.	``!` #1` (	`
 
1` `< 9 9 -1!%#''+26-1$L*$L$L !$L %	$L
 "0$L +$L 
"$L $LL 0 0  %)15OO!O !/O 
$	O O0 2 2 ;?@*8@	@ @& %)J"J	J J 9 9 = = A A 37RR#0R	&R R&  #'48"&48BBB 2B  	B
 2B 
B B@ S S $(04+/!%'+(,&*)-'+(,%))-)-/304.248#NF!NF-NF )NF 	NF
 %NF &NF $NF 'NF %NF &NF #NF 'NF 'NF -NF .NF  ,!NF" $2#NF$ 
%NF NF` '+48#'@$@$1@ !@ 
	@ @2 C C cc	3c c H H N N [ [ V V 7 7 O O  #*J J	J J" B B 0 0 -1NN*N	"N N( TT	&T T" FJDD6CD	D D, D D K K VV	)V V NNN 
#N N < < S-S	'S S NN	"N N 
 *.#'LLL L '	L
 !L 
!L L" QQ	$Q Q K#K-K 
 K K HH	H H RR	&R R SS	&S S RR	%R R Q Q	$Q Q  "&#'$()-J JJ !J "	J
 'J 
 J J* : : < <rw   rh   N)j
__future__r   typingr   r   r   pydoll.protocol.baser   pydoll.protocol.page.methodsr   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*   pydoll.protocol.page.typesr+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rh   r{   rw   ru   <module>r     s    " 3 3 ($ $ $ $ $ $ $ $ $ $J  1 1 1 1 1 1 1 1 1 1 1 1 1d	 	 	F< F<rw   