@burdenoff/ui-engine 2026.1202.1 → 2026.1203.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -94,6 +94,8 @@ The resolver and the runtime implement spec 05 section 3 for web pages (plan P1-
94
94
 
95
95
  A candidate carries `role`, `name` (cut to 200 characters; empty for sensitive elements; for typed content, an editor or a text area or anything inside one, only the name its labels give), `bounds` (CSS pixels in the top viewport) and the matching `method` and `methodIndex`. The interpreter maps the codes to node error families (see below).
96
96
 
97
+ **Containers of ambiguous candidates** (BOFF-17588). An `ELEMENT_AMBIGUOUS` candidate can also carry `container: { anchor, role }`: the nearest labelled container or landmark around it that tells it apart. `anchor` is a `UiAnchor`, so the proposal for "use this one" is the method `{ kind: 'anchor', anchor, relation: 'inside', role: <the candidate's role> }`; `role` is the container's own role for display (`''` when it has none). Two kinds are described, nearest first: a landmark or named grouping (`CONTAINER_ROLES`: `region`, `form`, `navigation`, `group`, `dialog`, `row`, `listitem` and others; a `fieldset`, `table` or `figure` is named by its legend or caption) as a `role` anchor with its accessible name, and an element titled by its first visible heading-like child: a heading as the role anchor `{ kind: 'role', role: 'heading', name }` (checking it reads the names of headings only), a `summary` or `dt` as a `text` anchor on its text. An `inside` method filters by role, not by name, so a container is found only when it holds no other element of the candidate's role in the required state: a Save button next to a Cancel button in the same titled section gets no container (the UI script schema has no way to say both, and it does not change here). The engine reports a container only after running that `inside` method on the same page, in the resolution's state, and finding this candidate and nothing else, so a proposal can be offered as it is (a caller replaying on a stored snapshot should still check it there). The field is absent when no container within 12 ancestors (`MAX_CONTAINER_DEPTH`) tells the candidate apart, for a candidate with no role, for a sensitive candidate, and on every other code and on found elements. **Cost limits.** An ambiguous target is polled until its wait runs out, and every poll resolves it again, so the work is bounded per resolution: at most 3 checks per candidate (`MAX_CONTAINER_CHECKS`), 8 for all candidates together (`MAX_CONTAINER_CHECKS_PER_RESOLUTION`), no new check and no further walking after 25 ms (`CONTAINER_TIME_BUDGET_MS`), at most two names read per ancestor, and none at all when the search root holds more than 5,000 elements (`MAX_CONTAINER_PAGE_ELEMENTS`). Candidates of one resolution share the answers of the checks already run, which cost nothing again. A candidate past those limits simply has no container. **Size.** Names and titles longer than 200 characters, or holding a control character, are skipped, never cut, and nothing is read from a sensitive element or from typed content. A container is at most about 700 bytes of JSON (200 UTF-16 code units at up to 3 bytes each, plus its role and keys), so it adds at most about 3.5 KB to five candidates. The UI script schema and its hash do not change. `describeContainer(element, root, keep, probe?, budget?)` and `createContainerBudget(now?)` are exported from `./target` for callers that want the same answer for an element they hold; a budget belongs to one resolution of one page state and must not be kept longer.
98
+
97
99
  **Methods on the web.** `role` compares the computed role and accessible name (a compact accname subset; form fields never take a name from their value) after NFKC, whitespace and case normalisation; `app` and `window` are desktop fields and are ignored. `css` and `xpath` use the page's engines (`xpath` is `unsupported` where the DOM has none). `testId` compares an attribute (default `data-testid`). `fuzzy` scores the edit-distance similarity of names (threshold 0.8 by default, never below 0.5). `anchor` finds a text or role anchor, then the element `inside` it (or inside the heading's container) or the nearest element `leftOf`, `rightOf`, `above`, `below` or on the `sameRow`, from element bounds. `text` matches the innermost element whose visible text contains (or, with `exact`, equals) the text.
98
100
 
99
101
  **The runtime.** `createDomRuntime(document)` returns `{ version, resolve, act, highlight, clearHighlight, snapshot }`; every result is plain JSON. `act(target, action)` resolves first and acts only on exactly one element: `click` (left, middle, right), `doubleClick`, `hover`, `focus`, `type` (through the value setter, with `input` and `change`; `append` optional), `clear`, `select` (by value, effective label or index), `check` (confirmed afterwards), `pressKey` (with the browser's defaults: Enter activates a button, link or summary or performs implicit submission through the default button; Space activates a button, checkbox, radio or summary), `scroll`, `scrollIntoView`, `getText`, `getValue`, `getAttribute` and `exists`. Pointer events follow a real mouse: entry events on every element entered, the held button in `buttons` on press, the click count in `detail`, the element centre as coordinates, focus moved to the nearest focusable element, and cancelled `pointerdown` or `mousedown` honoured. Action problems are `INVALID_ACTION`, `NOT_EDITABLE`, `NOT_SELECTABLE`, `NOT_CHECKABLE`, `OPTION_NOT_FOUND`, `STATE_NOT_CHANGED` (a handler cancelled a `check`) and `SENSITIVE_ELEMENT` (reads of password, one-time-code, card and secret-named fields, of content inside them, and of elements under `data-sensitive`, `data-private` or `data-fg-sensitive`, across shadow roots, slots and frames, are refused). Typed text and read values never appear in a result's report fields. `highlight` outlines the element, or numbers the candidates of an ambiguous target, in a closed shadow root using the system `Highlight` colour; the overlay is removed before every resolve, act or snapshot.
@@ -216,7 +218,7 @@ The modules were copied from `wspace-botmanor-svc` `src/modules/stewards/teach/`
216
218
 
217
219
  - A navigation URL that holds a value masked elsewhere in the same demonstration, as written or percent-encoded, loses its query and fragment, or its path when the value is in the path.
218
220
  - `maskUrl` also cuts a reset-style link after its reset segment (`/reset/<token>` becomes `/reset`) and drops a path or fragment that holds a recognisable credential. The sensitive values a URL loses (the password, the values of secret-looking parameters, values that may be a token or a code, and the path segments cut from a reset-style link) are masked in the rest of the recording too, so a code from a verification link does not survive in an intent or a label.
219
- - A path whose last segment is a single ordinary word holding a reset stem (`/orders/confirmed`, `/team/invites`, `/settings/presets`) is not a reset-style link, so such a page keeps its query and path (BOFF-18078), as any ordinary page does (`/unsubscribed?email=…` keeps the address), unless a query or fragment value has 16 or more characters without a space (`/team/invites?invite=<uuid>`). The same word before another segment (`/invites/<token>`) or with anything else in its segment (`/invites-QWERTYAB`) still is a reset link, as are plural and joined forms (`/users/password_resets/<token>`, `/confirmations/<token>`, `/pwreset/<token>`). A kept reset segment holds only clean reset words and side words such as `password`, `email` or `accept` (`reset-password`, `verify-email`, `accept-invite`), with no digit or run of 16 or more letters; any other reset segment (`/pwreset`, `/magic-9f8e7d6c`, `/confirmabcdefghijklmnop`) is dropped too. A trailing slash after a kept reset segment stays.
221
+ - A path whose last segment is a single ordinary word holding a reset stem (`/orders/confirmed`, `/team/invites`, `/settings/presets`) is not a reset-style link, so such a page keeps its query and path (BOFF-18078), as any ordinary page does, unless a query or fragment value has 16 or more characters without a space (`/team/invites?invite=<uuid>`). The same word before another segment (`/invites/<token>`) or with anything else in its segment (`/invites-QWERTYAB`) still is a reset link, as are plural and joined forms (`/users/password_resets/<token>`, `/confirmations/<token>`, `/pwreset/<token>`). A kept reset segment holds only clean reset words and side words such as `password`, `email` or `accept` (`reset-password`, `verify-email`, `accept-invite`), with no digit or run of 16 or more letters; any other reset segment (`/pwreset`, `/magic-9f8e7d6c`, `/confirmabcdefghijklmnop`) is dropped too. A trailing slash after a kept reset segment stays. The landing page of an unsubscribe mail is not an ordinary page: `/unsubscribed?email=a@b.com` stays a reset-style link and becomes `/unsubscribed`, with the address scrubbed from the whole recording, as before BOFF-18078 (BOFF-18125).
220
222
  - A plain-word user name, and the plain-word values of harmless parameters of a reset-style link (`lang`, `locale`, `source`, `ref`, `utm_*`, `page`, `tab` and similar, for example `?lang=english`), are removed from that URL only, not from the rest of the recording: they are not secret, and scrubbing them from every label stopped those labels resolving. A value under any other name, a value with a digit or a symbol, or one of 16 characters or more may be a token or a code and is still scrubbed everywhere.
221
223
  - `parseRecording` refuses a recording whose stored text (intent, target labels, typed text, URL, window app and title) still holds a recognisable credential, with `RecordingError` code `CREDENTIAL_IN_RECORDING`. The Stewards copy documented this check but did not perform it.
222
224
  - `parseRecording(value, { enforceCaptureRules: true })` also refuses, with `CREDENTIAL_IN_RECORDING`, a step that holds a value capture would have masked: a code-like typed value, text typed into a field whose label marks it as secret, a masked step that still carries text, a URL whose query, fragment, user info or reset-style path carries a secret, labels and window titles with a credential or a code, and intents with a credential (capture does not mask a code in an intent unless that code was typed in the demonstration, so neither does this check). Use it for every recording that did not come from `captureRecording` (an API, an import, a hand edit). The check is `unmaskedSecretStep` from `./capture`, ported from the Stewards copy at `84fe0aa` (BOFF-17096); markers already in the text are set aside, so every recording capture produces passes. The message names the step and the field, never the value. The default `parseRecording(value)` is unchanged.
package/dist/capture.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  captureRecording2
3
- } from "./index-8ntwcfb4.js";
3
+ } from "./index-5xqsjeqj.js";
4
4
  import {
5
5
  maskUrl2,
6
6
  unmaskedSecretStep2
7
- } from "./index-qepvchf7.js";
7
+ } from "./index-dcs2pe49.js";
8
8
  import {
9
9
  REDACTED2,
10
10
  redactCredentials2
@@ -1 +1 @@
1
- (()=>{var U=["data-fg-sensitive","data-sensitive","data-private"];function Z(e){return U.some((t)=>e.hasAttribute(t))}function _(e){let t=e.assignedSlot;if(t!==void 0)return t;let n=e.parentElement?.shadowRoot;if(!n)return null;for(let o of Array.from(n.querySelectorAll("slot")))if((typeof o.assignedNodes==="function"?o.assignedNodes():[]).includes(e))return o;return null}function x(e){let t=_(e);if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();if(n&&"host"in n)return n.host;try{return e.ownerDocument.defaultView?.frameElement??null}catch{return null}}function y(e){for(let t=e;t;t=x(t))if(Z(t))return!0;return!1}var me={button:"button",submit:"button",reset:"button",image:"button",checkbox:"checkbox",radio:"radio",range:"slider",number:"spinbutton",search:"searchbox",email:"textbox",tel:"textbox",text:"textbox",url:"textbox",password:"textbox",date:"textbox","datetime-local":"textbox",month:"textbox",time:"textbox",week:"textbox",color:"textbox",file:"button"},pe={article:"article",aside:"complementary",button:"button",datalist:"listbox",dd:"definition",details:"group",dialog:"dialog",dt:"term",fieldset:"group",figure:"figure",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",hr:"separator",li:"listitem",main:"main",menu:"list",meter:"meter",nav:"navigation",ol:"list",optgroup:"group",option:"option",output:"status",p:"paragraph",progress:"progressbar",summary:"button",table:"table",tbody:"rowgroup",td:"cell",textarea:"textbox",tfoot:"rowgroup",thead:"rowgroup",tr:"row",ul:"list"},be=new Set(["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"]);var Y=256;function g(e){return(e??"").normalize("NFKC").replace(/\s+/g," ").trim().toLowerCase()}function P(e,t){return g(e)===g(t)}function he(e,t){let n=g(t);return n.length>0&&g(e).includes(n)}function Ye(e,t){if(e===t)return 0;if(e.length===0)return t.length;if(t.length===0)return e.length;let n=Array.from({length:t.length+1},(o,r)=>r);for(let o=1;o<=e.length;o+=1){let r=[o];for(let i=1;i<=t.length;i+=1){let s=e[o-1]===t[i-1]?0:1;r[i]=Math.min((n[i]??0)+1,(r[i-1]??0)+1,(n[i-1]??0)+s)}n=r}return n[t.length]??0}function Ee(e,t){let n=g(e).slice(0,256),o=g(t).slice(0,256),r=Math.max(n.length,o.length);if(r===0)return 0;return 1-Ye(n,o)/r}function v(e,t){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}var Q=512,Je=65536,Qe=new Set(["button","input","meter","output","progress","select","textarea"]),et=new Set(["script","style","noscript","template","head","title","meta","link"]);function A(e){return e.localName.toLowerCase()}function ge(e){return e.parentElement?.closest("article, aside, main, nav, section")!=null}function tt(e){let t=A(e);switch(t){case"a":case"area":return e.hasAttribute("href")?"link":"";case"input":{let n=(e.getAttribute("type")??"text").toLowerCase();if(n==="hidden")return"";if(e.hasAttribute("list")&&["text","search","email","tel","url"].includes(n))return"combobox";return me[n]??"textbox"}case"select":{let n=Number(e.getAttribute("size")??"0");return e.hasAttribute("multiple")||n>1?"listbox":"combobox"}case"img":return e.getAttribute("alt")===""?"presentation":"img";case"th":return e.getAttribute("scope")==="row"?"rowheader":"columnheader";case"header":return ge(e)?"":"banner";case"footer":return ge(e)?"":"contentinfo";case"section":case"form":return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?t==="form"?"form":"region":"";default:return pe[t]??""}}function R(e){let t=e.getAttribute("role")?.trim().split(/\s+/)[0];return t?t.toLowerCase():tt(e)}function nt(e,t){let n=e.getRootNode();return typeof n.getElementById==="function"?n.getElementById(t):null}function ot(e){return e.hasAttribute("hidden")||e.getAttribute("aria-hidden")==="true"}function rt(e){let t=e.ownerDocument.defaultView;if(!t)return"none";let n=t.getComputedStyle(e);if(n.display==="none")return"subtree";return n.visibility==="hidden"||n.visibility==="collapse"?"self":"none"}function I(e){let t=e.getAttribute("contenteditable");if(t===null)return!1;let n=t.trim().toLowerCase();return n===""||n==="true"||n==="plaintext-only"}function it(e){if(e.shadowRoot)return Array.from(e.shadowRoot.childNodes);if(A(e)==="slot"){let t=e,n=typeof t.assignedNodes==="function"?t.assignedNodes({flatten:!0}):[];if(n.length>0)return n}return Array.from(e.childNodes)}var st=/^(div|p|li|tr|td|th|br|h[1-6]|section|article|header|footer)$/;function O(e,t){if(e.remaining<=0||t.length===0)return;let n=t.slice(0,e.remaining);e.parts.push(n),e.remaining-=n.length}function Te(e,t,n,o,r,i=!1){if(t>32||n.remaining<=0)return;if(e.nodeType===3){if(!i)O(n,e.textContent??"");return}if(e.nodeType!==1)return;let s=e,a=A(s);if(et.has(a)||Z(s))return;if(!r&&ot(s))return;let l=!1;if(t>0&&!r){let d=o?.isVisible?.(s);if(d===!1)l=!0;else if(d===void 0){let c=rt(s);if(c==="subtree")return;l=c==="self"}}let u=s.getAttribute("aria-label")?.trim();if(u&&t>0&&!l){O(n,` ${u} `);return}if(a==="img"||a==="input"&&s.getAttribute("type")==="image"){if(!l)O(n,` ${s.getAttribute("alt")??""} `);return}if(a==="input"||a==="textarea"||a==="select")return;if(t>0&&I(s))return;let f=t>0&&st.test(a);if(f)O(n," ");for(let d of it(s))Te(d,t+1,n,o,r,l);if(f)O(n," ")}function xe(e){if(A(e)==="textarea"||I(e))return!0;for(let n=x(e);n;n=x(n))if(A(n)==="textarea"||I(n))return!0;return!1}function Ae(e){for(let t=x(e);t;t=x(t)){let n=A(t);if(n==="textarea"||n==="select"||I(t))return!0}return!1}function H(e,t,n=!1){let o=A(e);if(o==="textarea"||o==="select"||I(e)||Ae(e)||y(e))return"";return E(e.getAttribute("aria-label")??"")||V(e,t,Q,n)}function V(e,t,n=Q,o=!1){if(e.nodeType===1&&y(e))return"";let r={parts:[],remaining:n*2+64};return Te(e,0,r,t,o),E(r.parts.join(""),n)}function E(e,t=Q){return e.replace(/\s+/g," ").trim().slice(0,t)}function at(e,t){let n=[],o=e.getAttribute("id");if(o){let i=e.getRootNode();for(let s of Array.from(i.querySelectorAll("label")))if(s.getAttribute("for")===o)n.push(H(s,t,!0))}let r=e.closest("label");if(r&&!r.hasAttribute("for"))n.push(H(r,t,!0));return E(n.join(" "))}function J(e,t,n){let o=Array.from(e.children).find((r)=>A(r)===t);return o?H(o,n):""}function k(e,t){return Se(e,t,!0)}function ye(e,t){return Se(e,t,!1)}function lt(e,t){let n=Array.from(e.children).find((o)=>A(o)==="title");if(!n||y(n)||Ae(n))return"";return E(Array.from(n.childNodes).map((o)=>V(o,t)).join(" "))}function Se(e,t,n){let o=e.getAttribute("aria-labelledby");if(o){let l=o.split(/\s+/).filter(Boolean).map((u)=>nt(e,u)).filter((u)=>u!==null).map((u)=>H(u,t,!0)).join(" ");if(E(l))return E(l)}let r=e.getAttribute("aria-label");if(r&&E(r))return E(r);let i=A(e);if(Qe.has(i)){let l=at(e,t);if(l)return l}if(i==="input"){let l=(e.getAttribute("type")??"text").toLowerCase();if(l==="button"||l==="submit"||l==="reset"){let u=e.getAttribute("value");if(u!==null)return E(u);return l==="submit"?"Submit":l==="reset"?"Reset":""}if(l==="image")return E(e.getAttribute("alt")??"")}if(i==="img"||i==="area"){let l=e.getAttribute("alt");if(l)return E(l)}if(i==="svg"){let l=lt(e,t);if(l)return l}if(i==="fieldset"){let l=J(e,"legend",t);if(l)return l}if(i==="table"){let l=J(e,"caption",t);if(l)return l}if(i==="option"){let l=E(e.getAttribute("label")??"");if(l)return l}if(i==="figure"){let l=J(e,"figcaption",t);if(l)return l}if(n&&be.has(R(e))){let l=V(e,t);if(l)return l}let s=e.getAttribute("title");if(s&&E(s))return E(s);let a=e.getAttribute("placeholder");if(a&&E(a))return E(a);return""}function F(e,t){if(A(e)==="input"){let o=(e.getAttribute("type")??"text").toLowerCase();return o==="button"||o==="submit"||o==="reset"?k(e,t):""}return V(e,t,Je)}function ee(e,t,n,o){return R(e)===t.trim().toLowerCase()&&g(k(e,o))===g(n)}function ut(e){return e.ownerDocument.defaultView}function B(e){let t=_(e);if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return n&&"host"in n?n.host:null}function N(e,t){let n=t?.isVisible?.(e);if(n!==void 0)return n;if(!e.isConnected)return!1;let o=ut(e),r=e;while(r){if(r.hasAttribute("hidden"))return!1;if(r.localName==="input"&&r.getAttribute("type")?.toLowerCase()==="hidden")return!1;if(o&&o.getComputedStyle(r).display==="none")return!1;r=B(r)}if(o){let s=o.getComputedStyle(e);if(s.visibility==="hidden"||s.visibility==="collapse")return!1;if(s.display==="contents")return!0}let i=e.checkVisibility;return typeof i==="function"?i.call(e):!0}function w(e){for(let n=e;n;n=x(n))if(n.getAttribute("aria-disabled")==="true"||n.hasAttribute("inert"))return!1;if(!ct.has(e.localName)){let n=e.parentElement?.closest("button, select, option, optgroup, textarea");return n?w(n):!0}if(e.hasAttribute("disabled"))return!1;let t=e.parentElement?.closest("fieldset[disabled]");if(t){if(!Array.from(t.children).find((o)=>o.localName==="legend")?.contains(e))return!1}try{return!e.matches(":disabled")}catch{return!0}}var ct=new Set(["button","input","select","textarea","optgroup","option","fieldset"]);function D(e,t,n){let r=t?.rectOf?.(e)??e.getBoundingClientRect();return{x:Math.round(r.x+(n?.x??0)),y:Math.round(r.y+(n?.y??0)),width:Math.round(r.width),height:Math.round(r.height)}}function C(e){let t=Array.from(e.querySelectorAll("*"));return e.nodeType===1?[e,...t]:t}var dt=/password|passcode|passwd|\bpin\b|otp|one[\s-]?time|verification|security code|auth(?:entication)? code|\bcvv\b|\bcvc\b|card number|secret|token|recovery/i,ft=/password|one-time-code|^cc-/i;function mt(e){return dt.test(e)}function S(e){if(y(e))return!0;if(Me(e))return!0;for(let t=x(e);t;t=x(t))if(Me(t))return!0;return!1}function Me(e){let t=e.localName,n=e.getAttribute("contenteditable"),o=n!==null&&n.trim().toLowerCase()!=="false";if(t!=="input"&&t!=="textarea"&&t!=="select"&&!o)return!1;if(e.getAttribute("type")?.toLowerCase()==="password")return!0;if((e.getAttribute("autocomplete")??"").trim().split(/\s+/).filter(Boolean).some((i)=>ft.test(i)))return!0;return pt(e).some((i)=>i.length>0&&mt(i.replace(/[-_]/g," ")))}function pt(e){let t=(a)=>(a??"").slice(0,512),n=[k(e),t(e.getAttribute("aria-label")),t(e.getAttribute("placeholder")),t(e.getAttribute("title")),t(e.getAttribute("name")),t(e.getAttribute("id"))],o=e.getRootNode(),r=(a)=>typeof o.getElementById==="function"?o.getElementById(a):null;for(let a of(e.getAttribute("aria-labelledby")??"").split(/\s+/).filter(Boolean)){let l=r(a);if(l)n.push(t(l.getAttribute("aria-label")),t(l.textContent))}let i=e.getAttribute("id"),s=Array.from(o.querySelectorAll("label")).filter((a)=>i!==null&&a.getAttribute("for")===i||!a.hasAttribute("for")&&a.contains(e));for(let a of s)n.push(t(a.getAttribute("aria-label")),t(a.textContent));return n}var bt=0.8,ht=0.05,Et=4,Re=1000,z=2,gt=new Set(["button","checkbox","combobox","link","listbox","menuitem","menuitemcheckbox","menuitemradio","option","radio","searchbox","slider","spinbutton","switch","tab","textbox","treeitem"]),Tt=/^[A-Za-z_][\w:.-]{0,127}$/;function xt(e){return e.nodeType===9?e:e.ownerDocument}function At(e,t){return{kind:"list",elements:C(t.root).filter((o)=>ee(o,e.role,e.name,t.probe)),...e.nth!==void 0?{nth:e.nth}:{}}}function yt(e,t){try{return{kind:"list",elements:Array.from(t.root.querySelectorAll(e))}}catch{return{kind:"invalid"}}}function St(e,t){let n=e.attribute??"data-testid";if(!Tt.test(n))return{kind:"invalid"};return{kind:"list",elements:C(t.root).filter((r)=>r.getAttribute(n)===e.value)}}function Mt(e,t){if(e.nodeType===9)return t.ownerDocument===e&&t.getRootNode()===e;return e===t||e.contains(t)}function Rt(e,t){let n=xt(t.root);if(typeof n.evaluate!=="function")return{kind:"unsupported"};let o;try{o=n.evaluate(e.xpath,t.root,null,7,null)}catch{return{kind:"invalid"}}let r=[],i=Math.min(o.snapshotLength,Re);for(let s=0;s<i;s+=1){let a=o.snapshotItem(s);if(a&&a.nodeType===1&&Mt(t.root,a))r.push(a)}return{kind:"list",elements:r,...o.snapshotLength>Re?{overflow:!0}:{}}}function kt(e,t,n){let o=Math.min(g(e).length,Y),r=Math.max(o,t);return r>0&&Math.abs(o-t)<=(1-n)*r}function Nt(e,t){let n=Math.min(1,Math.max(0.5,e.threshold??bt)),o=e.role?.trim().toLowerCase(),r=Math.min(g(e.name).length,Y),i=[];for(let s of C(t.root)){let a=R(s);if(o?a!==o:a==="")continue;let l=k(s,t.probe);if(!kt(l,r,n))continue;let u=Ee(l,e.name);if(u>=n)i.push({element:s,score:u})}return{kind:"ranked",scored:i,margin:ht}}function we(e,t){let n=C(e.root).filter((i)=>t(F(i,e.probe))),o=e.keep??(()=>!0),r=n.filter(o);return n.filter((i)=>!r.some((s)=>s!==i&&i.contains(s)))}function wt(e,t){let n=e.exact?(o)=>P(o,e.text):(o)=>he(o,e.text);if(g(e.text).length===0)return{kind:"list",elements:[]};return{kind:"list",elements:we(t,n),...e.nth!==void 0?{nth:e.nth}:{}}}function te(e){return g(e).replace(/[\s:*]+$/u,"")}function Ct(e,t){return(e.kind==="role"?C(t.root).filter((o)=>ee(o,e.role,e.name,t.probe)):we(t,(o)=>te(o)===te(e.text)&&te(o)!=="")).filter((o)=>N(o,t.probe))}function Ce(e,t,n){let o=e.role?.trim().toLowerCase();return C(t.root).filter((r)=>{let i=R(r);if(o?i!==o:!gt.has(i))return!1;return!n.some((s)=>s===r||r.contains(s))})}var vt=new Set(["h1","h2","h3","h4","h5","h6","legend","caption","figcaption","summary","dt"]);function Dt(e){return vt.has(e.localName)||R(e)==="heading"}function _t(e){for(let t=e;t;t=t.parentElement)if(Dt(t))return t;return null}function Ot(e,t,n){let o=Ce(e,t,n),r=new Set;for(let i of n){let a=_t(i)?.parentElement??i;for(let l of o)if(a.contains(l))r.add(l)}return{kind:"list",elements:o.filter((i)=>r.has(i))}}function ke(e,t,n,o){return e<o&&n<t}function It(e,t,n){let o=t.x+t.width,r=t.y+t.height,i=n.x+n.width,s=n.y+n.height,a=ke(t.y,r,n.y,s),l=ke(t.x,o,n.x,i);switch(e){case"rightOf":return a&&n.x>=o-z?Math.max(0,n.x-o):null;case"leftOf":return a&&i<=t.x+z?Math.max(0,t.x-i):null;case"below":return l&&n.y>=r-z?Math.max(0,n.y-r):null;case"above":return l&&s<=t.y+z?Math.max(0,t.y-s):null;case"sameRow":return a?Math.abs(n.x+n.width/2-(t.x+t.width/2)):null;default:return null}}function Ne(e){return e.width>0&&e.height>0}function Lt(e,t){let n=Ct(e.anchor,t);if(n.length===0)return{kind:"list",elements:[]};if(e.relation==="inside")return Ot(e,t,n);let o=n.map((i)=>D(i,t.probe)).filter(Ne);if(o.length===0)return{kind:"unsupported"};let r=[];for(let i of Ce(e,t,n)){let s=D(i,t.probe);if(!Ne(s))continue;let a=null;for(let l of o){let u=It(e.relation,l,s);if(u!==null&&(a===null||u<a))a=u}if(a!==null)r.push({element:i,score:-a})}return{kind:"ranked",scored:r,margin:Et}}function ve(e,t){switch(e.kind){case"role":return At(e,t);case"css":return yt(e.selector,t);case"testId":return St(e,t);case"xpath":return Rt(e,t);case"fuzzy":return Nt(e,t);case"anchor":return Lt(e,t);case"text":return wt(e,t);default:return{kind:"unsupported"}}}var De=5,_e=200;var Wt={x:0,y:0,width:0,height:0};function Ut(e,t,n){let o={root:e,offset:Wt,hidden:!1,disabled:!1};for(let[r,i]of(t??[]).entries()){let s;try{s=Array.from(o.root.querySelectorAll(i))}catch{return{index:r,reason:"invalid"}}if(s.length===0)return{index:r,reason:"notFound"};if(s.length>1)return{index:r,reason:"ambiguous"};let a=s[0],l=a.localName;if(l==="iframe"||l==="frame"){let u=a,f=null;try{f=u.contentDocument}catch{f=null}if(!f)return{index:r,reason:"inaccessible"};let d=D(a,n,o.offset);o={root:f,offset:{x:d.x+u.clientLeft,y:d.y+u.clientTop,width:0,height:0},hidden:o.hidden||!N(a,n),disabled:o.disabled||!w(a)}}else if(a.shadowRoot)o={root:a.shadowRoot,offset:o.offset,hidden:o.hidden,disabled:o.disabled};else return{index:r,reason:"notAFrame"}}return o}function Pt(e,t,n,o){if(t==="attached")return!0;if(n.hidden||!N(e,o))return!1;return t==="visible"||!n.disabled&&w(e)}function Oe(e,t,n,o,r){return{role:R(e),name:S(e)?"":v(xe(e)?ye(e,r):k(e,r),_e),bounds:D(e,r,o),method:t.kind,methodIndex:n}}function Ht(e,t,n,o=!1){if(t.length===0)return e.length>0?{outcome:"notInteractable",elements:e,matches:0}:{outcome:"none",elements:[],matches:0};if(o)return{outcome:"ambiguous",elements:t,matches:t.length};if(n!==void 0){let r=t[n];return r?{outcome:"found",element:r,matches:t.length}:{outcome:"none",elements:[],matches:t.length}}return t.length===1?{outcome:"found",element:t[0],matches:1}:{outcome:"ambiguous",elements:t,matches:t.length}}function Vt(e,t,n){if(t.length===0)return e.length>0?{outcome:"notInteractable",elements:e.map((a)=>a.element),matches:0}:{outcome:"none",elements:[],matches:0};let o=[...t].sort((a,l)=>l.score-a.score),r=o[0],i=o[1];if(!i||r.score-i.score>=n)return{outcome:"found",element:r.element,matches:t.length};let s=o.filter((a)=>r.score-a.score<n).map((a)=>a.element);return{outcome:"ambiguous",elements:s,matches:s.length}}function Ft(e,t){switch(e.kind){case"invalid":case"unsupported":return e.kind;case"list":return Ht(e.elements,e.elements.filter(t),e.nth,e.overflow);case"ranked":return Vt(e.scored,e.scored.filter((n)=>t(n.element)),e.margin)}}function X(e,t,n=[],o=0,r){return{status:"failed",code:e,candidates:n,candidateCount:o,attempts:t,...r?{frame:r}:{}}}function Ie(e,t,n={}){let o=n.state??"interactable",r=Ut(e,t.frame,n);if(!("root"in r)){let d=t.methods.map((c,p)=>({index:p,method:c.kind,outcome:"notTried",matches:0}));return X("ELEMENT_NOT_FOUND",d,[],0,r)}let i=[],s=t.methods.findIndex((d)=>d.enabled!==!1),a,l,u;for(let[d,c]of t.methods.entries()){if(u){i.push({index:d,method:c.kind,outcome:"notTried",matches:0});continue}if(c.enabled===!1){i.push({index:d,method:c.kind,outcome:"disabled",matches:0});continue}let p=(b)=>Pt(b,o,r,n),m=Ft(ve(c,{root:r.root,probe:n,keep:p}),p);if(m==="invalid"||m==="unsupported"){i.push({index:d,method:c.kind,outcome:m,matches:0});continue}if(i.push({index:d,method:c.kind,outcome:m.outcome,matches:m.matches}),m.outcome==="found")u={element:m.element,method:c,index:d};else if(m.outcome==="ambiguous"&&!a)a={elements:m.elements,method:c,index:d,count:m.matches};else if(m.outcome==="notInteractable"&&!l)l={elements:m.elements,method:c,index:d}}if(u)return{status:"found",element:u.element,method:u.method.kind,methodIndex:u.index,fallback:u.index!==s,candidate:Oe(u.element,u.method,u.index,r.offset,n),attempts:i};let f=(d)=>d.elements.slice(0,De).map((c)=>Oe(c,d.method,d.index,r.offset,n));if(a)return X("ELEMENT_AMBIGUOUS",i,f(a),a.count);if(l)return X("ELEMENT_NOT_INTERACTABLE",i,f(l),l.elements.length);return X("ELEMENT_NOT_FOUND",i)}var ne="[REDACTED]",Bt=[/\b(?:Bearer|Basic)\s+[^\s"'`,;)\]}]+/gi,/\b(?:sk|pk|rk|xai)-[^\s"'`,;)\]}]+/gi,/\b(?:gsk|hf|ghp|gho|ghs|ghu|glpat)_[^\s"'`,;)\]}]+/gi,/\bAIza[\w-]{10,}/g,/\b(?:AKIA|ASIA)[0-9A-Z]{12,}/g],zt=/([\s"'`,;:=()[\]{}]+)/,Xt=/^(?:api[_-]?key|access[_-]?key|secret|secret[_-]?key|client[_-]?secret|token|password)$/i;function Kt(e){let t=e.indexOf("…");return e.includes("***")||t!==-1&&t<e.length-1}function jt(e){let t=e.split(zt);for(let n=0;n<t.length;n+=2){let o=t[n]??"";if(o&&o!=="[REDACTED]"&&Kt(o))t[n]="[REDACTED]";let r=t[n+1]??"";if(t[n+2]&&Xt.test(o)&&/[:=]/.test(r))t[n+2]="[REDACTED]"}return t.join("")}function oe(e){if(!e)return e;let t=e;for(let n of Bt)t=t.replace(n,"[REDACTED]");return t=jt(t),t.replace(/(?:\[REDACTED\]){2,}/g,"[REDACTED]")}var Le="";function K(e){if(!e)return!1;let t=e.replaceAll("[REDACTED]",Le);return oe(t).replaceAll(Le,"[REDACTED]")!==e}function re(e){try{return decodeURIComponent(e.replaceAll("+"," "))}catch{return e}}function We(e){return K(re(e).replace(/[/?&#]/g," "))}var $t=500,Ue=/reset|recover|verify|verification|magic|confirm|activate|invite|unsubscribe/i;function Gt(e){let t=e;for(let n=0;n<3;n+=1){let o=re(t);if(o===t)break;t=o}return t}function qt(e){let t=e.split(/[/?#;]/),n=t.findIndex((r)=>Ue.test(r));return t.slice(0,n+1).map((r)=>K(r)?ne:r).join("/")}function ie(e){let t=e.trim();if(t==="")return null;let n=/^[a-z][a-z0-9+.-]*:/i.test(t)||t.startsWith("//"),o="",r;if(n){let f;try{f=new URL(t.startsWith("//")?`https:${t}`:t)}catch{return null}if(f.protocol!=="http:"&&f.protocol!=="https:")return null;o=t.startsWith("//")?`//${f.host}`:f.origin,r=f.pathname}else r=t.split(/[?#]/)[0]??"";let i=r.split("/"),s=i.map(Gt),a=s.findIndex((f)=>Ue.test(f)),u=(a>=0?i.slice(0,a+1):i).map((f,d)=>{let c=s[d]??f;if(d===a)return qt(c);return K(c)||We(f)?ne:f}).join("/");return v(`${o}${u}`,$t)}var Zt=1,Yt=5000,Jt=64,Qt=500,en=new Set(["script","style","noscript","template","link","meta","base","head","object","embed"]),tn=new Set(["textarea"]),nn=new Set(["id","class","role","name","type","for","title","alt","placeholder","label","autocomplete","tabindex","disabled","readonly","hidden","inert","contenteditable","list","multiple","size","scope","slot","part","lang","dir","data-testid","data-test","data-test-id","data-qa","data-cy","data-automation-id",...U]),on=new Set(["aria-valuenow","aria-valuetext","aria-checked","aria-selected","aria-pressed"]),rn=new Set(["button","submit","reset"]),sn=/^[a-z][a-z0-9-]{0,63}$/;var an=/^[a-z][a-z0-9_:.-]{0,127}$/;function He(e){let t=e.getAttribute("contenteditable");return t!==null&&t.trim().toLowerCase()!=="false"}function Ve(e){for(let t=x(e);t;t=x(t))if(t.localName==="textarea"||He(t))return!0;return!1}function ln(e){if(!e.parentElement?.shadowRoot)return!1;let t=_(e);return t!==null&&(S(t)||Ve(t))}function j(e){return v(oe(e),Qt)}var un=new Set(["alt","label","title","placeholder","value","aria-label","aria-description","aria-roledescription","aria-placeholder"]),cn=new Set(["aria-hidden","aria-disabled","aria-expanded","aria-haspopup","aria-controls","aria-owns","aria-labelledby","aria-describedby","aria-level","aria-current","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-readonly","aria-required","aria-invalid","aria-busy","aria-live","aria-atomic","aria-posinset","aria-setsize","aria-colcount","aria-colindex","aria-colspan","aria-rowcount","aria-rowindex","aria-rowspan","aria-sort"]);function dn(e,t){let n={},o=e.localName;for(let r of Array.from(e.attributes)){let i=r.name.toLowerCase();if(i.startsWith("on")||!an.test(i))continue;if(t&&(un.has(i)||i==="href"||i.startsWith("aria-")&&!cn.has(i)))continue;if(nn.has(i)||i.startsWith("aria-")&&!on.has(i))n[i]=j(r.value);else if(i==="href"&&(o==="a"||o==="area")){let s=ie(r.value);if(s!==null)n[i]=s}else if(i==="value"&&o==="input"&&rn.has((e.getAttribute("type")??"").toLowerCase()))n[i]=j(r.value)}return Object.keys(n).length>0?n:void 0}function fn(e,t){let n=t?.rectOf?.(e)??e.getBoundingClientRect(),o=[Math.round(n.x),Math.round(n.y),Math.round(n.width),Math.round(n.height)];return o[2]>0||o[3]>0?o:void 0}function Pe(e,t,n,o,r){let i=[];for(let s of Array.from(e.childNodes)){if(t.count>=t.max){t.truncated=!0;break}if(s.nodeType===3){if(!o||ln(s))continue;let a=s.textContent??"";if(a.length===0)continue;let l=a.trim()===""?" ":j(a);t.count+=1,i.push(l)}else if(s.nodeType===1){let a=G(s,t,n+1,o,r);if(a)i.push(a)}}return i}function G(e,t,n,o,r){let i=e.localName.toLowerCase();if(en.has(i)||!sn.test(i))return null;if(n>Jt)return t.truncated=!0,null;t.count+=1;let s={t:i},a=Ve(e),l=r||a||y(e),u=dn(e,l);if(u)s.a=u;if(N(e,t.probe)){let b=fn(e,t.probe);if(b)s.r=b}else s.h=1;let f=S(e),d=o&&!a&&!f&&!tn.has(i)&&!He(e),c=l||!d;if(i==="svg"){let b=Array.from(e.children).find((T)=>T.localName==="title"),h=b?G(b,t,n+1,d,c):null;if(h)s.c=[h];return s}if(i==="iframe"||i==="frame"){let b=null;try{b=e.contentDocument}catch{b=null}let h=b?.documentElement;if(h){let T=G(h,t,n+1,d,c);if(T)s.f=T}return s}let p=Pe(e,t,n,d,c);if(p.length>0)s.c=p;let m=e.shadowRoot;if(m){let b=Pe(m,t,n,d,c);if(b.length>0)s.s=b}return s}function mn(e){let t=e.querySelector("title");if(t&&y(t))return"";return j(e.title??"")}function Fe(e,t={}){let n={count:0,max:Math.max(1,t.maxNodes??Yt),truncated:!1,probe:t},o=G(e.documentElement,n,0,!0,!1)??{t:"html"},r=e.defaultView;return{snapshotVersion:Zt,url:ie(e.URL)??"",title:mn(e),viewport:{width:Math.round(r?.innerWidth??0),height:Math.round(r?.innerHeight??0)},root:o,nodeCount:n.count,truncated:n.truncated}}var se=65536,pn=65536,ze=new Set(["getText","getValue","getAttribute","exists"]),Xe=new Set(["click","doubleClick","hover","check"]);function bn(e){return e.ownerDocument.defaultView}var hn={left:0,middle:1,right:2},En={left:1,middle:4,right:2};function ae(e,t,n){let o=e.getBoundingClientRect();return{bubbles:!0,cancelable:!0,composed:!0,view:t,button:hn[n],buttons:0,clientX:o.x+o.width/2,clientY:o.y+o.height/2,pointerId:1,pointerType:"mouse",isPrimary:!0}}function Ke(e,t,n){let o=typeof t.PointerEvent==="function"?t.PointerEvent:t.MouseEvent,r=[];for(let s=e;s;s=B(s))r.unshift(s);let i={...n,bubbles:!1};e.dispatchEvent(new o("pointerover",n));for(let s of r)s.dispatchEvent(new o("pointerenter",i));e.dispatchEvent(new t.MouseEvent("mouseover",n));for(let s of r)s.dispatchEvent(new t.MouseEvent("mouseenter",i))}var gn='a[href], area[href], button, input, select, textarea, iframe, summary, [tabindex], [contenteditable]:not([contenteditable="false"])';function Tn(e,t){for(let o=e;o;o=B(o))if(o.matches(gn)&&w(o)&&o instanceof t.HTMLElement){o.focus();return}let n=e.ownerDocument.activeElement;if(n instanceof t.HTMLElement&&n!==e.ownerDocument.body)n.blur()}function xn(e,t,n,o,r){let i=typeof t.PointerEvent==="function"?t.PointerEvent:t.MouseEvent,s={...n,buttons:En[o],detail:r},a={...n,detail:r};Ke(e,t,n);let l=e.dispatchEvent(new i("pointerdown",s));if(l&&e.dispatchEvent(new t.MouseEvent("mousedown",s)))Tn(e,t);if(e.dispatchEvent(new i("pointerup",a)),l)e.dispatchEvent(new t.MouseEvent("mouseup",a))}function L(e,t,n,o=1){let r=ae(e,t,n);xn(e,t,r,n,o);let i=n==="left"?"click":n==="right"?"contextmenu":"auxclick";e.dispatchEvent(new t.MouseEvent(i,{...r,detail:o}))}function je(e,t){if(e instanceof t.HTMLTextAreaElement)return!0;if(!(e instanceof t.HTMLInputElement))return!1;return!["button","submit","reset","image","checkbox","radio","file","range","color","hidden"].includes(e.type)}function An(e,t,n){let o=e instanceof t.HTMLTextAreaElement?t.HTMLTextAreaElement.prototype:t.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(o,"value")?.set;if(r)r.call(e,n);else e.value=n;e.dispatchEvent(new t.Event("input",{bubbles:!0,composed:!0})),e.dispatchEvent(new t.Event("change",{bubbles:!0}))}function yn(e,t){if(!(e instanceof t.HTMLElement))return!1;if(e.isContentEditable)return!0;let n=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return n===""||n==="true"||n==="plaintext-only"}function Be(e,t,n,o){if(n.length>pn)return{ok:!1,problem:"INVALID_ACTION"};if(je(e,t)){if(e.readOnly)return{ok:!1,problem:"NOT_EDITABLE"};return e.focus(),An(e,t,o?`${e.value}${n}`:n),{ok:!0}}if(yn(e,t))return e.focus(),e.textContent=o?`${e.textContent??""}${n}`:n,e.dispatchEvent(new t.Event("input",{bubbles:!0,composed:!0})),{ok:!0};return{ok:!1,problem:"NOT_EDITABLE"}}function Sn(e){let t=e.getAttribute("label");return t!==null&&t.trim()!==""?t:e.textContent??""}function Mn(e,t,n){if(!(e instanceof t.HTMLSelectElement))return{ok:!1,problem:"NOT_SELECTABLE"};let o=Array.from(e.options),r=n.value!==void 0?o.find((i)=>i.value===n.value):n.label!==void 0?o.find((i)=>P(Sn(i),n.label)):n.index!==void 0?o[n.index]:void 0;if(!r||r.disabled||r.closest("optgroup")?.hasAttribute("disabled"))return{ok:!1,problem:"OPTION_NOT_FOUND"};return e.focus(),r.selected=!0,e.dispatchEvent(new t.Event("input",{bubbles:!0,composed:!0})),e.dispatchEvent(new t.Event("change",{bubbles:!0})),{ok:!0}}function Rn(e,t,n){if(e instanceof t.HTMLInputElement&&(e.type==="checkbox"||e.type==="radio")){if(e.checked!==n){if(e.type==="radio"&&!n)return{ok:!1,problem:"NOT_CHECKABLE"};L(e,t,"left")}return e.checked===n?{ok:!0}:{ok:!1,problem:"STATE_NOT_CHANGED"}}let o=e.getAttribute("role");if(o==="checkbox"||o==="switch"||o==="radio"||o==="menuitemcheckbox"){let r=()=>e.getAttribute("aria-checked")==="true";if(r()!==n)L(e,t,"left");return r()===n?{ok:!0}:{ok:!1,problem:"STATE_NOT_CHANGED"}}return{ok:!1,problem:"NOT_CHECKABLE"}}var kn=/^(?:[\s\S]|[A-Z][A-Za-z0-9]{1,23})$/u;function Nn(e,t){if(e instanceof t.HTMLButtonElement)return!0;if(e instanceof t.HTMLInputElement)return["submit","button","reset","image"].includes(e.type);let n=e.localName;return n==="a"&&e.hasAttribute("href")||n==="summary"}function wn(e,t){if(e instanceof t.HTMLButtonElement)return!0;if(e instanceof t.HTMLInputElement)return["submit","button","reset","image","checkbox","radio"].includes(e.type);return e.localName==="summary"}function le(e,t){e.dispatchEvent(new t.MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!0,view:t,detail:0}))}function Cn(e,t,n){if(!kn.test(n))return{ok:!1,problem:"INVALID_ACTION"};let o=n==="Space"?" ":n;if(e instanceof t.HTMLElement)e.focus();let r={key:o,bubbles:!0,cancelable:!0,composed:!0},i=e.dispatchEvent(new t.KeyboardEvent("keydown",r));if(o==="Enter"&&i){if(Nn(e,t))le(e,t);else if(e instanceof t.HTMLInputElement&&je(e,t)&&e.form)_n(e.form,t)}let s=e.dispatchEvent(new t.KeyboardEvent("keyup",r));if(o===" "&&i&&s&&wn(e,t))le(e,t);return{ok:!0}}var vn=new Set(["submit","image"]),Dn=new Set(["text","search","url","tel","email","password","date","month","week","time","datetime-local","number"]);function _n(e,t){let n=Array.from(e.elements),o=e.getRootNode(),r=Array.from(o.querySelectorAll("button, input")).find((s)=>(s instanceof t.HTMLButtonElement&&s.type==="submit"||s instanceof t.HTMLInputElement&&vn.has(s.type))&&s.form===e);if(r){if(w(r))le(r,t);return}if(n.filter((s)=>s instanceof t.HTMLInputElement&&Dn.has(s.type)).length===1)e.requestSubmit()}function On(e,t){if(e instanceof t.HTMLInputElement&&(e.type==="checkbox"||e.type==="radio"))return e.checked;if(e instanceof t.HTMLInputElement||e instanceof t.HTMLTextAreaElement||e instanceof t.HTMLSelectElement)return e.value.slice(0,se);let n=e.getAttribute("aria-checked");if(n==="true"||n==="false")return n==="true";return e.getAttribute("aria-valuenow")??e.getAttribute("aria-valuetext")}var In=/^[A-Za-z_][\w:.-]{0,127}$/;function $e(e,t){let n=bn(e);if(!n)return{ok:!1,problem:"INVALID_ACTION"};switch(t.kind){case"click":return L(e,n,t.button??"left"),{ok:!0};case"doubleClick":return L(e,n,"left",1),L(e,n,"left",2),e.dispatchEvent(new n.MouseEvent("dblclick",{...ae(e,n,"left"),detail:2})),{ok:!0};case"hover":{let o=ae(e,n,"left"),r=typeof n.PointerEvent==="function"?n.PointerEvent:n.MouseEvent;return Ke(e,n,o),e.dispatchEvent(new r("pointermove",o)),e.dispatchEvent(new n.MouseEvent("mousemove",o)),{ok:!0}}case"focus":if(e instanceof n.HTMLElement)e.focus();return{ok:!0};case"type":return typeof t.text==="string"?Be(e,n,t.text,t.append===!0):{ok:!1,problem:"INVALID_ACTION"};case"clear":return Be(e,n,"",!1);case"select":return Mn(e,n,t);case"check":return Rn(e,n,t.checked===!0);case"pressKey":return typeof t.key==="string"?Cn(e,n,t.key):{ok:!1,problem:"INVALID_ACTION"};case"scroll":return e.scrollBy?.({left:Number(t.dx??0)||0,top:Number(t.dy??0)||0}),{ok:!0};case"scrollIntoView":return e.scrollIntoView?.({block:"center",inline:"nearest"}),{ok:!0};case"getText":if(S(e))return{ok:!1,problem:"SENSITIVE_ELEMENT"};return{ok:!0,value:F(e).slice(0,se)};case"getValue":if(S(e))return{ok:!1,problem:"SENSITIVE_ELEMENT"};return{ok:!0,value:On(e,n)};case"getAttribute":{if(typeof t.name!=="string"||!In.test(t.name))return{ok:!1,problem:"INVALID_ACTION"};let o=t.name.toLowerCase();if(S(e))return{ok:!1,problem:"SENSITIVE_ELEMENT"};return{ok:!0,value:e.getAttribute(o)?.slice(0,se)??null}}case"exists":return{ok:!0,value:!0};default:return{ok:!1,problem:"INVALID_ACTION"}}}var qe=1,Ge="__burdenoffUiRuntime",Ln=60000,Wn="fg-ui-highlight",Un=new Set(["role","css","testId","xpath","fuzzy","anchor","text"]);function ue(e){if(!e||typeof e!=="object")return!1;let t=e;if(!Array.isArray(t.methods)||t.methods.length===0||t.methods.length>8)return!1;if(t.frame!==void 0&&!(Array.isArray(t.frame)&&t.frame.every((n)=>typeof n==="string")))return!1;return t.methods.every((n)=>!!n&&typeof n==="object"&&Un.has(String(n.kind)))}function ce(){return{status:"failed",code:"ELEMENT_NOT_FOUND",candidates:[],candidateCount:0,attempts:[]}}function de(e){return{status:e.status,method:e.method,methodIndex:e.methodIndex,fallback:e.fallback,candidate:e.candidate,attempts:e.attempts}}function Pn(e){try{return e.defaultView?.frameElement??null}catch{return null}}function Hn(e,t,n,o){let r=e.getRootNode();if(typeof r.elementFromPoint!=="function")return null;let i=r.elementFromPoint(t,n);if(!i)return"offscreen";if(i===e||e.contains(i))return null;return o.some((s)=>s.contains(i))?null:"covered"}function Vn(e,t){let n=t.x+t.width/2,o=t.y+t.height/2,r=Array.from(e.labels??[]),i=e;for(let s=0;s<32;s+=1){let a=Hn(i,n,o,s===0?r:[]);if(a)return a;let l=i.getRootNode();if(l&&"host"in l){i=l.host;continue}let u=Pn(i.ownerDocument);if(!u)return null;let f=u.getBoundingClientRect();n+=f.x+u.clientLeft,o+=f.y+u.clientTop,i=u}return null}function Fn(e,t){let n=e.ownerDocument.defaultView;if(!n)return!1;let o=t.x+t.width/2,r=t.y+t.height/2;return o<0||r<0||o>=n.innerWidth||r>=n.innerHeight}function Bn(e){let t=e.ownerDocument.defaultView;if(t&&t.getComputedStyle(e).pointerEvents==="none")return"noPointerEvents";let n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return null;if(Fn(e,n)&&typeof e.scrollIntoView==="function")e.scrollIntoView({block:"center",inline:"center"}),n=e.getBoundingClientRect();return Vn(e,n)}function zn(e,t={}){let n=t.root??e,o={...t.rectOf?{rectOf:t.rectOf}:{},...t.isVisible?{isVisible:t.isVisible}:{}},r=null,i=null,s=()=>{if(i!==null)clearTimeout(i),i=null;r?.remove(),r=null},a=(c,p)=>(s(),Ie(n,c,{...o,...p?{state:p}:{}})),l=(c,p={})=>{if(!ue(c))return ce();let m=a(c,p.state);return m.status==="found"?de(m):m},u=(c,p,m={})=>{if(!p||typeof p!=="object"||typeof p.kind!=="string")return{ok:!1,code:"INVALID_ACTION"};if(!ue(c))return{ok:!1,code:"ELEMENT_NOT_FOUND",resolution:ce()};let b=m.state??(ze.has(p.kind)?"visible":"interactable"),h=a(c,b);if(h.status!=="found"){if(p.kind==="exists"&&h.code==="ELEMENT_NOT_FOUND")return{ok:!0,value:!1,resolution:h};return{ok:!1,code:h.code,resolution:h}}let T=de(h),W=Xe.has(p.kind)?Bn(h.element):null;if(W)return{ok:!1,code:"ELEMENT_NOT_INTERACTABLE",reason:W,resolution:{status:"failed",code:"ELEMENT_NOT_INTERACTABLE",candidates:[h.candidate],candidateCount:1,attempts:h.attempts}};let M=$e(h.element,p);if(!M.ok)return{ok:!1,code:M.problem,resolution:T};return M.value===void 0?{ok:!0,resolution:T}:{ok:!0,resolution:T,value:M.value}},f=(c,p,m)=>{let b=e.createElement(Wn);b.setAttribute("aria-hidden","true"),b.setAttribute("style","all: initial; position: fixed; inset: 0; pointer-events: none; z-index: 2147483647;");let h=b.attachShadow({mode:"closed"});c.forEach((T,W)=>{let M=e.createElement("div");M.setAttribute("style",`position: fixed; left: ${T.bounds.x-3}px; top: ${T.bounds.y-3}px; width: ${T.bounds.width+6}px; height: ${T.bounds.height+6}px; outline: 3px solid Highlight; border-radius: 4px; box-sizing: border-box;`);let fe=m?`${W+1}${p?` ${p}`:""}`:p;if(fe){let q=e.createElement("span");q.textContent=fe.slice(0,120),q.setAttribute("style","position: absolute; left: 0; top: 100%; margin-top: 4px; padding: 2px 6px; font: 600 11px system-ui, sans-serif; background: Highlight; color: HighlightText; border-radius: 3px; white-space: nowrap;"),M.appendChild(q)}h.appendChild(M)}),e.documentElement.appendChild(b),r=b};return{version:qe,resolve:l,act:u,highlight:(c,p={})=>{if(!ue(c))return ce();let m=a(c,p.state??"visible");if(m.status==="found")f([m.candidate],p.label,!1);else if(m.candidates.length>0)f(m.candidates,p.label,!0);let b=Math.min(Ln,Math.max(0,Number(p.durationMs??0)||0));if(r&&b>0)i=setTimeout(s,b);return m.status==="found"?de(m):m},clearHighlight:s,snapshot:(c={})=>(s(),Fe(e,{...o,...c.maxNodes?{maxNodes:c.maxNodes}:{}}))}}function Ze(e,t){let n=Reflect.get(e,Ge);if(n&&typeof n==="object"&&typeof n.version==="number"&&n.version>=qe)return n;let o=Object.freeze(zn(t));return Object.defineProperty(e,Ge,{value:o,configurable:!0,enumerable:!1,writable:!1}),o}Ze(globalThis,globalThis.document);})();
1
+ (()=>{var H=["data-fg-sensitive","data-sensitive","data-private"];function Q(e){return H.some((t)=>e.hasAttribute(t))}function I(e){let t=e.assignedSlot;if(t!==void 0)return t;let n=e.parentElement?.shadowRoot;if(!n)return null;for(let o of Array.from(n.querySelectorAll("slot")))if((typeof o.assignedNodes==="function"?o.assignedNodes():[]).includes(e))return o;return null}function x(e){let t=I(e);if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();if(n&&"host"in n)return n.host;try{return e.ownerDocument.defaultView?.frameElement??null}catch{return null}}function k(e){for(let t=e;t;t=x(t))if(Q(t))return!0;return!1}var ge={button:"button",submit:"button",reset:"button",image:"button",checkbox:"checkbox",radio:"radio",range:"slider",number:"spinbutton",search:"searchbox",email:"textbox",tel:"textbox",text:"textbox",url:"textbox",password:"textbox",date:"textbox","datetime-local":"textbox",month:"textbox",time:"textbox",week:"textbox",color:"textbox",file:"button"},Te={article:"article",aside:"complementary",button:"button",datalist:"listbox",dd:"definition",details:"group",dialog:"dialog",dt:"term",fieldset:"group",figure:"figure",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",hr:"separator",li:"listitem",main:"main",menu:"list",meter:"meter",nav:"navigation",ol:"list",optgroup:"group",option:"option",output:"status",p:"paragraph",progress:"progressbar",summary:"button",table:"table",tbody:"rowgroup",td:"cell",textarea:"textbox",tfoot:"rowgroup",thead:"rowgroup",tr:"row",ul:"list"},xe=new Set(["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"]);var ee=256;function T(e){return(e??"").normalize("NFKC").replace(/\s+/g," ").trim().toLowerCase()}function V(e,t){return T(e)===T(t)}function Ae(e,t){let n=T(t);return n.length>0&&T(e).includes(n)}function rt(e,t){if(e===t)return 0;if(e.length===0)return t.length;if(t.length===0)return e.length;let n=Array.from({length:t.length+1},(o,r)=>r);for(let o=1;o<=e.length;o+=1){let r=[o];for(let i=1;i<=t.length;i+=1){let s=e[o-1]===t[i-1]?0:1;r[i]=Math.min((n[i]??0)+1,(r[i-1]??0)+1,(n[i-1]??0)+s)}n=r}return n[t.length]??0}function ye(e,t){let n=T(e).slice(0,256),o=T(t).slice(0,256),r=Math.max(n.length,o.length);if(r===0)return 0;return 1-rt(n,o)/r}function v(e,t){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}var ne=512,it=65536,st=new Set(["button","input","meter","output","progress","select","textarea"]),at=new Set(["script","style","noscript","template","head","title","meta","link"]);function M(e){return e.localName.toLowerCase()}function Se(e){return e.parentElement?.closest("article, aside, main, nav, section")!=null}function lt(e){let t=M(e);switch(t){case"a":case"area":return e.hasAttribute("href")?"link":"";case"input":{let n=(e.getAttribute("type")??"text").toLowerCase();if(n==="hidden")return"";if(e.hasAttribute("list")&&["text","search","email","tel","url"].includes(n))return"combobox";return ge[n]??"textbox"}case"select":{let n=Number(e.getAttribute("size")??"0");return e.hasAttribute("multiple")||n>1?"listbox":"combobox"}case"img":return e.getAttribute("alt")===""?"presentation":"img";case"th":return e.getAttribute("scope")==="row"?"rowheader":"columnheader";case"header":return Se(e)?"":"banner";case"footer":return Se(e)?"":"contentinfo";case"section":case"form":return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?t==="form"?"form":"region":"";default:return Te[t]??""}}function A(e){let t=e.getAttribute("role")?.trim().split(/\s+/)[0];return t?t.toLowerCase():lt(e)}function ut(e,t){let n=e.getRootNode();return typeof n.getElementById==="function"?n.getElementById(t):null}function ct(e){return e.hasAttribute("hidden")||e.getAttribute("aria-hidden")==="true"}function dt(e){let t=e.ownerDocument.defaultView;if(!t)return"none";let n=t.getComputedStyle(e);if(n.display==="none")return"subtree";return n.visibility==="hidden"||n.visibility==="collapse"?"self":"none"}function W(e){let t=e.getAttribute("contenteditable");if(t===null)return!1;let n=t.trim().toLowerCase();return n===""||n==="true"||n==="plaintext-only"}function ft(e){if(e.shadowRoot)return Array.from(e.shadowRoot.childNodes);if(M(e)==="slot"){let t=e,n=typeof t.assignedNodes==="function"?t.assignedNodes({flatten:!0}):[];if(n.length>0)return n}return Array.from(e.childNodes)}var mt=/^(div|p|li|tr|td|th|br|h[1-6]|section|article|header|footer)$/;function L(e,t){if(e.remaining<=0||t.length===0)return;let n=t.slice(0,e.remaining);e.parts.push(n),e.remaining-=n.length}function Me(e,t,n,o,r,i=!1){if(t>32||n.remaining<=0)return;if(e.nodeType===3){if(!i)L(n,e.textContent??"");return}if(e.nodeType!==1)return;let s=e,a=M(s);if(at.has(a)||Q(s))return;if(!r&&ct(s))return;let l=!1;if(t>0&&!r){let d=o?.isVisible?.(s);if(d===!1)l=!0;else if(d===void 0){let c=dt(s);if(c==="subtree")return;l=c==="self"}}let u=s.getAttribute("aria-label")?.trim();if(u&&t>0&&!l){L(n,` ${u} `);return}if(a==="img"||a==="input"&&s.getAttribute("type")==="image"){if(!l)L(n,` ${s.getAttribute("alt")??""} `);return}if(a==="input"||a==="textarea"||a==="select")return;if(t>0&&W(s))return;let f=t>0&&mt.test(a);if(f)L(n," ");for(let d of ft(s))Me(d,t+1,n,o,r,l);if(f)L(n," ")}function F(e){if(M(e)==="textarea"||W(e))return!0;for(let n=x(e);n;n=x(n))if(M(n)==="textarea"||W(n))return!0;return!1}function Re(e){for(let t=x(e);t;t=x(t)){let n=M(t);if(n==="textarea"||n==="select"||W(t))return!0}return!1}function B(e,t,n=!1){let o=M(e);if(o==="textarea"||o==="select"||W(e)||Re(e)||k(e))return"";return E(e.getAttribute("aria-label")??"")||X(e,t,ne,n)}function X(e,t,n=ne,o=!1){if(e.nodeType===1&&k(e))return"";let r={parts:[],remaining:n*2+64};return Me(e,0,r,t,o),E(r.parts.join(""),n)}function E(e,t=ne){return e.replace(/\s+/g," ").trim().slice(0,t)}function pt(e,t){let n=[],o=e.getAttribute("id");if(o){let i=e.getRootNode();for(let s of Array.from(i.querySelectorAll("label")))if(s.getAttribute("for")===o)n.push(B(s,t,!0))}let r=e.closest("label");if(r&&!r.hasAttribute("for"))n.push(B(r,t,!0));return E(n.join(" "))}function te(e,t,n){let o=Array.from(e.children).find((r)=>M(r)===t);return o?B(o,n):""}function R(e,t){return Ne(e,t,!0)}function ke(e,t){return Ne(e,t,!1)}function ht(e,t){let n=Array.from(e.children).find((o)=>M(o)==="title");if(!n||k(n)||Re(n))return"";return E(Array.from(n.childNodes).map((o)=>X(o,t)).join(" "))}function Ne(e,t,n){let o=e.getAttribute("aria-labelledby");if(o){let l=o.split(/\s+/).filter(Boolean).map((u)=>ut(e,u)).filter((u)=>u!==null).map((u)=>B(u,t,!0)).join(" ");if(E(l))return E(l)}let r=e.getAttribute("aria-label");if(r&&E(r))return E(r);let i=M(e);if(st.has(i)){let l=pt(e,t);if(l)return l}if(i==="input"){let l=(e.getAttribute("type")??"text").toLowerCase();if(l==="button"||l==="submit"||l==="reset"){let u=e.getAttribute("value");if(u!==null)return E(u);return l==="submit"?"Submit":l==="reset"?"Reset":""}if(l==="image")return E(e.getAttribute("alt")??"")}if(i==="img"||i==="area"){let l=e.getAttribute("alt");if(l)return E(l)}if(i==="svg"){let l=ht(e,t);if(l)return l}if(i==="fieldset"){let l=te(e,"legend",t);if(l)return l}if(i==="table"){let l=te(e,"caption",t);if(l)return l}if(i==="option"){let l=E(e.getAttribute("label")??"");if(l)return l}if(i==="figure"){let l=te(e,"figcaption",t);if(l)return l}if(n&&xe.has(A(e))){let l=X(e,t);if(l)return l}let s=e.getAttribute("title");if(s&&E(s))return E(s);let a=e.getAttribute("placeholder");if(a&&E(a))return E(a);return""}function O(e,t){if(M(e)==="input"){let o=(e.getAttribute("type")??"text").toLowerCase();return o==="button"||o==="submit"||o==="reset"?R(e,t):""}return X(e,t,it)}function oe(e,t,n,o){return A(e)===t.trim().toLowerCase()&&T(R(e,o))===T(n)}function bt(e){return e.ownerDocument.defaultView}function z(e){let t=I(e);if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return n&&"host"in n?n.host:null}function N(e,t){let n=t?.isVisible?.(e);if(n!==void 0)return n;if(!e.isConnected)return!1;let o=bt(e),r=e;while(r){if(r.hasAttribute("hidden"))return!1;if(r.localName==="input"&&r.getAttribute("type")?.toLowerCase()==="hidden")return!1;if(o&&o.getComputedStyle(r).display==="none")return!1;r=z(r)}if(o){let s=o.getComputedStyle(e);if(s.visibility==="hidden"||s.visibility==="collapse")return!1;if(s.display==="contents")return!0}let i=e.checkVisibility;return typeof i==="function"?i.call(e):!0}function C(e){for(let n=e;n;n=x(n))if(n.getAttribute("aria-disabled")==="true"||n.hasAttribute("inert"))return!1;if(!Et.has(e.localName)){let n=e.parentElement?.closest("button, select, option, optgroup, textarea");return n?C(n):!0}if(e.hasAttribute("disabled"))return!1;let t=e.parentElement?.closest("fieldset[disabled]");if(t){if(!Array.from(t.children).find((o)=>o.localName==="legend")?.contains(e))return!1}try{return!e.matches(":disabled")}catch{return!0}}var Et=new Set(["button","input","select","textarea","optgroup","option","fieldset"]);function D(e,t,n){let r=t?.rectOf?.(e)??e.getBoundingClientRect();return{x:Math.round(r.x+(n?.x??0)),y:Math.round(r.y+(n?.y??0)),width:Math.round(r.width),height:Math.round(r.height)}}function w(e){let t=Array.from(e.querySelectorAll("*"));return e.nodeType===1?[e,...t]:t}var gt=/password|passcode|passwd|\bpin\b|otp|one[\s-]?time|verification|security code|auth(?:entication)? code|\bcvv\b|\bcvc\b|card number|secret|token|recovery/i,Tt=/password|one-time-code|^cc-/i;function xt(e){return gt.test(e)}function y(e){if(k(e))return!0;if(Ce(e))return!0;for(let t=x(e);t;t=x(t))if(Ce(t))return!0;return!1}function Ce(e){let t=e.localName,n=e.getAttribute("contenteditable"),o=n!==null&&n.trim().toLowerCase()!=="false";if(t!=="input"&&t!=="textarea"&&t!=="select"&&!o)return!1;if(e.getAttribute("type")?.toLowerCase()==="password")return!0;if((e.getAttribute("autocomplete")??"").trim().split(/\s+/).filter(Boolean).some((i)=>Tt.test(i)))return!0;return At(e).some((i)=>i.length>0&&xt(i.replace(/[-_]/g," ")))}function At(e){let t=(a)=>(a??"").slice(0,512),n=[R(e),t(e.getAttribute("aria-label")),t(e.getAttribute("placeholder")),t(e.getAttribute("title")),t(e.getAttribute("name")),t(e.getAttribute("id"))],o=e.getRootNode(),r=(a)=>typeof o.getElementById==="function"?o.getElementById(a):null;for(let a of(e.getAttribute("aria-labelledby")??"").split(/\s+/).filter(Boolean)){let l=r(a);if(l)n.push(t(l.getAttribute("aria-label")),t(l.textContent))}let i=e.getAttribute("id"),s=Array.from(o.querySelectorAll("label")).filter((a)=>i!==null&&a.getAttribute("for")===i||!a.hasAttribute("for")&&a.contains(e));for(let a of s)n.push(t(a.getAttribute("aria-label")),t(a.textContent));return n}var yt=0.8,St=0.05,Mt=4,we=1000,K=2,Rt=new Set(["button","checkbox","combobox","link","listbox","menuitem","menuitemcheckbox","menuitemradio","option","radio","searchbox","slider","spinbutton","switch","tab","textbox","treeitem"]),kt=/^[A-Za-z_][\w:.-]{0,127}$/;function Nt(e){return e.nodeType===9?e:e.ownerDocument}function Ct(e,t){return{kind:"list",elements:w(t.root).filter((o)=>oe(o,e.role,e.name,t.probe)),...e.nth!==void 0?{nth:e.nth}:{}}}function wt(e,t){try{return{kind:"list",elements:Array.from(t.root.querySelectorAll(e))}}catch{return{kind:"invalid"}}}function _t(e,t){let n=e.attribute??"data-testid";if(!kt.test(n))return{kind:"invalid"};return{kind:"list",elements:w(t.root).filter((r)=>r.getAttribute(n)===e.value)}}function vt(e,t){if(e.nodeType===9)return t.ownerDocument===e&&t.getRootNode()===e;return e===t||e.contains(t)}function Ot(e,t){let n=Nt(t.root);if(typeof n.evaluate!=="function")return{kind:"unsupported"};let o;try{o=n.evaluate(e.xpath,t.root,null,7,null)}catch{return{kind:"invalid"}}let r=[],i=Math.min(o.snapshotLength,we);for(let s=0;s<i;s+=1){let a=o.snapshotItem(s);if(a&&a.nodeType===1&&vt(t.root,a))r.push(a)}return{kind:"list",elements:r,...o.snapshotLength>we?{overflow:!0}:{}}}function Dt(e,t,n){let o=Math.min(T(e).length,ee),r=Math.max(o,t);return r>0&&Math.abs(o-t)<=(1-n)*r}function It(e,t){let n=Math.min(1,Math.max(0.5,e.threshold??yt)),o=e.role?.trim().toLowerCase(),r=Math.min(T(e.name).length,ee),i=[];for(let s of w(t.root)){let a=A(s);if(o?a!==o:a==="")continue;let l=R(s,t.probe);if(!Dt(l,r,n))continue;let u=ye(l,e.name);if(u>=n)i.push({element:s,score:u})}return{kind:"ranked",scored:i,margin:St}}function Oe(e,t){let n=w(e.root).filter((i)=>t(O(i,e.probe))),o=e.keep??(()=>!0),r=n.filter(o);return n.filter((i)=>!r.some((s)=>s!==i&&i.contains(s)))}function Lt(e,t){let n=e.exact?(o)=>V(o,e.text):(o)=>Ae(o,e.text);if(T(e.text).length===0)return{kind:"list",elements:[]};return{kind:"list",elements:Oe(t,n),...e.nth!==void 0?{nth:e.nth}:{}}}function re(e){return T(e).replace(/[\s:*]+$/u,"")}function Wt(e,t){return(e.kind==="role"?w(t.root).filter((o)=>oe(o,e.role,e.name,t.probe)):Oe(t,(o)=>re(o)===re(e.text)&&re(o)!=="")).filter((o)=>N(o,t.probe))}function De(e,t,n){let o=e.role?.trim().toLowerCase();return w(t.root).filter((r)=>{let i=A(r);if(o?i!==o:!Rt.has(i))return!1;return!n.some((s)=>s===r||r.contains(s))})}var Ut=new Set(["h1","h2","h3","h4","h5","h6","legend","caption","figcaption","summary","dt"]);function ie(e){return Ut.has(e.localName)||A(e)==="heading"}function Pt(e){for(let t=e;t;t=t.parentElement)if(ie(t))return t;return null}function Ht(e,t,n){let o=De(e,t,n),r=new Set;for(let i of n){let a=Pt(i)?.parentElement??i;for(let l of o)if(a.contains(l))r.add(l)}return{kind:"list",elements:o.filter((i)=>r.has(i))}}function _e(e,t,n,o){return e<o&&n<t}function Vt(e,t,n){let o=t.x+t.width,r=t.y+t.height,i=n.x+n.width,s=n.y+n.height,a=_e(t.y,r,n.y,s),l=_e(t.x,o,n.x,i);switch(e){case"rightOf":return a&&n.x>=o-K?Math.max(0,n.x-o):null;case"leftOf":return a&&i<=t.x+K?Math.max(0,t.x-i):null;case"below":return l&&n.y>=r-K?Math.max(0,n.y-r):null;case"above":return l&&s<=t.y+K?Math.max(0,t.y-s):null;case"sameRow":return a?Math.abs(n.x+n.width/2-(t.x+t.width/2)):null;default:return null}}function ve(e){return e.width>0&&e.height>0}function Bt(e,t){let n=Wt(e.anchor,t);if(n.length===0)return{kind:"list",elements:[]};if(e.relation==="inside")return Ht(e,t,n);let o=n.map((i)=>D(i,t.probe)).filter(ve);if(o.length===0)return{kind:"unsupported"};let r=[];for(let i of De(e,t,n)){let s=D(i,t.probe);if(!ve(s))continue;let a=null;for(let l of o){let u=Vt(e.relation,l,s);if(u!==null&&(a===null||u<a))a=u}if(a!==null)r.push({element:i,score:-a})}return{kind:"ranked",scored:r,margin:Mt}}function j(e,t){switch(e.kind){case"role":return Ct(e,t);case"css":return wt(e.selector,t);case"testId":return _t(e,t);case"xpath":return Ot(e,t);case"fuzzy":return It(e,t);case"anchor":return Bt(e,t);case"text":return Lt(e,t);default:return{kind:"unsupported"}}}var Ie=5,G=200;var Ft=12,Xt=3,zt=8,Kt=25,jt=5000,Gt=new Set(["alertdialog","article","banner","complementary","contentinfo","dialog","figure","form","grid","group","list","listitem","main","menu","menubar","navigation","radiogroup","region","row","search","tablist","table","tabpanel","toolbar","tree","treegrid"]);function $t(){return typeof performance>"u"?Date.now():performance.now()}function se(e=$t){return{answers:new Map,checksLeft:zt,now:e,deadline:e()+Kt}}function qt(e){return e.replace(/\s+/g," ").trim()}function Zt(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n<32||n>=127&&n<=159)return!0}return!1}function Le(e){let t=qt(e);return t.length>0&&t.length<=G&&!Zt(t)?t:void 0}function We(e){return y(e)||F(e)}function Yt(e,t){for(let n of Array.from(e.children))if(ie(n)&&!We(n)&&N(n,t))return n;return}function*Jt(e,t){if(We(e))return;let n=A(e),o=Gt.has(n)?Le(R(e,t)):void 0;if(o)yield{anchor:{kind:"role",role:n,name:o},role:n};let r=Yt(e,t);if(!r)return;let i=A(r)==="heading",s=Le(i?R(r,t):O(r,t));if(!s)return;yield{anchor:i?{kind:"role",role:"heading",name:s}:{kind:"text",text:s},role:n}}function Qt(e,t){return JSON.stringify([e,t])}function en(e,t,n,o,r){let s=j({kind:"anchor",anchor:e,relation:"inside",role:t},{root:n,keep:o,...r?{probe:r}:{}});return s.kind==="list"?s.elements.filter(o):[]}function tn(e,t){return e.nodeType!==1||e===t||e.contains(t)}function Ue(e,t,n,o,r=se()){let i=A(e);if(i===""||y(e))return;let s=0,a=0;for(let l=e.parentElement;l&&a<Ft&&tn(t,l);l=l.parentElement){a+=1;for(let u of Jt(l,o)){let f=Qt(u.anchor,i),d=r.answers.get(f);if(!d){if(r.now()>=r.deadline)return;if(s>=Xt||r.checksLeft<=0)continue;s+=1,r.checksLeft-=1,d=en(u.anchor,i,t,n,o),r.answers.set(f,d)}if(d.length===1&&d[0]===e)return u}}return}function Pe(e){return e.querySelectorAll("*").length<=jt}var nn={x:0,y:0,width:0,height:0};function on(e,t,n){let o={root:e,offset:nn,hidden:!1,disabled:!1};for(let[r,i]of(t??[]).entries()){let s;try{s=Array.from(o.root.querySelectorAll(i))}catch{return{index:r,reason:"invalid"}}if(s.length===0)return{index:r,reason:"notFound"};if(s.length>1)return{index:r,reason:"ambiguous"};let a=s[0],l=a.localName;if(l==="iframe"||l==="frame"){let u=a,f=null;try{f=u.contentDocument}catch{f=null}if(!f)return{index:r,reason:"inaccessible"};let d=D(a,n,o.offset);o={root:f,offset:{x:d.x+u.clientLeft,y:d.y+u.clientTop,width:0,height:0},hidden:o.hidden||!N(a,n),disabled:o.disabled||!C(a)}}else if(a.shadowRoot)o={root:a.shadowRoot,offset:o.offset,hidden:o.hidden,disabled:o.disabled};else return{index:r,reason:"notAFrame"}}return o}function He(e,t,n,o){if(t==="attached")return!0;if(n.hidden||!N(e,o))return!1;return t==="visible"||!n.disabled&&C(e)}function Ve(e,t,n,o,r){return{role:A(e),name:y(e)?"":v(F(e)?ke(e,r):R(e,r),G),bounds:D(e,r,o),method:t.kind,methodIndex:n}}function rn(e,t,n,o=!1){if(t.length===0)return e.length>0?{outcome:"notInteractable",elements:e,matches:0}:{outcome:"none",elements:[],matches:0};if(o)return{outcome:"ambiguous",elements:t,matches:t.length};if(n!==void 0){let r=t[n];return r?{outcome:"found",element:r,matches:t.length}:{outcome:"none",elements:[],matches:t.length}}return t.length===1?{outcome:"found",element:t[0],matches:1}:{outcome:"ambiguous",elements:t,matches:t.length}}function sn(e,t,n){if(t.length===0)return e.length>0?{outcome:"notInteractable",elements:e.map((a)=>a.element),matches:0}:{outcome:"none",elements:[],matches:0};let o=[...t].sort((a,l)=>l.score-a.score),r=o[0],i=o[1];if(!i||r.score-i.score>=n)return{outcome:"found",element:r.element,matches:t.length};let s=o.filter((a)=>r.score-a.score<n).map((a)=>a.element);return{outcome:"ambiguous",elements:s,matches:s.length}}function an(e,t){switch(e.kind){case"invalid":case"unsupported":return e.kind;case"list":return rn(e.elements,e.elements.filter(t),e.nth,e.overflow);case"ranked":return sn(e.scored,e.scored.filter((n)=>t(n.element)),e.margin)}}function U(e,t,n=[],o=0,r){return{status:"failed",code:e,candidates:n,candidateCount:o,attempts:t,...r?{frame:r}:{}}}function Be(e,t,n={}){let o=n.state??"interactable",r=on(e,t.frame,n);if(!("root"in r)){let d=t.methods.map((c,p)=>({index:p,method:c.kind,outcome:"notTried",matches:0}));return U("ELEMENT_NOT_FOUND",d,[],0,r)}let i=[],s=t.methods.findIndex((d)=>d.enabled!==!1),a,l,u;for(let[d,c]of t.methods.entries()){if(u){i.push({index:d,method:c.kind,outcome:"notTried",matches:0});continue}if(c.enabled===!1){i.push({index:d,method:c.kind,outcome:"disabled",matches:0});continue}let p=(h)=>He(h,o,r,n),m=an(j(c,{root:r.root,probe:n,keep:p}),p);if(m==="invalid"||m==="unsupported"){i.push({index:d,method:c.kind,outcome:m,matches:0});continue}if(i.push({index:d,method:c.kind,outcome:m.outcome,matches:m.matches}),m.outcome==="found")u={element:m.element,method:c,index:d};else if(m.outcome==="ambiguous"&&!a)a={elements:m.elements,method:c,index:d,count:m.matches};else if(m.outcome==="notInteractable"&&!l)l={elements:m.elements,method:c,index:d}}if(u)return{status:"found",element:u.element,method:u.method.kind,methodIndex:u.index,fallback:u.index!==s,candidate:Ve(u.element,u.method,u.index,r.offset,n),attempts:i};let f=(d)=>d.elements.slice(0,Ie).map((c)=>Ve(c,d.method,d.index,r.offset,n));if(a){let d=(b)=>He(b,o,r,n),c=f(a);if(!Pe(r.root))return U("ELEMENT_AMBIGUOUS",i,c,a.count);let p=se(),{elements:m}=a,h=c.map((b,g)=>{let _=m[g],S=Ue(_,r.root,d,n,p);return S?{...b,container:S}:b});return U("ELEMENT_AMBIGUOUS",i,h,a.count)}if(l)return U("ELEMENT_NOT_INTERACTABLE",i,f(l),l.elements.length);return U("ELEMENT_NOT_FOUND",i)}var ae="[REDACTED]",ln=[/\b(?:Bearer|Basic)\s+[^\s"'`,;)\]}]+/gi,/\b(?:sk|pk|rk|xai)-[^\s"'`,;)\]}]+/gi,/\b(?:gsk|hf|ghp|gho|ghs|ghu|glpat)_[^\s"'`,;)\]}]+/gi,/\bAIza[\w-]{10,}/g,/\b(?:AKIA|ASIA)[0-9A-Z]{12,}/g],un=/([\s"'`,;:=()[\]{}]+)/,cn=/^(?:api[_-]?key|access[_-]?key|secret|secret[_-]?key|client[_-]?secret|token|password)$/i;function dn(e){let t=e.indexOf("…");return e.includes("***")||t!==-1&&t<e.length-1}function fn(e){let t=e.split(un);for(let n=0;n<t.length;n+=2){let o=t[n]??"";if(o&&o!=="[REDACTED]"&&dn(o))t[n]="[REDACTED]";let r=t[n+1]??"";if(t[n+2]&&cn.test(o)&&/[:=]/.test(r))t[n+2]="[REDACTED]"}return t.join("")}function le(e){if(!e)return e;let t=e;for(let n of ln)t=t.replace(n,"[REDACTED]");return t=fn(t),t.replace(/(?:\[REDACTED\]){2,}/g,"[REDACTED]")}var Fe="";function q(e){if(!e)return!1;let t=e.replaceAll("[REDACTED]",Fe);return le(t).replaceAll(Fe,"[REDACTED]")!==e}function ue(e){try{return decodeURIComponent(e.replaceAll("+"," "))}catch{return e}}function Xe(e){return q(ue(e).replace(/[/?&#]/g," "))}var mn=500,ze=/reset|recover|verify|verification|magic|confirm|activate|invite|unsubscribe/i;function pn(e){let t=e;for(let n=0;n<3;n+=1){let o=ue(t);if(o===t)break;t=o}return t}function hn(e){let t=e.split(/[/?#;]/),n=t.findIndex((r)=>ze.test(r));return t.slice(0,n+1).map((r)=>q(r)?ae:r).join("/")}function ce(e){let t=e.trim();if(t==="")return null;let n=/^[a-z][a-z0-9+.-]*:/i.test(t)||t.startsWith("//"),o="",r;if(n){let f;try{f=new URL(t.startsWith("//")?`https:${t}`:t)}catch{return null}if(f.protocol!=="http:"&&f.protocol!=="https:")return null;o=t.startsWith("//")?`//${f.host}`:f.origin,r=f.pathname}else r=t.split(/[?#]/)[0]??"";let i=r.split("/"),s=i.map(pn),a=s.findIndex((f)=>ze.test(f)),u=(a>=0?i.slice(0,a+1):i).map((f,d)=>{let c=s[d]??f;if(d===a)return hn(c);return q(c)||Xe(f)?ae:f}).join("/");return v(`${o}${u}`,mn)}var bn=1,En=5000,gn=64,Tn=500,xn=new Set(["script","style","noscript","template","link","meta","base","head","object","embed"]),An=new Set(["textarea"]),yn=new Set(["id","class","role","name","type","for","title","alt","placeholder","label","autocomplete","tabindex","disabled","readonly","hidden","inert","contenteditable","list","multiple","size","scope","slot","part","lang","dir","data-testid","data-test","data-test-id","data-qa","data-cy","data-automation-id",...H]),Sn=new Set(["aria-valuenow","aria-valuetext","aria-checked","aria-selected","aria-pressed"]),Mn=new Set(["button","submit","reset"]),Rn=/^[a-z][a-z0-9-]{0,63}$/;var kn=/^[a-z][a-z0-9_:.-]{0,127}$/;function je(e){let t=e.getAttribute("contenteditable");return t!==null&&t.trim().toLowerCase()!=="false"}function Ge(e){for(let t=x(e);t;t=x(t))if(t.localName==="textarea"||je(t))return!0;return!1}function Nn(e){if(!e.parentElement?.shadowRoot)return!1;let t=I(e);return t!==null&&(y(t)||Ge(t))}function Z(e){return v(le(e),Tn)}var Cn=new Set(["alt","label","title","placeholder","value","aria-label","aria-description","aria-roledescription","aria-placeholder"]),wn=new Set(["aria-hidden","aria-disabled","aria-expanded","aria-haspopup","aria-controls","aria-owns","aria-labelledby","aria-describedby","aria-level","aria-current","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-readonly","aria-required","aria-invalid","aria-busy","aria-live","aria-atomic","aria-posinset","aria-setsize","aria-colcount","aria-colindex","aria-colspan","aria-rowcount","aria-rowindex","aria-rowspan","aria-sort"]);function _n(e,t){let n={},o=e.localName;for(let r of Array.from(e.attributes)){let i=r.name.toLowerCase();if(i.startsWith("on")||!kn.test(i))continue;if(t&&(Cn.has(i)||i==="href"||i.startsWith("aria-")&&!wn.has(i)))continue;if(yn.has(i)||i.startsWith("aria-")&&!Sn.has(i))n[i]=Z(r.value);else if(i==="href"&&(o==="a"||o==="area")){let s=ce(r.value);if(s!==null)n[i]=s}else if(i==="value"&&o==="input"&&Mn.has((e.getAttribute("type")??"").toLowerCase()))n[i]=Z(r.value)}return Object.keys(n).length>0?n:void 0}function vn(e,t){let n=t?.rectOf?.(e)??e.getBoundingClientRect(),o=[Math.round(n.x),Math.round(n.y),Math.round(n.width),Math.round(n.height)];return o[2]>0||o[3]>0?o:void 0}function Ke(e,t,n,o,r){let i=[];for(let s of Array.from(e.childNodes)){if(t.count>=t.max){t.truncated=!0;break}if(s.nodeType===3){if(!o||Nn(s))continue;let a=s.textContent??"";if(a.length===0)continue;let l=a.trim()===""?" ":Z(a);t.count+=1,i.push(l)}else if(s.nodeType===1){let a=Y(s,t,n+1,o,r);if(a)i.push(a)}}return i}function Y(e,t,n,o,r){let i=e.localName.toLowerCase();if(xn.has(i)||!Rn.test(i))return null;if(n>gn)return t.truncated=!0,null;t.count+=1;let s={t:i},a=Ge(e),l=r||a||k(e),u=_n(e,l);if(u)s.a=u;if(N(e,t.probe)){let h=vn(e,t.probe);if(h)s.r=h}else s.h=1;let f=y(e),d=o&&!a&&!f&&!An.has(i)&&!je(e),c=l||!d;if(i==="svg"){let h=Array.from(e.children).find((g)=>g.localName==="title"),b=h?Y(h,t,n+1,d,c):null;if(b)s.c=[b];return s}if(i==="iframe"||i==="frame"){let h=null;try{h=e.contentDocument}catch{h=null}let b=h?.documentElement;if(b){let g=Y(b,t,n+1,d,c);if(g)s.f=g}return s}let p=Ke(e,t,n,d,c);if(p.length>0)s.c=p;let m=e.shadowRoot;if(m){let h=Ke(m,t,n,d,c);if(h.length>0)s.s=h}return s}function On(e){let t=e.querySelector("title");if(t&&k(t))return"";return Z(e.title??"")}function $e(e,t={}){let n={count:0,max:Math.max(1,t.maxNodes??En),truncated:!1,probe:t},o=Y(e.documentElement,n,0,!0,!1)??{t:"html"},r=e.defaultView;return{snapshotVersion:bn,url:ce(e.URL)??"",title:On(e),viewport:{width:Math.round(r?.innerWidth??0),height:Math.round(r?.innerHeight??0)},root:o,nodeCount:n.count,truncated:n.truncated}}var de=65536,Dn=65536,Ze=new Set(["getText","getValue","getAttribute","exists"]),Ye=new Set(["click","doubleClick","hover","check"]);function In(e){return e.ownerDocument.defaultView}var Ln={left:0,middle:1,right:2},Wn={left:1,middle:4,right:2};function fe(e,t,n){let o=e.getBoundingClientRect();return{bubbles:!0,cancelable:!0,composed:!0,view:t,button:Ln[n],buttons:0,clientX:o.x+o.width/2,clientY:o.y+o.height/2,pointerId:1,pointerType:"mouse",isPrimary:!0}}function Je(e,t,n){let o=typeof t.PointerEvent==="function"?t.PointerEvent:t.MouseEvent,r=[];for(let s=e;s;s=z(s))r.unshift(s);let i={...n,bubbles:!1};e.dispatchEvent(new o("pointerover",n));for(let s of r)s.dispatchEvent(new o("pointerenter",i));e.dispatchEvent(new t.MouseEvent("mouseover",n));for(let s of r)s.dispatchEvent(new t.MouseEvent("mouseenter",i))}var Un='a[href], area[href], button, input, select, textarea, iframe, summary, [tabindex], [contenteditable]:not([contenteditable="false"])';function Pn(e,t){for(let o=e;o;o=z(o))if(o.matches(Un)&&C(o)&&o instanceof t.HTMLElement){o.focus();return}let n=e.ownerDocument.activeElement;if(n instanceof t.HTMLElement&&n!==e.ownerDocument.body)n.blur()}function Hn(e,t,n,o,r){let i=typeof t.PointerEvent==="function"?t.PointerEvent:t.MouseEvent,s={...n,buttons:Wn[o],detail:r},a={...n,detail:r};Je(e,t,n);let l=e.dispatchEvent(new i("pointerdown",s));if(l&&e.dispatchEvent(new t.MouseEvent("mousedown",s)))Pn(e,t);if(e.dispatchEvent(new i("pointerup",a)),l)e.dispatchEvent(new t.MouseEvent("mouseup",a))}function P(e,t,n,o=1){let r=fe(e,t,n);Hn(e,t,r,n,o);let i=n==="left"?"click":n==="right"?"contextmenu":"auxclick";e.dispatchEvent(new t.MouseEvent(i,{...r,detail:o}))}function Qe(e,t){if(e instanceof t.HTMLTextAreaElement)return!0;if(!(e instanceof t.HTMLInputElement))return!1;return!["button","submit","reset","image","checkbox","radio","file","range","color","hidden"].includes(e.type)}function Vn(e,t,n){let o=e instanceof t.HTMLTextAreaElement?t.HTMLTextAreaElement.prototype:t.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(o,"value")?.set;if(r)r.call(e,n);else e.value=n;e.dispatchEvent(new t.Event("input",{bubbles:!0,composed:!0})),e.dispatchEvent(new t.Event("change",{bubbles:!0}))}function Bn(e,t){if(!(e instanceof t.HTMLElement))return!1;if(e.isContentEditable)return!0;let n=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return n===""||n==="true"||n==="plaintext-only"}function qe(e,t,n,o){if(n.length>Dn)return{ok:!1,problem:"INVALID_ACTION"};if(Qe(e,t)){if(e.readOnly)return{ok:!1,problem:"NOT_EDITABLE"};return e.focus(),Vn(e,t,o?`${e.value}${n}`:n),{ok:!0}}if(Bn(e,t))return e.focus(),e.textContent=o?`${e.textContent??""}${n}`:n,e.dispatchEvent(new t.Event("input",{bubbles:!0,composed:!0})),{ok:!0};return{ok:!1,problem:"NOT_EDITABLE"}}function Fn(e){let t=e.getAttribute("label");return t!==null&&t.trim()!==""?t:e.textContent??""}function Xn(e,t,n){if(!(e instanceof t.HTMLSelectElement))return{ok:!1,problem:"NOT_SELECTABLE"};let o=Array.from(e.options),r=n.value!==void 0?o.find((i)=>i.value===n.value):n.label!==void 0?o.find((i)=>V(Fn(i),n.label)):n.index!==void 0?o[n.index]:void 0;if(!r||r.disabled||r.closest("optgroup")?.hasAttribute("disabled"))return{ok:!1,problem:"OPTION_NOT_FOUND"};return e.focus(),r.selected=!0,e.dispatchEvent(new t.Event("input",{bubbles:!0,composed:!0})),e.dispatchEvent(new t.Event("change",{bubbles:!0})),{ok:!0}}function zn(e,t,n){if(e instanceof t.HTMLInputElement&&(e.type==="checkbox"||e.type==="radio")){if(e.checked!==n){if(e.type==="radio"&&!n)return{ok:!1,problem:"NOT_CHECKABLE"};P(e,t,"left")}return e.checked===n?{ok:!0}:{ok:!1,problem:"STATE_NOT_CHANGED"}}let o=e.getAttribute("role");if(o==="checkbox"||o==="switch"||o==="radio"||o==="menuitemcheckbox"){let r=()=>e.getAttribute("aria-checked")==="true";if(r()!==n)P(e,t,"left");return r()===n?{ok:!0}:{ok:!1,problem:"STATE_NOT_CHANGED"}}return{ok:!1,problem:"NOT_CHECKABLE"}}var Kn=/^(?:[\s\S]|[A-Z][A-Za-z0-9]{1,23})$/u;function jn(e,t){if(e instanceof t.HTMLButtonElement)return!0;if(e instanceof t.HTMLInputElement)return["submit","button","reset","image"].includes(e.type);let n=e.localName;return n==="a"&&e.hasAttribute("href")||n==="summary"}function Gn(e,t){if(e instanceof t.HTMLButtonElement)return!0;if(e instanceof t.HTMLInputElement)return["submit","button","reset","image","checkbox","radio"].includes(e.type);return e.localName==="summary"}function me(e,t){e.dispatchEvent(new t.MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!0,view:t,detail:0}))}function $n(e,t,n){if(!Kn.test(n))return{ok:!1,problem:"INVALID_ACTION"};let o=n==="Space"?" ":n;if(e instanceof t.HTMLElement)e.focus();let r={key:o,bubbles:!0,cancelable:!0,composed:!0},i=e.dispatchEvent(new t.KeyboardEvent("keydown",r));if(o==="Enter"&&i){if(jn(e,t))me(e,t);else if(e instanceof t.HTMLInputElement&&Qe(e,t)&&e.form)Yn(e.form,t)}let s=e.dispatchEvent(new t.KeyboardEvent("keyup",r));if(o===" "&&i&&s&&Gn(e,t))me(e,t);return{ok:!0}}var qn=new Set(["submit","image"]),Zn=new Set(["text","search","url","tel","email","password","date","month","week","time","datetime-local","number"]);function Yn(e,t){let n=Array.from(e.elements),o=e.getRootNode(),r=Array.from(o.querySelectorAll("button, input")).find((s)=>(s instanceof t.HTMLButtonElement&&s.type==="submit"||s instanceof t.HTMLInputElement&&qn.has(s.type))&&s.form===e);if(r){if(C(r))me(r,t);return}if(n.filter((s)=>s instanceof t.HTMLInputElement&&Zn.has(s.type)).length===1)e.requestSubmit()}function Jn(e,t){if(e instanceof t.HTMLInputElement&&(e.type==="checkbox"||e.type==="radio"))return e.checked;if(e instanceof t.HTMLInputElement||e instanceof t.HTMLTextAreaElement||e instanceof t.HTMLSelectElement)return e.value.slice(0,de);let n=e.getAttribute("aria-checked");if(n==="true"||n==="false")return n==="true";return e.getAttribute("aria-valuenow")??e.getAttribute("aria-valuetext")}var Qn=/^[A-Za-z_][\w:.-]{0,127}$/;function et(e,t){let n=In(e);if(!n)return{ok:!1,problem:"INVALID_ACTION"};switch(t.kind){case"click":return P(e,n,t.button??"left"),{ok:!0};case"doubleClick":return P(e,n,"left",1),P(e,n,"left",2),e.dispatchEvent(new n.MouseEvent("dblclick",{...fe(e,n,"left"),detail:2})),{ok:!0};case"hover":{let o=fe(e,n,"left"),r=typeof n.PointerEvent==="function"?n.PointerEvent:n.MouseEvent;return Je(e,n,o),e.dispatchEvent(new r("pointermove",o)),e.dispatchEvent(new n.MouseEvent("mousemove",o)),{ok:!0}}case"focus":if(e instanceof n.HTMLElement)e.focus();return{ok:!0};case"type":return typeof t.text==="string"?qe(e,n,t.text,t.append===!0):{ok:!1,problem:"INVALID_ACTION"};case"clear":return qe(e,n,"",!1);case"select":return Xn(e,n,t);case"check":return zn(e,n,t.checked===!0);case"pressKey":return typeof t.key==="string"?$n(e,n,t.key):{ok:!1,problem:"INVALID_ACTION"};case"scroll":return e.scrollBy?.({left:Number(t.dx??0)||0,top:Number(t.dy??0)||0}),{ok:!0};case"scrollIntoView":return e.scrollIntoView?.({block:"center",inline:"nearest"}),{ok:!0};case"getText":if(y(e))return{ok:!1,problem:"SENSITIVE_ELEMENT"};return{ok:!0,value:O(e).slice(0,de)};case"getValue":if(y(e))return{ok:!1,problem:"SENSITIVE_ELEMENT"};return{ok:!0,value:Jn(e,n)};case"getAttribute":{if(typeof t.name!=="string"||!Qn.test(t.name))return{ok:!1,problem:"INVALID_ACTION"};let o=t.name.toLowerCase();if(y(e))return{ok:!1,problem:"SENSITIVE_ELEMENT"};return{ok:!0,value:e.getAttribute(o)?.slice(0,de)??null}}case"exists":return{ok:!0,value:!0};default:return{ok:!1,problem:"INVALID_ACTION"}}}var nt=1,tt="__burdenoffUiRuntime",eo=60000,to="fg-ui-highlight",no=new Set(["role","css","testId","xpath","fuzzy","anchor","text"]);function pe(e){if(!e||typeof e!=="object")return!1;let t=e;if(!Array.isArray(t.methods)||t.methods.length===0||t.methods.length>8)return!1;if(t.frame!==void 0&&!(Array.isArray(t.frame)&&t.frame.every((n)=>typeof n==="string")))return!1;return t.methods.every((n)=>!!n&&typeof n==="object"&&no.has(String(n.kind)))}function he(){return{status:"failed",code:"ELEMENT_NOT_FOUND",candidates:[],candidateCount:0,attempts:[]}}function be(e){return{status:e.status,method:e.method,methodIndex:e.methodIndex,fallback:e.fallback,candidate:e.candidate,attempts:e.attempts}}function oo(e){try{return e.defaultView?.frameElement??null}catch{return null}}function ro(e,t,n,o){let r=e.getRootNode();if(typeof r.elementFromPoint!=="function")return null;let i=r.elementFromPoint(t,n);if(!i)return"offscreen";if(i===e||e.contains(i))return null;return o.some((s)=>s.contains(i))?null:"covered"}function io(e,t){let n=t.x+t.width/2,o=t.y+t.height/2,r=Array.from(e.labels??[]),i=e;for(let s=0;s<32;s+=1){let a=ro(i,n,o,s===0?r:[]);if(a)return a;let l=i.getRootNode();if(l&&"host"in l){i=l.host;continue}let u=oo(i.ownerDocument);if(!u)return null;let f=u.getBoundingClientRect();n+=f.x+u.clientLeft,o+=f.y+u.clientTop,i=u}return null}function so(e,t){let n=e.ownerDocument.defaultView;if(!n)return!1;let o=t.x+t.width/2,r=t.y+t.height/2;return o<0||r<0||o>=n.innerWidth||r>=n.innerHeight}function ao(e){let t=e.ownerDocument.defaultView;if(t&&t.getComputedStyle(e).pointerEvents==="none")return"noPointerEvents";let n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return null;if(so(e,n)&&typeof e.scrollIntoView==="function")e.scrollIntoView({block:"center",inline:"center"}),n=e.getBoundingClientRect();return io(e,n)}function lo(e,t={}){let n=t.root??e,o={...t.rectOf?{rectOf:t.rectOf}:{},...t.isVisible?{isVisible:t.isVisible}:{}},r=null,i=null,s=()=>{if(i!==null)clearTimeout(i),i=null;r?.remove(),r=null},a=(c,p)=>(s(),Be(n,c,{...o,...p?{state:p}:{}})),l=(c,p={})=>{if(!pe(c))return he();let m=a(c,p.state);return m.status==="found"?be(m):m},u=(c,p,m={})=>{if(!p||typeof p!=="object"||typeof p.kind!=="string")return{ok:!1,code:"INVALID_ACTION"};if(!pe(c))return{ok:!1,code:"ELEMENT_NOT_FOUND",resolution:he()};let h=m.state??(Ze.has(p.kind)?"visible":"interactable"),b=a(c,h);if(b.status!=="found"){if(p.kind==="exists"&&b.code==="ELEMENT_NOT_FOUND")return{ok:!0,value:!1,resolution:b};return{ok:!1,code:b.code,resolution:b}}let g=be(b),_=Ye.has(p.kind)?ao(b.element):null;if(_)return{ok:!1,code:"ELEMENT_NOT_INTERACTABLE",reason:_,resolution:{status:"failed",code:"ELEMENT_NOT_INTERACTABLE",candidates:[b.candidate],candidateCount:1,attempts:b.attempts}};let S=et(b.element,p);if(!S.ok)return{ok:!1,code:S.problem,resolution:g};return S.value===void 0?{ok:!0,resolution:g}:{ok:!0,resolution:g,value:S.value}},f=(c,p,m)=>{let h=e.createElement(to);h.setAttribute("aria-hidden","true"),h.setAttribute("style","all: initial; position: fixed; inset: 0; pointer-events: none; z-index: 2147483647;");let b=h.attachShadow({mode:"closed"});c.forEach((g,_)=>{let S=e.createElement("div");S.setAttribute("style",`position: fixed; left: ${g.bounds.x-3}px; top: ${g.bounds.y-3}px; width: ${g.bounds.width+6}px; height: ${g.bounds.height+6}px; outline: 3px solid Highlight; border-radius: 4px; box-sizing: border-box;`);let Ee=m?`${_+1}${p?` ${p}`:""}`:p;if(Ee){let J=e.createElement("span");J.textContent=Ee.slice(0,120),J.setAttribute("style","position: absolute; left: 0; top: 100%; margin-top: 4px; padding: 2px 6px; font: 600 11px system-ui, sans-serif; background: Highlight; color: HighlightText; border-radius: 3px; white-space: nowrap;"),S.appendChild(J)}b.appendChild(S)}),e.documentElement.appendChild(h),r=h};return{version:nt,resolve:l,act:u,highlight:(c,p={})=>{if(!pe(c))return he();let m=a(c,p.state??"visible");if(m.status==="found")f([m.candidate],p.label,!1);else if(m.candidates.length>0)f(m.candidates,p.label,!0);let h=Math.min(eo,Math.max(0,Number(p.durationMs??0)||0));if(r&&h>0)i=setTimeout(s,h);return m.status==="found"?be(m):m},clearHighlight:s,snapshot:(c={})=>(s(),$e(e,{...o,...c.maxNodes?{maxNodes:c.maxNodes}:{}}))}}function ot(e,t){let n=Reflect.get(e,tt);if(n&&typeof n==="object"&&typeof n.version==="number"&&n.version>=nt)return n;let o=Object.freeze(lo(t));return Object.defineProperty(e,tt,{value:o,configurable:!0,enumerable:!1,writable:!1}),o}ot(globalThis,globalThis.document);})();
@@ -6,7 +6,7 @@ import {
6
6
  isRuntimeTarget2,
7
7
  createDomRuntime2,
8
8
  installDomRuntime2
9
- } from "./index-70vm0qz8.js";
9
+ } from "./index-zagmp5ya.js";
10
10
  import {
11
11
  MAX_READ_TEXT2,
12
12
  MAX_TYPED_TEXT2,
package/dist/drivers.js CHANGED
@@ -1,17 +1,17 @@
1
- import"./index-qepvchf7.js";
1
+ import"./index-dcs2pe49.js";
2
2
  import {
3
3
  parseUiScript2
4
- } from "./index-s2hge7va.js";
5
- import"./index-nt1xf2w5.js";
4
+ } from "./index-68x61c7a.js";
5
+ import"./index-qm9nd548.js";
6
6
  import {
7
7
  DOM_DRIVER_CAPABILITIES2,
8
8
  safePageText2,
9
9
  safePageHtml2,
10
10
  createDomDriver2
11
- } from "./index-8w31tpfq.js";
11
+ } from "./index-y4j6zep8.js";
12
12
  import {
13
13
  runUiScript2
14
- } from "./index-486zee53.js";
14
+ } from "./index-3hsp44k5.js";
15
15
  import {
16
16
  UiDriverError2,
17
17
  createVirtualClock2
@@ -25,7 +25,7 @@ import {
25
25
  } from "./index-g7724awk.js";
26
26
  import {
27
27
  hydrateTreeSnapshot2
28
- } from "./index-qg9yfr7r.js";
28
+ } from "./index-n7ah1jn7.js";
29
29
  // src/drivers/snapshot-driver.ts
30
30
  var SNAPSHOT_DRIVER_CAPABILITIES = CAPABILITY_IDS2.filter((id) => id !== "action:focusWindow");
31
31
  var ignore = () => {
package/dist/heal.js CHANGED
@@ -1,5 +1,5 @@
1
- import"./index-qepvchf7.js";
2
- import"./index-s2hge7va.js";
1
+ import"./index-dcs2pe49.js";
2
+ import"./index-68x61c7a.js";
3
3
  import {
4
4
  UI_HEAL_MODES2,
5
5
  UI_HEAL_MODE_RANK2,
@@ -17,7 +17,7 @@ import {
17
17
  matchesUrlPattern2,
18
18
  HEAL_POSITION_TOLERANCE_PX2,
19
19
  verifyHealCandidate2
20
- } from "./index-nt1xf2w5.js";
20
+ } from "./index-qm9nd548.js";
21
21
  import {
22
22
  MAX_HEAL_QUESTION_NODES2,
23
23
  MAX_HEAL_NODE_NAME2,
@@ -2,7 +2,7 @@ import {
2
2
  uiTargetSchema2,
3
3
  UiScriptError2,
4
4
  parseUiScript2
5
- } from "./index-s2hge7va.js";
5
+ } from "./index-68x61c7a.js";
6
6
  import {
7
7
  UI_CONSEQUENCES2,
8
8
  parseHealMode2,
@@ -10,7 +10,7 @@ import {
10
10
  usablePopupHandlers2,
11
11
  matchesUrlPattern2,
12
12
  verifyHealCandidate2
13
- } from "./index-nt1xf2w5.js";
13
+ } from "./index-qm9nd548.js";
14
14
  import {
15
15
  isActingStep,
16
16
  classifyConsequence2,
@@ -6,7 +6,7 @@ import {
6
6
  RECORDING_VERSION2,
7
7
  targetFingerprint2,
8
8
  parseRecording2
9
- } from "./index-qepvchf7.js";
9
+ } from "./index-dcs2pe49.js";
10
10
  import {
11
11
  REDACTED2,
12
12
  redactCredentials2,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  sha256Hex2,
3
3
  targetFingerprint2
4
- } from "./index-qepvchf7.js";
4
+ } from "./index-dcs2pe49.js";
5
5
  import {
6
6
  UI_SCRIPT_VERSION2,
7
7
  MAX_SCRIPT_STEPS2,
@@ -28,12 +28,11 @@ var ORDINARY_WORDS = new Set([
28
28
  "unverified",
29
29
  "activated",
30
30
  "deactivated",
31
- "recovered",
32
- "unsubscribed"
31
+ "recovered"
33
32
  ]);
34
33
  var RESET_AFFIX_WORDS = "password|passwd|pass|pwd|account|email|mail|user|login|link|token|code|key";
35
34
  var RESET_AFFIX = `(?:${RESET_AFFIX_WORDS})`;
36
- var CLEAN_RESET_WORD = new RegExp(`^${RESET_AFFIX}?(?:reset|recover|recovery|verify|verification|magic|confirm|confirmation|activate|activation|invite|invitation|unsubscribe)(?:s|es)?${RESET_AFFIX}?$`, "i");
35
+ var CLEAN_RESET_WORD = new RegExp(`^${RESET_AFFIX}?(?:reset|recover|recovery|verify|verification|magic|confirm|confirmation|activate|activation|invite|invitation|unsubscribe|unsubscribed)(?:s|es)?${RESET_AFFIX}?$`, "i");
37
36
  var SIDE_WORD = new RegExp(`^(?:${RESET_AFFIX_WORDS}|accept|forgot|forgotten|new|change|request|resend|send|my|your|sign|signup|in|up)$`, "i");
38
37
  var PLAIN_WORDS = /^\p{L}[\p{L} ._-]{0,14}$/u;
39
38
  var HARMLESS_PARAM = /^(?:lang|language|locale|hl|lc|source|src|ref|referrer|utm_[a-z]+|campaign|medium|theme|view|tab|page|mode|step|flow|channel|platform|display|screen)$/i;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RecordingError2,
3
3
  parseRecording2
4
- } from "./index-qepvchf7.js";
4
+ } from "./index-dcs2pe49.js";
5
5
  import {
6
6
  readSnapshotNodes2,
7
7
  resolveTarget2
@@ -256,6 +256,134 @@ function matchMethod2(method, context) {
256
256
  }
257
257
  }
258
258
 
259
+ // src/target/container.ts
260
+ var MAX_CONTAINER_DEPTH2 = 12;
261
+ var MAX_CONTAINER_CHECKS2 = 3;
262
+ var MAX_CONTAINER_CHECKS_PER_RESOLUTION2 = 8;
263
+ var CONTAINER_TIME_BUDGET_MS2 = 25;
264
+ var MAX_CONTAINER_PAGE_ELEMENTS2 = 5000;
265
+ var CONTAINER_ROLES2 = new Set([
266
+ "alertdialog",
267
+ "article",
268
+ "banner",
269
+ "complementary",
270
+ "contentinfo",
271
+ "dialog",
272
+ "figure",
273
+ "form",
274
+ "grid",
275
+ "group",
276
+ "list",
277
+ "listitem",
278
+ "main",
279
+ "menu",
280
+ "menubar",
281
+ "navigation",
282
+ "radiogroup",
283
+ "region",
284
+ "row",
285
+ "search",
286
+ "tablist",
287
+ "table",
288
+ "tabpanel",
289
+ "toolbar",
290
+ "tree",
291
+ "treegrid"
292
+ ]);
293
+ function defaultNow() {
294
+ return typeof performance === "undefined" ? Date.now() : performance.now();
295
+ }
296
+ function createContainerBudget2(now = defaultNow) {
297
+ return {
298
+ answers: new Map,
299
+ checksLeft: MAX_CONTAINER_CHECKS_PER_RESOLUTION2,
300
+ now,
301
+ deadline: now() + CONTAINER_TIME_BUDGET_MS2
302
+ };
303
+ }
304
+ function collapse(text) {
305
+ return text.replace(/\s+/g, " ").trim();
306
+ }
307
+ function hasControl(text) {
308
+ for (let index = 0;index < text.length; index += 1) {
309
+ const code = text.charCodeAt(index);
310
+ if (code < 32 || code >= 127 && code <= 159)
311
+ return true;
312
+ }
313
+ return false;
314
+ }
315
+ function usable(text) {
316
+ const value = collapse(text);
317
+ return value.length > 0 && value.length <= MAX_CANDIDATE_NAME2 && !hasControl(value) ? value : undefined;
318
+ }
319
+ function isPrivate(element) {
320
+ return isSensitiveElement2(element) || isTypedContent2(element);
321
+ }
322
+ function titleChild(ancestor, probe) {
323
+ for (const child of Array.from(ancestor.children)) {
324
+ if (isHeadingLike(child) && !isPrivate(child) && isElementVisible2(child, probe))
325
+ return child;
326
+ }
327
+ return;
328
+ }
329
+ function* proposalsFor(ancestor, probe) {
330
+ if (isPrivate(ancestor))
331
+ return;
332
+ const role = roleOf2(ancestor);
333
+ const name = CONTAINER_ROLES2.has(role) ? usable(accessibleName2(ancestor, probe)) : undefined;
334
+ if (name)
335
+ yield { anchor: { kind: "role", role, name }, role };
336
+ const child = titleChild(ancestor, probe);
337
+ if (!child)
338
+ return;
339
+ const heading = roleOf2(child) === "heading";
340
+ const title = usable(heading ? accessibleName2(child, probe) : visibleText2(child, probe));
341
+ if (!title)
342
+ return;
343
+ yield { anchor: heading ? { kind: "role", role: "heading", name: title } : { kind: "text", text: title }, role };
344
+ }
345
+ function cacheKey(anchor, role) {
346
+ return JSON.stringify([anchor, role]);
347
+ }
348
+ function insideMatches(anchor, role, root, keep, probe) {
349
+ const method = { kind: "anchor", anchor, relation: "inside", role };
350
+ const match = matchMethod2(method, { root, keep, ...probe ? { probe } : {} });
351
+ return match.kind === "list" ? match.elements.filter(keep) : [];
352
+ }
353
+ function withinRoot(root, ancestor) {
354
+ return root.nodeType !== 1 || root === ancestor || root.contains(ancestor);
355
+ }
356
+ function describeContainer2(element, root, keep, probe, budget = createContainerBudget2()) {
357
+ const role = roleOf2(element);
358
+ if (role === "" || isSensitiveElement2(element))
359
+ return;
360
+ let checks = 0;
361
+ let depth = 0;
362
+ for (let ancestor = element.parentElement;ancestor && depth < MAX_CONTAINER_DEPTH2 && withinRoot(root, ancestor); ancestor = ancestor.parentElement) {
363
+ depth += 1;
364
+ for (const proposal of proposalsFor(ancestor, probe)) {
365
+ const key = cacheKey(proposal.anchor, role);
366
+ let found = budget.answers.get(key);
367
+ if (!found) {
368
+ if (budget.now() >= budget.deadline)
369
+ return;
370
+ if (checks >= MAX_CONTAINER_CHECKS2 || budget.checksLeft <= 0)
371
+ continue;
372
+ checks += 1;
373
+ budget.checksLeft -= 1;
374
+ found = insideMatches(proposal.anchor, role, root, keep, probe);
375
+ budget.answers.set(key, found);
376
+ }
377
+ if (found.length === 1 && found[0] === element)
378
+ return proposal;
379
+ }
380
+ }
381
+ return;
382
+ }
383
+ function containersAllowed2(root) {
384
+ return root.querySelectorAll("*").length <= MAX_CONTAINER_PAGE_ELEMENTS2;
385
+ }
386
+
259
387
  // src/target/resolve.ts
260
388
  var ZERO = { x: 0, y: 0, width: 0, height: 0 };
261
389
  function enterFrames2(root, chain, probe) {
@@ -405,8 +533,21 @@ function resolveWebTarget2(root, target, options = {}) {
405
533
  };
406
534
  }
407
535
  const listed = (report) => report.elements.slice(0, MAX_CANDIDATES2).map((element) => describeCandidate2(element, report.method, report.index, entered.offset, options));
408
- if (ambiguous)
409
- return failure("ELEMENT_AMBIGUOUS", attempts, listed(ambiguous), ambiguous.count);
536
+ if (ambiguous) {
537
+ const keep = (element) => inState(element, state, entered, options);
538
+ const listedCandidates = listed(ambiguous);
539
+ if (!containersAllowed2(entered.root)) {
540
+ return failure("ELEMENT_AMBIGUOUS", attempts, listedCandidates, ambiguous.count);
541
+ }
542
+ const budget = createContainerBudget2();
543
+ const { elements } = ambiguous;
544
+ const candidates = listedCandidates.map((candidate, position) => {
545
+ const element = elements[position];
546
+ const container = describeContainer2(element, entered.root, keep, options, budget);
547
+ return container ? { ...candidate, container } : candidate;
548
+ });
549
+ return failure("ELEMENT_AMBIGUOUS", attempts, candidates, ambiguous.count);
550
+ }
410
551
  if (blocked)
411
552
  return failure("ELEMENT_NOT_INTERACTABLE", attempts, listed(blocked), blocked.elements.length);
412
553
  return failure("ELEMENT_NOT_FOUND", attempts);
@@ -761,4 +902,4 @@ function hydrateTreeSnapshot2(document, snapshot) {
761
902
  };
762
903
  }
763
904
 
764
- export { WEB_TARGET_ERROR_CODES2, MAX_CANDIDATES2, MAX_CANDIDATE_NAME2, DEFAULT_FUZZY_THRESHOLD2, FUZZY_MARGIN2, ANCHOR_MARGIN_PX2, MAX_XPATH_RESULTS2, INTERACTIVE_ROLES2, relationDistance2, matchMethod2, enterFrames2, describeCandidate2, resolveWebTarget2, resolveAllWebTargets2, UI_TREE_SNAPSHOT_VERSION2, DEFAULT_SNAPSHOT_MAX_NODES2, MAX_SNAPSHOT_DEPTH2, MAX_SNAPSHOT_TEXT2, serializeTreeSnapshot2, hydrateTreeSnapshot2 };
905
+ export { WEB_TARGET_ERROR_CODES2, MAX_CANDIDATES2, MAX_CANDIDATE_NAME2, DEFAULT_FUZZY_THRESHOLD2, FUZZY_MARGIN2, ANCHOR_MARGIN_PX2, MAX_XPATH_RESULTS2, INTERACTIVE_ROLES2, relationDistance2, matchMethod2, MAX_CONTAINER_DEPTH2, MAX_CONTAINER_CHECKS2, MAX_CONTAINER_CHECKS_PER_RESOLUTION2, CONTAINER_TIME_BUDGET_MS2, MAX_CONTAINER_PAGE_ELEMENTS2, CONTAINER_ROLES2, createContainerBudget2, describeContainer2, containersAllowed2, enterFrames2, describeCandidate2, resolveWebTarget2, resolveAllWebTargets2, UI_TREE_SNAPSHOT_VERSION2, DEFAULT_SNAPSHOT_MAX_NODES2, MAX_SNAPSHOT_DEPTH2, MAX_SNAPSHOT_TEXT2, serializeTreeSnapshot2, hydrateTreeSnapshot2 };
@@ -7,13 +7,13 @@ import {
7
7
  uiStepFingerprint2,
8
8
  UiScriptError2,
9
9
  parseUiScript2
10
- } from "./index-s2hge7va.js";
10
+ } from "./index-68x61c7a.js";
11
11
  import {
12
12
  maskUrl2,
13
13
  sha256Hex2,
14
14
  RecordingError2,
15
15
  parseRecording2
16
- } from "./index-qepvchf7.js";
16
+ } from "./index-dcs2pe49.js";
17
17
  import {
18
18
  MAX_SCRIPT_STEPS2,
19
19
  MAX_SCRIPT_INPUTS2,
@@ -3,7 +3,7 @@ import {
3
3
  uiStepSchema2,
4
4
  UiScriptError2,
5
5
  parseUiScript2
6
- } from "./index-s2hge7va.js";
6
+ } from "./index-68x61c7a.js";
7
7
  import {
8
8
  HEALABLE_ACTIONS2,
9
9
  compatibleRoles2,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sha256Hex2
3
- } from "./index-qepvchf7.js";
3
+ } from "./index-dcs2pe49.js";
4
4
  import {
5
5
  NAME_PATTERN2,
6
6
  STEP_ID_PATTERN2,
@@ -9,7 +9,7 @@ import {
9
9
  withFingerprint2,
10
10
  UiScriptError2,
11
11
  parseUiScript2
12
- } from "./index-s2hge7va.js";
12
+ } from "./index-68x61c7a.js";
13
13
  import {
14
14
  UiRunError2
15
15
  } from "./index-yc0jgph6.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./index-20bbwwc9.js";
10
10
  import {
11
11
  createDomRuntime2
12
- } from "./index-70vm0qz8.js";
12
+ } from "./index-zagmp5ya.js";
13
13
  import {
14
14
  MAX_READ_TEXT2,
15
15
  performDomAction2
@@ -20,7 +20,7 @@ import {
20
20
  resolveWebTarget2,
21
21
  resolveAllWebTargets2,
22
22
  serializeTreeSnapshot2
23
- } from "./index-qg9yfr7r.js";
23
+ } from "./index-n7ah1jn7.js";
24
24
  import {
25
25
  isElementVisible2,
26
26
  isSensitiveElement2
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  resolveWebTarget2,
8
8
  serializeTreeSnapshot2
9
- } from "./index-qg9yfr7r.js";
9
+ } from "./index-n7ah1jn7.js";
10
10
 
11
11
  // src/dom-runtime/runtime.ts
12
12
  var DOM_RUNTIME_VERSION2 = 1;
package/dist/index.js CHANGED
@@ -13,10 +13,10 @@ import {
13
13
  RecordingError2,
14
14
  parseRecording2,
15
15
  isSavedStepAuthor2
16
- } from "./index-qepvchf7.js";
16
+ } from "./index-dcs2pe49.js";
17
17
  import {
18
18
  captureRecording2
19
- } from "./index-8ntwcfb4.js";
19
+ } from "./index-5xqsjeqj.js";
20
20
  import {
21
21
  MAX_SNAPSHOT_NODES2,
22
22
  readSnapshotNodes2,
@@ -30,7 +30,7 @@ import {
30
30
  finishFallback2,
31
31
  markFallbackAsked2,
32
32
  replayReasons2
33
- } from "./index-0vj2y9fd.js";
33
+ } from "./index-eg57f5cf.js";
34
34
  import {
35
35
  uiScriptRegistry2,
36
36
  NAME_PATTERN2,
@@ -50,7 +50,7 @@ import {
50
50
  UI_EXPRESSION_ARITY2,
51
51
  parseUiScript2,
52
52
  safeParseUiScript2
53
- } from "./index-s2hge7va.js";
53
+ } from "./index-68x61c7a.js";
54
54
  import {
55
55
  UI_SCRIPT_SCHEMA_HASH2,
56
56
  schemaHashOf2,
@@ -71,7 +71,7 @@ import {
71
71
  COMPUTER_USE_SKIP_REASONS2,
72
72
  targetFromUiFingerprint2,
73
73
  scriptFromComputerUseActions2
74
- } from "./index-hvdh7yx9.js";
74
+ } from "./index-pfdm8evf.js";
75
75
  import {
76
76
  UI_HEAL_MODES2,
77
77
  UI_HEAL_MODE_RANK2,
@@ -89,7 +89,7 @@ import {
89
89
  matchesUrlPattern2,
90
90
  HEAL_POSITION_TOLERANCE_PX2,
91
91
  verifyHealCandidate2
92
- } from "./index-nt1xf2w5.js";
92
+ } from "./index-qm9nd548.js";
93
93
  import {
94
94
  MAX_CALL_DEPTH2,
95
95
  COMPILED_NAME_PREFIX2,
@@ -97,7 +97,7 @@ import {
97
97
  stripBreakpoints2,
98
98
  inlineCalls2,
99
99
  compileUiScript2
100
- } from "./index-k7wfq22w.js";
100
+ } from "./index-rs3yzt5q.js";
101
101
  import {
102
102
  MAX_HEAL_QUESTION_NODES2,
103
103
  MAX_HEAL_NODE_NAME2,
@@ -129,7 +129,7 @@ import {
129
129
  MAX_PAGE_TEXT2,
130
130
  DEFAULT_LIST_ITEMS2,
131
131
  runUiScript2
132
- } from "./index-486zee53.js";
132
+ } from "./index-3hsp44k5.js";
133
133
  import {
134
134
  MAX_HEAL_KEYWORDS2,
135
135
  MAX_HEAL_KEYWORD_LENGTH2,
package/dist/interpret.js CHANGED
@@ -1,6 +1,6 @@
1
- import"./index-qepvchf7.js";
2
- import"./index-s2hge7va.js";
3
- import"./index-nt1xf2w5.js";
1
+ import"./index-dcs2pe49.js";
2
+ import"./index-68x61c7a.js";
3
+ import"./index-qm9nd548.js";
4
4
  import {
5
5
  MAX_CALL_DEPTH2,
6
6
  COMPILED_NAME_PREFIX2,
@@ -8,7 +8,7 @@ import {
8
8
  stripBreakpoints2,
9
9
  inlineCalls2,
10
10
  compileUiScript2
11
- } from "./index-k7wfq22w.js";
11
+ } from "./index-rs3yzt5q.js";
12
12
  import {
13
13
  MAX_VALUE_TEXT2,
14
14
  MAX_VALUE_ITEMS2,
@@ -31,7 +31,7 @@ import {
31
31
  MAX_PAGE_TEXT2,
32
32
  DEFAULT_LIST_ITEMS2,
33
33
  runUiScript2
34
- } from "./index-486zee53.js";
34
+ } from "./index-3hsp44k5.js";
35
35
  import {
36
36
  UI_ERROR_FAMILIES2,
37
37
  UI_ERROR_CODES2,
package/dist/recording.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  RecordingError2,
12
12
  parseRecording2,
13
13
  isSavedStepAuthor2
14
- } from "./index-qepvchf7.js";
14
+ } from "./index-dcs2pe49.js";
15
15
  export {
16
16
  MAX_RECORDED_STEPS2 as MAX_RECORDED_STEPS,
17
17
  RECORDING_VERSION2 as RECORDING_VERSION,
package/dist/replay.js CHANGED
@@ -6,9 +6,9 @@ import {
6
6
  finishFallback2,
7
7
  markFallbackAsked2,
8
8
  replayReasons2
9
- } from "./index-0vj2y9fd.js";
9
+ } from "./index-eg57f5cf.js";
10
10
  import"./index-3v887c75.js";
11
- import"./index-qepvchf7.js";
11
+ import"./index-dcs2pe49.js";
12
12
  export {
13
13
  afterReplayCall2 as afterReplayCall,
14
14
  finishFallback2 as finishFallback,
package/dist/script.js CHANGED
@@ -17,8 +17,8 @@ import {
17
17
  UI_EXPRESSION_ARITY2,
18
18
  parseUiScript2,
19
19
  safeParseUiScript2
20
- } from "./index-s2hge7va.js";
21
- import"./index-qepvchf7.js";
20
+ } from "./index-68x61c7a.js";
21
+ import"./index-dcs2pe49.js";
22
22
  import {
23
23
  UI_SCRIPT_SCHEMA_HASH2,
24
24
  schemaHashOf2,
@@ -39,8 +39,8 @@ import {
39
39
  COMPUTER_USE_SKIP_REASONS2,
40
40
  targetFromUiFingerprint2,
41
41
  scriptFromComputerUseActions2
42
- } from "./index-hvdh7yx9.js";
43
- import"./index-8ntwcfb4.js";
42
+ } from "./index-pfdm8evf.js";
43
+ import"./index-5xqsjeqj.js";
44
44
  import {
45
45
  UI_SCRIPT_STEP_KEY_PREFIX2,
46
46
  UI_SCRIPT_STEP_MESSAGES2,
@@ -0,0 +1,47 @@
1
+ import { type ElementStateProbe, type WebSearchRoot } from './dom.js';
2
+ import { type WebCandidateContainer } from './types.js';
3
+ /** Most ancestors looked at for a candidate's container. */
4
+ export declare const MAX_CONTAINER_DEPTH = 12;
5
+ /** Most container proposals checked on the page for one candidate; each check runs the anchor method once. */
6
+ export declare const MAX_CONTAINER_CHECKS = 3;
7
+ /** Most checks for all the candidates of one resolution together. */
8
+ export declare const MAX_CONTAINER_CHECKS_PER_RESOLUTION = 8;
9
+ /**
10
+ * Time, in milliseconds, after which no further check starts in one resolution.
11
+ * An ambiguous target is polled until its wait runs out, and every poll
12
+ * resolves it again, so the extra work per poll must stay small on large pages.
13
+ */
14
+ export declare const CONTAINER_TIME_BUDGET_MS = 25;
15
+ /** Pages with more elements under the search root get no containers: one check would scan them all. */
16
+ export declare const MAX_CONTAINER_PAGE_ELEMENTS = 5000;
17
+ /** Roles of elements that group content under a name, so `inside` that name says where an element is. */
18
+ export declare const CONTAINER_ROLES: Set<string>;
19
+ /**
20
+ * What the candidates of one resolution share: the answers of the checks run
21
+ * so far (two candidates often walk past the same ancestors), the checks left
22
+ * and the time limit. A budget is valid for one root, one state and one moment
23
+ * of the page; never keep it across resolutions.
24
+ */
25
+ export interface ContainerBudget {
26
+ /** Elements an `inside` check found, by anchor and role. */
27
+ answers: Map<string, Element[]>;
28
+ /** Checks that may still run, for all candidates together. */
29
+ checksLeft: number;
30
+ /** The clock (milliseconds) and the time after which no check starts. */
31
+ now: () => number;
32
+ deadline: number;
33
+ }
34
+ /** A fresh budget for one resolution. */
35
+ export declare function createContainerBudget(now?: () => number): ContainerBudget;
36
+ /**
37
+ * The nearest container of an ambiguous candidate that tells it apart from
38
+ * every other element: an `inside` anchor on it, with the candidate's role,
39
+ * finds exactly this element. Undefined when the candidate has no role or is
40
+ * sensitive, and when no container within `MAX_CONTAINER_DEPTH` ancestors
41
+ * does so with the checks the budget allows (`MAX_CONTAINER_CHECKS` for this
42
+ * candidate, the rest of the resolution's checks and time). An answer already
43
+ * in the budget is used without counting as a check.
44
+ */
45
+ export declare function describeContainer(element: Element, root: WebSearchRoot, keep: (element: Element) => boolean, probe?: ElementStateProbe, budget?: ContainerBudget): WebCandidateContainer | undefined;
46
+ /** True when the search root is small enough for containers to be described. */
47
+ export declare function containersAllowed(root: WebSearchRoot): boolean;
@@ -9,6 +9,7 @@ export { MAX_COMPARED_TEXT, clip, containsText, editDistance, normaliseText, sam
9
9
  export { MAX_NAME_LENGTH, MAX_VISIBLE_TEXT, type TextProbe, accessibleName, isTypedContent, labelName, matchesRoleAndName, roleOf, visibleText, } from './aria.js';
10
10
  export { type ElementStateProbe, SENSITIVE_MARKERS, type WebSearchRoot, elementRect, elementsUnder, isElementEnabled, isElementVisible, isSecretFieldName, isSensitiveElement, parentAcrossShadow, } from './dom.js';
11
11
  export { ANCHOR_MARGIN_PX, DEFAULT_FUZZY_THRESHOLD, FUZZY_MARGIN, INTERACTIVE_ROLES, MAX_XPATH_RESULTS, type MethodMatch, type ScoredElement, matchMethod, relationDistance, } from './methods.js';
12
+ export { CONTAINER_ROLES, CONTAINER_TIME_BUDGET_MS, type ContainerBudget, MAX_CONTAINER_CHECKS, MAX_CONTAINER_CHECKS_PER_RESOLUTION, MAX_CONTAINER_DEPTH, MAX_CONTAINER_PAGE_ELEMENTS, containersAllowed, createContainerBudget, describeContainer, } from './container.js';
12
13
  export { type ResolveWebTargetOptions, type WebFrameEntry, type WebTargetMatches, describeCandidate, enterFrames, resolveAllWebTargets, resolveWebTarget, } from './resolve.js';
13
14
  export { DEFAULT_SNAPSHOT_MAX_NODES, type HydratedSnapshot, MAX_SNAPSHOT_DEPTH, MAX_SNAPSHOT_TEXT, type SerializeTreeSnapshotOptions, UI_TREE_SNAPSHOT_VERSION, type UiTreeSnapshot, type UiTreeSnapshotChild, type UiTreeSnapshotNode, hydrateTreeSnapshot, serializeTreeSnapshot, snapshotUrl, } from './snapshot.js';
14
15
  export { MASKED_MARKER, MAX_MASKED_PATHS, type MaskSnapshotOptions, type MaskedSnapshot, maskSnapshot, } from './snapshot-mask.js';
@@ -46,6 +46,8 @@ export interface MatchContext {
46
46
  /** The resolver's state filter. A text hit that fails it does not hide a matching ancestor. */
47
47
  keep?: (element: Element) => boolean;
48
48
  }
49
+ /** True for an element that titles the container it sits in (the `inside` relation's heading rule). */
50
+ export declare function isHeadingLike(element: Element): boolean;
49
51
  /** Distance from the anchor to the element along the relation, or null when the element is not in that relation. */
50
52
  export declare function relationDistance(relation: UiAnchorMethod['relation'], anchor: WebRect, element: WebRect): number | null;
51
53
  /** Run one method under the root. */
@@ -4,7 +4,7 @@
4
4
  * Everything a resolution reports is plain JSON (no element references), so the
5
5
  * DOM runtime can hand it across an isolated-world or CDP boundary unchanged.
6
6
  */
7
- import type { UiTargetMethodKind } from '../script/types.js';
7
+ import type { UiAnchor, UiTargetMethodKind } from '../script/types.js';
8
8
  /** Bounds in CSS pixels, relative to the top viewport (frame offsets added). */
9
9
  export interface WebRect {
10
10
  x: number;
@@ -46,6 +46,18 @@ export interface WebMethodAttempt {
46
46
  /** Elements the method matched in the required state. */
47
47
  matches: number;
48
48
  }
49
+ /**
50
+ * The nearest labelled container or landmark around an ambiguous candidate that
51
+ * tells it apart (BOFF-17588): the anchor method
52
+ * `{ kind: 'anchor', anchor, relation: 'inside', role: <the candidate's role> }`
53
+ * found exactly this candidate on the page the resolution ran on.
54
+ */
55
+ export interface WebCandidateContainer {
56
+ /** The anchor of the `inside` method: the container's role and name, or the text of the heading that titles it. */
57
+ anchor: UiAnchor;
58
+ /** The container element's own role, for display (`region`, `form`, `group`, ...); '' when it has none. */
59
+ role: string;
60
+ }
49
61
  /** One element a method matched, as an ambiguity report lists it. */
50
62
  export interface WebCandidate {
51
63
  role: string;
@@ -56,6 +68,11 @@ export interface WebCandidate {
56
68
  method: UiTargetMethodKind;
57
69
  /** The position of that method in the target. */
58
70
  methodIndex: number;
71
+ /**
72
+ * Only on `ELEMENT_AMBIGUOUS` candidates, and only when one was found: the container an `inside` anchor can name
73
+ * so that the target matches this candidate alone. Absent on every other report and on older engines.
74
+ */
75
+ container?: WebCandidateContainer;
59
76
  }
60
77
  /** Why the frame and shadow-root chain could not be followed. */
61
78
  export interface WebFrameProblem {
package/dist/target.js CHANGED
@@ -30,6 +30,15 @@ import {
30
30
  INTERACTIVE_ROLES2,
31
31
  relationDistance2,
32
32
  matchMethod2,
33
+ MAX_CONTAINER_DEPTH2,
34
+ MAX_CONTAINER_CHECKS2,
35
+ MAX_CONTAINER_CHECKS_PER_RESOLUTION2,
36
+ CONTAINER_TIME_BUDGET_MS2,
37
+ MAX_CONTAINER_PAGE_ELEMENTS2,
38
+ CONTAINER_ROLES2,
39
+ createContainerBudget2,
40
+ describeContainer2,
41
+ containersAllowed2,
33
42
  enterFrames2,
34
43
  describeCandidate2,
35
44
  resolveWebTarget2,
@@ -40,7 +49,7 @@ import {
40
49
  MAX_SNAPSHOT_TEXT2,
41
50
  serializeTreeSnapshot2,
42
51
  hydrateTreeSnapshot2
43
- } from "./index-qg9yfr7r.js";
52
+ } from "./index-n7ah1jn7.js";
44
53
  import {
45
54
  MAX_NAME_LENGTH3,
46
55
  MAX_VISIBLE_TEXT2,
@@ -72,6 +81,8 @@ import {
72
81
  } from "./index-t55wvhvh.js";
73
82
  export {
74
83
  ANCHOR_MARGIN_PX2 as ANCHOR_MARGIN_PX,
84
+ CONTAINER_ROLES2 as CONTAINER_ROLES,
85
+ CONTAINER_TIME_BUDGET_MS2 as CONTAINER_TIME_BUDGET_MS,
75
86
  DEFAULT_FUZZY_THRESHOLD2 as DEFAULT_FUZZY_THRESHOLD,
76
87
  DEFAULT_SNAPSHOT_MAX_NODES2 as DEFAULT_SNAPSHOT_MAX_NODES,
77
88
  FUZZY_MARGIN2 as FUZZY_MARGIN,
@@ -80,6 +91,10 @@ export {
80
91
  MAX_CANDIDATES2 as MAX_CANDIDATES,
81
92
  MAX_CANDIDATE_NAME2 as MAX_CANDIDATE_NAME,
82
93
  MAX_COMPARED_TEXT2 as MAX_COMPARED_TEXT,
94
+ MAX_CONTAINER_CHECKS2 as MAX_CONTAINER_CHECKS,
95
+ MAX_CONTAINER_CHECKS_PER_RESOLUTION2 as MAX_CONTAINER_CHECKS_PER_RESOLUTION,
96
+ MAX_CONTAINER_DEPTH2 as MAX_CONTAINER_DEPTH,
97
+ MAX_CONTAINER_PAGE_ELEMENTS2 as MAX_CONTAINER_PAGE_ELEMENTS,
83
98
  MAX_MASKED_PATHS2 as MAX_MASKED_PATHS,
84
99
  MAX_NAME_LENGTH3 as MAX_NAME_LENGTH,
85
100
  MAX_SNAPSHOT_DEPTH2 as MAX_SNAPSHOT_DEPTH,
@@ -96,8 +111,11 @@ export {
96
111
  accessibleName2 as accessibleName,
97
112
  attributeOf2 as attributeOf,
98
113
  clip2 as clip,
114
+ containersAllowed2 as containersAllowed,
99
115
  containsText2 as containsText,
116
+ createContainerBudget2 as createContainerBudget,
100
117
  describeCandidate2 as describeCandidate,
118
+ describeContainer2 as describeContainer,
101
119
  editDistance2 as editDistance,
102
120
  elementRect2 as elementRect,
103
121
  elementsUnder2 as elementsUnder,
package/dist/testing.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createDomDriver2
3
- } from "./index-8w31tpfq.js";
3
+ } from "./index-y4j6zep8.js";
4
4
  import {
5
5
  UiDriverError2,
6
6
  createVirtualClock2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/ui-engine",
3
- "version": "2026.1202.1",
3
+ "version": "2026.1203.1",
4
4
  "description": "Shared, browser-safe UI automation engine: recordings, capture-time masking, target resolution, replay, the UI script v1 contract, the multi-method web target resolver and DOM runtime, the UI script interpreter, the UI script analyzer and UI step healing for FluidGrids RPA and BotManor Stewards.",
5
5
  "license": "MIT",
6
6
  "author": "Burdenoff Consultancy Services Pvt. Ltd.",