shiplightai 0.1.21 → 0.1.22

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.
Files changed (49) hide show
  1. package/dist/agentHelpers-ZM2YPYUG.js +3 -0
  2. package/dist/agentLogin-TVTERJCC.js +3 -0
  3. package/dist/chunk-47OHTDHW.js +18 -0
  4. package/dist/chunk-4MP3EHVU.js +11 -0
  5. package/dist/{chunk-32JFHFFG.js → chunk-AEEQXF3N.js} +29 -29
  6. package/dist/chunk-C6BVAOFE.js +3 -0
  7. package/dist/{chunk-RTTIJBGI.js → chunk-CSHDULY4.js} +28 -28
  8. package/dist/chunk-EEEG4LZX.js +3 -0
  9. package/dist/chunk-HJNJZWUA.js +5 -0
  10. package/dist/chunk-ID5JNGPZ.js +18 -0
  11. package/dist/{chunk-YHOTGR6H.js → chunk-J4TZ3OFZ.js} +1 -1
  12. package/dist/chunk-JQ2K2XJ4.js +61 -0
  13. package/dist/chunk-L5JSAS2D.js +3 -0
  14. package/dist/{chunk-YDR4P3GA.js → chunk-NLZ3YJX4.js} +1 -1
  15. package/dist/{chunk-JHSENQ4F.js → chunk-SFCNGCFT.js} +27 -27
  16. package/dist/{chunk-2F3YRAA7.js → chunk-VLVDPV2E.js} +13 -13
  17. package/dist/cjs/debugger-pw.cjs +7 -7
  18. package/dist/cjs/fixture.cjs +162 -147
  19. package/dist/cjs/index.cjs +229 -309
  20. package/dist/cjs/reporter.cjs +725 -0
  21. package/dist/cli.js +2107 -939
  22. package/dist/config-BUSI76YU.js +3 -0
  23. package/dist/debugger-pw.d.ts +5 -0
  24. package/dist/debugger-pw.js +1 -1
  25. package/dist/dist-3HGFS7M3-T7FMZHX4.js +3 -0
  26. package/dist/dist-K7NWI5BS.js +3 -0
  27. package/dist/dist-SIZHXBHX.js +3 -0
  28. package/dist/fixture.js +1 -1
  29. package/dist/handler-J6CCKSPE.js +3 -0
  30. package/dist/index.d.ts +1 -48
  31. package/dist/index.js +4 -11
  32. package/dist/{intRunner-5A6M6JSJ.js → intRunner-ZYEEZ6MK.js} +1 -1
  33. package/dist/reporter.d.ts +28 -0
  34. package/dist/reporter.js +723 -0
  35. package/dist/task-EDC5BGTS.js +192 -0
  36. package/dist/testFlow-HYGLHAP6.js +3 -0
  37. package/package.json +8 -1
  38. package/dist/agentHelpers-2TII7YCW.js +0 -3
  39. package/dist/agentLogin-GDOU6BCP.js +0 -3
  40. package/dist/chunk-DJDHFWEV.js +0 -3
  41. package/dist/chunk-JNRJXAJS.js +0 -18
  42. package/dist/chunk-LPSNOKYP.js +0 -61
  43. package/dist/chunk-THVHM4KG.js +0 -11
  44. package/dist/chunk-USRSZQWN.js +0 -5
  45. package/dist/dist-CXOVVE77.js +0 -3
  46. package/dist/dist-SRXGJZ7P.js +0 -3
  47. package/dist/handler-BAP4TGW6.js +0 -3
  48. package/dist/task-VW6MUEKX.js +0 -192
  49. package/dist/testFlow-ZLC5L5GT.js +0 -3
@@ -0,0 +1,3 @@
1
+ import { createRequire as __createRequire } from "module";
2
+ const require = __createRequire(import.meta.url);
3
+ import{a as o}from"./chunk-C6BVAOFE.js";var r=class{getLevel(){return o.get("logLevel")}debug(...e){this.getLevel()<=0&&console.error("[DEBUG]",...e)}info(...e){this.getLevel()<=1&&console.error("[INFO]",...e)}log(...e){this.info(...e)}warn(...e){this.getLevel()<=2&&console.warn("[WARN]",...e)}error(...e){this.getLevel()<=3&&console.error("[ERROR]",...e)}setLevel(e){o.set("logLevel",e)}},l=new r,t=l;export{t as a};
@@ -0,0 +1,5 @@
1
+ import { createRequire as __createRequire } from "module";
2
+ const require = __createRequire(import.meta.url);
3
+ import{a as o}from"./chunk-EEEG4LZX.js";import{a as g,b as d}from"./chunk-L5JSAS2D.js";var b={};d(b,{ACTION_TIMEOUT:()=>p,GOTO_TIMEOUT:()=>w,LOCATOR_TIMEOUT:()=>u,getActionTimeoutMs:()=>_,getFrameContext:()=>f,getLocator:()=>E,getMinimalActionEntity:()=>O,getPageLocatorExpression:()=>$,sanitizeForComment:()=>L});function _(e){return e?.getActionSettings()?.action_timeout_ms??p}function L(e){return e.replace(/\r\n/g," ").replace(/\n/g," ").replace(/\r/g," ").trim()}function E(e,t){let a=$(t);return a?new Function("page",`return ${a}`)(e):null}async function f(e,t=[]){let a=e;for(let i of t){let n=await a.locator(i).elementHandle();if(!n)return null;let r=await n.contentFrame();if(await n.dispose(),!r)return null;a=r}return a}function O(e){let t={action_data:e.action_data};return e.locator&&(t.locator=e.locator),e.xpath&&(t.xpath=e.xpath),e.frame_path&&(t.frame_path=e.frame_path),t}function v(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function T(e){let t=e.xpath;return typeof t=="string"&&t.trim()?!t.startsWith("xpath=")&&!t.startsWith("/")&&!t.startsWith("//")?`xpath=//${t}`:t.startsWith("xpath=")?t:`xpath=${t}`:null}function $(e){let t=v(e),a=e.locator;if(typeof a=="string"&&a.trim())return a=a.trim(),a.endsWith("first()")?`${t}.${a}`:`${t}.${a}.first()`;let i=T(e);if(i){let n=JSON.stringify(i);return`${t}.locator(${n}).first()`}return null}var u,p,w,y=g(()=>{u=1e4,p=1e4,w=2e4});y();async function h(e,t,a=[],i=[]){try{let n=await f(e,a);if(!n)return o.warn(`Could not find frame context for xpath: ${t}`),null;let r=null;if(i.length>0){let s=i[0];if(!s)return o.warn(`Missing shadow host xpath for element: ${t}`),null;let c=n.locator(`xpath=${x(s)}`),m=W(t);if(r=await(m?c.locator(`css=${m}`):c.locator(`xpath=${x(t)}`)).elementHandle({timeout:u}),!r)return o.warn(`Could not find shadow DOM element with xpath: ${t}`),null}else if(r=await n.locator(`xpath=${t}`).elementHandle({timeout:u}),!r)return o.warn(`Could not find element with xpath: ${t}`),null;let l=await n.evaluate(s=>typeof playwright<"u"&&playwright.generateLocator?playwright.generateLocator(s):null,r);return await r.dispose(),l?(o.debug(`Generated locator for ${t}: ${l}`),l):(o.debug("playwright.generateLocator is not available (PWDEBUG=console not set), using xpath fallback"),null)}catch(n){return o.error(`Error in pickBestLocator: ${n}`),null}}async function B(e,t){try{let a=await(await t.ownerFrame()??e).evaluate(i=>typeof playwright<"u"&&playwright.generateLocator?playwright.generateLocator(i):null,t);return await t.dispose(),a?(o.debug(`Generated locator: ${a}`),a):(o.debug("playwright.generateLocator is not available (PWDEBUG=console not set), using xpath fallback"),null)}catch(a){return o.error(`Error in pickBestLocator: ${a}`),null}}async function G(e,t){let a=new Map;return await Promise.all(t.map(async i=>{let n=await h(e,i);a.set(i,n)})),a}function x(e){let t=e.trim();return t.startsWith("/")||t.startsWith("(")||t.startsWith(".")?t:`//${t}`}function W(e){let t=e.trim().replace(/^\/+/,"");if(!t)return null;let a=t.split("/").filter(Boolean),i=[];for(let n of a){let r=n.match(/^([a-zA-Z][\w-]*)(?:\[(\d+)\])?$/);if(!r)return null;let l=r[1].toLowerCase(),s=r[2]?`:nth-of-type(${r[2]})`:"";i.push(`${l}${s}`)}return i.join(" > ")}async function H(e,t){if(t<0)return;let{page:a,domService:i}=e;return(e.domState||await i.getClickableElements(a)).selectorMap.get(t)}function A(e){let t=e.split("/").filter(n=>n);if(t.length===0)return"*";let a=t[t.length-1],i=a.match(/^(\w+)(?:\[(\d+)\])?$/);if(i){let[,n,r]=i;return r?`${n}:nth-of-type(${r})`:n}return a}function C(e,t=!0){try{let a=A(e.xpath);if(e.attributes.class&&t){let n=/^[a-zA-Z_][a-zA-Z0-9_-]*$/,r=e.attributes.class.split(/\s+/);for(let l of r)l.trim()&&n.test(l)&&(a+=`.${l}`)}let i=new Set(["id","name","type","placeholder","aria-label","aria-labelledby","aria-describedby","role","for","autocomplete","required","readonly","alt","title","target"]);t&&["data-id","data-qa","data-cy","data-testid","data-handlepos"].forEach(n=>i.add(n));for(let[n,r]of Object.entries(e.attributes)){if(n==="class"||!n.trim()||!i.has(n))continue;let l=n.replace(/:/g,"\\:");if(r==="")a+=`[${l}]`;else if(/["'<>`\n\r\t]/.test(r)){let s=r;r.includes(`
4
+ `)&&(s=r.split(`
5
+ `)[0]),s=s.replace(/\s+/g," ").trim();let c=s.replace(/"/g,'\\"');a+=`[${l}*="${c}"]`}else a+=`[${l}="${r}"]`}return a}catch{return`${e.tagName||"*"}[highlight_index='${e.highlightIndex}']`}}function M(e){let t=e.attributes;if(t.title)return`iframe[title="${t.title.replace(/"/g,'\\"')}"]`;if(t.id)return`iframe#${t.id}`;if(t.name)return`iframe[name="${t.name.replace(/"/g,'\\"')}"]`;if(t.src){try{let a=new URL(t.src);if(a.protocol==="chrome-extension:")return`iframe[src^="${a.origin}"]`}catch{}return`iframe[src="${t.src.replace(/"/g,'\\"')}"]`}return C(e,!1)}function k(e){let t=[],a=e;for(;a&&a.parent!==null;){let r=a.parent;t.push(r),a=r}t.reverse();let i=[],n=t.filter(r=>r.tagName==="iframe");for(let r of n){let l=M(r);o.debug("[frame-path] iframe attrs:",JSON.stringify(r.attributes),"\u2192",l),i.push(l)}return i}async function j(e,t){let a=null,i=k(t);return t.xpath&&(a=await h(e,t.xpath,i,t.shadowHostXPaths??[])),{locator:a||void 0,xpath:t.xpath,frame_path:i}}export{b as a,_ as b,E as c,$ as d,w as e,y as f,h as g,B as h,G as i,H as j,k,j as l};
@@ -0,0 +1,18 @@
1
+ import { createRequire as __createRequire } from "module";
2
+ const require = __createRequire(import.meta.url);
3
+ import{e as L}from"./chunk-L5JSAS2D.js";import{z as n}from"zod";import{stringify as N,parse as j,parseAllDocuments as Ke}from"yaml";import{v4 as P}from"uuid";import{parse as je,stringify as Re}from"yaml";var he=[/iphone/i,/ipad/i,/android/i,/pixel/i,/galaxy/i,/mobile/i,/nexus/i,/blackberry/i,/kindle/i];function ct(e){if(!e)return"desktop";for(let t of he)if(t.test(e))return"mobile";return"desktop"}function dt(e,t){if(!e||typeof e!="string")return e;let i=t instanceof Map?Object.fromEntries(t):t,o=a=>{let l=a.startsWith("$")?a.slice(1):a,s=i[l]??i[`$${l}`];return s!=null?String(s):void 0},r=e;return r=r.replace(/\{\{\s*\$?([^}]+?)\s*\}\}/g,(a,l)=>{let s=o(l.trim());return s!==void 0?s:a}),r=r.replace(/<secret>\$?([\w-]+)<\/secret>/g,(a,l)=>{let s=o(l);return s!==void 0?s:a}),r=r.replace(/\$\{([^}]+)\}/g,(a,l)=>{let s=o(l.trim());return s!==void 0?s:a}),r=r.replace(/\$([a-zA-Z_]\w*)/g,(a,l)=>{let s=o(l);return s!==void 0?s:a}),r}var ut=class{constructor(e,t){L(this,"version"),L(this,"goal"),L(this,"url"),this.version=e,this.goal=t.goal,this.url=t.url}generatePrelude(){let e=`// version ${this.version}
4
+ `,t=this.goal,i=this.url;e+=`// Navigate to the specified URL
5
+ const targetUrl = process.env.PLAYWRIGHT_STARTING_URL || '${i}';
6
+ if (targetUrl !== null) {
7
+ await page.goto(targetUrl, { waitUntil: 'domcontentloaded' });
8
+ }
9
+
10
+ // wait for page to load and give it a chance to stabilize
11
+ await page.waitForLoadState('load', { timeout: 15000 });
12
+ await page.waitForTimeout(2000);
13
+
14
+ `,e+=` // Goal:
15
+ `;let o=t.trim().split(`
16
+ `);for(let r of o)e+=` // ${r}
17
+ `;return e}generatePostlude(){return""}},v="android:",_="ios:";function pt(e){return e?e.startsWith(v)?"android":e.startsWith(_)?"ios":"web":"web"}function ft(e){return e?e.startsWith(v)||e.startsWith(_):!1}function wt(e){return!!e&&e.startsWith(v)}function mt(e){return!!e&&e.startsWith(_)}function gt(e){return e.startsWith(v)?e.slice(v.length):e.startsWith(_)?e.slice(_.length):e}function bt(e){return`${v}${e}`}function yt(e){return`${_}${e}`}function Q(e){return e?e.startsWith("http://")||e.startsWith("https://"):!1}function Mt(e){return e?!Q(e):!1}function ce(e){return e?Q(e)?["web"]:["android","ios"]:["web","android","ios"]}function St(e,t){if(!t)return!0;let i=ce(t);return e==="desktop"||e==="mobile"?i.includes("web"):i.includes(e)}function kt(e){return e.startsWith(_)?e:`${_}${e}`}function Pt(e){let t=e.iosVersion?` (iOS ${e.iosVersion})`:"";return e.deviceType==="simulator"?`${e.name}${t} - Simulator`:`${e.name}${t}`}function Tt(e){return!!(/^[0-9a-fA-F]{40}$/.test(e)||/^[0-9a-fA-F]{8}-[0-9a-fA-F]{16}$/.test(e))}var de="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",ee=112,ue=1920,pe=1080,fe=1920,we=1080-ee,me=1280,ge=720,be=500,ye=500,F="Desktop Chrome",Me=(e=>(e.Chromium="chromium",e.Firefox="firefox",e.Webkit="webkit",e))(Me||{}),U={"Blackberry PlayBook":{name:"Blackberry PlayBook",userAgent:"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/26.0 Safari/536.2+",screen:{width:600,height:1024},viewport:{width:600,height:1024},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"BlackBerry Z30":{name:"BlackBerry Z30",userAgent:"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/26.0 Mobile Safari/537.10+",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note 3":{name:"Galaxy Note 3",userAgent:"Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note II":{name:"Galaxy Note II",userAgent:"Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S III":{name:"Galaxy S III",userAgent:"Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S5":{name:"Galaxy S5",userAgent:"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S8":{name:"Galaxy S8",userAgent:"Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:740},viewport:{width:360,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S9+":{name:"Galaxy S9+",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:320,height:658},viewport:{width:320,height:658},deviceScaleFactor:4.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S24":{name:"Galaxy S24",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-S921U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:780},viewport:{width:360,height:780},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy A55":{name:"Galaxy A55",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-A556B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:480,height:1040},viewport:{width:480,height:1040},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S4":{name:"Galaxy Tab S4",userAgent:"Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:712,height:1138},viewport:{width:712,height:1138},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S9":{name:"Galaxy Tab S9",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-X710) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:640,height:1024},viewport:{width:640,height:1024},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"iPad (gen 5)":{name:"iPad (gen 5)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 6)":{name:"iPad (gen 6)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 7)":{name:"iPad (gen 7)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:810,height:1080},viewport:{width:810,height:1080},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 11)":{name:"iPad (gen 11)",userAgent:"Mozilla/5.0 (iPad; CPU OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/604.1",screen:{width:656,height:944},viewport:{width:656,height:944},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Mini":{name:"iPad Mini",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Pro 11":{name:"iPad Pro 11",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:834,height:1194},viewport:{width:834,height:1194},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6":{name:"iPhone 6",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6 Plus":{name:"iPhone 6 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7":{name:"iPhone 7",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7 Plus":{name:"iPhone 7 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8":{name:"iPhone 8",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8 Plus":{name:"iPhone 8 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE":{name:"iPhone SE",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/14E304 Safari/602.1",screen:{width:320,height:568},viewport:{width:320,height:568},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE (3rd gen)":{name:"iPhone SE (3rd gen)",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/602.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone X":{name:"iPhone X",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:812},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone XR":{name:"iPhone XR",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:896},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11":{name:"iPhone 11",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro":{name:"iPhone 11 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:635},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro Max":{name:"iPhone 11 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12":{name:"iPhone 12",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro":{name:"iPhone 12 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro Max":{name:"iPhone 12 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Mini":{name:"iPhone 12 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13":{name:"iPhone 13",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro":{name:"iPhone 13 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro Max":{name:"iPhone 13 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Mini":{name:"iPhone 13 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14":{name:"iPhone 14",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Plus":{name:"iPhone 14 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro":{name:"iPhone 14 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:660},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro Max":{name:"iPhone 14 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15":{name:"iPhone 15",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Plus":{name:"iPhone 15 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro":{name:"iPhone 15 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro Max":{name:"iPhone 15 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Kindle Fire HDX":{name:"Kindle Fire HDX",userAgent:"Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"LG Optimus L70":{name:"LG Optimus L70",userAgent:"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:1.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 550":{name:"Microsoft Lumia 550",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 950":{name:"Microsoft Lumia 950",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:4,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 10":{name:"Nexus 10",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 4":{name:"Nexus 4",userAgent:"Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5":{name:"Nexus 5",userAgent:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5X":{name:"Nexus 5X",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6":{name:"Nexus 6",userAgent:"Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6P":{name:"Nexus 6P",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 7":{name:"Nexus 7",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:600,height:960},viewport:{width:600,height:960},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia Lumia 520":{name:"Nokia Lumia 520",userAgent:"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",screen:{width:320,height:533},viewport:{width:320,height:533},deviceScaleFactor:1.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia N9":{name:"Nokia N9",userAgent:"Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",screen:{width:480,height:854},viewport:{width:480,height:854},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Pixel 2":{name:"Pixel 2",userAgent:"Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:731},viewport:{width:411,height:731},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 2 XL":{name:"Pixel 2 XL",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:823},viewport:{width:411,height:823},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 3":{name:"Pixel 3",userAgent:"Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:786},viewport:{width:393,height:786},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4":{name:"Pixel 4",userAgent:"Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:353,height:745},viewport:{width:353,height:745},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4a (5G)":{name:"Pixel 4a (5G)",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:892},viewport:{width:412,height:765},deviceScaleFactor:2.63,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 5":{name:"Pixel 5",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:851},viewport:{width:393,height:727},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 7":{name:"Pixel 7",userAgent:"Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:915},viewport:{width:412,height:839},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Moto G4":{name:"Moto G4",userAgent:"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Desktop Chrome HiDPI":{name:"Desktop Chrome HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge HiDPI":{name:"Desktop Edge HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Firefox HiDPI":{name:"Desktop Firefox HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"},"Desktop Safari":{name:"Desktop Safari",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Safari/605.1.15",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"webkit"},"Desktop Chrome":{name:"Desktop Chrome",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome Medium Resolution":{name:"Desktop Chrome Medium Resolution",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome (Branded)":{name:"Desktop Chrome (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Chrome Medium Resolution (Branded)":{name:"Desktop Chrome Medium Resolution (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Edge":{name:"Desktop Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge (Branded)":{name:"Desktop Edge (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Edge Medium Resolution (Branded)":{name:"Desktop Edge Medium Resolution (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Firefox":{name:"Desktop Firefox",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"}},Se=(e=>(e.Desktop="desktop",e.Mobile="mobile",e))(Se||{}),ke={desktop:["Desktop Chrome","Desktop Chrome Medium Resolution","Desktop Chrome (Branded)","Desktop Chrome Medium Resolution (Branded)","Desktop Edge (Branded)","Desktop Edge Medium Resolution (Branded)","Desktop Safari"],mobile:["iPhone 15 Pro Max","iPhone 15 Pro","iPhone 15 Plus","iPhone 15","iPhone 14 Pro Max","iPhone 14 Pro","iPhone 14 Plus","iPhone 14","iPhone 13 Pro Max","iPhone 13 Pro","iPhone 13","iPhone 13 Mini","iPhone 12 Pro Max","iPhone 12 Pro","iPhone 12","iPhone 12 Mini","iPhone 11 Pro Max","iPhone 11 Pro","iPhone 11","iPhone XR","iPhone X","iPhone SE (3rd gen)","iPhone SE","iPhone 8 Plus","iPhone 8","iPhone 7 Plus","iPhone 7","iPhone 6 Plus","iPhone 6","Galaxy S24","Galaxy A55","Galaxy S9+","Galaxy S8","Galaxy S5","Galaxy Note 3","Galaxy Note II","Galaxy S III","Pixel 7","Pixel 5","Pixel 4a (5G)","Pixel 4","Pixel 3","Pixel 2 XL","Pixel 2","Nexus 6P","Nexus 6","Nexus 5X","Nexus 5","Nexus 4","Moto G4","LG Optimus L70","Microsoft Lumia 950","Microsoft Lumia 550","Nokia Lumia 520","Nokia N9","BlackBerry Z30"]},H=(e,t=!1)=>{let i=["chromium"];return t&&i.push("webkit"),ke[e].map(o=>U[o]).filter(o=>o.defaultBrowserType&&i.includes(o.defaultBrowserType))},At=()=>Object.keys(U),X=e=>U[e],vt={desktop:{label:"Desktop",type:"desktop",devices:H("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:H("mobile")}},_t={desktop:{label:"Desktop",type:"desktop",devices:H("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:H("mobile",!0)}},te=(e,t=!1)=>{let i={userAgent:de,viewport:{width:fe,height:we},isMobile:!1,hasTouch:!1};if(!e||e===F)return i;let o=X(e);if(!o)return i;let{width:r,height:a}=o.viewport,l=Math.max(be/r,1),s=Math.max(ye/a,1),h=Math.max(l,s),p={width:Math.round(r*h),height:Math.round(a*h)};return{userAgent:o.userAgent,viewport:t?p:o.viewport,isMobile:o.isMobile,hasTouch:o.hasTouch}},xt=e=>{let t={width:ue,height:pe};if(!e||e===F)return t;let i=te(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height+ee}:t},Lt=e=>{let t={width:me,height:ge};if(!e||e===F)return t;let i=te(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height}:t},Et=e=>!e||e===F?void 0:X(e)?.channel,Ot=e=>!e||e===F?"chromium":X(e)?.defaultBrowserType??"chromium",Pe=(e=>(e.PASSWORD="password",e.OAUTH2="oauth2",e.SSO="sso",e.API="api",e))(Pe||{}),Te=(e=>(e.SMS="sms",e.EMAIL="email",e.TOTP="totp",e))(Te||{}),Ae=n.enum(["JS_CODE","AI_MODE"]),V=n.object({type:Ae,expression:n.string()}),ve=n.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),I=n.object({uid:n.string(),type:ve}),_e=n.object({action_data:n.object({action_name:n.string(),kwargs:n.record(n.any()).optional(),args:n.array(n.any()).optional()}),action_description:n.string().optional(),url:n.string().optional(),xpath:n.string().nullable().optional(),locator:n.string().nullable().optional(),css_selector:n.string().nullable().optional(),unique_selector:n.string().nullable().optional(),element_index:n.number().nullable().optional(),frame_path:n.array(n.any()).optional(),artifacts:n.record(n.any()).optional(),feedback:n.string().optional(),original_browser_use_action:n.any().optional()}).passthrough(),xe=I.extend({type:n.literal("DRAFT"),description:n.string()}),Le=I.extend({type:n.literal("ACTION"),description:n.string(),action_entity:_e.optional(),locator:n.string().optional(),use_pure_vision:n.boolean().optional()}),S=n.lazy(()=>n.union([xe,Le,I.extend({type:n.literal("STEP"),description:n.string().optional().default(""),statements:n.array(S),reference_id:n.number().optional()}),I.extend({type:n.literal("IF_ELSE"),description:n.string().optional(),condition:V,then:n.array(S),else:n.array(S).optional()}),I.extend({type:n.literal("WHILE_LOOP"),description:n.string().optional(),condition:V,body:n.array(S),timeout_ms:n.number().optional()})])),Ee=n.object({name:n.string(),statements:n.array(S),teardown:n.array(S).optional(),skip:n.union([n.boolean(),n.string()]).optional(),timeout:n.number().optional(),fail:n.union([n.boolean(),n.string()]).optional(),only:n.boolean().optional(),slow:n.boolean().optional()}),ie=n.object({tests:n.array(Ee).min(1),beforeAll:n.array(S).optional(),afterAll:n.array(S).optional(),beforeEach:n.array(S).optional(),afterEach:n.array(S).optional()}),Oe=n.object({version:n.string().optional(),goal:n.string().optional(),url:n.string().optional(),baseURL:n.string().optional(),final_feedback:n.string().optional(),completed:n.boolean().optional(),success:n.boolean().optional(),statements:n.array(S).optional(),teardown:n.array(S).optional(),last_modified_at:n.string().optional(),testGroup:ie.optional()}).refine(e=>e.testGroup!==void 0?e.goal===void 0&&(e.statements===void 0||e.statements.length===0):e.goal!==void 0,{message:"TestFlow must have either goal/statements (single test) or testGroup (suite), not both"});function We(e,t){let i={...t?.test_case_id!==void 0?{test_case_id:t.test_case_id}:{},...t?.name?{name:t.name}:{},goal:e.goal??"",url:e.url,base_url:e.baseURL,statements:(e.statements??[]).map(y)};return e.final_feedback&&(i.final_feedback=e.final_feedback),e.teardown&&e.teardown.length>0&&(i.teardown=e.teardown.map(y)),i}var $={lineWidth:120,defaultKeyType:"PLAIN",defaultStringType:"PLAIN"};function It(e,t){return e.testGroup?Ge(e,t):N(We(e,t),$)}function Ge(e,t){let i=e.testGroup;if(!i)throw new Error("suiteToYaml requires a TestFlow with testGroup");let o={};t?.test_case_id!==void 0&&(o.test_case_id=t.test_case_id),t?.name&&(o.name=t.name),t?.tags&&t.tags.length>0&&(o.tags=t.tags),t?.use&&Object.keys(t.use).length>0&&(o.use=t.use);let r={};return e.baseURL&&(r.base_url=e.baseURL),i.beforeAll&&i.beforeAll.length>0&&(r.beforeAll=i.beforeAll.map(y)),i.beforeEach&&i.beforeEach.length>0&&(r.beforeEach=i.beforeEach.map(y)),i.afterEach&&i.afterEach.length>0&&(r.afterEach=i.afterEach.map(y)),i.afterAll&&i.afterAll.length>0&&(r.afterAll=i.afterAll.map(y)),r.tests=i.tests.map(a=>{let l={name:a.name};return a.skip!==void 0&&(l.skip=a.skip),a.timeout!==void 0&&(l.timeout=a.timeout),a.fail!==void 0&&(l.fail=a.fail),a.only!==void 0&&(l.only=a.only),a.slow!==void 0&&(l.slow=a.slow),l.statements=a.statements.map(y),a.teardown&&a.teardown.length>0&&(l.teardown=a.teardown.map(y)),l}),o.suite=r,N(o,$)}function Ft(e){return e.map(t=>N(t,$)).join(`---
18
+ `)}function y(e){switch(e.type){case"DRAFT":return Ie(e);case"ACTION":return Fe(e);case"STEP":return Ce(e);case"IF_ELSE":return Be(e);case"WHILE_LOOP":return He(e)}}function Ie(e){return{desc:e.description}}function Fe(e){let t=e.action_entity?.action_data?.action_name??e.action_entity?.action?.action_name,i=e.action_entity?.action_data?.kwargs??e.action_entity?.action?.kwargs;if(t==="verify"){let s=i?.statement;if(typeof s=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath){let h=i?.code;return typeof h=="string"?{VERIFY:s,js:h}:{VERIFY:s}}}if(t==="go_to_url"){let s=i?.url;if(typeof s=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath){let h={URL:s};return i?.new_tab===!0&&(h.new_tab=!0),typeof i?.timeout_seconds=="number"&&(h.timeout_seconds=i.timeout_seconds),h}}if(t==="js_action"){let s=i?.code;if(typeof s=="string"&&e.description)return{desc:e.description,js:s}}if(t==="js_code"){let s=i?.code;if(typeof s=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath)return{CODE:s}}if(!e.action_entity)return{desc:e.description};let o=e.action_entity.action_data??e.action_entity.action;if(!o)return{desc:e.description};let r={desc:e.description,action:o.action_name},a=e.locator??e.action_entity.locator;a&&(r.locator=a);let l=e.action_entity.xpath;if(l&&(r.xpath=l),e.use_pure_vision&&(r.use_pure_vision=!0),o.kwargs&&Object.keys(o.kwargs).length>0)for(let[s,h]of Object.entries(o.kwargs))r[s]=h;return o.args&&o.args.length>0&&(r.args=o.args),r}function Ce(e){let t={STEP:e.description,statements:e.statements.map(y)};return e.reference_id!==void 0&&(t.reference_id=e.reference_id),t}function Be(e){let t={IF:oe(e.condition),THEN:e.then.map(y)};return e.else&&e.else.length>0&&(t.ELSE=e.else.map(y)),t}function He(e){let t={WHILE:oe(e.condition),DO:e.body.map(y)};return e.timeout_ms!==void 0&&(t.timeout_ms=e.timeout_ms),t}function oe(e){return e.type==="JS_CODE"?`js:${e.expression}`:e.expression}function Ct(e){let t=Ke(e),i;if(t.length>1||t.length===1&&!Array.isArray(t[0]?.toJSON()))i=t.map((o,r)=>o.errors.length>0?{__parseError:`Document ${r+1}: ${o.errors[0].message}`}:o.toJSON());else{let o;try{o=j(e)}catch(r){throw new Error(`Invalid YAML: ${r instanceof Error?r.message:String(r)}`)}if(!Array.isArray(o))throw new Error("Expected a YAML array or multi-document YAML (separated by ---)");i=o}return i.map((o,r)=>{try{if(o&&typeof o=="object"&&"__parseError"in o)return{error:o.__parseError};if(!o||typeof o!="object")return{error:`Item ${r+1}: expected an object`};let a=o,l=typeof a.name=="string"&&a.name.trim()||void 0,s=typeof a.goal=="string"?a.goal.trim():"";if(!s)return{error:`Item ${r+1}: missing "goal" field`};if(Array.isArray(a.statements))try{let h=N(a,$),p=R(h);return{name:l,goal:p.goal??s,testFlow:p}}catch{}return{name:l,goal:s}}catch(a){return{error:`Item ${r+1}: ${a instanceof Error?a.message:String(a)}`}}})}function Bt(e){try{let t=j(e);if(!t||typeof t!="object")return{};let i={};return typeof t.test_case_id=="number"&&Number.isFinite(t.test_case_id)&&(i.test_case_id=t.test_case_id),typeof t.template_id=="number"&&Number.isFinite(t.template_id)&&(i.template_id=t.template_id),typeof t.name=="string"&&t.name.trim()&&(i.name=t.name.trim()),i}catch{return{}}}var J=1024*1024;function R(e){if(e.length>J)throw new Error(`YAML input too large (${e.length} bytes, max ${J})`);let t=j(e);if(!t||typeof t!="object")throw new Error("Invalid YAML: expected an object at root level");if(t.suite)return Ne(t);let i={version:"1.3.0",goal:t.goal,url:t.url,baseURL:t.base_url,statements:M(t.statements??[])};t.final_feedback&&(i.final_feedback=t.final_feedback),t.teardown&&Array.isArray(t.teardown)&&(i.teardown=M(t.teardown));let o=Oe.safeParse(i);if(!o.success)throw new Error(`Invalid TestFlow after YAML conversion: ${JSON.stringify(o.error.errors)}`);return o.data}function Ne(e){let t=e.suite;if(!t||typeof t!="object")throw new Error("Invalid suite: expected an object");let i=t.tests;if(!Array.isArray(i)||i.length===0)throw new Error('Suite must have a non-empty "tests" array');let o={tests:i.map(a=>{if(!a.name)throw new Error('Each test in a suite must have a "name" field');if(!Array.isArray(a.statements)||a.statements.length===0)throw new Error(`Suite test "${a.name}" must have a non-empty "statements" array`);let l={name:a.name,statements:M(a.statements)};return Array.isArray(a.teardown)&&a.teardown.length>0&&(l.teardown=M(a.teardown)),a.skip!==void 0&&(l.skip=a.skip),typeof a.timeout=="number"&&(l.timeout=a.timeout),a.fail!==void 0&&(l.fail=a.fail),a.only===!0&&(l.only=!0),a.slow===!0&&(l.slow=!0),l})};Array.isArray(t.beforeAll)&&t.beforeAll.length>0&&(o.beforeAll=M(t.beforeAll)),Array.isArray(t.afterAll)&&t.afterAll.length>0&&(o.afterAll=M(t.afterAll)),Array.isArray(t.beforeEach)&&t.beforeEach.length>0&&(o.beforeEach=M(t.beforeEach)),Array.isArray(t.afterEach)&&t.afterEach.length>0&&(o.afterEach=M(t.afterEach));let r=ie.safeParse(o);if(!r.success)throw new Error(`Invalid TestGroup: ${JSON.stringify(r.error.errors)}`);return{version:"1.3.0",baseURL:t.base_url||void 0,testGroup:r.data}}function M(e){if(!Array.isArray(e))throw new Error("Expected an array of statements");return e.map($e)}function $e(e){if(typeof e=="string")throw new Error(`Plain string statements are not supported. Use "desc: ${e}" instead.`);if(typeof e!="object"||e===null)throw new Error(`Invalid statement: expected object, got ${typeof e}`);let t=e;if("IF"in t)return De(t);if("WHILE"in t)return ze(t);if("STEP"in t)return Ue(t);if("VERIFY"in t){let i=t.VERIFY,o={statement:typeof i=="string"?i:String(i)};return typeof t.js=="string"&&(o.code=t.js),{uid:P(),type:"ACTION",description:`Verify: ${i}`,action_entity:{action_description:`Verify: ${i}`,action_data:{action_name:"verify",kwargs:o}}}}if("URL"in t){let i=t.URL,o=t.new_tab===!0?!0:void 0,r=typeof t.timeout_seconds=="number"?t.timeout_seconds:void 0,a={url:typeof i=="string"?i:String(i)};return o&&(a.new_tab=!0),r!==void 0&&(a.timeout_seconds=r),{uid:P(),type:"ACTION",description:`Navigate to ${i}`,action_entity:{action_description:`Navigate to ${i}`,action_data:{action_name:"go_to_url",kwargs:a}}}}if("CODE"in t){let i=t.CODE;return{uid:P(),type:"ACTION",description:"Code block",action_entity:{action_description:"Code block",action_data:{action_name:"js_code",kwargs:{code:typeof i=="string"?i:String(i)}}}}}if("js"in t&&"desc"in t&&!("VERIFY"in t)){let i=t.js,o=typeof t.desc=="string"?t.desc:"";return{uid:P(),type:"ACTION",description:o,action_entity:{action_description:o,action_data:{action_name:"js_action",kwargs:{code:typeof i=="string"?i:String(i)}}}}}if("call"in t&&typeof t.call=="string"){let{call:i,...o}=t;return Y({...o,action:"function",functionName:i})}if("action"in t)return Y(t);if("desc"in t&&typeof t.desc=="string")return{uid:P(),type:"DRAFT",description:t.desc};throw new Error(`Cannot infer statement type from object: ${JSON.stringify(t)}`)}function re(e){if(typeof e!="string")throw new Error(`Condition must be a string, got ${typeof e}`);return e.startsWith("js:")?{type:"JS_CODE",expression:e.slice(3)}:{type:"AI_MODE",expression:e}}function De(e){let t=re(e.IF),i=e.THEN;if(!Array.isArray(i))throw new Error("IF_ELSE requires a THEN array");let o={uid:P(),type:"IF_ELSE",condition:t,then:M(i)};return"ELSE"in e&&Array.isArray(e.ELSE)&&(o.else=M(e.ELSE)),o}function ze(e){let t=re(e.WHILE),i=e.DO;if(!Array.isArray(i))throw new Error("WHILE_LOOP requires a DO array");let o={uid:P(),type:"WHILE_LOOP",condition:t,body:M(i)};return typeof e.timeout_ms=="number"&&(o.timeout_ms=e.timeout_ms),o}function Ue(e){let t=typeof e.STEP=="string"?e.STEP:"";if(!Array.isArray(e.statements))throw new Error("STEP requires a statements array");let i={uid:P(),type:"STEP",description:t,statements:M(e.statements)};return typeof e.reference_id=="number"&&(i.reference_id=e.reference_id),i}var Xe=new Set(["action","desc","locator","xpath","use_pure_vision"]);function Y(e){let t=typeof e.action=="string"?e.action:String(e.action),i=typeof e.desc=="string"?e.desc:"",o=typeof e.locator=="string"?e.locator:void 0,r=typeof e.xpath=="string"?e.xpath:void 0,a=typeof e.use_pure_vision=="boolean"?e.use_pure_vision:void 0,l={};for(let[p,c]of Object.entries(e))Xe.has(p)||(l[p]=c);let s={action_description:i,action_data:{action_name:t,kwargs:Object.keys(l).length>0?l:{}}};o&&(s.locator=o),r&&(s.xpath=r);let h={uid:P(),type:"ACTION",description:i,action_entity:s};return a&&(h.use_pure_vision=!0),h}function Ve(e,t){let i=[];t.version!=="1.0"&&i.push(`Unsupported patch version: ${t.version}`),(!Array.isArray(t.operations)||t.operations.length===0)&&i.push("Patch must have at least one operation");for(let o=0;o<t.operations.length;o++){let r=t.operations[o],a=`operations[${o}]`;switch(r.reason||i.push(`${a}: missing reason`),r.op){case"remove":{(typeof r.index!="number"||r.index<0||r.index>=e.length)&&i.push(`${a}: index ${r.index} out of bounds (0..${e.length-1})`);break}case"modify":{(typeof r.index!="number"||r.index<0||r.index>=e.length)&&i.push(`${a}: index ${r.index} out of bounds (0..${e.length-1})`),(r.statement===void 0||r.statement===null)&&i.push(`${a}: missing statement`);break}case"insert":{(typeof r.index!="number"||r.index<0||r.index>=e.length)&&i.push(`${a}: index ${r.index} out of bounds (0..${e.length-1})`),r.position!=="before"&&r.position!=="after"&&i.push(`${a}: position must be 'before' or 'after'`),(r.statement===void 0||r.statement===null)&&i.push(`${a}: missing statement`);break}default:i.push(`${a}: unknown operation type "${r.op}"`)}}return{valid:i.length===0,errors:i}}function Je(e,t){let i=Ve(e,t);if(!i.valid)throw new Error(`Invalid patch: ${i.errors.join("; ")}`);let o=[...e],r=t.operations.map((s,h)=>({...s,originalOrder:h})),a={remove:0,modify:1,insert:2},l=[...r].sort((s,h)=>s.index!==h.index?h.index-s.index:a[s.op]-a[h.op]);for(let s of l)switch(s.op){case"remove":o.splice(s.index,1);break;case"modify":o[s.index]=s.statement;break;case"insert":s.position==="before"?o.splice(s.index,0,s.statement):o.splice(s.index+1,0,s.statement);break}return o}function Nt(e,t){let i=je(e);if(!i||typeof i!="object")throw new Error("Invalid YAML: expected an object at root level");let o=i.statements;if(!Array.isArray(o))throw new Error('YAML must have a "statements" array');let r=Je(o,t);i.statements=r;let a=Re(i,{lineWidth:120,defaultKeyType:"PLAIN",defaultStringType:"PLAIN"});return R(a),{modifiedYaml:a,modifiedStatements:r}}var G=e=>{let t=[];switch(e.type){case"STEP":e.statements&&t.push({key:"statements",statements:e.statements});break;case"IF_ELSE":e.then&&t.push({key:"then",statements:e.then}),e.else&&t.push({key:"else",statements:e.else});break;case"WHILE_LOOP":e.body&&t.push({key:"body",statements:e.body});break}return t},k=(e,t,i=void 0,o="root")=>{for(let r=0;r<e.length;r++){let a=e[r],l=a.uid;if(l===t)return{stableId:l,path:[r],statement:a,parent:i,containerKey:o,index:r};let s=G(a);for(let h of s){let p=k(h.statements,t,a,h.key);if(p)return{...p,path:[r,h.key,...p.path]}}}return null},E=(e,t,i)=>{let o=k(e,t);if(!o)return null;let{statement:r,parent:a,containerKey:l,index:s}=o,h=null;switch(r.type){case"DRAFT":case"ACTION":h=O(e,o)||K(e,o);break;case"STEP":if(r.statements&&r.statements.length>0)return r.statements[0];h=O(e,o)||K(e,o);break;case"IF_ELSE":if(i===!0&&r.then&&r.then.length>0)return r.then[0];if(i===!1&&r.else&&r.else.length>0)return r.else[0];h=O(e,o)||K(e,o);break;case"WHILE_LOOP":if(i===!0&&r.body&&r.body.length>0)return r.body[0];h=O(e,o)||K(e,o);break;default:h=O(e,o)||K(e,o);break}if(a&&a.type==="WHILE_LOOP"&&l==="body"){if(!h)return a;let p=k(e,h.uid);if(!p||p.parent!==a)return a}return h},O=(e,t)=>{if(!t.parent)return e[t.index+1]||null;let i=G(t.parent).find(o=>o.key===t.containerKey);return i&&t.index+1<i.statements.length?i.statements[t.index+1]:null},K=(e,t)=>{if(!t.parent)return null;let i=t.parent.uid,o=k(e,i);return o?O(e,o)||K(e,o):null},q=e=>{let t=[],i=o=>{for(let r of o){t.push(r);let a=G(r);for(let l of a)i(l.statements)}};return i(e),t},$t=e=>{switch(e.type){case"DRAFT":case"ACTION":return!0;case"STEP":return!0;case"IF_ELSE":case"WHILE_LOOP":return!0;default:return!1}},Dt=(e,t,i)=>{if(!k(e,t))return null;if(i===null){let a=[],l=t;for(;l!==null&&k(e,l);)if(a.push(l),l=E(e,l)?.uid||null,a.length>1e3)return null;return a}if(!k(e,i))return null;if(t===i)return[];let o=[],r=t;for(;r&&r!==i;){let a=k(e,r);if(!a)break;if(o.push(r),a.statement.type==="IF_ELSE"){let l=Ye(a.statement,i);l?r=E(e,r,l==="then")?.uid||null:r=E(e,r)?.uid||null}else a.statement.type==="WHILE_LOOP"?qe(a.statement,i)?r=E(e,r,!0)?.uid||null:r=E(e,r,!1)?.uid||null:r=E(e,r)?.uid||null;if(o.length>1e3)return null}return r===i?o:null},Ye=(e,t)=>{if(e.type!=="IF_ELSE")return null;let i=e;return i.then&&k(i.then,t)?"then":i.else&&k(i.else,t)?"else":null},qe=(e,t)=>{if(e.type!=="WHILE_LOOP")return!1;let i=e;return!!(i.body&&k(i.body,t))};function Ze(e){for(let t of e){if(t.type==="STEP"&&t.reference_id)return!0;let i=G(t);for(let o of i)if(Ze(o.statements))return!0}return!1}function zt(e){let t=new Set;function i(o){for(let r of o){r.type==="STEP"&&r.reference_id&&t.add(r.reference_id);let a=G(r);for(let l of a)i(l.statements)}}return i(e),Array.from(t)}var Ut=e=>e.startsWith("ai_")?!0:["js_code","function","assert","verify","wait_for_download_complete","extract_activation_code","extract_email_content"].includes(e),Xt=e=>!["js_code","function","assert","ai_assert","verify","ai_extract","ai_wait_until","upload_file","login","extract_activation_code","extract_email_content","ai_step"].includes(e),W=(e,t,i)=>{e.forEach((o,r)=>{let a=`${t}.${r}`;o.type==="DRAFT"?i[a]={description:o.description||"Draft",action_entity:void 0}:o.type==="ACTION"?i[a]={description:o.description||"Action",action_entity:o.action_entity}:o.type==="STEP"&&o.statements?W(o.statements,a,i):o.type==="IF_ELSE"?(i[a]={description:"IF "+(o.condition?.expression||""),action_entity:void 0},o.then&&W(o.then,`${a}.then`,i),o.else&&W(o.else,`${a}.else`,i)):o.type==="WHILE_LOOP"&&(i[a]={description:"WHILE "+(o.condition?.expression||""),action_entity:void 0},o.body&&W(o.body,`${a}.body`,i))})};function jt(e){if(!e?.statements||!Array.isArray(e.statements))return{};let t={};return W(e.statements,"main",t),e.teardown&&Array.isArray(e.teardown)&&W(e.teardown,"teardown",t),t}function A(e,t,i){let o=e+".",r=t.filter(([c])=>c===e||c.startsWith(o));if(r.length===0)return[];let a=[],l=new Set;for(let[c]of r){let f=c===e?"":c.slice(o.length);if(!f)continue;let u=f.split(".")[0];l.has(u)||l.add(u)}let s=Array.from(l);s.sort((c,f)=>{let u=/^\d+$/.test(c)?parseInt(c,10):-1,d=/^\d+$/.test(f)?parseInt(f,10):-1;return u>=0&&d>=0?u-d:c==="then"&&f==="else"?-1:c==="else"&&f==="then"||c==="body"?1:f==="body"?-1:c.localeCompare(f)});function h(c){return i[c]}function p(c){let f=c.match(/^(IF|WHILE)\s+([\s\S]+)$/);return{type:"JS_CODE",expression:(f?f[2].trim():c)||"true"}}for(let c of s){let f=e?`${e}.${c}`:c,u=h(f),d=u?.description??"",g=f;if(c==="then"){let w=`${e}.then`,b=`${e}.else`,T=A(w,t,i),x=A(b,t,i),B=h(e),le=B?p(B.description):{type:"JS_CODE",expression:"true"};a.push({uid:e,type:"IF_ELSE",condition:le,then:T,...x.length>0?{else:x}:{}});continue}if(c==="else")continue;if(c==="body"){let w=`${e}.body`,b=A(w,t,i),T=h(e),x=T?p(T.description):{type:"JS_CODE",expression:"true"};a.push({uid:e,type:"WHILE_LOOP",condition:x,body:b});continue}let m=`${e}.${c}`,C=t.some(([w])=>w.startsWith(m+".then.")||w===m+".then"),D=t.some(([w])=>w.startsWith(m+".else.")||w===m+".else"),ne=t.some(([w])=>w.startsWith(m+".body.")||w===m+".body"),se=t.filter(([w])=>{if(!w.startsWith(m+"."))return!1;let b=w.slice(m.length+1).split(".")[0];return/^\d+$/.test(b)&&b!=="then"&&b!=="else"&&b!=="body"});if(C||D){let w=m+".then",b=m+".else",T=A(w,t,i),x=A(b,t,i),B=u?p(d):{type:"JS_CODE",expression:"true"};a.push({uid:f,type:"IF_ELSE",condition:B,then:T,...x.length>0?{else:x}:{}})}else if(ne){let w=m+".body",b=A(w,t,i),T=u?p(d):{type:"JS_CODE",expression:"true"};a.push({uid:f,type:"WHILE_LOOP",condition:T,body:b})}else if(se.length>0){let w=A(m,t,i);a.push({uid:f,type:"STEP",description:d||"Group",statements:w})}else a.push({uid:f,type:"ACTION",description:d||"Action",action_entity:u?.action_entity})}return a}function Rt(e){let t=Object.entries(e),i=o=>{let r=o+".";return t.some(([a])=>a===o||a.startsWith(r))?A(o,t,e):[]};return{before:i("before"),main:i("main"),teardown:i("teardown"),after:i("after")}}var Qe=.5;function et(e){try{return new Function(`return async function() { ${e} }`),null}catch(t){return t.message}}function Z(e){try{return new Function(`return async function() { return (${e}) }`),null}catch(t){return t.message}}function Vt(e,t){let i=t?.coverageThreshold??Qe,o=[],r=[],a;try{a=R(e)}catch(u){return{valid:!1,errors:[`Invalid YAML: ${u.message}`],warnings:[],stats:{total:0,withLocator:0,coverage:0}}}a.goal||o.push('Missing required field: "goal"'),a.statements?.length||o.push('Missing required field: "statements"');let l=[...q(a.statements??[]),...a.teardown?q(a.teardown):[]],s=0,h=0;for(let u of l)if(!(u.type!=="DRAFT"&&u.type!=="ACTION"||(u.description?.toLowerCase()??"").startsWith("verify:"))){if(u.type==="ACTION"){let d=u.action_entity?.action_data?.action_name??"";if(d==="verify"||d==="ai_assert"||d==="done")continue}if(s++,u.type==="ACTION"){let d=u;if((d.action_entity?.action_data?.action_name??"")==="js_action"){let g=d.action_entity?.action_data?.kwargs?.code??"";/page\.(getBy|locator\(|frameLocator\()/.test(g)&&h++}else(d.action_entity?.locator||d.action_entity?.xpath)&&h++}}let p="Hint: in YAML double-quoted strings, backslashes are escape characters \u2014 use \\\\/ instead of \\/ for regex, or use single quotes.";for(let u of l){if(u.type==="ACTION"){let d=u,g=d.action_entity?.action_data?.action_name??"";if(g==="js_code"||g==="js_action"||g==="verify"||g==="ai_assert"){let m=d.action_entity?.action_data?.kwargs?.code;if(typeof m=="string"){let C=et(m);if(C){let D=d.description||g;o.push(`Invalid JS in "${D}": ${C}. ${p}`)}}}}if(u.type==="IF_ELSE"){let d=u;if(d.condition.type==="JS_CODE"){let g=Z(d.condition.expression);g&&o.push(`Invalid JS in IF condition "${d.condition.expression}": ${g}. ${p}`)}}if(u.type==="WHILE_LOOP"){let d=u;if(d.condition.type==="JS_CODE"){let g=Z(d.condition.expression);g&&o.push(`Invalid JS in WHILE condition "${d.condition.expression}": ${g}. ${p}`)}}}let c=s>0?h/s:0,f=Math.round(c*100);return s>0&&c<i&&r.push(`Low locator coverage: ${h}/${s} statements (${f}%) have locators. Tests with locators replay ~10x faster. Use MCP tools (act, get_locators) to enrich your test flow.`),{valid:o.length===0,errors:o,warnings:r,stats:{total:s,withLocator:h,coverage:f}}}function Jt(){return{version:"1.0",entries:{}}}function Yt(e,t){return{action_entity:e,updated_at:new Date().toISOString(),updated_by:{source:"runner",test_run_id:t}}}function qt(e,t){let i=t?.entries[e.uid],o=i?.action_entity??e.action_entity;return e.locator&&o?{...o,locator:e.locator}:i?i.action_entity:e.action_entity?e.action_entity:null}function Zt(e,t,i,o){return e.entries[t]={action_entity:i,updated_at:new Date().toISOString(),updated_by:o},e}function Qt(e,t){let i=e??{version:"1.0",entries:{}};for(let[o,r]of t)i.entries[o]=r;return i}function ei(e){return e?Object.keys(e.entries).length===0:!0}function ti(e){return e?Object.keys(e.entries).length:0}function ii(e,t){if(!t||Object.keys(t.entries).length===0)return e;let i=z(e.statements??[],t),o=e.teardown?z(e.teardown,t):void 0;return{...e,statements:i,teardown:o}}function z(e,t){return e.map(i=>tt(i,t))}function tt(e,t){if(e.type==="ACTION"){let r=e,a=t.entries[r.uid];return a?{...r,action_entity:a.action_entity}:r}let i=G(e);if(i.length===0)return e;let o={};for(let r of i)o[r.key]=z(r.statements,t);return{...e,...o}}var it=(e=>(e.DRAFT="DRAFT",e.STEP="STEP",e.ACTION="ACTION",e.IF_ELSE="IF_ELSE",e.WHILE_LOOP="WHILE_LOOP",e))(it||{}),ot=(e=>(e.JS_CODE="JS_CODE",e.AI_MODE="AI_MODE",e))(ot||{}),oi=18e4,ri=class ae{constructor(){L(this,"data",{}),L(this,"sensitive",new Set)}get(t){return this.data[t]}set(t,i,o=!1){this.data[t]=i,o?this.sensitive.add(t):this.sensitive.has(t)&&this.sensitive.delete(t)}getAll(){return{...this.data}}isSensitive(t){return this.sensitive.has(t)}getAllSensitiveKeys(){return new Set(this.sensitive)}delete(t){return this.sensitive.delete(t),delete this.data[t]}clear(){this.data={},this.sensitive.clear()}has(t){return t in this.data}get size(){return Object.keys(this.data).length}merge(t){for(let[i,o]of Object.entries(t.getAll()))this.set(i,o,t.isSensitive(i))}toJSON(){return{data:{...this.data},sensitiveKeys:Array.from(this.sensitive)}}static fromJSON(t){let i=new ae;if(t.data){let o=new Set(t.sensitiveKeys||[]);for(let[r,a]of Object.entries(t.data))i.set(r,a,o.has(r))}return i}},rt="claude-sonnet-4-6",at="gemini-2.5-pro",nt="claude-haiku-4-5",st="gemini-2.5-pro";function ai(e){return{copilot:e?.models?.copilot||rt,webagent:e?.models?.webagent||at}}function ni(e){if(e){if(e.WEB_AGENT_MODEL)return e.WEB_AGENT_MODEL;if(e.ANTHROPIC_API_KEY)return nt;if(e.GOOGLE_API_KEY)return st}}var lt=(e=>(e.INITIALIZING="initializing",e.READY="ready",e.PROCESSING="processing",e.STOPPING="stopping",e.WAITING_USER="waiting_user",e.COMPLETED="completed",e.FAILED="failed",e))(lt||{});function si(e){let t=e.trim();if(!t||t.startsWith("List of devices"))return null;let i=t.split(/\s+/);if(i.length<2)return null;let o=i[0],r=i[1],a="usb";return o.startsWith("emulator-")?a="emulator":o.includes(":")&&(a="wifi"),{id:o,state:r,connectionType:a}}function li(e){return e.startsWith(v)?e:`${v}${e}`}function hi(e){return e.model?`${e.model} (${e.id})`:e.connectionType==="emulator"?`Android Emulator (${e.id})`:e.id}export{ct as a,dt as b,ut as c,v as d,_ as e,pt as f,ft as g,wt as h,mt as i,gt as j,bt as k,yt as l,Q as m,Mt as n,ce as o,St as p,kt as q,Pt as r,Tt as s,de as t,ee as u,ue as v,pe as w,fe as x,we as y,me as z,ge as A,be as B,ye as C,F as D,Me as E,U as F,Se as G,ke as H,H as I,At as J,X as K,vt as L,_t as M,te as N,xt as O,Lt as P,Et as Q,Ot as R,Pe as S,Te as T,Ae as U,V,ve as W,I as X,_e as Y,xe as Z,Le as _,S as $,Ee as aa,ie as ba,Oe as ca,We as da,It as ea,Ge as fa,Ft as ga,Ct as ha,Bt as ia,R as ja,Ve as ka,Je as la,Nt as ma,G as na,k as oa,E as pa,O as qa,K as ra,q as sa,$t as ta,Dt as ua,Ze as va,zt as wa,Ut as xa,Xt as ya,W as za,jt as Aa,Rt as Ba,Vt as Ca,Jt as Da,Yt as Ea,qt as Fa,Zt as Ga,Qt as Ha,ei as Ia,ti as Ja,ii as Ka,it as La,ot as Ma,oi as Na,ri as Oa,rt as Pa,at as Qa,nt as Ra,st as Sa,ai as Ta,ni as Ua,lt as Va,si as Wa,li as Xa,hi as Ya};
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __createRequire } from "module";
2
2
  const require = __createRequire(import.meta.url);
3
- import{c as w}from"./chunk-DJDHFWEV.js";var h=`
3
+ import{a as w}from"./chunk-EEEG4LZX.js";var h=`
4
4
  // check to make sure we're not inside the PDF viewer
5
5
  window.isPdfViewer = !!document?.body?.querySelector('body > embed[type="application/pdf"][width="100%"]')
6
6
  if (!window.isPdfViewer) {
@@ -0,0 +1,61 @@
1
+ import { createRequire as __createRequire } from "module";
2
+ const require = __createRequire(import.meta.url);
3
+ import{h as m}from"./chunk-J4TZ3OFZ.js";import{a as t}from"./chunk-NLZ3YJX4.js";var y=5e3,v=1e4;async function w(s,o){let n=Object.getPrototypeOf(async()=>{}).constructor,e=`
4
+ return await (${o});
5
+ `;return await new n("page",e)(s)}async function f(s,o,n){let e=[],r=[];for(let c of o){let i=!1;try{let a=`page.${c}`;t.log(`Checking element existence: ${a}`),e.push(`Checking element existence: ${a}`);try{await w(s,`${a}.waitFor({ state: 'attached', timeout: ${y} })`),t.log(`Element is attached: ${a}`),e.push(`Element is attached: ${a}`),i=!0}catch{await w(s,`${a}.count()`)>0?(t.log(`Element found (snapshot): ${a}`),e.push(`Element found (snapshot): ${a}`),i=!0):(t.log(`Element not found: ${a}`),e.push(`Element not found: ${a}`),i=!1)}}catch(a){t.log(`Error checking element: ${a.message}`),e.push(`Error checking element: ${a.message}`),i=!1}if(r.push(i),!i&&n)break}return{successResults:r,logs:e}}async function $(s,o,n=!0){let{successResults:e,logs:r}=await f(s,o,n);return{success:e.length===o.length&&e.every(c=>c),logs:r}}async function N(s,o){if(!o||o.length===0)return t.log("No validation expressions provided, cannot validate login"),!1;t.log(`Validating login with ${o.length} expression(s)`);let{success:n,logs:e}=await $(s,o,!0);return n?t.log("All validation expressions passed"):t.log(`Validation failed: ${e.join(", ")}`),n}async function b(s,o){let n=s.context().browser();if(!n)throw new Error("Cannot create unsigned-in context: browser not available");let e=await n.newContext(),r=await e.newPage();return await r.goto(o),await m(r,v),{context:e,page:r,close:async()=>{await r.close(),await e.close()}}}async function E(s,o,n,e,r,c){let i=`
6
+ Based on the current page status, generate ${r} Playwright locators in JavaScript code that can
7
+ be used by a program to verify the page is signed in.
8
+ Each expression should yield a locator object that can be used for waiting and checking visibility.
9
+ `;o&&(i+=`
10
+ For your comparison, the DOM elements of the UNSIGNED IN page are:
11
+ """
12
+ ${o}
13
+ """
14
+ `),i+=`
15
+ Output the code in a code block with \`\`\`javascript\`\`\` at the beginning and \`\`\` at the end.
16
+
17
+ Here is an example of the right format:
18
+ \`\`\`javascript
19
+ getByRole("button", { name: "Logout" }).first()
20
+ \`\`\`
21
+
22
+ User name, id, email etc are great choices as a part of locators if they present.
23
+ They tend to be strong and stable indicators of signed in status.
24
+
25
+ Don't use locators that may change with page content, such as:
26
+ - time of day
27
+ - location
28
+ - language
29
+ - timezone
30
+ - device
31
+ - browser
32
+ - operating system
33
+ - numbers
34
+ - and other dynamic values
35
+
36
+ It is a good idea to add 'first()' to the locator to make it more stable for locators
37
+ that can result in multiple results.
38
+ `,n&&(i+=`
39
+ Previously generated expressions and their results:
40
+ """
41
+ ${n}
42
+ """
43
+ Avoid regenerating these failed ones, but can reuse the successful ones.`),e&&(i+=`
44
+ ${e}
45
+ `),i+=`
46
+ Remember, you must have the javascript code block in your final response.
47
+ `,t.log("Agent generating validation locators"),t.log(`Prompt:
48
+ ${i}`);let a=await c(s,i);if(!a.success)throw new Error(a.details||"Agent failed to generate verification code");let g=(a.details||"").match(/```javascript\n(.*)\n```/s);if(!g)throw new Error("Agent failed to generate verification code: no javascript code block found");return g[1].split(`
49
+ `).map(l=>l.trim()).filter(l=>l.length>0).map(l=>(l.startsWith("page.")&&(l=l.slice(5)),l))}async function A(s,o,n,e,r){let c=null;try{c=await b(s,o);let i=await r(c.page),a=3,g="";for(let l=0;l<a;l++)try{let u=await E(s,i,g||null,n.verification_hint??null,n.num_verification_exprs??1,e);t.log(`Generated validation locators: ${JSON.stringify(u)}`);{let{successResults:d,logs:h}=await f(s,u,!1);if(g+=`Test results on a SIGNED IN page. EXPECT ALL PASS:
50
+ ${h.join(`
51
+ `)}
52
+
53
+ `,!d.every(p=>p)){t.log(`Locator validation on signed-in page failed. Results: ${JSON.stringify(d)}`),t.log(`Validation logs:
54
+ ${h.join(`
55
+ `)}`);continue}}{t.log("Validating locators in unsigned-in context, EXPECT ALL TO FAIL");let{successResults:d,logs:h}=await f(c.page,u,!1);if(g+=`Test results on an UNSIGNED IN page. EXPECT ALL FAIL:
56
+ ${h.join(`
57
+ `)}
58
+
59
+ `,d.some(p=>p)){t.log(`Locator validation on unsigned-in page failed (some passed when should fail). Results: ${JSON.stringify(d)}`),t.log(`Validation logs:
60
+ ${h.join(`
61
+ `)}`);continue}}return t.log("Generated validation locators passed dual validation"),u}catch(u){t.log(`Failed to generate validation expressions (attempt ${l+1}/${a}): ${u.message}`)}return t.log("Failed to generate valid locators after max retries"),null}finally{c&&await c.close()}}export{f as a,$ as b,N as c,b as d,E as e,A as f};
@@ -0,0 +1,3 @@
1
+ import { createRequire as __createRequire } from "module";
2
+ const require = __createRequire(import.meta.url);
3
+ var a=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,v=(r,e,t)=>e in r?a(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,s=(r,e)=>()=>(r&&(e=r(r=0)),e),i=(r,e)=>{for(var t in e)a(r,t,{get:e[t],enumerable:!0})},l=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of p(e))!u.call(r,o)&&o!==t&&a(r,o,{get:()=>e[o],enumerable:!(n=f(e,o))||n.enumerable});return r},y=(r,e,t)=>(l(r,e,"default"),t&&l(t,e,"default")),b=r=>l(a({},"__esModule",{value:!0}),r),c=(r,e,t)=>v(r,typeof e!="symbol"?e+"":e,t);export{s as a,i as b,y as c,b as d,c as e};
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __createRequire } from "module";
2
2
  const require = __createRequire(import.meta.url);
3
- import{b as e}from"./chunk-DJDHFWEV.js";import{appendFileSync as s}from"fs";var r=class{constructor(){this.initialized=!1}init(){if(this.initialized)return;let t=e().agentLogPath;if(t)try{s(t,`
3
+ import{c as e}from"./chunk-C6BVAOFE.js";import{appendFileSync as s}from"fs";var r=class{constructor(){this.initialized=!1}init(){if(this.initialized)return;let t=e().agentLogPath;if(t)try{s(t,`
4
4
  === Agent Execution Log ===
5
5
  Started: ${new Date().toISOString()}
6
6