§
    ®	Êj'ú  ã                  óB  — U d Z ddlmZ ddlZddlZddlZddlZddlZddl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 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+ ddl,m-Z- d	Z.d
Z/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8dZ9dZ:dZ; e<¦   «         Z=de>d<   e?fd°d „Z@d±d!„ZA	 dd"lBmCZD dZEn# eF$ rZGdZDeGZEd#e>d$<   Y dZG[GndZG[Gww xY wdd%lmHZH d&ZId²d(„ZJd³d0„ZKd´d2„ZLdµd4„ZMd¶d5„ZNd´d6„ZO G d7„ d8¦  «        ZP eP¦   «         ZQd/e>d9<   d·d<„ZR G d=„ d>¦  «        ZSd¸d@„ZT G dA„ dB¦  «        ZUd¹dF„ZVdºdI„ZW	 d»ddJddKœd¼dV„ZX e¦   «         ZYdWe>dX<    e¦   «         ZZdYe>dZ<   d½d\„Z[d¾d^„Z\d¿d`„Z]dÀdb„Z^dÁde„Z_dÂdg„Z`dÃdi„ZadÄdk„ZbdÅdq„ZcdÆds„ZddÆdt„ZedÇdw„ZfdÈdy„ZgdÉd{„ZhdÊd|„Zidd}œdËd‚„Zj	 d»ddJdƒœdÌd†„ZkdÍd‡„ZldÎd‰„ZmdandŠe>d‹<   daod'e>dŒ<   dapd'e>d�<   daqd'e>dŽ<   i Zrd�e>d�<   d‘Zsd’ZtdÏd—„ZudÐd™„ZvdÑdš„ZwdÒdž„Zxdd}œdÓd „Zye
 G d¡„ d¢¦  «        ¦   «         ZzdÔd¤„Z{dÕd§„Z|dÐd¨„Z}dÐd©„Z~dÖd¬„ZdÐd­„Z€d´d®„Z�g d¯¢Z‚dS )×ai  Wiring that routes pointer movement through the wrapper's own generator.

WHY THE MOTION IS GENERATED HERE AND NOT IN THE BROWSER
-------------------------------------------------------
Until now every ``mousemove`` was expanded inside the browser, by code that
ships with the binary.  That has three consequences we want to be rid of:

* The trajectory is built from compiled-in constants, so its shape is an
  invariant across every session of every install.  Generated here it derives
  from the session seed instead, which means two users - and two sessions of
  the same user - do not move the same way, and a replayed seed replays the
  cursor exactly like it replays the fingerprint.
* The expansion happened *inside* the browser's own mouse-dispatch entry
  point, which is what breaks hover (see HOVER, below).
* Changing anything about it required rebuilding and re-releasing a browser.

Nothing is lost by moving it.  The in-browser expansion dispatched its
waypoints with exactly the same arguments the ordinary ``mouse.move`` path
uses - same pressure, same input source, same pointer id, same synthesized
flags - so a waypoint driven from here is indistinguishable from one the
binary used to generate itself.

HOW IT REACHES ``page.click`` WITHOUT A NEW API
-----------------------------------------------
This package's promise is that it *is* Playwright: same objects, same
methods, no rewrite.  A ``page.move_like_a_human()`` helper would break that
promise - it only helps code that was written after we shipped it, and every
existing script keeps teleporting.  So there is no new API.  Instead we wrap
the *one* internal funnel every pointer action already goes through.

In Playwright's Python bindings, ``Page.click``, ``Frame.click`` and
``Locator.click`` all end up in the same coroutine on the implementation
object (``Frame._click``); ``hover`` / ``dblclick`` / ``tap`` / ``check`` /
``uncheck`` funnel the same way, and ``Page.set_checked`` funnels into
``check`` / ``uncheck``.  Wrapping those six coroutines therefore covers the
public surface for the sync API *and* the async API at once, because the sync
API is a greenlet driver over the very same implementation objects.  User code
that already says ``page.click("#buy")`` gets the motion with no edit.
``Mouse.move`` and ``Mouse.wheel`` are wrapped for the same reason.

The wrappers are installed on the class, once per process, but they are inert
unless the page belongs to a session that asked for them: the lookup is a
weak-keyed registry, and a page from a plain ``sync_playwright()`` browser in
the same process finds nothing and is delegated to untouched.

HOVER
-----
The in-browser expansion ran *inside* the mouse-dispatch entry point, i.e.
after the automation layer had already installed its hit-target interceptor
for this action.  The interceptor's job is to confirm that the point being
clicked really lands on the element it was told to click.  It sees the first
event of the action, and the first event of the action was the first waypoint
of the curve, which sits far away from the target - usually over ``<html>``.
The interceptor concludes the element is covered by another element and the
action fails.  On Windows that is roughly three hover calls in four.

Generating here fixes it by construction, not by tuning: the whole approach
runs to completion *before* we call the original coroutine, so the interceptor
is installed after the cursor has already arrived.  The only event it sees is
the single, exact move the automation layer makes itself, onto the point it
computed.  There is no waypoint left inside the checked window for it to
mistake for an obstruction.

THE THREE LAYERS, AND WHO OWNS WHAT
------------------------------------
``_motion``     the shape and the pacing of ONE stroke, A to B.
``_behaviour``  what an action is made of and what happens between actions:
                how many strokes, where they aim inside a control, the
                overshoot and the correction, the fidget while nothing is
                happening, the pointer creep during a scroll.  Pure: it
                returns a timeline and never touches a clock.
this module     everything with a side effect.  It decides WHEN the macro
                layer runs, walks the timeline against a real clock, keeps
                coordinates inside the viewport (a waypoint outside it is not
                merely dropped by the browser, it parks the cursor at the
                origin), and guarantees that none of the above can fail a call
                that would otherwise have succeeded.

``_motion`` is an optional dependency and its absence is survivable: without
it a session hands the job back to the browser's own expansion and says so.
``_behaviour`` is not optional - it decides where an action aims - so it is
imported plainly. It is pure stdlib and in this same package, so an install in
which it fails to import is an install in which nothing else works either.

WHEN THE MACRO LAYER RUNS - AND WHY IT IS NOT A BACKGROUND TASK
----------------------------------------------------------------
The honest way to make a pointer move while the caller's script is doing
nothing would be a background task dispatching pointer events on its own.  We
do not do that, deliberately.  The caller's script is single-threaded by
assumption; a second writer on the same page would interleave a ``mousemove``
into the middle of somebody's ``click`` - precisely the hit-target failure
described under HOVER - and it would keep sending input to a page whose script
believes nothing is touching it.  A stealth feature that intermittently breaks
clicks is not a stealth feature.

So every event this module sends is sent from inside a call the user made, and
the macro layer is folded into the head of the NEXT action instead:

* the wall clock since the last dispatch is real, and it is the input the idle
  planner wants.  We plan the whole of that idle period, then dispatch only
  the tail of it that fits the movement budget (:func:`_behaviour.tail_within`).
  What reaches the wire is therefore the last fraction of a second of a
  fidget that is planned as if it had been running all along;
* the approach to a control is planned by :func:`_behaviour.plan_approach`, so
  an action is one to three submovements with a dwell between them, ending on
  a point inside the element that is not its centre;
* ``mouse.wheel`` becomes a burst of detents with the pointer creeping between
  them, which is what a hand on a wheel does.

The whole of it is bounded by ``humanize=<seconds>``: one action never spends
more than that budget in motion, and the budget is enforced by DROPPING
waypoints, never by emitting them faster than a device could report them.
é    )ÚannotationsN)Ú	dataclass)ÚAnyÚCallableÚDictÚIterableÚListÚOptionalÚSequenceÚTuple)ÚWeakKeyDictionary)ÚDONEÚSLEEPÚEvÚPacerÚPointerPersonaÚStepÚclamp_to_viewportÚ
fine_timerÚfit_timelineÚinitial_pointerÚlanding_pointÚplan_aimless_moveÚplan_approachÚ	plan_idleÚplan_scrollÚsteps_from_waypointsÚtail_within)Úsub_seedÚINVPW_CURSOR_ENGINEÚpythonÚbinaryÚoffÚINVPW_CURSOR_LANDINGg      ø?g      y@g     ùå@gffffffÖ?)g      ”@g     €†@g     ˆ³@g      (@gìQ¸…ëÁ?g¤p=
×£Ð?ÚsetÚ_warnedÚkeyÚstrÚmessageÚcategoryÚtypeÚreturnÚNonec                ó„   — | t           v rd S t                                | ¦  «         t          j        d|z   |d¬¦  «         d S )Nzinvisible_playwright: é   )Ú
stacklevel)r&   ÚaddÚwarningsÚwarn)r'   r)   r*   s      úLC:\Projects\Muse2API\.venv\Lib\site-packages\invisible_playwright/_cursor.pyÚ
_warn_oncer5   É   sE   € Ø
�g€~€~ØˆÝ‡K‚K�ÑÔÐÝ„MÐ*¨WÑ4°hÈ1ÐMÑMÔMÐMÐMÐMó    c                 ó8   — t                                ¦   «          dS )z;Test hook: forget which warnings have already been emitted.N)r&   Úclear© r6   r4   Ú_reset_warningsr:   Ð   s   € å‡M‚M�O„O€O€O€Or6   )ÚjugglerzOptional[BaseException]Ú_MOTION_IMPORT_ERROR)ÚMIN_EVENT_INTERVAL_MS)ÚCursorMotionÚMotionProfileÚ
new_motionúOptional[Callable[..., Any]]c                 óü   — t           } | �.t          D ]&}t          | |d¦  «        }t          |¦  «        r|c S Œ't          �%dt          t          ¦  «        j        › dt          › d�nd}t          dd|z   dz   ¦  «         dS )	zEReturn the callable that builds a per-page stroke generator, or None.Nz (ú: ú)Ú z	no-motionzFno cursor motion generator found (invisible_core.juggler.CursorMotion)zk; falling back to the browser's own motion for this process. This is a broken install, not a configuration.)Ú_motion_modÚ_MOTION_FACTORY_NAMESÚgetattrÚcallabler<   r+   Ú__name__r5   )ÚmodÚnameÚfactoryÚdetails       r4   Ú_motion_factoryrO     s¸   € å
€CØ
€Ý)ð 	ð 	ˆDÝ˜c 4¨Ñ.Ô.ˆGÝ˜Ñ Ô ð Ø���ðõ  Ð+ð 	L�TÕ&Ñ'Ô'Ô0ÐKÐKÕ4HÐKÐKÐKÐKàð õ
 Øð	0Ø28ñ	9ð<(ñ	(ñô ð ð ˆ4r6   rM   úCallable[..., Any]ÚseedÚintÚmax_secondsÚfloatr   c                ó¢   — 	 t          j        | ¦  «        j        }n# t          t          f$ r i }Y nw xY wd|v r | ||¬¦  «        S  | |¦  «        S )a  Construct a profile, whether or not the generator wants the cap.

    The cap belongs to the public constructor (``humanize=<seconds>``), so the
    wrapper honours it either way: a generator that takes it applies it itself,
    one that does not gets its schedule fitted here.
    rS   ©rQ   rS   )ÚinspectÚ	signatureÚ
parametersÚ	TypeErrorÚ
ValueError)rM   rQ   rS   Úparamss       r4   Ú_build_profiler]     ss   € ðÝÔ" 7Ñ+Ô+Ô6ˆˆøÝ•zÐ"ð ð ð Øˆˆˆðøøøà˜ÐÐØˆw˜D¨kÐ:Ñ:Ô:Ð:Øˆ7�4‰=Œ=Ðs   ‚ œ2±2Úboolc                 ó>   — t          ¦   «         duot          ¦   «         S )z?True when a generator exists AND the bindings could be wrapped.N)rO   Ú_ensure_patchedr9   r6   r4   Úmotion_availablera   ,  s   € åÑÔ DÐ(Ð>­_Ñ->Ô->Ð>r6   Úhumanizec                ó,  — | st           S t          j                             t          ¦  «        pd                     ¦   «                              ¦   «         }|t          dfv rt          S |t           dddfv rt           S t          ¦   «         rt          nt          S )an  Decide who generates the motion for a session.

    ``humanize`` keeps exactly the meaning it has always had on the public
    constructor: falsy disables humanisation, ``True`` enables it with the
    default cap, a number enables it with that cap in seconds. This function
    only decides WHERE the motion comes from, never WHETHER the user asked
    for it.
    rE   r;   ÚnoneÚfalseÚ0)
Ú
ENGINE_OFFÚosÚenvironÚgetÚ
ENGINE_ENVÚstripÚlowerÚENGINE_BINARYra   ÚENGINE_PYTHON)rb   Úchoices     r4   Úresolve_cursor_enginerq   1  s‰   € ð ð ÝÐÝŒj�nŠn�ZÑ(Ô(Ð.¨B×5Ò5Ñ7Ô7×=Ò=Ñ?Ô?€FØ•- Ð+Ð+Ð+ÝÐØ•*˜f g¨sÐ3Ð3Ð3ÝÐõ -Ñ.Ô.ÐA�=ˆ=µMÐAr6   c                ó”   — | du rt           S 	 t          | ¦  «        }n# t          t          f$ r
 t           cY S w xY w|dk    r|nt           S )z1The motion-duration cap implied by ``humanize=``.Tr   )Ú_DEFAULT_MAX_SECONDSrT   rZ   r[   )rb   Úvalues     r4   Úmax_seconds_forru   F  sd   € à�4ÐÐÝ#Ð#ð$Ý�h‘”ˆˆøÝ•zÐ"ð $ð $ð $Ý#Ð#Ð#Ð#ð$øøøà˜A’I�Iˆ5ˆ5Õ#7Ð7s   � �8·8c                 óš   — t           j                             t          ¦  «        pd                     ¦   «                              ¦   «         dvS )zGWhether an action may be told to click somewhere other than the centre.rE   )r#   rf   re   Úno)rh   ri   rj   ÚLANDING_ENVrl   rm   r9   r6   r4   Úlanding_enabledry   Q  s@   € åŒJ�NŠN�;Ñ'Ô'Ð-¨2×4Ò4Ñ6Ô6×<Ò<Ñ>Ô>ð Gð ð r6   c                  óF   — e Zd ZdZdZed
d„¦   «         Zedd„¦   «         Zd	S )Ú
_RealTimerzWall clock and a real sleep.r9   r,   rT   c                 ó(   — t          j        ¦   «         S ©N)ÚtimeÚperf_counterr9   r6   r4   Únowz_RealTimer.nowc  s   € åÔ Ñ"Ô"Ð"r6   Úsecondsr-   c              ƒ  ó>   K  — t          j        | ¦  «        ƒ d {V —† d S r}   )ÚasyncioÚsleep)r�   s    r4   r„   z_RealTimer.sleepg  s.   è è € åŒm˜GÑ$Ô$Ð$Ð$Ð$Ð$Ð$Ð$Ð$Ð$Ð$r6   N)r,   rT   )r�   rT   r,   r-   )rJ   Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__Ústaticmethodr€   r„   r9   r6   r4   r{   r{   ^  s]   € € € € € Ø&Ð&à€Iàð#ð #ð #ñ „\ð#ð ð%ð %ð %ñ „\ð%ð %ð %r6   r{   Ú_TIMERÚsession_seedÚordinalc                óÈ   — t          |¦  «        }t          | ¦  «        dz  dz  }||dz  dz  z  dz  }|dz	  }|dk    r||dz  z  dz  dz  }|dz  }|dk    °||dz	  z  }|dz  S )	uH  Derive a page's motion seed from the session seed.

    Per PAGE rather than per session so that determinism survives more than
    one tab: a single shared stream would make every path depend on the order
    in which tabs happened to move. Same session seed plus same tab ordinal
    gives the same path, which is what makes a replayed seed replay the
    cursor. Kept inside int31 for consistency with the rest of the seeding.

    â›” EVERY BIT OF THE ORDINAL COUNTS, not only the low 16. A page the site
    opened is numbered in a space of its own above bit 62 (`_behaviour.
    popup_number`), and with the old mask two popups shared a path whenever
    their numbers agreed on 16 bits. The higher bits are folded in only when
    there are any, so the pages the script asks for (0, 1, 2 ...) keep the
    seeds they always had.
    l   ÿÿ l   ±yn< iÿÿ  l   kJ× é   r   l   5.e iÿÿÿ)rR   )r‹   rŒ   ÚhÚhighs       r4   Úpage_motion_seedr‘   p  s–   € õ  �'‰lŒl€GÝ	ˆ\Ñ	Ô	˜ZÑ	'¨:Ñ5€AØ	
ˆw˜Ñ :Ñ-Ñ	.°*Ñ<€AØ�b‰=€DØ
�Š(ˆ(Ø�4˜&‘=Ñ! ZÑ/°:Ñ=ˆØ�‰ˆð �Š(ˆ(ð ˆˆb‰�L€AØˆz‰>Ðr6   c                  ó   — e Zd ZdZdZdd	„Zd
S )Ú_Sessionz6Everything a session hands to the pages underneath it.rV   rQ   rR   rS   rT   r,   r-   c                óV   — t          |¦  «        | _        t          |¦  «        | _        d S r}   )rR   rQ   rT   rS   )ÚselfrQ   rS   s      r4   Ú__init__z_Session.__init__�  s%   € Ý˜‘I”IˆŒ	Ý  Ñ-Ô-ˆÔÐÐr6   N)rQ   rR   rS   rT   r,   r-   )rJ   r…   r†   r‡   rˆ   r–   r9   r6   r4   r“   r“   ‹  s3   € € € € € Ø@Ð@à'€Ið.ð .ð .ð .ð .ð .r6   r“   Úpagec                ó6   — t          | j        d         ¦  «        S )u:  The page's number in the session, as the server gave it.

    â›” READ FROM THE PAGE, NEVER COUNTED HERE. The server sends it in the
    page's initializer (`PageDispatcher.number`: the number the client
    reserved at the `new_page()` call, or a popup's derived one), and the
    server draws the page's acts under it. This cursor used to count its own,
    at each page's FIRST MOVEMENT: a script that created two pages and moved
    on the second first gave the second page 0 here and 1 there - two
    counters for one fact, with two different orders ([B237]).
    Ú
pageNumber)rR   Ú_initializer)r—   s    r4   Úpage_numberr›   •  s   € õ ˆtÔ  Ô.Ñ/Ô/Ð/r6   c                  óF   — e Zd ZdZdZd"d„Zd#d„Zd$d„Zd%d„Zd&d„Z	d'd „Z
d!S )(Ú_PageCursorzACursor state for one page: where it is, and how it likes to move.)	rQ   rS   Ú_profileÚpersonaÚxÚyÚbusyÚactionÚlast_event_atrQ   rR   rS   rT   rM   rP   r,   r-   c                ó  — t          |¦  «        | _        t          |¦  «        | _        t	          || j        | j        ¦  «        | _        t          j        | j        ¦  «        | _        d | _	        d | _
        d| _        d| _        d | _        d S )NFr   )rR   rQ   rT   rS   r]   rž   r   Ú	from_seedrŸ   r    r¡   r¢   r£   r¤   )r•   rQ   rS   rM   s       r4   r–   z_PageCursor.__init__©  sw   € Ý˜‘I”IˆŒ	Ý  Ñ-Ô-ˆÔÝ& w°´	¸4Ô;KÑLÔLˆŒÝ%Ô/°´	Ñ:Ô:ˆŒØ"&ˆŒØ"&ˆŒØˆŒ	ð ˆŒØ.2ˆÔÐÐr6   ÚwidthúOptional[float]ÚheightúTuple[float, float]c           	     óR  — ||}}|r|sOt          ddt          t          d         ¦  «        t          t          d         ¦  «        fz  ¦  «         t          \  }}t          | j        dd¦  «        }t          |¦  «        r{	  |||¦  «        \  }}t          |¦  «        t          |¦  «        fS # t          t          t          f$ r3}t          ddt          |¦  «        j        ›d	|›d
�¦  «         Y d}~nd}~ww xY wt          | j        t          |¦  «        t          |¦  «        f¦  «        S )a  Where the pointer is before this page's first movement.

        Never the origin, and never a constant: a session whose first movement
        departs from (0, 0) is announcing that it had no pointer state at all
        before it started, which no real navigation produces.
        zno-viewportz°a page reported no viewport size; the cursor start position falls back to a nominal %dx%d viewport. Coordinates are still seeded, but they are not derived from the real window.r   é   Ústart_pointNzbad-start-pointz-the motion generator's start_point() failed (rC   z)); using the behaviour planner's instead.)r5   rR   Ú_FALLBACK_VIEWPORTrH   rž   rI   rT   rZ   r[   ÚArithmeticErrorr+   rJ   r   rQ   )	r•   r§   r©   Úwr�   ÚfnÚpxÚpyÚexcs	            r4   r­   z_PageCursor.start_point¹  s[  € ð �fˆ1ˆØð 	&˜ð 	&õ
 ØðIõ Õ)¨!Ô,Ñ-Ô-­sÕ3EÀaÔ3HÑ/IÔ/IÐJñKñô ð õ &‰DˆAˆqÝ�T”] M°4Ñ8Ô8ˆÝ�B‰<Œ<ð 
	ð	Ø˜˜A˜q™œ‘��BÝ˜R‘y”y¥%¨¡)¤)Ð+Ð+øÝ�z­?Ð;ð ð ð ÝØ%Ð%õ ˜C‘y”yÔ)Ð)Ð)¨3¨3¨3ð0ñô ð ð ð ð ð ð øøøøðøøøõ ˜tœy­5°©8¬8µU¸1±X´XÐ*>Ñ?Ô?Ð?s   Á>,B+ Â+C5Ã)C0Ã0C5r—   r   c                óØ   — | j         �| j        €5t          |¦  «        \  }}|                      ||¦  «        \  | _         | _        t	          | j         ¦  «        t	          | j        ¦  «        fS )zACurrent pointer position, placing it first if it has never moved.)r    r¡   Ú	_viewportr­   rT   )r•   r—   r°   r�   s       r4   Úherez_PageCursor.hereÜ  sV   € àŒ6ˆ>˜TœV˜^Ý˜T‘?”?‰DˆAˆqØ!×-Ò-¨a°Ñ3Ô3‰NˆDŒF�D”FÝ�T”V‰}Œ}�e D¤F™mœmÐ+Ð+r6   ÚfxÚfyÚtxÚtyú List[Tuple[float, float, float]]c                óf   — | j                              ||||¦  «        }t          || j        ¦  «        S r}   )rž   ÚpathÚ_normalise_waypointsrS   )r•   r¸   r¹   rº   r»   Úraws         r4   r¾   z_PageCursor.pathå  s0   € ØŒm× Ò   R¨¨RÑ0Ô0ˆÝ# C¨Ô)9Ñ:Ô:Ð:r6   ÚboundsúCallable[..., List[Any]]c                óF   ‡‡— | j         Š| j        j        Š|ddœdˆˆfd„}|S )a
  A ``_behaviour`` renderer backed by the stroke generator.

        This is what keeps ONE stroke model in the product: the macro planner
        decides that a movement happens and where it goes, and every stroke it
        asks for is drawn by ``_motion``.
        N)rÁ   Útarget_wÚstartrª   ÚendÚkindr(   Úlead_msrT   rÁ   r   rÄ   r¨   r,   ú	List[Any]c          
     ó˜  •— 	 t          ‰                     | d         | d         |d         |d         |¬¦  «        ¦  «        }nM# t          $ r@ t          ‰                     | d         | d         |d         |d         ¦  «        ¦  «        }Y nw xY w|r't          d„ |D ¦   «         ¦  «        sˆfd„|D ¦   «         }t	          ||||¬¦  «        S )Nr   r¬   )rÄ   c              3  óä   K  — | ]k}t          |d ¦  «        r t          t          |d d¦  «        pd¦  «        n6t          t	          |¦  «        ¦  «        dk    rt          |d         ¦  «        ndV — ŒldS )Údt_msç        é   N)ÚhasattrrT   rH   ÚlenÚtuple)Ú.0Úps     r4   ú	<genexpr>z7_PageCursor.renderer.<locals>.render.<locals>.<genexpr>þ  s�   è è € ð -ð -ð $%õ #*¨!¨WÑ"5Ô"5ð K�u¥W¨Q°¸Ñ%=Ô%=Ð%DÀÑEÔEÐEå/2µ5¸±8´8©}¬}¸qÒ/@Ð/@¥ a¨¤d¡¤ Àcð-ð -ð -ð -ð -ð -r6   c           
     óê   •— g | ]o}t          t          |d ¦  «        rt          |d d¦  «        n|d         ¦  «        t          t          |d¦  «        rt          |dd¦  «        n|d         ¦  «        ‰f‘ŒpS )r    Nr   r¡   r¬   )rT   rÏ   rH   )rÒ   rÓ   Únominals     €r4   ú
<listcomp>z8_PageCursor.renderer.<locals>.render.<locals>.<listcomp>  sŠ   ø€ ð %ð %ð %ð õ µw¸qÀ#±´ÐP�g a¨¨dÑ3Ô3Ð3ÈAÈaÌDÑQÔQÝµw¸qÀ#±´ÐP�g a¨¨dÑ3Ô3Ð3ÈAÈaÌDÑQÔQØð!ð %ð %ð %r6   )rÇ   rÈ   rÁ   )Úlistr¾   rZ   Úanyr   )	rÅ   rÆ   rÇ   rÈ   rÁ   rÄ   rÀ   rÖ   Úprofiles	          €€r4   Úrenderz$_PageCursor.renderer.<locals>.renderó  s#  ø€ ðMÝ˜7Ÿ<š<¨¨a¬°%¸´(¸CÀ¼FÀCÈÄFØ19ð (ñ ;ô ;ñ <ô <��øåð Mð Mð Mõ ˜7Ÿ<š<¨¨a¬°%¸´(¸CÀ¼FÀCÈÄFÑKÔKÑLÔL���ð	Møøøð
 ð 
%�3ð -ð -ð ),ð-ñ -ô -ñ -ô -ð 
%ð%ð %ð %ð %ð !$ð%ñ %ô %�õ (Ø˜$¨¸ðñ ô ð s   ƒ?A ÁABÂB)rÅ   rª   rÆ   rª   rÇ   r(   rÈ   rT   rÁ   r   rÄ   r¨   r,   rÉ   )rž   rŸ   Ú	sample_ms)r•   rÁ   rÛ   rÖ   rÚ   s      @@r4   Úrendererz_PageCursor.rendereré  sT   øø€ ð ”-ˆØ”,Ô(ˆð =CØ/3ð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð4 ˆr6   Útagr(   úrandom.Randomc                ód   — t          j        t          | j        d|| j        fz  ¦  «        ¦  «        S )zAA per-(page, action, purpose) stream. Reproducible from the seed.z%s:%d)ÚrandomÚRandomr   rQ   r£   )r•   rÞ   s     r4   Úrngz_PageCursor.rng  s1   € åŒ}Ý�T”Y ¨3°´Ð*<Ñ <Ñ=Ô=ñ
ô 
ð 	
r6   N)rQ   rR   rS   rT   rM   rP   r,   r-   )r§   r¨   r©   r¨   r,   rª   ©r—   r   r,   rª   )
r¸   rT   r¹   rT   rº   rT   r»   rT   r,   r¼   )rÁ   rª   r,   rÂ   )rÞ   r(   r,   rß   )rJ   r…   r†   r‡   rˆ   r–   r­   r·   r¾   rÝ   rã   r9   r6   r4   r�   r�   £  sŸ   € € € € € ØKÐKð4€Ið3ð 3ð 3ð 3ð !@ð !@ð !@ð !@ðF,ð ,ð ,ð ,ð;ð ;ð ;ð ;ð$ð $ð $ð $ðL
ð 
ð 
ð 
ð 
ð 
r6   r�   ÚstepsúIterable[Any]ú	List[_Ev]c                ó2  — g }d}| D ]�}|t          dt          |j        ¦  «        ¦  «        z  }|j        dk    rŒ3|                     t          ||j        |j        |j        dk    rdndt          |dd¦  «        t          |dd¦  «        ¦  «        ¦  «         Œ�|S )zFTurn a ``_behaviour`` Step list (relative delays) into absolute times.rÍ   ÚwaitÚwheelÚmoveÚdxÚdy)	ÚmaxrT   Údelay_msrÇ   ÚappendÚ_Evr    r¡   rH   )rå   ÚoutÚtÚss       r4   Ú	_timelinerõ      s¶   € à€CØ€AØð Fð FˆØ	�S�•e˜AœJÑ'Ô'Ñ(Ô(Ñ(ˆØŒ6�VÒÐØØ�
Š
•3�q˜!œ#˜qœs¨q¬v¸Ò/@Ð/@ G GÀfÝ˜q $¨Ñ,Ô,­g°a¸¸sÑ.CÔ.CñEô Eñ 	Fô 	Fð 	Fð 	Fà€Jr6   rÀ   r¼   c                ó~  ‡— g }| D �]T}t          |dd¦  «        }|�}t          |d¦  «        rmt          |dd¦  «        }|�t          |¦  «        dz  nd}|                     t          |¦  «        t          |j        ¦  «        t          d|¦  «        f¦  «         Œ“t          |¦  «        }t          |¦  «        dk    ra|                     t          |d         ¦  «        t          |d	         ¦  «        t          dt          |d
         ¦  «        ¦  «        f¦  «         �Œ|                     t          |d         ¦  «        t          |d	         ¦  «        df¦  «         �ŒV|sg S t          d„ |D ¦   «         ¦  «        rd„ |D ¦   «         }|d         d
         dk     r |t          |¦  «        z  Šˆfd„|D ¦   «         }g }d}	|D ]2\  }}
}|	|dz  z  }	|                     t          |	||
¦  «        ¦  «         Œ3t          ||¦  «        }g }d}|D ]6}|                     |j        |j        |j        |z
  dz  f¦  «         |j        }Œ7|S )aÅ  Reduce whatever the generator returns to ``(x, y, delay_seconds)``.

    Three shapes are accepted: a waypoint object carrying ``x`` / ``y`` /
    ``dt_ms``, an ``(x, y, delay_seconds)`` triple, and a bare ``(x, y)`` pair
    whose pacing is then spread evenly over the cap.

    The cap from ``humanize=<seconds>`` is applied through
    :func:`_fit_timeline`, so a tighter cap makes the movement shorter AND
    coarser rather than merely denser.
    r    Nr¡   rÌ   ç     @�@rÍ   r/   r   r¬   rÎ   ç      ð¿c              3  ó*   K  — | ]\  }}}|d k    V — ŒdS )rÍ   Nr9   )rÒ   Ú_Úds      r4   rÔ   z'_normalise_waypoints.<locals>.<genexpr>G  s,   è è € Ð
*Ð
*™˜˜1˜aˆ1�Š8Ð
*Ð
*Ð
*Ð
*Ð
*Ð
*r6   c                ó    — g | ]\  }}}||d f‘ŒS )rø   r9   )rÒ   r    r¡   rú   s       r4   r×   z(_normalise_waypoints.<locals>.<listcomp>K  s$   € Ð5Ð5Ð5¡7 1 a¨�1�a˜�,Ð5Ð5Ð5r6   c                ó"   •— g | ]\  }}}||‰f‘ŒS r9   r9   )rÒ   r    r¡   rú   Úevens       €r4   r×   z(_normalise_waypoints.<locals>.<listcomp>N  s%   ø€ Ð5Ð5Ð5¡7 1 a¨�1�a˜�,Ð5Ð5Ð5r6   )rH   rÏ   rT   rð   r¡   rî   rÑ   rÐ   Úallrñ   Ú_fit_timeliner    Út_ms)rÀ   rS   ÚpointsrÓ   r    rÌ   ÚdelayÚseqÚevsró   r¡   rû   rò   ÚprevÚevrþ   s                  @r4   r¿   r¿   -  sN  ø€ ð 02€FØð @ñ @ˆÝ�A�s˜DÑ!Ô!ˆØˆ=�W Q¨™_œ_ˆ=Ý˜A˜w¨Ñ-Ô-ˆEØ-2Ð->•E˜%‘L”L 6Ñ)Ð)ÀCˆEØ�MŠM�5 ™8œ8¥U¨1¬3¡Z¤Zµ°S¸%±´ÐAÑBÔBÐBØÝ�A‰hŒhˆÝˆs‰8Œ8�qŠ=ˆ=Ø�MŠM�5  Q¤™=œ=­%°°A´©-¬-½¸SÅ%ÈÈAÌÁ-Ä-Ñ9PÔ9PÐQÑRÔRÐRÑRà�MŠM�5  Q¤™=œ=­%°°A´©-¬-¸Ð>Ñ?Ô?Ð?Ñ?Øð Øˆ	Ý
Ð
*Ð
* 6Ð
*Ñ
*Ô
*Ñ*Ô*ð 6ð 6Ð5¨fÐ5Ñ5Ô5ˆØˆa„y�„|�aÒÐØ�S ™[œ[Ñ(ˆØ5Ð5Ð5Ð5¨fÐ5Ñ5Ô5ˆà€CØ€AØð !ð !‰ˆˆ1ˆaØ	ˆQ�‰Z‰ˆØ�
Š
•3�q˜!˜Q‘<”<Ñ Ô Ð Ð Ý
˜˜[Ñ
)Ô
)€Cà,.€CØ€DØð ð ˆØ�
Š
�B”D˜"œ$ ¤¨4¡°6Ñ 9Ð:Ñ;Ô;Ð;ØŒwˆˆØ€Jr6   T©ÚtimerÚ	emit_lastÚoriginr  úSequence[_Ev]Ú	emit_moveúCallable[[float, float], Any]Ú
emit_wheelú'Optional[Callable[[float, float], Any]]r	  r
  r  úOptional[Tuple[float, float]]c             ƒ  ó^  K  — |�|nt           }| sdS t          | ||¬¦  «        }t          ¦   «         5  	 |                     |                     ¦   «         ¦  «        \  }}	|t
          k    rn¦|t          k    r|                     |	¦  «        ƒ d{V —† Œ^|	j        r4|€| 	                    ¦   «          Œ| ||	j
        |	j        ¦  «        ƒ d{V —† n ||	j        |	j        ¦  «        ƒ d{V —† |                     |                     ¦   «         ¦  «         ŒÜ	 ddd¦  «         n# 1 swxY w Y   |j        S )a  The ASYNCHRONOUS driver of :class:`invisible_core.juggler.Pacer`. Returns events sent.

    The rules it obeys - absolute deadlines from one ``t0``, drop rather than
    send late while the drop stays within reach, never two events in one
    instant - are not written here: they are in :mod:`._pacing`, because the
    server's drag is synchronous and has to obey the same ones. This function
    supplies a clock, a way of waiting and where the pointer starts from; it
    makes no decision the pacer has not already made.
    Nr   )r
  r  )rŠ   r   Ú_fine_timerÚstepr€   r   r   r„   Úis_wheelÚdroppedrì   rí   r    r¡   ÚemittedÚ	delivered)
r  r  r  r	  r
  r  ÚtmÚpacerÚwhatÚargs
             r4   Ú	_dispatchr  _  s“  è è € ð$ Ð#ˆˆ­€BØð ØˆqÝ�# °6Ð:Ñ:Ô:€EÝ	‰Œð $ð $ð	$ØŸ
š
 2§6¢6¡8¤8Ñ,Ô,‰IˆD�#Ø•tŠ|ˆ|ØØ•uŠ}ˆ}Ø—h’h˜s‘m”mÐ#Ð#Ð#Ð#Ð#Ð#Ð#ØØŒ|ð .ØÐ%Ø—M’M‘O”O�OØØ �j ¤¨¬Ñ0Ô0Ð0Ð0Ð0Ð0Ð0Ð0Ð0Ð0à�i ¤ s¤uÑ-Ô-Ð-Ð-Ð-Ð-Ð-Ð-Ð-Ø�MŠM˜"Ÿ&š&™(œ(Ñ#Ô#Ð#ð	$ð ð	$ð $ð $ñ $ô $ð $ð $ð $ð $ð $ð $øøøð $ð $ð $ð $ð  Œ?Ðs   ²CDÄD!Ä$D!z"'WeakKeyDictionary[Any, _Session]'Ú	_SESSIONSz%'WeakKeyDictionary[Any, _PageCursor]'Ú_PAGESÚobjc                ó$   — t          | d| ¦  «        S )z>The implementation object behind a sync/async binding wrapper.Ú	_impl_obj©rH   )r   s    r4   Ú_implr$  �  s   € å�3˜ SÑ)Ô)Ð)r6   Úownerc               ó¶   — t          ¦   «         sdS t          ¦   «         €dS 	 t          ||¦  «        t          t	          | ¦  «        <   n# t
          $ r Y dS w xY wdS )aÏ  Arm the Python cursor engine for a Browser or a BrowserContext.

    Registering the *owner* (rather than each page) is what lets pages created
    by any route benefit: ``context.new_page()``, ``browser.new_page()`` - which
    makes its context inside the driver, out of reach of any wrapper we install
    on our side - and popups a site opens by itself.  A page looks its session
    up lazily through its own context and browser the first time it moves.
    FNT)r`   rO   r“   r  r$  rZ   )r%  rQ   rS   s      r4   Ú
enable_forr'  •  sq   € õ ÑÔð ØˆuÝÑÔÐ ØˆuðÝ"*¨4°Ñ"=Ô"=�	•%˜‘,”,ÑÐøÝð ð ð Øˆuˆuðøøøàˆ4s   ¢%A Á
AÁAúOptional[_Session]c                ó  — t                                | ¦  «        }|�|S t          | dd ¦  «        }|€d S t                                |¦  «        }|�|S t          |dd ¦  «        }|€d S t                                |¦  «        S )NÚ_browser_contextÚ_browser)r  rj   rH   )r—   ÚsessionÚcontextÚbrowsers       r4   Ú_session_for_pager/  ©  sƒ   € Ý�mŠm˜DÑ!Ô!€GØÐØˆÝ�dÐ.°Ñ5Ô5€GØ€ØˆtÝ�mŠm˜GÑ$Ô$€GØÐØˆÝ�g˜z¨4Ñ0Ô0€GØ€ØˆtÝ�=Š=˜Ñ!Ô!Ð!r6   úOptional[_PageCursor]c           	     ó–  — t                                | ¦  «        }|�|S t          | ¦  «        }|€d S t          ¦   «         }|€d S t	          |j        t          | ¦  «        ¦  «        }	 t          ||j        |¦  «        }nA# t          $ r4}t          ddt          |¦  «        j        ›d|›d�¦  «         Y d }~d S d }~ww xY w|t           | <   |S )Nzprofile-constructionz6the cursor motion generator could not be constructed (rC   z]); this session will not humanise its pointer. This is a broken install, not a configuration.)r  rj   r/  rO   r‘   rQ   r›   r�   rS   Ú	Exceptionr5   r+   rJ   )r—   Úcursorr,  rM   rQ   r´   s         r4   Ú_cursor_for_pager4  ¹  sý   € Ý�ZŠZ˜ÑÔ€FØÐØˆÝ Ñ%Ô%€GØ€ØˆtÝÑÔ€GØ€ØˆtÝ˜GœL­+°dÑ*;Ô*;Ñ<Ô<€DðÝØØÔØñ
ô 
ˆˆøõ
 ð ð ð ÝØ"Ð"õ 04°C©y¬yÔ/AÐ/AÐ/AÀ3À3À3ðHñ	
ô 	
ð 	
ð ˆtˆtˆtˆtˆtøøøøðøøøð …Fˆ4�LØ€Ms   Á'A> Á>
B<Â)B7Â7B<ÚframeúOptional[Any]c                ó$   — t          | dd ¦  «        S )NÚ_pager#  )r5  s    r4   Ú_page_of_framer9  Ö  s   € Ý�5˜' 4Ñ(Ô(Ð(r6   Úmousec                óN   — t          | dd ¦  «        }|�t          |dd ¦  «        nd S )NÚ_channelÚ_objectr#  )r:  Úchannels     r4   Ú_page_of_mouser?  Ú  s1   € õ �e˜Z¨Ñ.Ô.€GØ07Ð0C�7�7˜I tÑ,Ô,Ð,ÈÐMr6   ú'Tuple[Optional[float], Optional[float]]c                óÈ   — t          | dd ¦  «        pt          | dd ¦  «        }t          |t          ¦  «        r*|                     d¦  «        |                     d¦  «        fS dS )NÚ_viewport_sizeÚviewport_sizer§   r©   ©NN)rH   Ú
isinstanceÚdictrj   )r—   Úsizes     r4   r¶   r¶   ã  s`   € Ý�4Ð)¨4Ñ0Ô0ÐXµG¸DÀ/ÐSWÑ4XÔ4X€DÝ�$�ÑÔð 5Ø�xŠx˜Ñ Ô  $§(¢(¨8Ñ"4Ô"4Ð4Ð4Øˆ:r6   rª   c                ó„   — t          | ¦  «        \  }}|r|st          S t          |¦  «        dz
  t          |¦  «        dz
  fS )z<Viewport size to plan inside, falling back to a nominal one.ç      ð?)r¶   r®   rT   )r—   r°   r�   s      r4   Ú_boundsrJ  ê  sE   € å�T‰?Œ?�D€A€qØð "�Að "Ý!Ð!Ý�‰8Œ8�c‰>�5 ™8œ8 c™>Ð)Ð)r6   r    r¡   r°   r¨   r�   c                ó‚   — |r|sdS d| cxk    ot          |¦  «        k     nc od|cxk    ot          |¦  «        k     nc S )NTrÍ   )rT   )r    r¡   r°   r�   s       r4   Ú_insiderL  ò  se   € Øð �Að ØˆtØ�!ÐÐÒÐ•e˜A‘h”hÒÐÐÐÐ6 3¨!Ð#6Ð#6Ò#6Ð#6­e°A©h¬hÒ#6Ð#6Ð#6Ð#6Ð6r6   úTuple[type, ...]c                 ól   — 	 ddl m}  n*# t          $ r 	 ddlm}  n# t          $ r Y Y dS w xY wY nw xY w| fS )Nr   )ÚErrorr9   )Ú&invisible_playwright._pw._impl._errorsrO  ÚImportErrorÚ)invisible_playwright._pw._impl._api_types)ÚPWErrors    r4   Ú_page_errorsrT  ý  sˆ   € ðØKÐKÐKÐKÐKÐKÐKøÝð ð ð ð	ØRÐRÐRÐRÐRÐRÐRøÝð 	ð 	ð 	Ø�2�2�2ð	øøøð SÐRðøøøð
 ˆ:Ðó$   ‚	 ‰
0”š0›
*¥0©*ª0¯0c                 ól   — 	 ddl m}  n*# t          $ r 	 ddlm}  n# t          $ r Y Y dS w xY wY nw xY w| fS )Nr   )ÚTimeoutErrorr9   )rP  rW  rQ  rR  )Ú	PWTimeouts    r4   Ú_timeout_errorsrY    sˆ   € ðØTÐTÐTÐTÐTÐTÐTøÝð ð ð ð	Ø[Ð[Ð[Ð[Ð[Ð[Ð[øÝð 	ð 	ð 	Ø�2�2�2ð	øøøð \Ð[ðøøøð
 ˆ<ÐrU  Úselectorú$Tuple[Optional[Any], Optional[dict]]c              ƒ  ó  K  — 	 |                       |¦  «        ƒ d{V —†}n# t          ¦   «         $ r Y dS w xY w|€dS 	 |                     ¦   «         ƒ d{V —†}n# t          ¦   «         $ r d}Y nw xY w|st          |¦  «        ƒ d{V —† dS ||fS )aÆ  Resolve the element and its box, or (None, None). Never raises.

    Deliberately non-blocking and deliberately forgiving: this is a hint used
    to aim a mouse path, never a correctness step. It resolves the element if
    it is already there and gives up otherwise, so it can neither add a wait
    to a passing call nor invent an exception on a failing one - the original
    coroutine still does its own waiting and still raises its own errors.
    NrD  )Úquery_selectorrT  Úbounding_boxÚ_dispose)r5  rZ  ÚhandleÚboxs       r4   Ú_element_boxrb    së   è è € ðØ×+Ò+¨HÑ5Ô5Ð5Ð5Ð5Ð5Ð5Ð5ˆˆøÝ‰>Œ>ð ð ð Øˆzˆzðøøøà€~ØˆzðØ×'Ò'Ñ)Ô)Ð)Ð)Ð)Ð)Ð)Ð)ˆˆøÝ‰>Œ>ð ð ð Øˆˆˆðøøøàð Ý�vÑÔÐÐÐÐÐÐÐØˆzØ�3ˆ;Ðs   „   5´5½A ÁA.Á-A.r`  c              ƒ  óp   K  — 	 |                       ¦   «         ƒ d {V —† d S # t          ¦   «         $ r Y d S w xY wr}   )ÚdisposerT  )r`  s    r4   r_  r_  ,  sY   è è € ðØ�nŠnÑÔÐÐÐÐÐÐÐÐÐøÝ‰>Œ>ð ð ð Øˆˆðøøøs   „   5´5Úpositionc              ƒ  óp  K  — t          | |¦  «        ƒ d{V —†\  }}|�|€dS t          |¦  «        ƒ d{V —† t          |t          ¦  «        rDd|v r@d|v r<|d         t	          |d         ¦  «        z   |d         t	          |d         ¦  «        z   fS |d         |d         dz  z   |d         |d         dz  z   fS )zÜWhere the action is about to touch, in viewport coordinates.

    Kept as its own function because it is the whole of what the aiming needs
    when the caller has specified a position: no landing draw, no hit test.
    Nr    r¡   r§   ç       @r©   )rb  r_  rE  rF  rT   )r5  rZ  re  r`  ra  s        r4   Ú_target_pointrh  3  sâ   è è € õ % U¨HÑ5Ô5Ð5Ð5Ð5Ð5Ð5Ð5�K€FˆCØ€~˜˜ØˆtÝ
�6Ñ
Ô
ÐÐÐÐÐÐÐÝ�(�DÑ!Ô!ð P c¨X o o¸#À¸/¸/Ø�3Œx�% ¨¤Ñ.Ô.Ñ.°°C´½5ÀÈ#ÄÑ;OÔ;OÑ0OÐOÐOØˆsŒ8�c˜'”l SÑ(Ñ(¨#¨c¬(°S¸´]ÀSÑ5HÑ*HÐHÐHr6   c           
   ƒ  ó¤   K  — 	 t          | j                             ddd||dœid¬¦  «        ƒ d{V —†¦  «        S # t          ¦   «         $ r Y dS w xY w)us  Does (x, y), in the same main-frame space as the box, land on this element?

    A bounding box is not the element. An inline link that wraps across two
    lines, a rotated control, a rounded button: all of them have points inside
    their box that belong to something else. The centre is checked by the
    automation layer itself; a point we chose has to be checked by us, or we
    would be turning working clicks into hit-target failures.

    â›” THE QUESTION GOES TO THE SERVER, WHICH ANSWERS IT FOR THE ACTION TOO
    (`Actions.hit_target`). It used to be answered here with
    `document.elementFromPoint`, in the element's own document but at the
    main frame's coordinates: in a nested frame that asked about another
    place, and in a shadow root the hit is the host, never the control. Both
    rejected every off-centre point, so those clicks went to the exact
    geometric centre, one number for every install. `checkHitTarget` is a
    method of this package's server, not of Playwright's protocol: the Node
    driver arm (`INVPW_TRANSPORT=driver`) refuses it, and there the landing
    falls back to the centre.
    ÚcheckHitTargetNÚpoint©r    r¡   T)Úis_internalF)r^   r<  ÚsendrT  )r`  r    r¡   s      r4   Ú_hitsro  B  s“   è è € ð(Ý˜&œ/×.Ò.Ø˜d W°A¸AÐ.>Ð.>Ð$?Øð /ñ ô ð ð ð ð ð ð ñ ô ð 	øõ ‰>Œ>ð ð ð Øˆuˆuðøøøs   „5: ºAÁA)r	  r3  Úto_xÚto_yÚraw_movec          	   ƒ  ó€  ‡ ‡K  — t          |¦  «        \  }}‰                      |¦  «         	 ‰                      ‰ j        ‰ j        ||¦  «        }nB# t
          $ r5}	t          ddt          |	¦  «        j        ›d|	›d�¦  «         g }Y d}	~	nd}	~	ww xY wg }
d}t          |¦  «        t          |¦  «        f}|D ]j\  }}}||dz  z  }t          ||||¦  «        \  }}t          |¦  «        t          |¦  «        f|k    rŒF|
                     t          |||¦  «        ¦  «         Œk|
                     t          t          ||
r|
d         j        nd¦  «        ||¦  «        ¦  «         dˆ ˆfd„}t          |
||d‰ j        ‰ j        f¬¦  «        ƒ d{V —† ||c‰ _        ‰ _        |pt                                ¦   «         ‰ _        dS )a  Emit the intermediate waypoints of one plain stroke.

    Used by ``mouse.move``, which is the one entry point where the caller named
    the exact destination and the macro layer has nothing to add.

    The endpoint is the caller's to emit - a bare ``mouse.move`` has to land on
    the exact coordinates it was given, unclamped - so this returns after
    waiting out the last waypoint's deadline without sending it. The return
    value is kept at 0.0: with absolute scheduling there is no owed pause left
    to hand back.
    zpath-failedz:the cursor motion generator raised while planning a path (rC   zQ); this movement is not humanised. This is a broken install, not a configuration.NrÍ   r÷   éÿÿÿÿr    rT   r¡   r,   r-   c              “  óN   •K  —  ‰| |¦  «        ƒ d {V —† | |c‰_         ‰_        d S r}   rl  )r    r¡   r3  rr  s     €€r4   Úemitz_travel.<locals>.emit—  s=   øè è € Øˆh�q˜!‰nŒnÐÐÐÐÐÐÐØ ÐˆŒ�&”(�(�(r6   Fr  ©r    rT   r¡   rT   r,   r-   )r¶   r·   r¾   r    r¡   r2  r5   r+   rJ   ÚroundÚ_clamprð   rñ   rî   r  r  rŠ   r€   r¤   )r3  r—   rp  rq  rr  r	  r°   r�   Ú	waypointsr´   r  ró   Úend_keyr²   r³   r  ÚcxÚcyrv  s   `   `              r4   Ú_travelr~  `  s$  øøè è € õ( �T‰?Œ?�D€A€qØ
‡K‚K�ÑÔÐð	Ø—K’K ¤¨&¬(°D¸$Ñ?Ô?ˆ	ˆ	øÝð ð ð ÝØˆMõ 04°C©y¬yÔ/AÐ/AÐ/AÀ3À3À3ðHñ	
ô 	
ð 	
ð ˆ	ˆ	ˆ	ˆ	ˆ	ˆ	øøøøðøøøð €CØ€AÝ�T‰{Œ{�E $™KœKÐ(€GØ"ð #ð #‰ˆˆB�Ø	ˆU�V‰^ÑˆÝ˜˜B  1Ñ%Ô%‰ˆˆBõ �"‰IŒI•u˜R‘y”yÐ! WÒ,Ð,ØØ�
Š
•3�q˜"˜b‘>”>Ñ"Ô"Ð"Ð"ð ‡J‚J�s•3�q¨#Ð6˜#˜bœ'œ,˜,°3Ñ7Ô7¸¸tÑDÔDÑEÔEÐEð"ð "ð "ð "ð "ð "ð "õ �C˜ U°eØ"œH f¤hÐ/ð1ñ 1ô 1ð 1ð 1ð 1ð 1ð 1ð 1ð 1à˜tÐ€F„HˆfŒhØ!˜O¥V×0Ò0Ñ2Ô2€FÔØˆ3s   ­"A Á
BÁ+B
Â
B)r	  r
  úSequence[Any]Úbudget_sc          	   ƒ  ó>  ‡ ‡K  — t          t          |¦  «        |¦  «        }|sdS d
ˆ ˆfd„}t          |||||‰ j        ‰ j        f¬¦  «        ƒ d{V —† |s'|r%|d	         j        |d	         j        c‰ _        ‰ _        |pt
                               ¦   «         ‰ _        dS )zADispatch a planned ``_behaviour`` timeline, inside a time budget.Nr    rT   r¡   r,   r-   c              “  óN   •K  —  ‰| |¦  «        ƒ d {V —† | |c‰_         ‰_        d S r}   rl  )r    r¡   r3  r  s     €€r4   rë   z_run_steps.<locals>.move±  s=   øè è € Øˆi˜˜1‰oŒoÐÐÐÐÐÐÐØ ÐˆŒ�&”(�(�(r6   r  rt  rw  )r   rõ   r  r    r¡   rŠ   r€   r¤   )	r3  rå   r  r  r€  r	  r
  r  rë   s	   ` `      r4   Ú
_run_stepsrƒ  ¢  sç   øøè è € õ �	 %Ñ(Ô(¨(Ñ
3Ô
3€CØð Øˆð"ð "ð "ð "ð "ð "ð "õ �C˜˜z°À)Ø"œH f¤hÐ/ð1ñ 1ô 1ð 1ð 1ð 1ð 1ð 1ð 1ð 1àð 2˜ð 2Ø  œWœY¨¨B¬¬	ÐˆŒ�&”(Ø!˜O¥V×0Ò0Ñ2Ô2€FÔÐÐr6   c                óÈ   — |�|nt           }| j        €dS |                     ¦   «         | j        z
  dz  }|t          k     rdS t	          | j        t          z  dz  |dz  ¦  «        S )zõHow much of the movement budget this action may spend on a fidget.

    Zero when the previous event was moments ago: two calls back to back are
    one piece of work, and inserting a fidget between them would be both a lie
    and a delay.
    NrÍ   r÷   g      à?)rŠ   r¤   r€   Ú_IDLE_MIN_GAP_MSÚminrS   Ú_IDLE_BUDGET_FRAC)r3  r	  r  Úgap_mss       r4   Ú_idle_budget_msr‰  ¼  sm   € ð Ð#ˆˆ­€BØÔÐ#ØˆsØ�fŠf‰hŒh˜Ô-Ñ-°Ñ7€FØÕ Ò Ð ØˆsÝˆvÔ!Õ$5Ñ5¸Ñ>ÀÈÁÑMÔMÐMr6   rÉ   c                ó°  — t          | |¦  «        }|dk    rg S |�|nt          }t          |                     ¦   «         | j        p|                     ¦   «         z
  dz  t
          ¦  «        }t          |¦  «        }|                      |¦  «        }|                      d¦  «        }| 	                    ¦   «         | j
        j        k     rIt          | j        | j
        ||| j        |                      |¦  «        ¬¦  «        }	t!          |	|||¦  «        S t#          | j        | j
        |||| j        |                      |¦  «        ¬¦  «        }	t!          |	|||¦  «        S )ap  What the hand did while the caller's script was busy elsewhere.

    We cannot dispatch into the past, so the idle period is planned in full and
    only its tail is kept - see :func:`_behaviour.tail_within`. The alternative,
    inventing a short episode from scratch, would have a distribution of its
    own that no amount of seeding makes match the planner's.
    rÍ   Nr÷   zcursor:fidget-gate)ÚnoncerÛ   )r‰  rŠ   r†  r€   r¤   Ú_IDLE_MAX_GAP_MSrJ  r·   rã   rá   rŸ   Úaimless_rater   rQ   r£   rÝ   r   r   )
r3  r—   r	  Úbudgetr  rˆ  rÁ   r·   Úgaterå   s
             r4   Ú_plan_fidgetr�  Ì  sC  € õ ˜V UÑ+Ô+€FØ�‚}€}Øˆ	ØÐ#ˆˆ­€BÝ�"—&’&‘(”(˜fÔ2Ð>°b·f²f±h´hÑ?À6ÑIÝ!ñ#ô #€Få�T‰]Œ]€FØ�;Š;�tÑÔ€DØ�:Š:Ð*Ñ+Ô+€DØ‡{‚{�}„}�v”~Ô2Ò2Ð2õ "ØŒK˜œ¨¨vØ”-¨¯ª¸Ñ(?Ô(?ð
ñ 
ô 
ˆõ ˜5 &¨$°Ñ7Ô7Ð7ÝØŒ�V”^ T¨6°6ØŒm F§O¢O°FÑ$;Ô$;ðñ ô €Eõ �u˜f d¨FÑ3Ô3Ð3r6   zOptional[bool]Ú_PATCH_STATEÚ_ORIGINAL_MOUSE_MOVEÚ_ORIGINAL_MOUSE_WHEELÚ_ORIGINAL_MOUSE_CLICKrF  Ú_ORIGINAL_FRAME_ACTIONS)Ú_clickÚdblclickÚhoverÚtapÚcheckÚuncheckÚ_invpw_cursor_wrappedÚargsÚkwargsrL   Úindexc                óT   — ||v r||         S t          | ¦  «        |k    r| |         nd S r}   )rÐ   )r�  rž  rL   rŸ  s       r4   Ú_firstr¡  þ  s3   € Øˆv€~€~Ø�dŒ|ÐÝ˜d™)œ) eÒ+Ð+ˆ4�Œ;ˆ;°Ð5r6   Úoriginalc                ó„   ‡ — d
ˆ fd„}t          |t          d¦  «         t          ‰ dd	¦  «        |_        ‰ j        |_        |S )Nr•   r   r�  rž  r,   c           	   Ÿ  óî  •K  — d }	 t          | ||¦  «        ƒ d {V —†}nO# t          j        $ r ‚ t          $ r3}t	          ddt          |¦  «        j        ›d|›d�¦  «         Y d }~nd }~ww xY w|s ‰| g|¢R i |¤Žƒ d {V —†S 	  ‰| g|¢R i i |¥|¥¤Žƒ d {V —†S # t          ¦   «         $ r8}t	          ddt          |¦  «        j        ›dt          ›d�¦  «         Y d }~nd }~ww xY w ‰| g|¢R i |¤Žƒ d {V —†S )	Nzapproach-failedzthe cursor approach raised (rC   zH); the action itself is unaffected and ran normally. Please report this.zlanding-retryz0an off-centre landing point was not actionable (z6); the action was retried with its own arguments. Set z#=off to disable off-centre landing.)	Ú	_approachrƒ   ÚCancelledErrorr2  r5   r+   rJ   rY  rx   )r•   r�  rž  Ú	overridesr´   r¢  s        €r4   Úwrapperz#_wrap_frame_action.<locals>.wrapper  sä  øè è € Ø.2ˆ	ð
	Ý'¨¨d°FÑ;Ô;Ð;Ð;Ð;Ð;Ð;Ð;ˆIˆIøÝÔ%ð 	ð 	ð 	ØÝð 	ð 	ð 	ÝØ!Ð!õ ˜‘9”9Ô%Ð%Ð% s s sð,ñô ð ð ð ð ð ð øøøøð	øøøð ð 	9Ø!˜ $Ð8¨Ð8Ð8Ð8°Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8ð
	Ø!˜ $ÐI¨ÐIÐIÐIÐ1H°FÐ1H¸iÐ1HÐIÐIÐIÐIÐIÐIÐIÐIÐIøÝÑ Ô ð 	ð 	ð 	ÝØ�õ 26°c±´Ô1CÐ1CÐ1CÅ[À[À[ðRñô ð ð ð ð ð ð øøøøð	øøøð �X˜dÐ4 TÐ4Ð4Ð4¨VÐ4Ð4Ð4Ð4Ð4Ð4Ð4Ð4Ð4s,   ‡ ŸA+¸)A&Á&A+ÂB ÂC"Â*.CÃC"TrJ   r¨  )r•   r   r�  r   rž  r   r,   r   ©ÚsetattrÚ_MARKERrH   rJ   r‡   ©r¢  r¨  s   ` r4   Ú_wrap_frame_actionr­    sX   ø€ ð5ð 5ð 5ð 5ð 5ð 5õ< ˆG•W˜dÑ#Ô#Ð#Ý˜x¨°YÑ?Ô?€GÔØÔ&€G„OØ€Nr6   c                ón   — t          | ¦  «        dk    o"d|vod|vot          t          ¦   «         ¦  «        S )aQ  Is it safe to add ``position``/``timeout`` to this call's arguments?

    Only when the caller supplied neither. The bindings pass everything but the
    selector by keyword, so ``args`` longer than the selector means an unknown
    caller shape and we keep our hands off rather than risk a "got multiple
    values for argument" on somebody's click.

    Also requires that Playwright's TimeoutError be importable, because that is
    what the retry below catches: without it an off-centre point that turns out
    not to be actionable would fail a call that would otherwise have worked.
    r¬   re  Útimeout)rÐ   r^   rY  )r�  rž  s     r4   Ú_may_overrider°  )  sH   € õ 	ˆD‰	Œ	�QŠð 	$Ø˜fÐ$ð	$à˜VÐ#ð	$õ •Ñ"Ô"Ñ#Ô#ð	r6   ra  ÚlandingúDict[str, Any]c                óX   — |d         | d         z
  |d         | d         z
  dœt           dœS )ai  The kwargs that make the action itself land on our point.

    Without this the approach ends off-centre and the automation layer then
    moves to the exact geometric centre anyway, so the LAST event of every
    element-targeted action is ``box.x + width/2, box.y + height/2`` - one
    exact number, identical in every install, readable from a single event.

    The bounded ``timeout`` is the price of touching the action's own
    arguments: if our point is not actionable, the caller's call must still
    succeed, so the retry has to be reachable before the caller's own deadline
    rather than after it.
    r   r    r¬   r¡   rl  )re  r¯  )Ú_LANDING_ATTEMPT_TIMEOUT_MS)ra  r±  s     r4   Ú_landing_overriderµ  =  sB   € ð ˜”˜c #œhÑ&Ø˜”˜c #œhÑ&ð
ð 
õ /ðð ð r6   úOptional[Dict[str, Any]]c             ƒ  ó†  K  — |                      d¦  «        rdS t          | ¦  «        }|€dS t          |¦  «        }|�|j        rdS t	          ||dd¦  «        }t          |t          ¦  «        sdS t          }t          |dd¦  «        }|�|€dS d|_        |xj	        dz  c_	        	 t          | ||||¦  «        ƒ d{V —†}	|	€
	 d|_        dS t          |¦  «        \  }
}t          |	j        d         |	j        d         |
|¦  «        s
	 d|_        dS t          |||	|||¦  «        ƒ d{V —† |	j        d|_        S # d|_        w xY w)	z‹Walk the cursor onto the element this action is about to touch.

    Returns the kwargs overrides the action should run with, or None.
    ÚtrialNrZ  r   r:  Tr¬   F)rj   r9  r4  r¢   r¡  rE  r(   r’  rH   r£   Ú_choose_landingr¶   rL  r±  Ú
_walk_ontoÚoverride)r5  r�  rž  r	  r—   r3  rZ  rë   r:  Úaimr°   r�   s               r4   r¥  r¥  S  s�  è è € ð ‡z‚z�'ÑÔð ØˆtÝ˜%Ñ Ô €DØ€|ØˆtÝ˜dÑ#Ô#€FØ€~˜œ€~ØˆtÝ�d˜F J°Ñ2Ô2€HÝ�h¥Ñ$Ô$ð ØˆtÝ€DÝ�D˜' 4Ñ(Ô(€EØ€|�u�}Øˆtà€F„KØ
€M„M�QÑ€M„MðÝ# E¨6°8¸TÀ6ÑJÔJÐJÐJÐJÐJÐJÐJˆØˆ;Øð ˆŒˆˆõ ˜‰Œ‰ˆˆ1Ý�s”{ 1”~ s¤{°1¤~°q¸!Ñ<Ô<ð 	ð ð
 ˆŒˆˆõ ˜  s¨D°%¸Ñ?Ô?Ð?Ð?Ð?Ð?Ð?Ð?Ð?ØŒ|àˆŒˆø�eˆŒÐÐÐÐs   Â&D7 Ã:D7 Ä D7 Ä7	E c                  óJ   — e Zd ZU dZded<   ded<   ded<   edd	„¦   «         Zd
S )Ú_Aima  Where this action is going, and how the caller must be adjusted for it.

    ``override`` is the kwargs change that tells the action to click the point
    we walked to rather than the element's centre; None means the action is
    left exactly as the caller wrote it.
    zDict[str, float]ra  rÑ   r±  r¶  r»  r,   c                óf   — | j         d         | j         d         | j         d         | j         d         fS )Nr    r¡   r§   r©   )ra  )r•   s    r4   Úrectz	_Aim.rect“  s0   € à”˜”˜tœx¨œ}Ø”˜Ô! 4¤8¨HÔ#5ð7ð 	7r6   N)r,   rÑ   )rJ   r…   r†   r‡   Ú__annotations__ÚpropertyrÀ  r9   r6   r4   r¾  r¾  †  sa   € € € € € € ðð ð ÐÐÑØ€N€N�NØ&Ð&Ð&Ñ&àð7ð 7ð 7ñ „Xð7ð 7ð 7r6   r¾  úOptional[_Aim]c           	   ƒ  óü  K  — t          | |¦  «        ƒ d{V —†\  }}|�|€dS 	 |                     d¦  «        }t          |t          ¦  «        rhd|v rdd|v r`t	          ||d         t          |d         ¦  «        z   |d         t          |d         ¦  «        z   fd¦  «        t          |¦  «        ƒ d{V —† S t          |d         |d         |d         |d         f|                     d¦  «        t          t          ¬¦  «        }t          ¦   «         r‰t          ||¦  «        ry|d         t          k    rh|d         t          k    rWt          ||d	         |d
         ¦  «        ƒ d{V —†r4t	          ||t          ||¦  «        ¦  «        t          |¦  «        ƒ d{V —† S t	          ||d         |d         dz  z   |d         |d         dz  z   fd¦  «        t          |¦  «        ƒ d{V —† S # t          |¦  «        ƒ d{V —† w xY w)a  Pick the point on the element this action will land on.

    Split out of ``_approach`` so the element handle's lifetime is one small
    scope with one ``finally`` in it, rather than a nested try inside a
    function that also spends a time budget and dispatches events.
    Nre  r    r¡   r§   r©   zcursor:landing)ÚspreadÚkeepr   r¬   rg  )rb  rj   rE  rF  r¾  rT   r_  r   rã   Ú_LANDING_SPREADÚ_LANDING_KEEPry   r°  Ú_LANDING_MIN_BOX_PXro  rµ  )	r5  r3  rZ  r�  rž  r`  ra  re  r±  s	            r4   r¹  r¹  ™  sn  è è € õ % U¨HÑ5Ô5Ð5Ð5Ð5Ð5Ð5Ð5�K€FˆCØ€~˜˜ØˆtðØ—:’:˜jÑ)Ô)ˆÝ�h¥Ñ%Ô%ð 	F¨#°¨/¨/¸cÀX¸o¸oõ ˜˜c #œh­¨x¸¬}Ñ)=Ô)=Ñ=Ø! #œh­¨x¸¬}Ñ)=Ô)=Ñ=ð?Ø@DñFô Fõ. �vÑÔÐÐÐÐÐÐÐÐõ)  Ø�ŒX�s˜3”x  W¤¨s°8¬}Ð=Ø�JŠJÐ'Ñ(Ô(Ý"­ð
ñ 
ô 
ˆõ ÑÔð	Gå˜d FÑ+Ô+ð	Gð �G”Õ 3Ò3Ð3Ø�H”Õ!4Ò4Ð4Ý˜F G¨A¤J°¸´
Ñ;Ô;Ð;Ð;Ð;Ð;Ð;Ð;ð 5õ ˜˜WÕ&7¸¸WÑ&EÔ&EÑFÔFõ �vÑÔÐÐÐÐÐÐÐÐõ �C˜#˜cœ( S¨¤\°CÑ%7Ñ7Ø˜cœ( S¨¤]°SÑ%8Ñ8ð:Ø;?ñAô Aõ �vÑÔÐÐÐÐÐÐÐÐø�h�vÑÔÐÐÐÐÐÐÐÐøøøs   £A<G$ Â5CG$ Æ6G$ Ç$G;r¼  rë   c              ƒ  ó>  ‡‡K  — dˆˆfd„}t          |¦  «        }| j        }t          | ||¦  «        }	|	r_t          t	          d„ |	D ¦   «         ¦  «        dz  |t
          z  ¦  «        }
t          | |	||
|¬	¦  «        ƒ d
{V —† t          ||
z
  d¦  «        }t          | j	        | j
        |                      |¦  «        |j        || j        |j        |                      |¦  «        ¬¦  «        }|rt          | ||||d¬¦  «        ƒ d
{V —† d
S |j        \  | _        | _        d
S )z5Spend the time budget getting the pointer to ``aim``.r    rT   r¡   r,   r-   c              “  ó2   •K  —  ‰‰| |¦  «        ƒ d {V —† d S r}   r9   ©r    r¡   r:  rë   s     €€r4   rÀ   z_walk_onto.<locals>.rawÈ  s3   øè è € Øˆd�5˜!˜QÑÔÐÐÐÐÐÐÐÐÐr6   c              3  ó$   K  — | ]}|j         V — Œd S r}   )rï   ©rÒ   rô   s     r4   rÔ   z_walk_onto.<locals>.<genexpr>Ó  s$   è è € Ð3Ð3 q˜œ
Ð3Ð3Ð3Ð3Ð3Ð3r6   r÷   )r€  r	  Ngš™™™™™É?)r‹  r±  rÛ   F)r€  r	  r
  rw  )rJ  rS   r�  r†  Úsumr‡  rƒ  rî   r   rQ   rŸ   r·   rÀ  r£   r±  rÝ   r    r¡   )r3  r—   r¼  rë   r:  r	  rÀ   rÁ   rŽ  ÚfidgetÚspentrå   s      ``       r4   rº  rº  Ä  s†  øøè è € ð ð  ð  ð  ð  ð  ð  õ �T‰]Œ]€FØÔ€Få˜& $¨Ñ.Ô.€FØð *õ •CÐ3Ð3¨FÐ3Ñ3Ô3Ñ3Ô3°fÑ<ØÕ.Ñ.ñ0ô 0ˆå˜ ¨°uÀEÐJÑJÔJÐJÐJÐJÐJÐJÐJÐJÝ�V˜e‘^ SÑ)Ô)ˆåØŒ�V”^ V§[¢[°Ñ%6Ô%6¸¼À&ØŒm S¤[Ø�Š˜vÑ&Ô&ðñ ô €Eð
 ð )õ ˜ ¨°fÀEØ#(ð*ñ *ô *ð 	*ð 	*ð 	*ð 	*ð 	*ð 	*ð 	*ð 	*ð 	*ð !œ[ÑˆŒ�&”(�(�(r6   c                ó†   ‡ — ddˆ fd	„}t          |t          d
¦  «         t          ‰ dd¦  «        |_        ‰ j        |_        |S )Nr•   r   r    rT   r¡   rå   rR   r,   c           	   “  óÔ  •‡ K  — |�|dk    rÈ	 t          ‰ ¦  «        }|�t          |¦  «        nd }|�S|j        sLd|_        |xj        dz  c_        	 dˆˆ fd„}t	          |||||¦  «        ƒ d {V —† d	|_        n# d	|_        w xY wnO# t
          j        $ r ‚ t          $ r3}t          d
dt          |¦  «        j
        ›d|›d�¦  «         Y d }~nd }~ww xY w ‰‰ |||¬¦  «        ƒ d {V —†S )Nr¬   Tr²   rT   r³   r,   r-   c              “  ó2   •K  —  ‰‰| |¦  «        ƒ d {V —† d S r}   r9   )r²   r³   r¢  r•   s     €€r4   rÀ   z._wrap_mouse_move.<locals>.wrapper.<locals>.rawø  ó3   øè è € Ø"* (¨4°°RÑ"8Ô"8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8r6   Fzmove-failedz*the cursor path raised during mouse.move (rC   z5); the move itself is unaffected. Please report this.)rå   )r²   rT   r³   rT   r,   r-   )r?  r4  r¢   r£   r~  rƒ   r¦  r2  r5   r+   rJ   )	r•   r    r¡   rå   r—   r3  rÀ   r´   r¢  s	   `       €r4   r¨  z!_wrap_mouse_move.<locals>.wrapperî  s…  øøè è € àˆ=˜E QšJ˜JðÝ% dÑ+Ô+�Ø37Ð3CÕ)¨$Ñ/Ô/Ð/È�ØÐ%¨f¬kÐ%Ø"&�F”KØ�M”M QÑ&�M”Mð,ð9ð 9ð 9ð 9ð 9ð 9ð 9õ & f¨d°A°q¸#Ñ>Ô>Ð>Ð>Ð>Ð>Ð>Ð>Ð>à&+˜œ˜ø e˜œÐ+Ð+Ð+Ð+øøÝÔ)ð ð ð ØÝð ð ð ÝØ!�Mõ ˜C‘y”yÔ)Ð)Ð)¨3¨3¨3ð0ñô ð ð ð ð ð ð øøøøðøøøð �X˜d A q°Ð6Ñ6Ô6Ð6Ð6Ð6Ð6Ð6Ð6Ð6s0   ŽAB Á A9 Á1B Á9	BÂB ÂCÂ)CÃCTrJ   rë   r}   )
r•   r   r    rT   r¡   rT   rå   rR   r,   r   r©  r¬  s   ` r4   Ú_wrap_mouse_moverÖ  í  s]   ø€ ð7ð 7ð 7ð 7ð 7ð 7ð 7õ< ˆG•W˜dÑ#Ô#Ð#Ý˜x¨°VÑ<Ô<€GÔØÔ&€G„OØ€Nr6   c                ó„   ‡ — dˆ fd„}t          |t          d	¦  «         t          ‰ d
d¦  «        |_        ‰ j        |_        |S )aá  Walks the pointer onto the point before clicking it.

    `Mouse.click` and `Mouse.dblclick` both go through `_click`, which sends
    `mouseClick` without calling `self.move`: the patch on `move` does not see
    them, and the pointer shows up on the target without ever having arrived
    there. Measured: a single mousemove against the ten from `locator.click()`.

    The movement goes through `self.move`, which is already wrapped: one
    trajectory generator, one seed.
    r•   r   r    rT   r¡   rž  r,   c           	   ›  ó  •K  — 	 |                       ||¦  «        ƒ d {V —† nO# t          j        $ r ‚ t          $ r3}t	          ddt          |¦  «        j        ›d|›d�¦  «         Y d }~nd }~ww xY w ‰| ||fi |¤Žƒ d {V —†S )Nzclick-move-failedz,the pointer path raised before mouse.click (rC   z6); the click itself is unaffected. Please report this.)rë   rƒ   r¦  r2  r5   r+   rJ   )r•   r    r¡   rž  r´   r¢  s        €r4   r¨  z"_wrap_mouse_click.<locals>.wrapper  sì   øè è € ð	Ø—)’)˜A˜q‘/”/Ð!Ð!Ð!Ð!Ð!Ð!Ð!Ð!øÝÔ%ð 	ð 	ð 	ØÝð 	ð 	ð 	õ Ø#Ð#õ ˜‘9”9Ô%Ð%Ð% s s sð,ñô ð ð ð ð ð ð øøøøð	øøøð �X˜d A qÐ3Ð3¨FÐ3Ð3Ð3Ð3Ð3Ð3Ð3Ð3Ð3s   …" ¢A.»)A)Á)A.TrJ   r–  )
r•   r   r    rT   r¡   rT   rž  r   r,   r   r©  r¬  s   ` r4   Ú_wrap_mouse_clickrÙ    sX   ø€ ð4ð 4ð 4ð 4ð 4ð 4õ  ˆG•W˜dÑ#Ô#Ð#Ý˜x¨°XÑ>Ô>€GÔØÔ&€G„OØ€Nr6   Údelta_xÚdelta_yc                ó|  — t          |¦  «        t          |¦  «        z   }|dk     rg S d}t          dt          | j        dz  dz  ¦  «        ¦  «        }t          t          dt	          t          ||z  ¦  «        |d¦  «        ¦  «        ¦  «        }|dk     rg S t          |¦  «        }t          | j        | j	        |  
                    |¦  «        ||d| j        |                      |¦  «        ¬¦  «        }	d	„ |	D ¦   «         }
t          |
¦  «        }|
r|d
k    rg S g }dx}}d
}|	D ]›}|j        dk    r|                     |¦  «         Œ#|dz  }|t!          |
¦  «        k    r||z
  ||z
  }}n|j        |z  }||z  ||z  }}||z  }||z  }|                     t%          |j        |j        |j        d||¬¦  «        ¦  «         Œœ|S )a¤  A wheel burst carrying exactly (delta_x, delta_y), with the hand on it.

    One protocol-level wheel event of 900 px is not a scroll a person performs;
    a notched wheel produces detents. The number of detents is bounded by the
    movement budget, and the deltas are rescaled so the burst sums EXACTLY to
    what the caller asked for - a scroll that lands somewhere else is a broken
    call, not a subtle one.
    rI  g      Y@r¬   r÷   g     €V@é   rÎ   )ÚticksÚtick_dyr‹  rÛ   c                ó2   — g | ]}|j         d k    ¯|j        ‘ŒS )rê   )rÇ   rí   rÎ  s     r4   r×   z _scroll_plan.<locals>.<listcomp>L  s&   € Ð7Ð7Ð7�q Q¤V¨wÒ%6Ð%6ˆaŒdÐ%6Ð%6Ð%6r6   r   rÍ   rê   )r    r¡   rï   rÇ   rì   rí   )Úabsrî   rR   rS   r†  rx  rJ  r   rQ   rŸ   r·   r£   rÝ   rÏ  rÇ   rð   rÐ   rí   r   r    r¡   rï   )r3  r—   rÚ  rÛ  ÚtotalÚnotchÚ	max_ticksrÞ  rÁ   rå   ÚsharesÚtotrò   Úused_xÚused_yÚseenrô   rì   rí   Úfracs                       r4   Ú_scroll_planrë  4  sü  € õ �‰LŒL�3˜w™<œ<Ñ'€EØˆs‚{€{Øˆ	Ø€EÝ�A•s˜6Ô-°Ñ6¸Ñ=Ñ>Ô>Ñ?Ô?€IÝ•�A•s�5 ¨¡Ñ/Ô/°¸BÑ?Ô?Ñ@Ô@ÑAÔA€EØˆq‚y€yØˆ	Ý�T‰]Œ]€FÝØŒ�V”^ V§[¢[°Ñ%6Ô%6¸Ø˜S¨¬Ø�Š˜vÑ&Ô&ðñ ô €Eð
 8Ð7˜EÐ7Ñ7Ô7€FÝ
ˆf‰+Œ+€CØð �S˜A’X�XØˆ	Ø€CØÐ€FˆVØ€DØð @ð @ˆØŒ6�WÒÐØ�JŠJ�q‰MŒMˆMØØ�‰	ˆØ•3�v‘;”;ÒÐØ˜vÑ% w°Ñ'7�ˆBˆBà”4˜#‘:ˆDØ˜t‘^ W¨t¡^�ˆBØ�"‰ˆØ�"‰ˆØ�
Š
•4˜!œ# ¤¨q¬zØ(/°B¸2ð?ñ ?ô ?ñ 	@ô 	@ð 	@ð 	@à€Jr6   c                ó„   ‡ — dˆ fd„}t          |t          d¦  «         t          ‰ d	d
¦  «        |_        ‰ j        |_        |S )Nr•   r   ÚdeltaXrT   ÚdeltaYr,   c           	   “  óˆ  •‡ ‡‡K  — ||}}	 t          ‰ ¦  «        }|�t          |¦  «        nd }|�±|j        sªd|_        |xj        dz  c_        	 t	          ||t          |¦  «        t          |¦  «        ¦  «        }|rOt          Št          |dd ¦  «        Šdˆˆfd	„}dˆˆ fd„}	t          ||||	|j	        ¬¦  «        ƒ d {V —† 	 d|_        d S 	 d|_        n# d|_        w xY wnO# t          j        $ r ‚ t          $ r3}
t          ddt          |
¦  «        j        ›d|
›d�¦  «         Y d }
~
nd }
~
ww xY w ‰‰ ||¦  «        ƒ d {V —†S )NTr¬   r:  r    rT   r¡   r,   r-   c              “  óB   •K  — ‰�‰� ‰‰| |¦  «        ƒ d {V —† d S d S d S r}   r9   rÌ  s     €€r4   r  z5_wrap_mouse_wheel.<locals>.wrapper.<locals>.emit_movew  sL   øè è € Ø#Ð/°EÐ4EØ&* d¨5°!°QÑ&7Ô&7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7ð  0Ð/Ð4EÐ4Er6   rì   rí   c              “  ó2   •K  —  ‰‰| |¦  «        ƒ d {V —† d S r}   r9   )rì   rí   r¢  r•   s     €€r4   r  z6_wrap_mouse_wheel.<locals>.wrapper.<locals>.emit_wheel{  rÕ  r6   )r€  Fzwheel-failedzthe scroll planner raised (rC   z7); the scroll itself is unaffected. Please report this.rw  )rì   rT   rí   rT   r,   r-   )r?  r4  r¢   r£   rë  rT   r’  rH   rƒ  rS   rƒ   r¦  r2  r5   r+   rJ   )r•   rí  rî  rÚ  rÛ  r—   r3  Úplanr  r  r´   r:  rë   r¢  s   `          @@€r4   r¨  z"_wrap_mouse_wheel.<locals>.wrapperi  s  øøøøè è € Ø! 6�ˆð	Ý! $Ñ'Ô'ˆDØ/3Ð/?Õ% dÑ+Ô+Ð+ÀTˆFØÐ!¨&¬+Ð!Ø"�”Ø�” Ñ"�”ð(Ý'¨°µe¸G±n´nÅeÈGÁnÄnÑUÔU�DØð $Ý3˜Ý '¨¨g°tÑ <Ô <˜ð8ð 8ð 8ð 8ð 8ð 8ð 8ð9ð 9ð 9ð 9ð 9ð 9ð 9õ )¨°°yÀ*Ø28Ô2DðFñ Fô Fð Fð Fð Fð Fð Fð Fð Fà#à"'�F”K�K�Kð$ð #(�F”K�Kø %�F”KÐ'Ð'Ð'Ð'øøÝÔ%ð 	ð 	ð 	ØÝð 	ð 	ð 	ÝØ�å59¸#±Y´YÔ5GÐ5GÐ5GÈÈÈðNñô ð ð ð ð ð ð øøøøð	øøøð �X˜d F¨FÑ3Ô3Ð3Ð3Ð3Ð3Ð3Ð3Ð3s7   ŒAC" ÁA3C ÃC" ÃC" Ã	CÃC" Ã"D.Ã;)D)Ä)D.TrJ   rê   )r•   r   rí  rT   rî  rT   r,   r   r©  r¬  s   ` r4   Ú_wrap_mouse_wheelró  d  sY   ø€ ð
"4ð "4ð "4ð "4ð "4ð "4õH ˆG•W˜dÑ#Ô#Ð#Ý˜x¨°WÑ=Ô=€GÔØÔ&€G„OØ€Nr6   c            	     óê  — t           �t           S 	 ddlm}  ddlm} t
          D ]T}t          | |d¦  «        }|�t          |t          d¦  «        rŒ,|t          |<   t          | |t          |¦  «        ¦  «         ŒU|j        }t          |t          d¦  «        s|at          |¦  «        |_        t          |dd¦  «        }|�,t          |t          d¦  «        s|at          |¦  «        |_        t          |dd¦  «        }|�,t          |t          d¦  «        s|at%          |¦  «        |_        da nB# t(          $ r5}t+          d	d
t-          |¦  «        j        ›d|›d�¦  «         da Y d}~nd}~ww xY wt           S )zIInstall the wrappers once per process. Idempotent, and honest on failure.Nr   )ÚFrame)ÚMouseFr–  rê   TÚbindingsz.the Playwright bindings could not be wrapped (rC   z‚), so pointer movement is not humanised in this process. The installed Playwright version is probably outside the supported range.)r‘  Ú%invisible_playwright._pw._impl._framerõ  Ú%invisible_playwright._pw._impl._inputrö  Ú_FRAME_ACTIONSrH   r«  r•  rª  r­  rë   r’  rÖ  r”  rÙ  r–  r“  ró  rê   r2  r5   r+   rJ   )rõ  rö  rL   r¢  rë   Úclickrê   r´   s           r4   r`   r`   “  s»  € õ ÐÝÐð Ø?Ð?Ð?Ð?Ð?Ð?Ø?Ð?Ð?Ð?Ð?Ð?å"ð 	?ð 	?ˆDÝ˜u d¨DÑ1Ô1ˆHØÐ¥7¨8µW¸eÑ#DÔ#DÐØØ,4Õ# DÑ)Ý�E˜4Õ!3°HÑ!=Ô!=Ñ>Ô>Ð>Ð>àŒzˆÝ�t�W eÑ,Ô,ð 	0Ø#'Ð Ý)¨$Ñ/Ô/ˆEŒJÝ˜˜x¨Ñ.Ô.ˆØÐ¥W¨UµG¸UÑ%CÔ%CÐØ$)Ð!Ý,¨UÑ3Ô3ˆEŒLÝ˜˜w¨Ñ-Ô-ˆØÐ¥W¨UµG¸UÑ%CÔ%CÐØ$)Ð!Ý+¨EÑ2Ô2ˆEŒKØˆˆøÝð ð ð ÝØˆJõ �C‰yŒyÔ!Ð!Ð! 3 3 3ð(ñ	
ô 	
ð 	
ð ˆˆˆˆˆˆøøøøðøøøõ Ðs   �DD, Ä,
E+Ä6+E&Å&E+)rk   rn   rg   ro   rx   r=   r'  ry   ru   ra   r‘   rq   )r'   r(   r)   r(   r*   r+   r,   r-   )r,   r-   )r,   rA   )rM   rP   rQ   rR   rS   rT   r,   r   )r,   r^   )rb   r   r,   r(   )rb   r   r,   rT   )r‹   rR   rŒ   rR   r,   rR   )r—   r   r,   rR   )rå   ræ   r,   rç   )rÀ   ræ   rS   rT   r,   r¼   r}   )r  r  r  r  r  r  r	  r   r
  r^   r  r  r,   rR   )r   r   r,   r   )r%  r   rQ   rR   rS   rT   r,   r^   )r—   r   r,   r(  )r—   r   r,   r0  )r5  r   r,   r6  )r:  r   r,   r6  )r—   r   r,   r@  rä   )
r    rT   r¡   rT   r°   r¨   r�   r¨   r,   r^   )r,   rM  )r5  r   rZ  r(   r,   r[  )r`  r   r,   r-   )r5  r   rZ  r(   re  r   r,   r  )r`  r   r    rT   r¡   rT   r,   r^   )r3  r�   r—   r   rp  rT   rq  rT   rr  r  r	  r   r,   rT   )r3  r�   rå   r  r  r  r  r  r€  rT   r	  r   r
  r^   r,   r-   )r3  r�   r	  r   r,   rT   )r3  r�   r—   r   r	  r   r,   rÉ   )
r�  r  rž  rF  rL   r(   rŸ  rR   r,   r   )r¢  rP   r,   rP   )r�  r  rž  rF  r,   r^   )ra  rF  r±  rª   r,   r²  )
r5  r   r�  r  rž  rF  r	  r   r,   r¶  )r5  r   r3  r   rZ  r(   r�  r  rž  rF  r,   rÃ  )r3  r   r—   r   r¼  r¾  rë   r   r:  r   r	  r   r,   r-   )
r3  r�   r—   r   rÚ  rT   rÛ  rT   r,   rÉ   )ƒr‡   Ú
__future__r   rƒ   rW   rh   rá   r~   r2   Údataclassesr   Útypingr   r   r   r   r	   r
   r   r   Úweakrefr   Úinvisible_core.jugglerr   r   r   rñ   r   r   r   r   ry  r   r  r   r   r   r   r   r   r   r   r   r   Úinvisible_core.seedmixr   rk   ro   rn   rg   rx   rs   r…  rŒ  r‡  r®   r´  rÉ  rÇ  rÈ  r%   r&   rÁ  ÚRuntimeWarningr5   r:   Úinvisible_corer;   rF   r<   r2  Ú_motion_excr=   rG   rO   r]   ra   rq   ru   ry   r{   rŠ   r‘   r“   r›   r�   rõ   r¿   r  r  r  r$  r'  r/  r4  r9  r?  r¶   rJ  rL  rT  rY  rb  r_  rh  ro  r~  rƒ  r‰  r�  r‘  r’  r“  r”  r•  rú  r«  r¡  r­  r°  rµ  r¥  r¾  r¹  rº  rÖ  rÙ  rë  ró  r`   Ú__all__r9   r6   r4   ú<module>r     s  ððpð pð pðb #Ð "Ð "Ð "Ð "Ð "à €€€Ø €€€Ø 	€	€	€	Ø €€€Ø €€€Ø €€€Ø !Ð !Ð !Ð !Ð !Ð !Ø QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QØ %Ð %Ð %Ð %Ð %Ð %ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ,Ð +Ð +Ð +Ð +Ð +ð #€
à€Ø€Ø€
ð
 %€ð Ð ð Ð ð Ð ð Ð ð %Ð ð %Ð ØÐ ð €Ø€ð ˆs‰uŒu€Ð Ð Ð Ñ ð 9Gð Nð Nð Nð Nð Nðð ð ð ð8 ð 6Ð5Ð5Ð5Ð5Ð5ð
  ÐÐøð	 ð @ð @ð @Ø€KØ4?ÐÐ?Ð?Ð?Ñ?Ð?Ð?Ð?Ð?Ð?øøøøð@øøøð 9Ð 8Ð 8Ð 8Ð 8Ð 8ð HÐ ðð ð ð ð.ð ð ð ð ?ð ?ð ?ð ?ð
Bð Bð Bð Bð*8ð 8ð 8ð 8ðð ð ð ð%ð %ð %ð %ð %ñ %ô %ð %ð ˆj‰lŒl€Ð Ð Ð Ñ ðð ð ð ð6.ð .ð .ð .ð .ñ .ô .ð .ð0ð 0ð 0ð 0ðp
ð p
ð p
ð p
ð p
ñ p
ô p
ð p
ðz
ð 
ð 
ð 
ð/ð /ð /ð /ðj ;?ð&ð
 ØØ,0ð&ð &ð &ð &ð &ð &ðZ 1BÐ0AÑ0CÔ0C€	Ð CÐ CÐ CÑ CØ0AÐ0AÑ0CÔ0C€Ð CÐ CÐ CÑ Cð*ð *ð *ð *ð
ð ð ð ð("ð "ð "ð "ð ð ð ð ð:)ð )ð )ð )ðNð Nð Nð Nðð ð ð ð*ð *ð *ð *ð7ð 7ð 7ð 7ðð ð ð ðð ð ð ðð ð ð ð2ð ð ð ðIð Ið Ið Iðð ð ð ðJ ð?ð ?ð ?ð ?ð ?ð ?ðL ;?ð	3ð Øð3ð 3ð 3ð 3ð 3ð 3ð4Nð Nð Nð Nð 4ð 4ð 4ð 4ðF  $€Ð #Ð #Ð #Ñ #Ø59Ð Ð 9Ð 9Ð 9Ñ 9Ø6:Ð Ð :Ð :Ð :Ñ :Ø6:Ð Ð :Ð :Ð :Ñ :ð !#Ð Ð "Ð "Ð "Ñ "ð L€à
!€ð6ð 6ð 6ð 6ð"ð "ð "ð "ðJð ð ð ð(ð ð ð ð. %)ð0ð 0ð 0ð 0ð 0ð 0ðf ð7ð 7ð 7ð 7ð 7ñ 7ô 7ñ „ð7ð$(ð (ð (ð (ðV&)ð &)ð &)ð &)ðR"ð "ð "ð "ðJð ð ð ðD-ð -ð -ð -ð`,ð ,ð ,ð ,ð^'ð 'ð 'ð 'ðTð ð €€€s   Â$B- Â-CÂ2	C Ã C