shiplightai 0.1.47 → 0.1.48

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.
@@ -11,7 +11,7 @@ ${e}`)}prompt(e,t){this.section("LLM Prompt"),this.log(`System Prompt:
11
11
  ${e}`),this.log(`
12
12
  User Prompt:
13
13
  ${t}`)}response(e){this.log(`LLM Response:
14
- ${e}`)}error(e,t){this.log(`ERROR: ${e}`),t&&(this.log(`Error details: ${t.message}`),t.stack&&this.log(`Stack: ${t.stack}`))}isEnabled(){return!!G().agentLogPath}},k=new _l});var Mn,kl,Sl,El,Ia,mi,$n,Pa,In,we=w(()=>{"use strict";Mn=Object.defineProperty,kl=Object.getOwnPropertyDescriptor,Sl=Object.getOwnPropertyNames,El=Object.prototype.hasOwnProperty,Ia=(e,t)=>()=>(e&&(t=e(e=0)),t),mi=(e,t)=>{for(var i in t)Mn(e,i,{get:t[i],enumerable:!0})},$n=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Sl(t))!El.call(e,a)&&a!==i&&Mn(e,a,{get:()=>t[a],enumerable:!(n=kl(t,a))||n.enumerable});return e},Pa=(e,t,i)=>($n(e,t,"default"),i&&$n(i,t,"default")),In=e=>$n(Mn({},"__esModule",{value:!0}),e)});function P(e,t){return t??e?.getActionSettings()?.action_timeout_ms??Cn}function Tl(e){return e.replace(/\r\n/g," ").replace(/\n/g," ").replace(/\r/g," ").trim()}function C(e,t){let i=Me(t);return i?new Function("page",`return ${i}`)(e):null}async function Pn(e,t=[]){let i=e;for(let n of t){let a=await i.locator(n).elementHandle();if(!a)return null;let o=await a.contentFrame();if(await a.dispose(),!o)return null;i=o}return i}function Al(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 $l(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function Ml(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 Me(e){let t=$l(e),i=e.locator;if(typeof i=="string"&&i.trim())return i=i.trim(),i.endsWith("first()")?`${t}.${i}`:`${t}.${i}.first()`;let n=Ml(e);if(n){let a=JSON.stringify(n);return`${t}.locator(${a}).first()`}return null}var pi,at,Cn,ue,M,R=w(()=>{"use strict";we();pi={};mi(pi,{ACTION_TIMEOUT:()=>Cn,GOTO_TIMEOUT:()=>ue,LOCATOR_TIMEOUT:()=>at,getActionTimeoutMs:()=>P,getFrameContext:()=>Pn,getLocator:()=>C,getMinimalActionEntity:()=>Al,getPageLocatorExpression:()=>Me,sanitizeForComment:()=>Tl});M=Ia(()=>{at=5e3,Cn=1e4,ue=2e4})});async function On(e,t,i=[],n=[]){try{let a=await Pn(e,i);if(!a)return g.warn(`Could not find frame context for xpath: ${t}`),null;let o=null;if(n.length>0){let s=n[0];if(!s)return g.warn(`Missing shadow host xpath for element: ${t}`),null;let l=a.locator(`xpath=${Ca(s)}`),d=Il(t);if(o=await(d?l.locator(`css=${d}`):l.locator(`xpath=${Ca(t)}`)).elementHandle({timeout:at}),!o)return g.warn(`Could not find shadow DOM element with xpath: ${t}`),null}else if(o=await a.locator(`xpath=${t}`).elementHandle({timeout:at}),!o)return g.warn(`Could not find element with xpath: ${t}`),null;let r=await a.evaluate(s=>typeof playwright<"u"&&playwright.generateLocator?playwright.generateLocator(s):null,o);return await o.dispose(),r?(g.debug(`Generated locator for ${t}: ${r}`),r):(g.debug("playwright.generateLocator is not available (PWDEBUG=console not set), using xpath fallback"),null)}catch(a){return g.error(`Error in pickBestLocator: ${a}`),null}}async function Nn(e,t){try{let i=await(await t.ownerFrame()??e).evaluate(n=>typeof playwright<"u"&&playwright.generateLocator?playwright.generateLocator(n):null,t);return await t.dispose(),i?(g.debug(`Generated locator: ${i}`),i):(g.debug("playwright.generateLocator is not available (PWDEBUG=console not set), using xpath fallback"),null)}catch(i){return g.error(`Error in pickBestLocator: ${i}`),null}}function Ca(e){let t=e.trim();return t.startsWith("/")||t.startsWith("(")||t.startsWith(".")?t:`//${t}`}function Il(e){let t=e.trim().replace(/^\/+/,"");if(!t)return null;let i=t.split("/").filter(Boolean),n=[];for(let a of i){let o=a.match(/^([a-zA-Z][\w-]*)(?:\[(\d+)\])?$/);if(!o)return null;let r=o[1].toLowerCase(),s=o[2]?`:nth-of-type(${o[2]})`:"";n.push(`${r}${s}`)}return n.join(" > ")}var Ne=w(()=>{"use strict";H();R();M()});async function ot(e,t,i){await e.evaluate(()=>{document.getElementById("playwright-highlight-container")?.remove(),window._highlightCleanupFunctions&&(window._highlightCleanupFunctions.forEach(l=>l()),window._highlightCleanupFunctions=[])});let n=await e.screenshot({type:"png",fullPage:!1}),{default:a}=await import("sharp"),o=a(n),{width:r=0,height:s=0}=await o.metadata();return k.log(`Screenshot actual: ${r}x${s}, viewport: ${t}x${i}`),(r!==t||s!==i?await o.resize(t,i).png().toBuffer():n).toString("base64")}async function be(e,t,i){let n=await e.evaluateHandle(r=>document.elementFromPoint(r.x,r.y),{x:t,y:i}),a=n.asElement();if(!a)throw await n.dispose(),new Error(`No element found at (${t}, ${i})`);let o=await a.boundingBox();if(!o)throw await n.dispose(),new Error(`Element at (${t}, ${i}) has no bounding box`);return{relative_x:t-(o.x+o.width/2),relative_y:i-(o.y+o.height/2),element:a}}async function gi(e,t){if(!t)return{xpath:void 0,locator:void 0,frame_path:[]};let i=await t.evaluate(a=>{let o=[],r=a;for(;r&&r.nodeType===Node.ELEMENT_NODE;){let s=1,l=r.previousElementSibling;for(;l;)l.tagName===r.tagName&&s++,l=l.previousElementSibling;o.unshift(`${r.tagName.toLowerCase()}[${s}]`),r=r.parentElement}return o.length?`/${o.join("/")}`:null}).catch(()=>null),n=await Nn(e,t);return{xpath:i??void 0,locator:n??void 0,frame_path:[]}}function fi(e,t,i){return{action_description:e,action_data:t,locator:i.locator??void 0,xpath:i.xpath??void 0,frame_path:i.frame_path}}var We=w(()=>{"use strict";te();Ne()});function wi(){let e=(G().env||{}).GOOGLE_GENAI_USE_VERTEXAI;return e==="True"||e==="true"}function La(e){let t=G().env||{};if(wi()){let n=t.GOOGLE_CLOUD_PROJECT;if(!n)throw new Error("GOOGLE_CLOUD_PROJECT is required when using Vertex AI");let a=e==="gemini-3-flash-preview"?"global":t.GOOGLE_CLOUD_LOCATION;if(!a)throw new Error("GOOGLE_CLOUD_LOCATION is required when using Vertex AI");return g.debug(`Using Vertex AI provider: model=${e}, location=${a}`),(0,Da.createVertex)({project:n,location:a})(e)}let i=t.GOOGLE_API_KEY;if(!i)throw new Error("Google API key is missing. Set GOOGLE_API_KEY in SDK config or environment.");return g.debug(`Using Google AI provider (API key): model=${e}`),(0,Na.createGoogleGenerativeAI)({apiKey:i})(e)}function Ra(e,t){let i={thinkingConfig:{thinkingBudget:512,includeThoughts:!0}},n={thinkingConfig:{thinkingLevel:"minimal",includeThoughts:!0},mediaResolution:Oa.MEDIA_RESOLUTION_HIGH},a;switch(t){case"gemini-3-flash-preview":a={...n};break;default:a={...i},e===1&&(a.mediaResolution=Oa.MEDIA_RESOLUTION_HIGH)}return wi()?{vertex:a}:{google:a}}var Na,Da,Oa,Ue=w(()=>{"use strict";H();ee();Na=require("@ai-sdk/google"),Da=require("@ai-sdk/google-vertex"),Oa={MEDIA_RESOLUTION_HIGH:"MEDIA_RESOLUTION_HIGH",MEDIA_RESOLUTION_MEDIUM:"MEDIA_RESOLUTION_MEDIUM",MEDIA_RESOLUTION_LOW:"MEDIA_RESOLUTION_LOW"}});function he(e,t){return Math.round(e/1e3*t)}async function Cl(e,t,i,n,a){let o=null,r=null;try{switch(t){case"click_at":{let s=he(i.x,n),l=he(i.y,a),d=await be(e,s,l);o={action_name:"click_by_coordinates",kwargs:{relative_x:d.relative_x,relative_y:d.relative_y}},r=d.element;break}case"right_click_at":{let s=he(i.x,n),l=he(i.y,a),d=await be(e,s,l);o={action_name:"right_click_by_coordinates",kwargs:{relative_x:d.relative_x,relative_y:d.relative_y}},r=d.element;break}case"double_click_at":{let s=he(i.x,n),l=he(i.y,a),d=await be(e,s,l);o={action_name:"double_click_by_coordinates",kwargs:{relative_x:d.relative_x,relative_y:d.relative_y}},r=d.element;break}case"drag_and_drop":{let s=he(i.x,n),l=he(i.y,a),d=he(i.destination_x,n),c=he(i.destination_y,a),u=await be(e,s,l);o={action_name:"drag_drop",kwargs:{relative_x:u.relative_x,relative_y:u.relative_y,delta_x:d-s,delta_y:c-l}},r=u.element;break}default:k.log(`Unsupported Gemini function: ${t}`)}}catch(s){k.error(`Error mapping Gemini action "${t}"`,s)}return{action_data:o,locatorInfo:await gi(e,r)}}async function Ha(e){let{statement:t,page:i,screenshotB64:n,viewportWidth:a,viewportHeight:o,modelId:r}=e,s=r||Ol,l=G(),d;if(wi()){let b=l.env?.GOOGLE_CLOUD_PROJECT;if(!b)return{status:"error",error:"GOOGLE_CLOUD_PROJECT is required when using Vertex AI."};let E=l.env?.GOOGLE_CLOUD_LOCATION??"global";d={vertexai:!0,project:b,location:E}}else{let b=l.env?.GOOGLE_API_KEY;if(!b)return{status:"error",error:"GOOGLE_API_KEY not found in SDK env config."};d={apiKey:b}}let c=new bi.GoogleGenAI(d);k.log(`Sending request to Gemini CUA (model=${s})...`);let u=await c.models.generateContent({model:s,contents:[{role:"user",parts:[{text:`Execute this action: ${t}`},{inlineData:{mimeType:"image/png",data:n}}]}],config:{tools:[{computerUse:{environment:bi.Environment.ENVIRONMENT_BROWSER,excludedPredefinedFunctions:["search","type_text_at","scroll_document","navigate","go_back","go_forward","key_combination","hover_at","scroll_at"]}},{functionDeclarations:Pl}],temperature:.1}});k.log("Received response from Gemini CUA");let m=u.candidates?.[0];if(!m)return{status:"error",error:"No candidates in Gemini response"};let f=m.content?.parts?.find(b=>b.functionCall);if(!f)return{status:"error",reasoning:m.content?.parts?.filter(b=>b.text).map(b=>b.text).join(" ")||"No action generated",error:"No function call in Gemini response"};let{name:h,args:x}=f.functionCall;k.log(`Generated function call: ${h} with args ${JSON.stringify(x)}`),g.debug(`Generated function call: ${h} with args ${JSON.stringify(x)}`);let{action_data:y,locatorInfo:p}=await Cl(i,h,x,a,o);return y?{status:"success",actionEntity:fi(t,y,p),reasoning:"Action generated successfully using Gemini computer use",goalAccomplished:!0}:{status:"error",error:`Unsupported or invalid Gemini action: ${h}`}}var bi,Fa,Pl,Ol,yi=w(()=>{"use strict";We();te();Ue();H();ee();bi=require("@google/genai");Fa={type:"object",properties:{x:{type:"integer",description:"X coordinate in the 0-1000 normalized space."},y:{type:"integer",description:"Y coordinate in the 0-1000 normalized space."}},required:["x","y"]},Pl=[{name:"right_click_at",description:"Right-click at the given normalized coordinate.",parameters:Fa},{name:"double_click_at",description:"Double-click at the given normalized coordinate.",parameters:Fa}];Ol="gemini-3-flash-preview"});function Ua(e){return e!=null&&typeof e=="object"}function Be(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Wa(e){return typeof e=="string"?e:void 0}function Nl(e){let t,i;return Array.isArray(e)?(t=Be(e[0]),i=Be(e[1])):Ua(e)&&(t=Be(e.x),i=Be(e.y)),t===void 0||i===void 0?null:{x:t,y:i}}function Ba(e){if(!Ua(e))return{};let t=Array.isArray(e.path)?e.path.map(Nl).filter(i=>i!==null):void 0;return{type:Wa(e.type),x:Be(e.x),y:Be(e.y),button:Wa(e.button),path:t}}var xi=w(()=>{"use strict"});async function Dl(e,t){let i=Ba(t),n=null,a=null;switch(i.type){case"click":{if(i.x===void 0||i.y===void 0)break;let o=i.button==="right"?"right_click_by_coordinates":"click_by_coordinates",r=await be(e,i.x,i.y);n={action_name:o,kwargs:{relative_x:r.relative_x,relative_y:r.relative_y}},a=r.element;break}case"double_click":{if(i.x===void 0||i.y===void 0)break;let o=await be(e,i.x,i.y);n={action_name:"double_click_by_coordinates",kwargs:{relative_x:o.relative_x,relative_y:o.relative_y}},a=o.element;break}case"drag":{if(!i.path||i.path.length<2)break;let o=i.path[0],r=i.path[i.path.length-1],s=await be(e,o.x,o.y);n={action_name:"drag_drop",kwargs:{relative_x:s.relative_x,relative_y:s.relative_y,delta_x:r.x-o.x,delta_y:r.y-o.y}},a=s.element;break}}return{action_data:n,locatorInfo:await gi(e,a)}}async function Ka(e){let{statement:t,page:i,viewportWidth:n,viewportHeight:a,modelId:o}=e,r=o||Ll,s=await ot(i,n,a),l=G().env?.OPENAI_API_KEY;if(!l)return{status:"error",error:"OPENAI_API_KEY not found in SDK env config."};let d=new ja.default({apiKey:l}),c=d.responses.create.bind(d.responses);k.log(`Sending request to OpenAI CUA (model=${r})...`);let u=[{role:"user",content:[{type:"input_text",text:t},{type:"input_image",detail:"original",image_url:`data:image/png;base64,${s}`}]}];async function m(p,b){let E={model:r,tools:[Rl],input:p,temperature:.1};return b&&(E.previous_response_id=b),c(E)}let f=await m(u,void 0),h;for(let p=0;p<Ga;p++){k.log(`Received response from OpenAI CUA (turn ${p+1})`);let b=f.output.find(A=>A.type==="computer_call");if(!b)return{status:"error",reasoning:f.output_text||"Invalid action generation response",error:"No computer_call in OpenAI response"};let E=b.actions??[];if(E.length>1&&k.log(`[openai CUA] dropping ${E.length-1} batched action(s); only the first is executed`),h=E[0],!h)return{status:"error",error:"OpenAI CUA returned a computer_call with no actions"};if(h.type!=="screenshot")break;s=await ot(i,n,a);let T=[{type:"computer_call_output",call_id:b.call_id,output:{type:"computer_screenshot",image_url:`data:image/png;base64,${s}`}}];f=await m(T,f.id)}if(!h)return{status:"error",error:"OpenAI CUA loop ended without an action"};if(h.type==="screenshot")return{status:"error",error:`OpenAI CUA kept requesting screenshots after ${Ga} turns`};k.log(`Generated action: ${JSON.stringify(h)}`);let{action_data:x,locatorInfo:y}=await Dl(i,h);return x?{status:"success",actionEntity:fi(t,x,y),reasoning:"Action generated successfully using OpenAI computer use",goalAccomplished:!0}:{status:"error",error:`Failed to map OpenAI action: ${JSON.stringify(h)}`}}var ja,Ll,Rl,Ga,vi=w(()=>{"use strict";xi();We();te();ee();ja=Q(require("openai"),1);Ll="gpt-5.4",Rl={type:"computer"},Ga=4});function Va(e){let t=G(),i=t.env?.OPENAI_API_KEY;if(!i)throw new Error("OPENAI_API_KEY not configured in SDK config");let n=t.env?.OPENAI_BASE_URL;return g.debug(`Using OpenAI provider: model=${e}${n?`, baseURL=${n}`:""}`),(0,za.createOpenAI)({apiKey:i,baseURL:n})(e)}function Xa(e){return{}}var za,rt=w(()=>{"use strict";H();ee();za=require("@ai-sdk/openai")});function Fl(e){if(!e)return!1;let t=e.trim().toLowerCase();return t==="1"||t==="true"||t==="yes"||t==="on"}function Dn(e){return G().env?.[e]??process.env[e]}function Hl(){return Fl(Dn("ANTHROPIC_MODELS_USE_VERTEXAI"))}function qa(e){if(Hl()){let i=Dn("GOOGLE_CLOUD_PROJECT"),n=Dn("GOOGLE_CLOUD_LOCATION");if(!i)throw new Error("GOOGLE_CLOUD_PROJECT is required when ANTHROPIC_MODELS_USE_VERTEXAI is enabled");if(!n)throw new Error("GOOGLE_CLOUD_LOCATION is required when ANTHROPIC_MODELS_USE_VERTEXAI is enabled");return g.debug(`Using Anthropic via Vertex AI provider: model=${e}, project=${i}, location=${n}`),(0,Ja.createVertexAnthropic)({project:i,location:n})(e)}let t=G().env?.ANTHROPIC_API_KEY;if(!t)throw new Error("ANTHROPIC_API_KEY not configured in SDK config");return g.debug(`Using Anthropic provider: model=${e}`),(0,Ya.createAnthropic)({apiKey:t})(e)}function Ln(e){return{anthropic:{structuredOutputMode:"jsonTool"}}}var Ya,Ja,st=w(()=>{"use strict";H();ee();Ya=require("@ai-sdk/anthropic"),Ja=require("@ai-sdk/google-vertex/anthropic")});function Qa(e){if(e.startsWith("claude-"))return"anthropic";if(e.startsWith("gemini-"))return"google";if(Wl.test(e))return"openai"}function _i(e){let t=e.indexOf(":");if(t>0){let i=e.slice(0,t);if(Ul.has(i))return{provider:i,modelId:e.slice(t+1)}}return{provider:void 0,modelId:e}}function ye(e){let{provider:t,modelId:i}=_i(e),n=t??Qa(i);if(!n)throw new Error(`Cannot determine provider for model: ${e}. Use a known model prefix (claude-*, gemini-*, gpt-*) or specify a provider (e.g., "openai:${i}", "azure:${i}", "bedrock:${i}").`);if(!i)throw new Error(`Empty model ID in model string: "${e}". Specify a model after the provider prefix (e.g., "${n}:gpt-5.4-mini").`);let a=Za[n];if(!a)throw new Error(`Provider "${n}" is not yet implemented. Supported providers: ${Object.keys(Za).join(", ")}. See packages/sdk-core/src/agent/llm/DESIGN.md for the roadmap.`);return a(i)}function xe(e,t){let{provider:i,modelId:n}=_i(e),a=i??Qa(n);return a==="anthropic"||a==="vertex"?Ln(n):a==="openai"||a==="azure"?Xa(n):a==="bedrock"?n.startsWith("anthropic.")?Ln(n):{}:Ra(t,n)}var Wl,Ul,Za,ve=w(()=>{"use strict";rt();st();Ue();Wl=/^(gpt-|o\d|chatgpt-)/;Ul=new Set(["anthropic","google","openai","vertex","azure","bedrock"]);Za={anthropic:qa,google:La,openai:Va}});function Gl(e){return e.startsWith("gemini-")?"google":"openai"}async function Ge(e,t,i={}){let{page:n}=t,a=n.viewportSize();if(!a)return{status:"error",error:"Viewport size not available"};let{width:o,height:r}=a;k.log(`Viewport: ${o}x${r}`);let s=await ot(n,o,r),l=t.agentServices.getComputerUseModel();if(!l)return{status:"error",error:"No computer use model configured"};let{modelId:d}=_i(l),c=Gl(d),u=Bl[c];k.log(`Using CUA provider: ${c} (model: ${d})`);let m={statement:e,page:n,screenshotB64:s,viewportWidth:o,viewportHeight:r,modelId:d};try{return await u(m)}catch(f){return k.error(`CUA provider "${c}" threw an error`,f),{status:"error",error:f.message??"CUA provider failed"}}}var Bl,je=w(()=>{"use strict";yi();vi();We();te();ve();Bl={google:Ha,openai:Ka}});function ki(e){let t=(0,eo.zodToJsonSchema)(e,{$refStrategy:"none"});if(t.$schema&&delete t.$schema,t.type!=="object")throw new Error(`Schema must be a Zod object schema, got type: ${t.type}`);return lt(t),t}function lt(e){if(!(typeof e!="object"||e===null)){if(e.type==="object"&&(e.additionalProperties=!1,e.properties)){let t=Object.keys(e.properties);e.required=t;for(let i of Object.values(e.properties))lt(i)}e.type==="array"&&e.items&&lt(e.items);for(let t of["anyOf","oneOf","allOf"])Array.isArray(e[t])&&e[t].forEach(lt);for(let[t,i]of Object.entries(e))typeof i=="object"&&i!==null&&!["properties","items","anyOf","oneOf","allOf"].includes(t)&&lt(i)}}var eo,ct=w(()=>{"use strict";eo=require("zod-to-json-schema")});var Rn,Si=w(()=>{"use strict";ct();Rn=class{constructor(e){this.registry=e}getToolDefinitions(){return this.registry.getTools().filter(e=>e.availability.openai).map(e=>({type:"function",function:{name:e.name,description:e.description,parameters:ki(e.schema),strict:!0}}))}getToolDefinitionsFiltered(e){let t=new Set(e);return this.registry.getTools().filter(i=>t.has(i.name)&&i.availability.openai).map(i=>({type:"function",function:{name:i.name,description:i.description,parameters:ki(i.schema),strict:!0}}))}toJSON(){return this.getToolDefinitions()}getToolDefinition(e){let t=this.registry.get(e);if(t)return{type:"function",function:{name:t.name,description:t.description,parameters:ki(t.schema),strict:!0}}}getToolCount(){return this.registry.size()}getToolNames(){return this.registry.getToolNames()}}});function jl(e,t){let i=new Map;for(let l of t)l.hash&&l.url?i.set(l.hash,l.url):l.uuid&&l.url&&i.set(l.uuid,l.url);let n=/!\[([^\]]*)\]\(image:([a-f0-9]{64}|[a-zA-Z0-9\-]+)\)/g,a=[],o=0,r;for(;(r=n.exec(e))!==null;){let l=e.slice(o,r.index);l&&a.push({type:"text",text:l});let d=r[2];i.has(d)?a.push({type:"image",image:new URL(i.get(d))}):a.push({type:"text",text:r[0]}),o=r.index+r[0].length}let s=e.slice(o);return s&&a.push({type:"text",text:s}),a.length===0&&a.push({type:"text",text:e}),a}function Kl(e){let t=[];for(let i of e){let n=i.content||"",a=i.images||[],o=jl(n,a);t.length>0&&o.length>0&&t.push({type:"text",text:`
14
+ ${e}`)}error(e,t){this.log(`ERROR: ${e}`),t&&(this.log(`Error details: ${t.message}`),t.stack&&this.log(`Stack: ${t.stack}`))}isEnabled(){return!!G().agentLogPath}},k=new _l});var Mn,kl,Sl,El,Ia,mi,$n,Pa,In,we=w(()=>{"use strict";Mn=Object.defineProperty,kl=Object.getOwnPropertyDescriptor,Sl=Object.getOwnPropertyNames,El=Object.prototype.hasOwnProperty,Ia=(e,t)=>()=>(e&&(t=e(e=0)),t),mi=(e,t)=>{for(var i in t)Mn(e,i,{get:t[i],enumerable:!0})},$n=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Sl(t))!El.call(e,a)&&a!==i&&Mn(e,a,{get:()=>t[a],enumerable:!(n=kl(t,a))||n.enumerable});return e},Pa=(e,t,i)=>($n(e,t,"default"),i&&$n(i,t,"default")),In=e=>$n(Mn({},"__esModule",{value:!0}),e)});function P(e,t){return t??e?.getActionSettings()?.action_timeout_ms??Cn}function Tl(e){return e.replace(/\r\n/g," ").replace(/\n/g," ").replace(/\r/g," ").trim()}function C(e,t){let i=Me(t);return i?new Function("page",`return ${i}`)(e):null}async function Pn(e,t=[]){let i=e;for(let n of t){let a=await i.locator(n).elementHandle();if(!a)return null;let o=await a.contentFrame();if(await a.dispose(),!o)return null;i=o}return i}function Al(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 $l(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function Ml(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 Me(e){let t=$l(e),i=e.locator;if(typeof i=="string"&&i.trim())return i=i.trim(),i.endsWith("first()")?`${t}.${i}`:`${t}.${i}.first()`;let n=Ml(e);if(n){let a=JSON.stringify(n);return`${t}.locator(${a}).first()`}return null}var pi,at,Cn,ue,M,R=w(()=>{"use strict";we();pi={};mi(pi,{ACTION_TIMEOUT:()=>Cn,GOTO_TIMEOUT:()=>ue,LOCATOR_TIMEOUT:()=>at,getActionTimeoutMs:()=>P,getFrameContext:()=>Pn,getLocator:()=>C,getMinimalActionEntity:()=>Al,getPageLocatorExpression:()=>Me,sanitizeForComment:()=>Tl});M=Ia(()=>{at=5e3,Cn=1e4,ue=2e4})});async function On(e,t,i=[],n=[]){try{let a=await Pn(e,i);if(!a)return g.warn(`Could not find frame context for xpath: ${t}`),null;let o=null;if(n.length>0){let s=n[0];if(!s)return g.warn(`Missing shadow host xpath for element: ${t}`),null;let l=a.locator(`xpath=${Ca(s)}`),d=Il(t);if(o=await(d?l.locator(`css=${d}`):l.locator(`xpath=${Ca(t)}`)).elementHandle({timeout:at}),!o)return g.warn(`Could not find shadow DOM element with xpath: ${t}`),null}else if(o=await a.locator(`xpath=${t}`).elementHandle({timeout:at}),!o)return g.warn(`Could not find element with xpath: ${t}`),null;let r=await a.evaluate(s=>typeof playwright<"u"&&playwright.generateLocator?playwright.generateLocator(s):null,o);return await o.dispose(),r?(g.debug(`Generated locator for ${t}: ${r}`),r):(g.debug("playwright.generateLocator is not available (PWDEBUG=console not set), using xpath fallback"),null)}catch(a){return g.error(`Error in pickBestLocator: ${a}`),null}}async function Nn(e,t){try{let i=await(await t.ownerFrame()??e).evaluate(n=>typeof playwright<"u"&&playwright.generateLocator?playwright.generateLocator(n):null,t);return await t.dispose(),i?(g.debug(`Generated locator: ${i}`),i):(g.debug("playwright.generateLocator is not available (PWDEBUG=console not set), using xpath fallback"),null)}catch(i){return g.error(`Error in pickBestLocator: ${i}`),null}}function Ca(e){let t=e.trim();return t.startsWith("/")||t.startsWith("(")||t.startsWith(".")?t:`//${t}`}function Il(e){let t=e.trim().replace(/^\/+/,"");if(!t)return null;let i=t.split("/").filter(Boolean),n=[];for(let a of i){let o=a.match(/^([a-zA-Z][\w-]*)(?:\[(\d+)\])?$/);if(!o)return null;let r=o[1].toLowerCase(),s=o[2]?`:nth-of-type(${o[2]})`:"";n.push(`${r}${s}`)}return n.join(" > ")}var Ne=w(()=>{"use strict";H();R();M()});async function ot(e,t,i){await e.evaluate(()=>{document.getElementById("playwright-highlight-container")?.remove(),window._highlightCleanupFunctions&&(window._highlightCleanupFunctions.forEach(l=>l()),window._highlightCleanupFunctions=[])});let n=await e.screenshot({type:"png",fullPage:!1}),{default:a}=await import("sharp"),o=a(n),{width:r=0,height:s=0}=await o.metadata();return k.log(`Screenshot actual: ${r}x${s}, viewport: ${t}x${i}`),(r!==t||s!==i?await o.resize(t,i).png().toBuffer():n).toString("base64")}async function be(e,t,i){let n=await e.evaluateHandle(r=>document.elementFromPoint(r.x,r.y),{x:t,y:i}),a=n.asElement();if(!a)throw await n.dispose(),new Error(`No element found at (${t}, ${i})`);let o=await a.boundingBox();if(!o)throw await n.dispose(),new Error(`Element at (${t}, ${i}) has no bounding box`);return{relative_x:t-(o.x+o.width/2),relative_y:i-(o.y+o.height/2),element:a}}async function gi(e,t){if(!t)return{xpath:void 0,locator:void 0,frame_path:[]};let i=await t.evaluate(a=>{let o=[],r=a;for(;r&&r.nodeType===Node.ELEMENT_NODE;){let s=1,l=r.previousElementSibling;for(;l;)l.tagName===r.tagName&&s++,l=l.previousElementSibling;o.unshift(`${r.tagName.toLowerCase()}[${s}]`),r=r.parentElement}return o.length?`/${o.join("/")}`:null}).catch(()=>null),n=await Nn(e,t);return{xpath:i??void 0,locator:n??void 0,frame_path:[]}}function fi(e,t,i){return{action_description:e,action_data:t,locator:i.locator??void 0,xpath:i.xpath??void 0,frame_path:i.frame_path}}var We=w(()=>{"use strict";te();Ne()});function wi(){let e=(G().env||{}).GOOGLE_GENAI_USE_VERTEXAI;return e==="True"||e==="true"}function La(e){let t=G().env||{};if(wi()){let n=t.GOOGLE_CLOUD_PROJECT;if(!n)throw new Error("GOOGLE_CLOUD_PROJECT is required when using Vertex AI");let a=e==="gemini-3-flash-preview"?"global":t.GOOGLE_CLOUD_LOCATION;if(!a)throw new Error("GOOGLE_CLOUD_LOCATION is required when using Vertex AI");return g.debug(`Using Vertex AI provider: model=${e}, location=${a}`),(0,Da.createVertex)({project:n,location:a})(e)}let i=t.GOOGLE_API_KEY;if(!i)throw new Error("Google API key is missing. Set GOOGLE_API_KEY in SDK config or environment.");return g.debug(`Using Google AI provider (API key): model=${e}`),(0,Na.createGoogleGenerativeAI)({apiKey:i})(e)}function Ra(e,t){let i={thinkingConfig:{thinkingBudget:512,includeThoughts:!0}},n={thinkingConfig:{thinkingLevel:"minimal",includeThoughts:!0},mediaResolution:Oa.MEDIA_RESOLUTION_HIGH},a;switch(t){case"gemini-3-flash-preview":a={...n};break;default:a={...i},e===1&&(a.mediaResolution=Oa.MEDIA_RESOLUTION_HIGH)}return wi()?{vertex:a}:{google:a}}var Na,Da,Oa,Ue=w(()=>{"use strict";H();ee();Na=require("@ai-sdk/google"),Da=require("@ai-sdk/google-vertex"),Oa={MEDIA_RESOLUTION_HIGH:"MEDIA_RESOLUTION_HIGH",MEDIA_RESOLUTION_MEDIUM:"MEDIA_RESOLUTION_MEDIUM",MEDIA_RESOLUTION_LOW:"MEDIA_RESOLUTION_LOW"}});function he(e,t){return Math.round(e/1e3*t)}async function Cl(e,t,i,n,a){let o=null,r=null;try{switch(t){case"click_at":{let s=he(i.x,n),l=he(i.y,a),d=await be(e,s,l);o={action_name:"click_by_coordinates",kwargs:{relative_x:d.relative_x,relative_y:d.relative_y}},r=d.element;break}case"right_click_at":{let s=he(i.x,n),l=he(i.y,a),d=await be(e,s,l);o={action_name:"right_click_by_coordinates",kwargs:{relative_x:d.relative_x,relative_y:d.relative_y}},r=d.element;break}case"double_click_at":{let s=he(i.x,n),l=he(i.y,a),d=await be(e,s,l);o={action_name:"double_click_by_coordinates",kwargs:{relative_x:d.relative_x,relative_y:d.relative_y}},r=d.element;break}case"drag_and_drop":{let s=he(i.x,n),l=he(i.y,a),d=he(i.destination_x,n),c=he(i.destination_y,a),u=await be(e,s,l);o={action_name:"drag_drop",kwargs:{relative_x:u.relative_x,relative_y:u.relative_y,delta_x:d-s,delta_y:c-l}},r=u.element;break}default:k.log(`Unsupported Gemini function: ${t}`)}}catch(s){k.error(`Error mapping Gemini action "${t}"`,s)}return{action_data:o,locatorInfo:await gi(e,r)}}async function Ha(e){let{statement:t,page:i,screenshotB64:n,viewportWidth:a,viewportHeight:o,modelId:r}=e,s=r||Ol,l=G(),d;if(wi()){let b=l.env?.GOOGLE_CLOUD_PROJECT;if(!b)return{status:"error",error:"GOOGLE_CLOUD_PROJECT is required when using Vertex AI."};let E=l.env?.GOOGLE_CLOUD_LOCATION??"global";d={vertexai:!0,project:b,location:E}}else{let b=l.env?.GOOGLE_API_KEY;if(!b)return{status:"error",error:"GOOGLE_API_KEY not found in SDK env config."};d={apiKey:b}}let c=new bi.GoogleGenAI(d);k.log(`Sending request to Gemini CUA (model=${s})...`);let u=await c.models.generateContent({model:s,contents:[{role:"user",parts:[{text:`Execute this action: ${t}`},{inlineData:{mimeType:"image/png",data:n}}]}],config:{tools:[{computerUse:{environment:bi.Environment.ENVIRONMENT_BROWSER,excludedPredefinedFunctions:["search","type_text_at","scroll_document","navigate","go_back","go_forward","key_combination","hover_at","scroll_at"]}},{functionDeclarations:Pl}],temperature:.1}});k.log("Received response from Gemini CUA");let m=u.candidates?.[0];if(!m)return{status:"error",error:"No candidates in Gemini response"};let f=m.content?.parts?.find(b=>b.functionCall);if(!f)return{status:"error",reasoning:m.content?.parts?.filter(b=>b.text).map(b=>b.text).join(" ")||"No action generated",error:"No function call in Gemini response"};let{name:h,args:x}=f.functionCall;k.log(`Generated function call: ${h} with args ${JSON.stringify(x)}`),g.debug(`Generated function call: ${h} with args ${JSON.stringify(x)}`);let{action_data:y,locatorInfo:p}=await Cl(i,h,x,a,o);return y?{status:"success",actionEntity:fi(t,y,p),reasoning:"Action generated successfully using Gemini computer use",goalAccomplished:!0}:{status:"error",error:`Unsupported or invalid Gemini action: ${h}`}}var bi,Fa,Pl,Ol,yi=w(()=>{"use strict";We();te();Ue();H();ee();bi=require("@google/genai");Fa={type:"object",properties:{x:{type:"integer",description:"X coordinate in the 0-1000 normalized space."},y:{type:"integer",description:"Y coordinate in the 0-1000 normalized space."}},required:["x","y"]},Pl=[{name:"right_click_at",description:"Right-click at the given normalized coordinate.",parameters:Fa},{name:"double_click_at",description:"Double-click at the given normalized coordinate.",parameters:Fa}];Ol="gemini-3-flash-preview"});function Ua(e){return e!=null&&typeof e=="object"}function Be(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Wa(e){return typeof e=="string"?e:void 0}function Nl(e){let t,i;return Array.isArray(e)?(t=Be(e[0]),i=Be(e[1])):Ua(e)&&(t=Be(e.x),i=Be(e.y)),t===void 0||i===void 0?null:{x:t,y:i}}function Ba(e){if(!Ua(e))return{};let t=Array.isArray(e.path)?e.path.map(Nl).filter(i=>i!==null):void 0;return{type:Wa(e.type),x:Be(e.x),y:Be(e.y),button:Wa(e.button),path:t}}var xi=w(()=>{"use strict"});async function Dl(e,t){let i=Ba(t),n=null,a=null;switch(i.type){case"click":{if(i.x===void 0||i.y===void 0)break;let o=i.button==="right"?"right_click_by_coordinates":"click_by_coordinates",r=await be(e,i.x,i.y);n={action_name:o,kwargs:{relative_x:r.relative_x,relative_y:r.relative_y}},a=r.element;break}case"double_click":{if(i.x===void 0||i.y===void 0)break;let o=await be(e,i.x,i.y);n={action_name:"double_click_by_coordinates",kwargs:{relative_x:o.relative_x,relative_y:o.relative_y}},a=o.element;break}case"drag":{if(!i.path||i.path.length<2)break;let o=i.path[0],r=i.path[i.path.length-1],s=await be(e,o.x,o.y);n={action_name:"drag_drop",kwargs:{relative_x:s.relative_x,relative_y:s.relative_y,delta_x:r.x-o.x,delta_y:r.y-o.y}},a=s.element;break}}return{action_data:n,locatorInfo:await gi(e,a)}}async function Ka(e){let{statement:t,page:i,viewportWidth:n,viewportHeight:a,modelId:o}=e,r=o||Ll,s=await ot(i,n,a),l=G().env?.OPENAI_API_KEY;if(!l)return{status:"error",error:"OPENAI_API_KEY not found in SDK env config."};let d=new ja.default({apiKey:l}),c=d.responses.create.bind(d.responses);k.log(`Sending request to OpenAI CUA (model=${r})...`);let u=[{role:"user",content:[{type:"input_text",text:t},{type:"input_image",detail:"original",image_url:`data:image/png;base64,${s}`}]}];async function m(p,b){let E={model:r,tools:[Rl],input:p,temperature:.1};return b&&(E.previous_response_id=b),c(E)}let f=await m(u,void 0),h;for(let p=0;p<Ga;p++){k.log(`Received response from OpenAI CUA (turn ${p+1})`);let b=f.output.find(A=>A.type==="computer_call");if(!b)return{status:"error",reasoning:f.output_text||"Invalid action generation response",error:"No computer_call in OpenAI response"};let E=b.actions??[];if(E.length>1&&k.log(`[openai CUA] dropping ${E.length-1} batched action(s); only the first is executed`),h=E[0],!h)return{status:"error",error:"OpenAI CUA returned a computer_call with no actions"};if(h.type!=="screenshot")break;s=await ot(i,n,a);let T=[{type:"computer_call_output",call_id:b.call_id,output:{type:"computer_screenshot",image_url:`data:image/png;base64,${s}`,detail:"original"}}];f=await m(T,f.id)}if(!h)return{status:"error",error:"OpenAI CUA loop ended without an action"};if(h.type==="screenshot")return{status:"error",error:`OpenAI CUA kept requesting screenshots after ${Ga} turns`};k.log(`Generated action: ${JSON.stringify(h)}`);let{action_data:x,locatorInfo:y}=await Dl(i,h);return x?{status:"success",actionEntity:fi(t,x,y),reasoning:"Action generated successfully using OpenAI computer use",goalAccomplished:!0}:{status:"error",error:`Failed to map OpenAI action: ${JSON.stringify(h)}`}}var ja,Ll,Rl,Ga,vi=w(()=>{"use strict";xi();We();te();ee();ja=Q(require("openai"),1);Ll="gpt-5.4",Rl={type:"computer"},Ga=4});function Va(e){let t=G(),i=t.env?.OPENAI_API_KEY;if(!i)throw new Error("OPENAI_API_KEY not configured in SDK config");let n=t.env?.OPENAI_BASE_URL;return g.debug(`Using OpenAI provider: model=${e}${n?`, baseURL=${n}`:""}`),(0,za.createOpenAI)({apiKey:i,baseURL:n})(e)}function Xa(e){return{}}var za,rt=w(()=>{"use strict";H();ee();za=require("@ai-sdk/openai")});function Fl(e){if(!e)return!1;let t=e.trim().toLowerCase();return t==="1"||t==="true"||t==="yes"||t==="on"}function Dn(e){return G().env?.[e]??process.env[e]}function Hl(){return Fl(Dn("ANTHROPIC_MODELS_USE_VERTEXAI"))}function qa(e){if(Hl()){let i=Dn("GOOGLE_CLOUD_PROJECT"),n=Dn("GOOGLE_CLOUD_LOCATION");if(!i)throw new Error("GOOGLE_CLOUD_PROJECT is required when ANTHROPIC_MODELS_USE_VERTEXAI is enabled");if(!n)throw new Error("GOOGLE_CLOUD_LOCATION is required when ANTHROPIC_MODELS_USE_VERTEXAI is enabled");return g.debug(`Using Anthropic via Vertex AI provider: model=${e}, project=${i}, location=${n}`),(0,Ja.createVertexAnthropic)({project:i,location:n})(e)}let t=G().env?.ANTHROPIC_API_KEY;if(!t)throw new Error("ANTHROPIC_API_KEY not configured in SDK config");return g.debug(`Using Anthropic provider: model=${e}`),(0,Ya.createAnthropic)({apiKey:t})(e)}function Ln(e){return{anthropic:{structuredOutputMode:"jsonTool"}}}var Ya,Ja,st=w(()=>{"use strict";H();ee();Ya=require("@ai-sdk/anthropic"),Ja=require("@ai-sdk/google-vertex/anthropic")});function Qa(e){if(e.startsWith("claude-"))return"anthropic";if(e.startsWith("gemini-"))return"google";if(Wl.test(e))return"openai"}function _i(e){let t=e.indexOf(":");if(t>0){let i=e.slice(0,t);if(Ul.has(i))return{provider:i,modelId:e.slice(t+1)}}return{provider:void 0,modelId:e}}function ye(e){let{provider:t,modelId:i}=_i(e),n=t??Qa(i);if(!n)throw new Error(`Cannot determine provider for model: ${e}. Use a known model prefix (claude-*, gemini-*, gpt-*) or specify a provider (e.g., "openai:${i}", "azure:${i}", "bedrock:${i}").`);if(!i)throw new Error(`Empty model ID in model string: "${e}". Specify a model after the provider prefix (e.g., "${n}:gpt-5.4-mini").`);let a=Za[n];if(!a)throw new Error(`Provider "${n}" is not yet implemented. Supported providers: ${Object.keys(Za).join(", ")}. See packages/sdk-core/src/agent/llm/DESIGN.md for the roadmap.`);return a(i)}function xe(e,t){let{provider:i,modelId:n}=_i(e),a=i??Qa(n);return a==="anthropic"||a==="vertex"?Ln(n):a==="openai"||a==="azure"?Xa(n):a==="bedrock"?n.startsWith("anthropic.")?Ln(n):{}:Ra(t,n)}var Wl,Ul,Za,ve=w(()=>{"use strict";rt();st();Ue();Wl=/^(gpt-|o\d|chatgpt-)/;Ul=new Set(["anthropic","google","openai","vertex","azure","bedrock"]);Za={anthropic:qa,google:La,openai:Va}});function Gl(e){return e.startsWith("gemini-")?"google":"openai"}async function Ge(e,t,i={}){let{page:n}=t,a=n.viewportSize();if(!a)return{status:"error",error:"Viewport size not available"};let{width:o,height:r}=a;k.log(`Viewport: ${o}x${r}`);let s=await ot(n,o,r),l=t.agentServices.getComputerUseModel();if(!l)return{status:"error",error:"No computer use model configured"};let{modelId:d}=_i(l),c=Gl(d),u=Bl[c];k.log(`Using CUA provider: ${c} (model: ${d})`);let m={statement:e,page:n,screenshotB64:s,viewportWidth:o,viewportHeight:r,modelId:d};try{return await u(m)}catch(f){return k.error(`CUA provider "${c}" threw an error`,f),{status:"error",error:f.message??"CUA provider failed"}}}var Bl,je=w(()=>{"use strict";yi();vi();We();te();ve();Bl={google:Ha,openai:Ka}});function ki(e){let t=(0,eo.zodToJsonSchema)(e,{$refStrategy:"none"});if(t.$schema&&delete t.$schema,t.type!=="object")throw new Error(`Schema must be a Zod object schema, got type: ${t.type}`);return lt(t),t}function lt(e){if(!(typeof e!="object"||e===null)){if(e.type==="object"&&(e.additionalProperties=!1,e.properties)){let t=Object.keys(e.properties);e.required=t;for(let i of Object.values(e.properties))lt(i)}e.type==="array"&&e.items&&lt(e.items);for(let t of["anyOf","oneOf","allOf"])Array.isArray(e[t])&&e[t].forEach(lt);for(let[t,i]of Object.entries(e))typeof i=="object"&&i!==null&&!["properties","items","anyOf","oneOf","allOf"].includes(t)&&lt(i)}}var eo,ct=w(()=>{"use strict";eo=require("zod-to-json-schema")});var Rn,Si=w(()=>{"use strict";ct();Rn=class{constructor(e){this.registry=e}getToolDefinitions(){return this.registry.getTools().filter(e=>e.availability.openai).map(e=>({type:"function",function:{name:e.name,description:e.description,parameters:ki(e.schema),strict:!0}}))}getToolDefinitionsFiltered(e){let t=new Set(e);return this.registry.getTools().filter(i=>t.has(i.name)&&i.availability.openai).map(i=>({type:"function",function:{name:i.name,description:i.description,parameters:ki(i.schema),strict:!0}}))}toJSON(){return this.getToolDefinitions()}getToolDefinition(e){let t=this.registry.get(e);if(t)return{type:"function",function:{name:t.name,description:t.description,parameters:ki(t.schema),strict:!0}}}getToolCount(){return this.registry.size()}getToolNames(){return this.registry.getToolNames()}}});function jl(e,t){let i=new Map;for(let l of t)l.hash&&l.url?i.set(l.hash,l.url):l.uuid&&l.url&&i.set(l.uuid,l.url);let n=/!\[([^\]]*)\]\(image:([a-f0-9]{64}|[a-zA-Z0-9\-]+)\)/g,a=[],o=0,r;for(;(r=n.exec(e))!==null;){let l=e.slice(o,r.index);l&&a.push({type:"text",text:l});let d=r[2];i.has(d)?a.push({type:"image",image:new URL(i.get(d))}):a.push({type:"text",text:r[0]}),o=r.index+r[0].length}let s=e.slice(o);return s&&a.push({type:"text",text:s}),a.length===0&&a.push({type:"text",text:e}),a}function Kl(e){let t=[];for(let i of e){let n=i.content||"",a=i.images||[],o=jl(n,a);t.length>0&&o.length>0&&t.push({type:"text",text:`
15
15
 
16
16
  `}),t.push(...o)}return t}function Ei(e,t=to){if(t){let i=Kl(e);if(i.length===0)return[];let n={type:"text",text:`
17
17
 
@@ -4298,7 +4298,7 @@ ${f.join(`
4298
4298
  `,n+=`- Use the EXACT placeholder name as shown above
4299
4299
  `,n+=`- Do NOT use the actual value directly in the action
4300
4300
  `,n+=`- The values shown are for context only to help you understand what data is available
4301
- `,n+='- In action descriptions, describe what the placeholder represents in natural language (e.g., "Type the first user name" instead of "Type {{ firstUserName }}")',n}}});var ii=w(()=>{"use strict"});async function nd(e,t){let i=new Set,n=Date.now(),a=new Set(["document","stylesheet","image","font","script","iframe"]),o=new Set(["text/html","text/css","application/javascript","image/","font/","application/json"]),r=["analytics","tracking","telemetry","beacon","metrics","doubleclick","adsystem","adserver","advertising","facebook.com/plugins","platform.twitter","linkedin.com/embed","livechat","zendesk","intercom","crisp.chat","hotjar","push-notifications","onesignal","pushwoosh","heartbeat","ping","alive","webrtc","rtmp://","wss://","cloudfront.net","fastly.net"],s=u=>{let m=u.toLowerCase();return m.startsWith("data:")||m.startsWith("blob:")?!0:r.some(f=>m.includes(f))},l=u=>{let m=u.resourceType(),f=u.url();if(!a.has(m)||s(f))return;let h=u.headers();h.purpose==="prefetch"||["video","audio"].includes(h["sec-fetch-dest"])||(i.add(u),n=Date.now())},d=async u=>{let m=u.request();if(!i.has(m))return;let f=(u.headers()["content-type"]||"").toLowerCase();if(["streaming","video","audio","webm","mp4","event-stream","websocket","protobuf"].some(x=>f.includes(x))){i.delete(m);return}if(![...o].some(x=>f.startsWith(x))){i.delete(m);return}let h=u.headers()["content-length"];if(h)try{if(parseInt(h,10)>5*1024*1024){i.delete(m);return}}catch{}i.delete(m),n=Date.now()},c=Date.now()-id;for(let u of await e.requests()){let m=u.resourceType(),f=u.url(),h=u.timing();a.has(m)&&!s(f)&&h.responseEnd===-1&&h.startTime>=c&&(i.add(u),n=Date.now())}g.debug(`[waitForStableNetwork] Pre-populated ${i.size} in-flight requests`),e.on("request",l),e.on("response",d);try{let u=Date.now(),m=td;for(;;){await new Promise(h=>setTimeout(h,100));let f=Date.now();if(i.size===0&&f-n>=m){g.debug(`[waitForStableNetwork] Network idle after ${f-u}ms`);break}if(f-u>t){g.debug(`[waitForStableNetwork] Max wait time exceeded (${t}ms), pending: ${i.size}`);break}}}finally{e.removeListener("request",l),e.removeListener("response",d)}}async function qe(e,t=ed,i=Qc){let n=Date.now();try{await Promise.all([e.waitForLoadState("load",{timeout:t}).catch(()=>{}),nd(e,t)])}catch(r){throw r instanceof Error?new Error(`Failed during network stabilization: ${r.message}`):new Error("An unknown error occurred during network stabilization.")}let a=Date.now()-n,o=Math.max(i-a,0);o>0&&await new Promise(r=>setTimeout(r,o))}var Qc,ed,td,id,Pe=w(()=>{"use strict";ii();H();Qc=.5*1e3,ed=30*1e3,td=1*1e3,id=3*1e3});function ad(e,t){return e?{prompt_tokens:e.promptTokens||e.inputTokens||0,completion_tokens:e.completionTokens||e.outputTokens||0,total_tokens:e.totalTokens||0,model:t}:null}async function Ur(e,t,i={}){let n=Date.now();if(i.maxSteps!==void 0&&i.maxSteps<=0)throw new Error(`maxSteps must be >= 1, got ${i.maxSteps}`);let a=i.maxSteps??15,o=3,r=t.agentServices.getModel(),s=t.domService||new Ie(t.agentServices.getDomServiceOptions()),l={...t,domService:s};k.init(),k.section("Task Execution Started"),k.log(`Task: ${e}`),k.log(`Max steps: ${a}`),k.log(`Model: ${r}`);let d={currentStep:0,maxSteps:a,consecutiveFailures:0,maxFailures:o,lastFailReason:null,stepHistory:[],memory:[],lastGoal:null,lastEvaluation:null},c=[],u=pn(i.customPrompt),m=new fn(u);k.log(`System prompt length: ${u.length} chars`);let f=!1,h="",x=[];try{for(i.onEvent?.({type:"start",task:e,maxSteps:a});d.currentStep<a;){if(i.abortSignal?.aborted)throw new Error("Task aborted by user");d.currentStep++;let y=Date.now();k.section(`Step ${d.currentStep}/${a}`),k.log(`URL: ${l.page.url()}`),i.onEvent?.({type:"step_start",step:d.currentStep});try{k.log("Waiting for page to stabilize..."),await qe(l.page),k.log("Page stabilized")}catch{k.log("Page stabilization timed out, continuing anyway")}let p;try{k.log("Preparing context (DOM + screenshot)...");let L=l.agentServices.getInteractiveClassNames(),F=l.agentServices.getIframeFallbackDomains();p=await Hr(l.page,l.domService,L,F),k.log("Context prepared")}catch(L){if(L.message.includes("Execution context was destroyed")){k.log("Page navigating, waiting for load..."),await qe(l.page);let F=l.agentServices.getInteractiveClassNames(),O=l.agentServices.getIframeFallbackDomains();p=await Hr(l.page,l.domService,F,O)}else throw k.error("Error preparing context",L),L}m.addStateMessage(e,p.currentUrl,p.domTree,p.screenshotBase64,d,{isFinalStep:d.currentStep===a-1,placeholderData:t.variables,sensitiveKeys:t.sensitiveKeys});let b=await rd(m,r,i,p.screenshotBase64);if(b.tokenUsages&&b.tokenUsages.length>0&&c.push(...b.tokenUsages),!b.stepOutput){if(k.error("Failed to get valid LLM response"),d.consecutiveFailures++,d.consecutiveFailures>=o){h="Reached the maximum allowed consecutive failures. Most recent error: Unable to get a valid response from the language model.";break}continue}let E=b.stepOutput;dd(d.currentStep,a,E);let T=await ld(E,l,p.domState,d.currentStep,i.onEvent,p.screenshotBase64,b.debugInfo);x.push(...T.actionEntities);let A=cd(d.currentStep,E,T,d,y,b.debugInfo,b.tokenUsages),I=Date.now()-y;if(i.onEvent?.({type:"step_complete",step:d.currentStep,duration:I}),d.consecutiveFailures>=o){k.error(`Too many consecutive failures (${d.consecutiveFailures}), stopping`),h=`Reached the maximum allowed consecutive failures. Most recent error: ${d.lastFailReason}`;break}if(T.doneResult){f=T.doneResult.success,h=T.doneResult.summary;break}if(T.completesInstruction){f=!0,h="Instruction completed";break}}return d.currentStep>=a&&!f&&(h="Reached the maximum allowed steps."),i.onEvent?.({type:"complete",totalSteps:d.currentStep,duration:Date.now()-n}),k.log(`Build success result: summary=${h}, completed=${f}, actions=${x.length}, tokens=${c.length}`),ud(d,x,f,h,n,c,r)}catch(y){let p=y.message;return k.error(`Task execution failed: ${p}`,y),i.onEvent?.({type:"error",error:p,recoverable:!1}),hd(d,p,n,c,r)}}async function Hr(e,t,i,n){let{domState:a,screenshotBase64:o}=await t.getClickableElementsWithScreenshot(e,{interactiveClassNames:i,playwrightFrameFallbackDomains:n}),r=a.elementTree.clickableElementsToString();return{currentUrl:e.url(),domTree:r,screenshotBase64:o,domState:a}}function od(e){return e.map(t=>({role:t.role,content:Array.isArray(t.content)?t.content.map(i=>{if(i.type==="image"){let n=i.image,a=typeof n=="string"?n:"";return{type:"image",file:a.startsWith("data:")?a:`data:image/png;base64,${a}`}}return{type:"text",text:i.text}}):t.content}))}async function rd(e,t,i,n){let a=i.temperature??0,{system:o,messages:r}=e.getMessages(),s=0;for(let u of r)Array.isArray(u.content)&&(s+=u.content.filter(m=>m.type==="image").length);let l=xe(t,s),d={model:ye(t),system:o,messages:r,temperature:a,providerOptions:l},c=3;for(let u=0;u<c;u++)try{let m=Date.now();k.log(`Calling LLM (${t})...`);let f=await(0,Wr.generateText)(d),h=Date.now()-m,x=f,y=x.usage;k.llmCall(t,h,y);let p=x.reasoningText;p&&(k.thinking(p),i.onEvent?.({type:"thinking",text:p})),e.addAssistantMessage(f.text);let b={systemPrompt:o,userPrompt:od(r),rawLlmResponse:f.text,reasoningContent:p,screenshotWithSom:n},E=[],T=ad(y,t);T&&E.push(T);let A=sd(f.text);if(!A)if(u<c-1){k.log(`Attempt ${u+1}/${c}: Failed to parse response, retrying...`),e.addTextMessage("user","Your response was not valid JSON. Please respond with a properly formatted JSON object according to the expected format."),await new Promise(I=>setTimeout(I,i.retryDelay||1e3));continue}else return k.error("All parsing attempts failed"),{stepOutput:null,debugInfo:b,tokenUsages:E};return{stepOutput:A,debugInfo:b,tokenUsages:E}}catch(m){if(u<c-1){k.log(`Attempt ${u+1}/${c}: LLM call failed (${m.message}), retrying...`),await new Promise(f=>setTimeout(f,i.retryDelay||1e3));continue}else throw k.error("All LLM call attempts failed",m),m}return{stepOutput:null}}function sd(e){let t=e.trim();t.startsWith("```json")?t=t.replace(/^```json\s*/,"").replace(/\s*```\s*$/,""):t.startsWith("```")&&(t=t.replace(/^```\s*/,"").replace(/\s*```\s*$/,""));try{let i=JSON.parse(t);if(!i.current_goal)return k.error("Missing required field: current_goal"),null;if(!i.actions||!Array.isArray(i.actions)||i.actions.length===0)return k.error("Missing required field: actions (must be non-empty array)"),null;for(let n of i.actions){if(!n.action_name)return k.error("Action missing required field: action_name"),null;if(!n.description)return k.error("Action missing required field: description"),null}return i}catch(i){return k.error(`Failed to parse LLM JSON response: ${t.substring(0,500)}`),k.error(`Parse error: ${i.message}`),null}}async function ld(e,t,i,n,a,o,r){let s=[],l=!0,d=null;k.log(`Using pre-captured DOM state with ${i.selectorMap.size} elements for ${e.actions.length} action(s)`);let c=null,u={...t,domState:i},m=o;for(let f of e.actions){if(f.action_name==="done"){c={success:f.kwargs.success??!0,summary:f.kwargs.summary||f.kwargs.text||"Task completed"};break}let h={},x=f.kwargs?.element_index??f.kwargs?.index;if(typeof x=="number"){let p=i.selectorMap.get(x);p&&(h=await D(t.page,p))}let y={...h,action_description:f.description,action_data:{action_name:f.action_name,kwargs:f.kwargs}};try{let p=await W.execute(f.action_name,f.kwargs,u);f.action_name==="perform_accurate_operation"&&(y=p.actionEntity);let b=await u.agentServices.getCurrentPage();if(b&&(u.page=b,t.page=u.page),p?.success===!1){l=!1,k.log("Action failed, stopping execution of remaining actions in this step"),d=p.error||"Action execution failed";break}s.push(y),a?.({type:"action",action_entity:y,step:n,debugInfo:r})}catch(p){l=!1,d=p.message,k.error(`Action execution failed: ${p.message}`);break}}return{allSuccess:l,failReason:d,actionEntities:s,doneResult:c,completesInstruction:e.completes_instruction??!1}}function cd(e,t,i,n,a,o,r){let s={stepNumber:e,thinking:t.thinking,evaluation:t.evaluation_previous_goal,memory:t.memory,goal:t.current_goal,actions:i.actionEntities,timestamp:a,duration:Date.now()-a,outcome:{success:i.allSuccess},debugInfo:o,tokenUsages:r};if(n.lastGoal=t.current_goal,t.evaluation_previous_goal&&(n.lastEvaluation=t.evaluation_previous_goal),t.memory&&t.memory.trim()){let l=t.memory.trim();n.memory.includes(l)||(n.memory.push(l),n.memory.length>10&&(n.memory=n.memory.slice(-10)))}return i.allSuccess?(n.consecutiveFailures=0,n.lastFailReason=null):(n.consecutiveFailures++,n.lastFailReason=i.failReason),n.stepHistory.push(s),s}function dd(e,t,i){if(k.log(`Step ${e}/${t}`),i.thinking&&k.log(`Thinking: ${i.thinking}`),i.evaluation_previous_goal&&k.log(`Evaluation: ${i.evaluation_previous_goal}`),i.memory&&k.log(`Memory: ${i.memory}`),k.log(`Goal: ${i.current_goal}`),i.actions.length===1){let n=i.actions[0];k.log(`Action: ${n.action_name}(${JSON.stringify(n.kwargs)}) - ${n.description}`)}else k.log(`Actions (${i.actions.length}):`),i.actions.forEach((n,a)=>{k.log(` ${a+1}. ${n.action_name}(${JSON.stringify(n.kwargs)}) - ${n.description}`)})}function ud(e,t,i,n,a,o,r){let s=o.reduce((c,u)=>c+u.prompt_tokens,0),l=o.reduce((c,u)=>c+u.completion_tokens,0),d=o.reduce((c,u)=>c+u.total_tokens,0);return{success:!0,completed:i,summary:n,trajectory:{steps:e.currentStep,actions:t,stepRecords:e.stepHistory},metadata:{totalSteps:e.currentStep,totalDuration:Date.now()-a,model:r,successfulSteps:e.stepHistory.filter(c=>c.outcome.success).length,failedSteps:e.stepHistory.filter(c=>!c.outcome.success).length,promptTokens:s,completionTokens:l,totalTokens:d,tokenUsages:o}}}function hd(e,t,i,n,a){let o=n.reduce((l,d)=>l+d.prompt_tokens,0),r=n.reduce((l,d)=>l+d.completion_tokens,0),s=n.reduce((l,d)=>l+d.total_tokens,0);return{success:!1,completed:!1,error:t,trajectory:{steps:e.currentStep,actions:[],stepRecords:e.stepHistory},metadata:{totalSteps:e.currentStep,totalDuration:Date.now()-i,model:a,successfulSteps:e.stepHistory.filter(l=>l.outcome.success).length,failedSteps:e.stepHistory.filter(l=>!l.outcome.success).length,promptTokens:o,completionTokens:r,totalTokens:s,tokenUsages:n}}}var Wr,Br=w(()=>{"use strict";ga();gn();_e();De();te();Pe();ve();j();Wr=require("ai")});var Gr={};He(Gr,{TaskMessageManager:()=>fn,formatFinalStepWarning:()=>Rr,formatTaskContext:()=>mn,getBrowserTaskJSONPrompt:()=>pn,runTaskLoop:()=>Ur});var jr=w(()=>{"use strict";Br();ga();gn();_e();Gi();De();gt();ft();Ke();wt();bt();te();Pe();ii();ve();rt();st();Ue();j();Ne();H();ee();xt();R();we()});async function vt(e,t){try{if(!e.action_data)return{success:!1,error:"Action entity missing action_data"};let{action_name:i,kwargs:n}=e.action_data;if(W.has(i)){let a=await W.execute(i,n,t),o=a?.success!==!1,r=a?.error||a?.message;return{success:o,error:o?void 0:r}}else{let{page:a,agentServices:o}=t;return await(await md()).execute(a,e,o),{success:!0,error:void 0}}}catch(i){return{success:!1,error:i.message}}}async function md(){if(wn)return wn;let e=await Promise.resolve().then(()=>(hn(),un));return wn=new e.default,wn}async function ji(e,t,i,n={},a){let o=a||{page:t,agentServices:i,domService:new Ie(i.getDomServiceOptions()),executionHistory:n.executionHistory,variables:n.variables,sensitiveKeys:n.sensitiveKeys},r=i.replaceVariables(e),s=await Hn(r,o,n);return s.status==="error"?{status:"error",completed:s.goalAccomplished||!1,actionEntities:[],explanation:s.reasoning,error:s.error,debugInfo:s.debugInfo}:{status:"success",completed:s.goalAccomplished||!1,actionEntities:s.actionEntity?[s.actionEntity]:[],explanation:s.reasoning,debugInfo:s.debugInfo}}async function Ki(e,t,i,n={},a){let o=a||{page:t,agentServices:i,domService:new Ie(i.getDomServiceOptions()),executionHistory:n.executionHistory,variables:n.variables,sensitiveKeys:n.sensitiveKeys},r=i.replaceVariables(e),s=await Hn(r,o,n);if(s.status==="error"||!s.actionEntity)return{status:"error",completed:s.goalAccomplished||!1,actionEntities:[],explanation:s.reasoning,error:s.error||"No action generated",debugInfo:s.debugInfo};let{actionEntity:l,reasoning:d,goalAccomplished:c,debugInfo:u}=s,m=await vt(l,o);return m.success?(d&&i.addNote(d),{status:"success",completed:c||!1,actionEntities:[l],explanation:d,debugInfo:u}):{status:"error",completed:!1,actionEntities:[l],error:m.error||"Action execution failed",debugInfo:u}}async function zi(e,t,i,n={}){let a={page:t,agentServices:i,domService:new Ie(i.getDomServiceOptions()),executionHistory:n.executionHistory,variables:n.variables,sensitiveKeys:n.sensitiveKeys},o=i.replaceVariables(e);return n.useCleanScreenshotForAssertion??(n.useCleanScreenshotForAssertion=i.isUseCleanScreenshotForAssertion()),so(o,a,n)}async function Vi(e,t,i,n,a={}){let{runTaskLoop:o}=await Promise.resolve().then(()=>(jr(),Gr)),r=n?l=>{n(l)}:void 0,s=await o(e,{page:t,agentServices:i,domService:void 0,executionHistory:a.executionHistory,variables:a.variables,sensitiveKeys:a.sensitiveKeys},{maxSteps:a.maxSteps,onEvent:r,abortSignal:a.abortSignal});return{status:s.success?"success":"error",completed:s.completed,actionEntities:s.trajectory.actions,explanation:s.summary,error:s.error,tokenUsages:s.metadata.tokenUsages}}var wn,_t=w(()=>{"use strict";Ci();_e();De();wn=null});var v,Ry,Ky,Xy,qy,cs,Oy,ds,xd,vd,yn,Ny,Dy,us,hs,_d,ls,kd,ni,Sd,Ed,Td,ae,Ad,$d,Ly,Vy,ai=w(()=>{"use strict";we();v=require("zod"),Ry=require("yaml"),Ky=require("uuid"),Xy=require("yaml"),qy=require("uuid"),cs=112,Oy=1080-cs,ds=(e=>(e.Chromium="chromium",e.Firefox="firefox",e.Webkit="webkit",e))(ds||{}),xd={"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"}},vd={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"]},yn=(e,t=!1)=>{let i=["chromium"];return t&&i.push("webkit"),vd[e].map(n=>xd[n]).filter(n=>n.defaultBrowserType&&i.includes(n.defaultBrowserType))},Ny={desktop:{label:"Desktop",type:"desktop",devices:yn("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:yn("mobile")}},Dy={desktop:{label:"Desktop",type:"desktop",devices:yn("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:yn("mobile",!0)}},us=(e=>(e.PASSWORD="password",e.OAUTH2="oauth2",e.SSO="sso",e.API="api",e))(us||{}),hs=(e=>(e.SMS="sms",e.EMAIL="email",e.TOTP="totp",e))(hs||{}),_d=v.z.enum(["JS_CODE","AI_MODE"]),ls=v.z.object({type:_d,expression:v.z.string()}),kd=v.z.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),ni=v.z.object({uid:v.z.string(),type:kd,comment:v.z.string().optional()}),Sd=v.z.object({action_data:v.z.object({action_name:v.z.string(),kwargs:v.z.record(v.z.any()).optional(),args:v.z.array(v.z.any()).optional()}),action_description:v.z.string().optional(),url:v.z.string().optional(),xpath:v.z.string().nullable().optional(),locator:v.z.string().nullable().optional(),css_selector:v.z.string().nullable().optional(),unique_selector:v.z.string().nullable().optional(),element_index:v.z.number().nullable().optional(),frame_path:v.z.array(v.z.any()).optional(),artifacts:v.z.record(v.z.any()).optional(),feedback:v.z.string().optional(),original_browser_use_action:v.z.any().optional()}).passthrough(),Ed=ni.extend({type:v.z.literal("DRAFT"),description:v.z.string()}),Td=ni.extend({type:v.z.literal("ACTION"),description:v.z.string(),action_entity:Sd.optional(),locator:v.z.string().optional(),use_pure_vision:v.z.boolean().optional()}),ae=v.z.lazy(()=>v.z.union([Ed,Td,ni.extend({type:v.z.literal("STEP"),description:v.z.string().optional().default(""),statements:v.z.array(ae),reference_id:v.z.number().optional()}),ni.extend({type:v.z.literal("IF_ELSE"),description:v.z.string().optional(),condition:ls,then:v.z.array(ae),else:v.z.array(ae).optional()}),ni.extend({type:v.z.literal("WHILE_LOOP"),description:v.z.string().optional(),condition:ls,body:v.z.array(ae),timeout_ms:v.z.number().optional()})])),Ad=v.z.object({name:v.z.string(),statements:v.z.array(ae),teardown:v.z.array(ae).optional(),skip:v.z.union([v.z.boolean(),v.z.string()]).optional(),timeout:v.z.number().optional(),fail:v.z.union([v.z.boolean(),v.z.string()]).optional(),only:v.z.boolean().optional(),slow:v.z.boolean().optional()}),$d=v.z.object({tests:v.z.array(Ad).min(1),beforeAll:v.z.array(ae).optional(),afterAll:v.z.array(ae).optional(),beforeEach:v.z.array(ae).optional(),afterEach:v.z.array(ae).optional()}),Ly=v.z.object({comment:v.z.string().optional(),version:v.z.string().optional(),goal:v.z.string().optional(),url:v.z.string().optional(),baseURL:v.z.string().optional(),final_feedback:v.z.string().optional(),completed:v.z.boolean().optional(),success:v.z.boolean().optional(),statements:v.z.array(ae).optional(),teardown:v.z.array(ae).optional(),last_modified_at:v.z.string().optional(),testGroup:$d.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"}),Vy=1024*1024});var ba=w(()=>{"use strict";te();Pe()});var _,gs,xa,fs,et,ws,bs,ys,ie,xs,xn,va,_a=w(()=>{"use strict";_=require("zod"),gs=_.z.enum(["JS_CODE","AI_MODE"]),xa=_.z.object({type:gs,expression:_.z.string()}),fs=_.z.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),et=_.z.object({uid:_.z.string(),type:fs,comment:_.z.string().optional()}),ws=_.z.object({action_data:_.z.object({action_name:_.z.string(),kwargs:_.z.record(_.z.any()).optional(),args:_.z.array(_.z.any()).optional()}),action_description:_.z.string().optional(),url:_.z.string().optional(),xpath:_.z.string().nullable().optional(),locator:_.z.string().nullable().optional(),css_selector:_.z.string().nullable().optional(),unique_selector:_.z.string().nullable().optional(),element_index:_.z.number().nullable().optional(),frame_path:_.z.array(_.z.any()).optional(),artifacts:_.z.record(_.z.any()).optional(),feedback:_.z.string().optional(),original_browser_use_action:_.z.any().optional()}).passthrough(),bs=et.extend({type:_.z.literal("DRAFT"),description:_.z.string()}),ys=et.extend({type:_.z.literal("ACTION"),description:_.z.string(),action_entity:ws.optional(),locator:_.z.string().optional(),use_pure_vision:_.z.boolean().optional()}),ie=_.z.lazy(()=>_.z.union([bs,ys,et.extend({type:_.z.literal("STEP"),description:_.z.string().optional().default(""),statements:_.z.array(ie),reference_id:_.z.number().optional()}),et.extend({type:_.z.literal("IF_ELSE"),description:_.z.string().optional(),condition:xa,then:_.z.array(ie),else:_.z.array(ie).optional()}),et.extend({type:_.z.literal("WHILE_LOOP"),description:_.z.string().optional(),condition:xa,body:_.z.array(ie),timeout_ms:_.z.number().optional()})])),xs=_.z.object({name:_.z.string(),statements:_.z.array(ie),teardown:_.z.array(ie).optional(),skip:_.z.union([_.z.boolean(),_.z.string()]).optional(),timeout:_.z.number().optional(),fail:_.z.union([_.z.boolean(),_.z.string()]).optional(),only:_.z.boolean().optional(),slow:_.z.boolean().optional()}),xn=_.z.object({tests:_.z.array(xs).min(1),beforeAll:_.z.array(ie).optional(),afterAll:_.z.array(ie).optional(),beforeEach:_.z.array(ie).optional(),afterEach:_.z.array(ie).optional()}),va=_.z.object({comment:_.z.string().optional(),version:_.z.string().optional(),goal:_.z.string().optional(),url:_.z.string().optional(),baseURL:_.z.string().optional(),final_feedback:_.z.string().optional(),completed:_.z.boolean().optional(),success:_.z.boolean().optional(),statements:_.z.array(ie).optional(),teardown:_.z.array(ie).optional(),last_modified_at:_.z.string().optional(),testGroup:xn.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 Ss(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(re)};return e.final_feedback&&(i.final_feedback=e.final_feedback),e.teardown&&e.teardown.length>0&&(i.teardown=e.teardown.map(re)),i}function vn(e,t){if(e.testGroup)return Ts(e,t);let i=Ss(e,t),n=new N.Document(i);return e.comment&&(n.commentBefore=e.comment),vs(n,e.statements??[]),e.teardown&&vs(n,e.teardown,"teardown"),n.toString(Es)}function vs(e,t,i="statements"){let n=e.contents;if(!n||!(0,N.isMap)(n))return;let a=n.get(i,!0);(0,N.isSeq)(a)&&ri(a,t)}function ri(e,t){for(let i=0;i<Math.min(e.items.length,t.length);i++){let n=t[i],a=e.items[i];if(i>0&&(a.spaceBefore=!0),n.comment&&(i===0?e.commentBefore=n.comment:a.commentBefore=n.comment),(0,N.isMap)(a)){let o=a;if(n.type==="STEP"){let r=o.get("statements",!0);(0,N.isSeq)(r)&&ri(r,n.statements)}else if(n.type==="IF_ELSE"){let r=o.get("THEN",!0);(0,N.isSeq)(r)&&ri(r,n.then);let s=o.get("ELSE",!0);(0,N.isSeq)(s)&&n.else&&ri(s,n.else)}else if(n.type==="WHILE_LOOP"){let r=o.get("DO",!0);(0,N.isSeq)(r)&&ri(r,n.body)}}}}function Ts(e,t){let i=e.testGroup;if(!i)throw new Error("suiteToYaml requires a TestFlow with testGroup");let n={};t?.test_case_id!==void 0&&(n.test_case_id=t.test_case_id),t?.name&&(n.name=t.name),t?.tags&&t.tags.length>0&&(n.tags=t.tags),t?.use&&Object.keys(t.use).length>0&&(n.use=t.use);let a={};return e.baseURL&&(a.base_url=e.baseURL),i.beforeAll&&i.beforeAll.length>0&&(a.beforeAll=i.beforeAll.map(re)),i.beforeEach&&i.beforeEach.length>0&&(a.beforeEach=i.beforeEach.map(re)),i.afterEach&&i.afterEach.length>0&&(a.afterEach=i.afterEach.map(re)),i.afterAll&&i.afterAll.length>0&&(a.afterAll=i.afterAll.map(re)),a.tests=i.tests.map(o=>{let r={name:o.name};return o.skip!==void 0&&(r.skip=o.skip),o.timeout!==void 0&&(r.timeout=o.timeout),o.fail!==void 0&&(r.fail=o.fail),o.only!==void 0&&(r.only=o.only),o.slow!==void 0&&(r.slow=o.slow),r.statements=o.statements.map(re),o.teardown&&o.teardown.length>0&&(r.teardown=o.teardown.map(re)),r}),n.suite=a,(0,N.stringify)(n,Es)}function re(e){switch(e.type){case"DRAFT":return Dd(e);case"ACTION":return Ld(e);case"STEP":return Rd(e);case"IF_ELSE":return Fd(e);case"WHILE_LOOP":return Hd(e)}}function Dd(e){return{intent:e.description}}function Ld(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 l=i?.code;return typeof l=="string"?{VERIFY:s,js:l}:{VERIFY:s}}}if(t==="go_to_url"){let s=i?.url;if(typeof s=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath){let l={URL:s};return i?.new_tab===!0&&(l.new_tab=!0),typeof i?.timeout_seconds=="number"&&(l.timeout_seconds=i.timeout_seconds),l}}if(t==="js_action"){let s=i?.code;if(typeof s=="string"&&e.description)return{intent:e.description,js:s}}if(t==="ai_wait_until"){let s=i?.condition;if(typeof s=="string"){let l={WAIT_UNTIL:s};return typeof i?.timeout_seconds=="number"&&i.timeout_seconds!==60&&(l.timeout_seconds=i.timeout_seconds),l}}if(t==="wait"){let s=i?.seconds,d={WAIT:e.description||`Wait ${s}s`};return typeof s=="number"&&(d.seconds=s),d}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{intent:e.description};let n=e.action_entity.action_data??e.action_entity.action;if(!n)return{intent:e.description};let a={intent:e.description,action:n.action_name},o=e.locator??e.action_entity.locator;o&&(a.locator=o);let r=e.action_entity.xpath;if(r&&(a.xpath=r),e.use_pure_vision&&(a.use_pure_vision=!0),n.kwargs&&Object.keys(n.kwargs).length>0)for(let[s,l]of Object.entries(n.kwargs))a[s]=l;return n.args&&n.args.length>0&&(a.args=n.args),a}function Rd(e){let t={STEP:e.description,statements:e.statements.map(re)};return e.reference_id!==void 0&&(t.reference_id=e.reference_id),t}function Fd(e){let t={IF:As(e.condition),THEN:e.then.map(re)};return e.else&&e.else.length>0&&(t.ELSE=e.else.map(re)),t}function Hd(e){let t={WHILE:As(e.condition),DO:e.body.map(re)};return e.timeout_ms!==void 0&&(t.timeout_ms=e.timeout_ms),t}function As(e){return e.type==="JS_CODE"?`js:${e.expression}`:e.expression}function Sa(e){try{let t=(0,N.parse)(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{}}}function ka(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(ka);let t=e,i=Object.keys(t);if(i.length===1){let a=i[0];if(a.startsWith("{ ")&&a.endsWith(" }")&&t[a]===null)return`{{${a.slice(2,-2)}}}`}let n={};for(let[a,o]of Object.entries(t))n[a]=ka(o);return n}function Ee(e){if(e.length>_s)throw new Error(`YAML input too large (${e.length} bytes, max ${_s})`);let t=ka((0,N.parse)(e));if(!t||typeof t!="object")throw new Error("Invalid YAML: expected an object at root level");if(t.suite)return Wd(t);let i={version:"1.3.0",goal:t.goal,url:t.url,baseURL:t.base_url,statements:se(t.statements??[])};t.final_feedback&&(i.final_feedback=t.final_feedback),t.teardown&&Array.isArray(t.teardown)&&(i.teardown=se(t.teardown));let n=va.safeParse(i);if(!n.success)throw new Error(`Invalid TestFlow after YAML conversion: ${JSON.stringify(n.error.errors)}`);let a=n.data;return _n(e,a),a}function Wd(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 a={tests:i.map(s=>{if(!s.name)throw new Error('Each test in a suite must have a "name" field');if(!Array.isArray(s.statements)||s.statements.length===0)throw new Error(`Suite test "${s.name}" must have a non-empty "statements" array`);let l={name:s.name,statements:se(s.statements)};return Array.isArray(s.teardown)&&s.teardown.length>0&&(l.teardown=se(s.teardown)),s.skip!==void 0&&(l.skip=s.skip),typeof s.timeout=="number"&&(l.timeout=s.timeout),s.fail!==void 0&&(l.fail=s.fail),s.only===!0&&(l.only=!0),s.slow===!0&&(l.slow=!0),l})};Array.isArray(t.beforeAll)&&t.beforeAll.length>0&&(a.beforeAll=se(t.beforeAll)),Array.isArray(t.afterAll)&&t.afterAll.length>0&&(a.afterAll=se(t.afterAll)),Array.isArray(t.beforeEach)&&t.beforeEach.length>0&&(a.beforeEach=se(t.beforeEach)),Array.isArray(t.afterEach)&&t.afterEach.length>0&&(a.afterEach=se(t.afterEach));let o=xn.safeParse(a);if(!o.success)throw new Error(`Invalid TestGroup: ${JSON.stringify(o.error.errors)}`);return{version:"1.3.0",baseURL:t.base_url||void 0,testGroup:o.data}}function se(e){if(!Array.isArray(e))throw new Error("Expected an array of statements");return e.map(Ud)}function Ud(e){if(typeof e=="string")throw new Error(`Plain string statements are not supported. Use an object with a "desc" key instead. Example: { "desc": "${e}" }`);if(typeof e!="object"||e===null)throw new Error(`Invalid statement: expected object, got ${typeof e}`);let t=e;if("IF"in t)return Bd(t);if("WHILE"in t)return Gd(t);if("STEP"in t)return jd(t);if("VERIFY"in t){let i=t.VERIFY,n={statement:typeof i=="string"?i:String(i)};return typeof t.js=="string"&&(n.code=t.js),{uid:(0,oe.v4)(),type:"ACTION",description:String(i),action_entity:{action_description:String(i),action_data:{action_name:"verify",kwargs:n}}}}if("URL"in t){let i=t.URL,n=t.new_tab===!0?!0:void 0,a=typeof t.timeout_seconds=="number"?t.timeout_seconds:void 0,o={url:typeof i=="string"?i:String(i)};return n&&(o.new_tab=!0),a!==void 0&&(o.timeout_seconds=a),{uid:(0,oe.v4)(),type:"ACTION",description:`Navigate to ${i}`,action_entity:{action_description:`Navigate to ${i}`,action_data:{action_name:"go_to_url",kwargs:o}}}}if("WAIT_UNTIL"in t){let i=t.WAIT_UNTIL,n=typeof t.timeout_seconds=="number"?t.timeout_seconds:60;return{uid:(0,oe.v4)(),type:"ACTION",description:`Wait until: ${i}`,action_entity:{action_description:`Wait until: ${i}`,action_data:{action_name:"ai_wait_until",kwargs:{condition:typeof i=="string"?i:String(i),timeout_seconds:n}}}}}if("WAIT"in t){let i=t.WAIT,n=typeof t.seconds=="number"?t.seconds:3;return{uid:(0,oe.v4)(),type:"ACTION",description:typeof i=="string"?i:`Wait ${n}s`,action_entity:{action_description:typeof i=="string"?i:`Wait ${n}s`,action_data:{action_name:"wait",kwargs:{seconds:n}}}}}if("CODE"in t){let i=t.CODE;if(i==null)throw new Error('CODE statement has no code. Use "CODE: |" followed by indented code on the next line.');return{uid:(0,oe.v4)(),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&&("intent"in t||"desc"in t)&&!("VERIFY"in t)){let i=t.js,n=typeof t.intent=="string"?t.intent:typeof t.desc=="string"?t.desc:"";return{uid:(0,oe.v4)(),type:"ACTION",description:n,action_entity:{action_description:n,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,...n}=t;return ks({...n,action:"function",functionName:i})}if("action"in t)return ks(t);if("intent"in t&&typeof t.intent=="string"||"desc"in t&&typeof t.desc=="string")return{uid:(0,oe.v4)(),type:"DRAFT",description:typeof t.intent=="string"?t.intent:t.desc};throw new Error(`Cannot infer statement type from object: ${JSON.stringify(t)}`)}function $s(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 Bd(e){let t=$s(e.IF),i=e.THEN;if(!Array.isArray(i))throw new Error("IF_ELSE requires a THEN array");let n={uid:(0,oe.v4)(),type:"IF_ELSE",condition:t,then:se(i)};return"ELSE"in e&&Array.isArray(e.ELSE)&&(n.else=se(e.ELSE)),n}function Gd(e){let t=$s(e.WHILE),i=e.DO;if(!Array.isArray(i))throw new Error("WHILE_LOOP requires a DO array");let n={uid:(0,oe.v4)(),type:"WHILE_LOOP",condition:t,body:se(i)};return typeof e.timeout_ms=="number"&&(n.timeout_ms=e.timeout_ms),n}function jd(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:(0,oe.v4)(),type:"STEP",description:t,statements:se(e.statements)};return typeof e.reference_id=="number"&&(i.reference_id=e.reference_id),i}function ks(e){let t=typeof e.action=="string"?e.action:String(e.action),i=typeof e.intent=="string"?e.intent:typeof e.desc=="string"?e.desc:"",n=typeof e.locator=="string"?e.locator:void 0,a=typeof e.xpath=="string"?e.xpath:void 0,o=typeof e.use_pure_vision=="boolean"?e.use_pure_vision:void 0,r={};for(let[d,c]of Object.entries(e))Kd.has(d)||(r[d]=c);let s={action_description:i,action_data:{action_name:t,kwargs:Object.keys(r).length>0?r:{}}};n&&(s.locator=n),a&&(s.xpath=a);let l={uid:(0,oe.v4)(),type:"ACTION",description:i,action_entity:s};return o&&(l.use_pure_vision=!0),l}function _n(e,t){let i;try{i=(0,N.parseDocument)(e)}catch{return}let n=i.contents;if(!n||!(0,N.isMap)(n))return;if(i.commentBefore)t.comment=i.commentBefore;else{let l=n.items?.[0];l?.key&&l.key.commentBefore&&(t.comment=l.key.commentBefore)}let a=n,o=a.get("statements",!0);(0,N.isSeq)(o)&&t.statements&&tt(o,t.statements);let r=a.get("teardown",!0);(0,N.isSeq)(r)&&t.teardown&&tt(r,t.teardown)}function tt(e,t){e.commentBefore&&t.length>0&&(t[0].comment=e.commentBefore);for(let i=0;i<Math.min(e.items.length,t.length);i++){let n=e.items[i];n.commentBefore&&!(i===0&&e.commentBefore)&&(t[i].comment=n.commentBefore);let a=t[i];if(a.type==="STEP"&&(0,N.isMap)(n)){let o=n.get("statements",!0);(0,N.isSeq)(o)&&tt(o,a.statements)}else if(a.type==="IF_ELSE"&&(0,N.isMap)(n)){let o=n.get("THEN",!0);(0,N.isSeq)(o)&&tt(o,a.then);let r=n.get("ELSE",!0);(0,N.isSeq)(r)&&a.else&&tt(r,a.else)}else if(a.type==="WHILE_LOOP"&&(0,N.isMap)(n)){let o=n.get("DO",!0);(0,N.isSeq)(o)&&tt(o,a.body)}}}var N,oe,Es,_s,Kd,kn=w(()=>{"use strict";_a();N=require("yaml"),oe=require("uuid");Es={lineWidth:120,defaultKeyType:"PLAIN",defaultStringType:"PLAIN"};_s=1024*1024;Kd=new Set(["action","intent","desc","locator","xpath","use_pure_vision"])});var Ms,Is=w(()=>{"use strict";kn();Ms=require("yaml")});var Sn=w(()=>{"use strict"});var Ps=w(()=>{"use strict";kn();Sn()});var Cs=w(()=>{"use strict";Sn()});var Xd,Os=w(()=>{"use strict";Xd=require("uuid")});var Le,Ns=w(()=>{"use strict";Le=(e=>(e.DRAFT="DRAFT",e.STEP="STEP",e.ACTION="ACTION",e.IF_ELSE="IF_ELSE",e.WHILE_LOOP="WHILE_LOOP",e))(Le||{})});var En=w(()=>{"use strict"});var Ds=w(()=>{"use strict";En()});var Ls,Jd,Rs,Fs,si,qd,Zd,Hs=w(()=>{"use strict";Ls=112,Jd=1080-Ls,Rs={"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"}},Fs={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"]},si=(e,t=!1)=>{let i=["chromium"];return t&&i.push("webkit"),Fs[e].map(n=>Rs[n]).filter(n=>n.defaultBrowserType&&i.includes(n.defaultBrowserType))},qd={desktop:{label:"Desktop",type:"desktop",devices:si("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:si("mobile")}},Zd={desktop:{label:"Desktop",type:"desktop",devices:si("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:si("mobile",!0)}}});var Ws=w(()=>{"use strict"});var Us=w(()=>{"use strict"});var Bs=w(()=>{"use strict"});var Gs=w(()=>{"use strict"});var js=w(()=>{"use strict"});var Ks=w(()=>{"use strict"});var zs=w(()=>{"use strict"});var Vs=w(()=>{"use strict";En()});var it=w(()=>{"use strict";Is();Ps();kn();_a();Cs();Os();Sn();Ns();Ds();Hs();Ws();Us();Bs();Gs();js();Ks();zs();Vs();En()});function nu(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function au(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 qs(e){let t=nu(e),i=e.locator;if(typeof i=="string"&&i.trim())return i=i.trim(),i.endsWith("first()")?`${t}.${i}`:`${t}.${i}.first()`;let n=au(e);if(n){let a=JSON.stringify(n);return`${t}.locator(${a}).first()`}return null}function $(e,t){Z.set(e,t)}function Re(e,t,i=[]){let n=[...i];return t.locator?n.push(`locator: ${JSON.stringify(t.locator)}`):t.xpath&&n.push(`xpath: ${JSON.stringify(t.xpath)}`),t.frame_path&&t.frame_path.length>0&&n.push(`frame_path: ${JSON.stringify(t.frame_path)}`),n.length===0?[`await agent.execAction("${e}", page, {});`]:[`await agent.execAction("${e}", page, {`,...n.map(a=>` ${a},`),"});"]}function Xs(e){let t=e.functionName;if(!t)return null;let i=Array.isArray(e.args)?e.args.map(String):[];if(i.length===0)return`await ${t}()`;let n=["page","testContext","request","agent"],a=["undefined","null","true","false"],o=i.map(r=>n.includes(r)||a.includes(r)||/^-?\d+(\.\d+)?$/.test(r)?r:r.startsWith("$")?`agent.agentServices.readVariable('${r.substring(1)}')`:`"${r}"`);return`await ${t}(${o.join(", ")})`}function el(e,t){let i={expandingPaths:new Set([(0,di.resolve)(t)]),depth:0,referencedPaths:new Set},n={...e};Array.isArray(n.statements)&&(n.statements=Ce(n.statements,t,i)),Array.isArray(n.teardown)&&(n.teardown=Ce(n.teardown,t,i));for(let a of["beforeAll","afterAll","beforeEach","afterEach"])Array.isArray(n[a])&&(n[a]=Ce(n[a],t,i));return{doc:n,referencedTemplatePaths:Array.from(i.referencedPaths)}}function Ce(e,t,i){let n=[];for(let a of e)if(ou(a)){let o=ru(a,t,i);n.push(...o)}else n.push(su(a,t,i));return n}function ou(e){return typeof e=="object"&&e!==null&&typeof e.template=="string"}function ru(e,t,i){if(i.depth>=Ys)throw new Error(`Template expansion exceeded maximum depth of ${Ys}. Check for deeply nested or circular template references.`);let n=(0,di.resolve)((0,di.dirname)(t),e.template);if(i.expandingPaths.has(n))throw new Error(`Circular template reference detected: ${n} is already being expanded. Stack: ${Array.from(i.expandingPaths).join(" \u2192 ")} \u2192 ${n}`);i.referencedPaths.add(n);let a;try{a=(0,Qs.readFileSync)(n,"utf-8")}catch(c){throw new Error(`Failed to read template file: ${n} (referenced from ${t}): ${c.message}`)}let o=(0,li.parse)(a);if(!o||typeof o!="object")throw new Error(`Invalid template file: ${n} \u2014 expected a YAML object`);let r=o.params||[],s=e.params||{};for(let c of r)if(!(c in s))throw new Error(`Template ${e.template} requires param "${c}" but it was not provided. Required params: [${r.join(", ")}]`);let l=o.statements;if(!Array.isArray(l))throw new Error(`Template ${e.template} must have a "statements" array`);if(Object.keys(s).length>0){let u=(0,li.stringify)(l);for(let[m,f]of Object.entries(s))u=u.split(`<<${m}>>`).join(String(f));l=(0,li.parse)(u)}let d={expandingPaths:new Set([...i.expandingPaths,n]),depth:i.depth+1,referencedPaths:i.referencedPaths};return Ce(l,n,d)}function su(e,t,i){if(typeof e!="object"||e===null)return e;let n={...e};return Array.isArray(n.statements)&&(n.statements=Ce(n.statements,t,i)),Array.isArray(n.THEN)&&(n.THEN=Ce(n.THEN,t,i)),Array.isArray(n.ELSE)&&(n.ELSE=Ce(n.ELSE,t,i)),Array.isArray(n.DO)&&(n.DO=Ce(n.DO,t,i)),n}function il(e,t){let i=(0,ci.parse)(e),n=i?.name,a=i?.tags,o=i?.use;if(i&&(i.name!==void 0||i.tags!==void 0||i.use!==void 0)&&(delete i.name,delete i.tags,delete i.use),i?.suite){if(i.goal||i.statements)throw new tl('YAML file cannot have both "suite" and top-level "goal"/"statements". Use either suite format or single-test format.');return cu(i,n,a,o,t)}return lu(i,n,a,o,t)}function lu(e,t,i,n,a){let o=e?.beforeEach,r=e?.afterEach,s=nl(e?.parameters),l=e?.timeout,d=e?.skip,c=e?.fail,u=e?.only,m=e?.slow;if(e&&(delete e.beforeEach,delete e.afterEach,delete e.parameters,delete e.timeout,delete e.skip,delete e.fail,delete e.only,delete e.slow),e?.url)throw new tl(`The "url" field is not supported in local YAML tests. Use "base_url: ${e.url}" and add "- URL: /" as the first statement instead.`);e&&!e.goal&&t&&(e.goal=t);let f=[];if(a&&e&&typeof e=="object"){let y=el(e,a);e=y.doc,f=y.referencedTemplatePaths}let h=(0,ci.stringify)(e),x=Ee(h);return a&&(nt(x.statements??[],a,"main"),x.teardown&&nt(x.teardown,a,"teardown")),{testFlow:x,name:t,tags:i,use:n,beforeEach:o,afterEach:r,parameters:s,timeout:l,skip:d,fail:c,only:u,slow:m,referencedTemplatePaths:f}}function cu(e,t,i,n,a){let o=e.suite;if(!Array.isArray(o.tests)||o.tests.length===0)throw new Error('Suite must have a non-empty "tests" array.');let r=o.beforeAll,s=o.afterAll,l=o.beforeEach,d=o.afterEach,c=[],u=o.tests.map(h=>{if(!h.name)throw new Error('Each test in a suite must have a "name" field.');if(!Array.isArray(h.statements)||h.statements.length===0)throw new Error(`Suite test "${h.name}" must have a non-empty "statements" array.`);let x={goal:h.name,statements:h.statements};h.teardown&&(x.teardown=h.teardown);let y=[],p=x;if(a&&typeof x=="object"){let A=el(x,a);p=A.doc,y=A.referencedTemplatePaths,c.push(...y)}let b=(0,ci.stringify)(p),E=Ee(b),T=nl(h.parameters);return{testFlow:E,name:h.name,tags:Array.isArray(h.tags)?h.tags:void 0,parameters:T,timeout:h.timeout,skip:h.skip,fail:h.fail,only:h.only,slow:h.slow}}),m=o.base_url,f=m?{...n,baseURL:m}:n;return{suite:{beforeAll:r,afterAll:s,beforeEach:l,afterEach:d,tests:u},name:t,tags:i,use:f,referencedTemplatePaths:c}}function nl(e){if(!(!Array.isArray(e)||e.length===0))return e.map((t,i)=>{if(!t.name)throw new Error(`Parameter set at index ${i} must have a "name" field.`);if(!t.values||typeof t.values!="object")throw new Error(`Parameter set "${t.name}" must have a "values" object.`);return{name:t.name,values:t.values}})}function nt(e,t,i){for(let n=0;n<e.length;n++){let a=e[n],o=`${i}.${n}`,r=a.description||"";if(a.uid=du(t,o,r),a.type===Le.STEP)nt(a.statements,t,o);else if(a.type===Le.IF_ELSE){let s=a;nt(s.then,t,`${o}.then`),s.else&&nt(s.else,t,`${o}.else`)}else a.type===Le.WHILE_LOOP&&nt(a.body,t,`${o}.body`)}}function du(e,t,i){let n=(0,Zs.createHash)("sha256").update(`${e}:${t}:${i}`).digest("hex");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20,32)}`}var iu,Zs,ci,Qs,di,li,Js,Z,Ys,tl,al=w(()=>{"use strict";it();iu=require("yaml");it();Zs=require("crypto"),ci=require("yaml");it();Qs=require("fs"),di=require("path"),li=require("yaml");it();Js=5e3;Z=new Map;$("click",e=>{let t=qs(e);if(!t)return['await agent.execAction("click", page, {});'];let i=e.action_data?.kwargs?.timeout_ms??Js;return[`await ${t}.click({ timeout: ${i} });`]});$("click_element",Z.get("click"));$("click_element_by_index",Z.get("click"));$("double_click",e=>Re("double_click",e));$("double_click_on_element",Z.get("double_click"));$("right_click",e=>Re("right_click",e));$("right_click_on_element",Z.get("right_click"));$("hover",e=>Re("hover",e));$("hover_element_by_index",Z.get("hover"));$("input_text",e=>{let t=e.action_data?.kwargs?.text??e.action_data?.kwargs?.value??"";return Re("input_text",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});$("fill",Z.get("input_text"));$("clear_input",e=>Re("clear_input",e));$("press",e=>{let t=e.action_data?.kwargs?.keys;return[`await page.keyboard.press(${JSON.stringify(t)});`]});$("send_keys",Z.get("press"));$("send_keys_on_element",e=>{let t=qs(e),i=e.action_data?.kwargs?.keys||"";if(!t)return['await agent.execAction("send_keys_on_element", page, {',` action_data: { kwargs: { keys: ${JSON.stringify(i)} } },`,"});"];let n=e.action_data?.kwargs?.timeout_ms??Js;return[`await ${t}.press(${JSON.stringify(i)}, { timeout: ${n} });`]});$("select_dropdown_option",e=>{let t=e.action_data?.kwargs?.text||e.action_data?.kwargs?.option||"";return Re("select_dropdown_option",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});$("scroll",e=>{let t=e.action_data?.kwargs?.down??!0;return[`await page.evaluate('window.scrollBy(0, window.innerHeight * ${(e.action_data?.kwargs?.num_pages??1)*(t?1:-1)})');`]});$("scroll_down",Z.get("scroll"));$("scroll_up",Z.get("scroll"));$("scroll_element",Z.get("scroll"));$("scroll_to_text",e=>{let t=e.action_data?.kwargs?.text||"";return[`await page.getByText(${JSON.stringify(t)}, { exact: false }).first().scrollIntoViewIfNeeded();`]});$("scroll_on_element",e=>Re("scroll_on_element",e,[`action_data: { kwargs: ${JSON.stringify(e.action_data?.kwargs||{})} }`]));$("go_to_url",e=>{let t=e.action_data?.kwargs?.url||"";return e.action_data?.kwargs?.new_tab===!0?['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)}, new_tab: true } },`,"});"]:['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)} } },`,"});"]});$("open_tab",Z.get("go_to_url"));$("go_back",()=>['await agent.execAction("go_back", page, {});']);$("reload_page",()=>['await agent.execAction("reload_page", page, {});']);$("wait",e=>[`await page.waitForTimeout(${(e.action_data?.kwargs?.seconds||1)*1e3});`]);$("wait_for_page_ready",()=>["await page.waitForLoadState('domcontentloaded');"]);$("verify",(e,t)=>{let i=e.action_data?.kwargs,n=typeof i?.code=="string",a=n?i?.statement||e.action_description:e.action_description||i?.statement;if(n&&a){let r=i.code.split(`
4301
+ `,n+='- In action descriptions, describe what the placeholder represents in natural language (e.g., "Type the first user name" instead of "Type {{ firstUserName }}")',n}}});var ii=w(()=>{"use strict"});async function nd(e,t){let i=new Set,n=Date.now(),a=new Set(["document","stylesheet","image","font","script","iframe"]),o=new Set(["text/html","text/css","application/javascript","image/","font/","application/json"]),r=["analytics","tracking","telemetry","beacon","metrics","doubleclick","adsystem","adserver","advertising","facebook.com/plugins","platform.twitter","linkedin.com/embed","livechat","zendesk","intercom","crisp.chat","hotjar","push-notifications","onesignal","pushwoosh","heartbeat","ping","alive","webrtc","rtmp://","wss://","cloudfront.net","fastly.net"],s=u=>{let m=u.toLowerCase();return m.startsWith("data:")||m.startsWith("blob:")?!0:r.some(f=>m.includes(f))},l=u=>{let m=u.resourceType(),f=u.url();if(!a.has(m)||s(f))return;let h=u.headers();h.purpose==="prefetch"||["video","audio"].includes(h["sec-fetch-dest"])||(i.add(u),n=Date.now())},d=async u=>{let m=u.request();if(!i.has(m))return;let f=(u.headers()["content-type"]||"").toLowerCase();if(["streaming","video","audio","webm","mp4","event-stream","websocket","protobuf"].some(x=>f.includes(x))){i.delete(m);return}if(![...o].some(x=>f.startsWith(x))){i.delete(m);return}let h=u.headers()["content-length"];if(h)try{if(parseInt(h,10)>5*1024*1024){i.delete(m);return}}catch{}i.delete(m),n=Date.now()},c=Date.now()-id;for(let u of await e.requests()){let m=u.resourceType(),f=u.url(),h=u.timing();a.has(m)&&!s(f)&&h.responseEnd===-1&&h.startTime>=c&&(i.add(u),n=Date.now())}g.debug(`[waitForStableNetwork] Pre-populated ${i.size} in-flight requests`),e.on("request",l),e.on("response",d);try{let u=Date.now(),m=td;for(;;){await new Promise(h=>setTimeout(h,100));let f=Date.now();if(i.size===0&&f-n>=m){g.debug(`[waitForStableNetwork] Network idle after ${f-u}ms`);break}if(f-u>t){g.debug(`[waitForStableNetwork] Max wait time exceeded (${t}ms), pending: ${i.size}`);break}}}finally{e.removeListener("request",l),e.removeListener("response",d)}}async function qe(e,t=ed,i=Qc){let n=Date.now();try{await Promise.all([e.waitForLoadState("load",{timeout:t}).catch(()=>{}),nd(e,t)])}catch(r){throw r instanceof Error?new Error(`Failed during network stabilization: ${r.message}`):new Error("An unknown error occurred during network stabilization.")}let a=Date.now()-n,o=Math.max(i-a,0);o>0&&await new Promise(r=>setTimeout(r,o))}var Qc,ed,td,id,Pe=w(()=>{"use strict";ii();H();Qc=.5*1e3,ed=30*1e3,td=1*1e3,id=3*1e3});function ad(e,t){return e?{prompt_tokens:e.promptTokens||e.inputTokens||0,completion_tokens:e.completionTokens||e.outputTokens||0,total_tokens:e.totalTokens||0,model:t}:null}async function Ur(e,t,i={}){let n=Date.now();if(i.maxSteps!==void 0&&i.maxSteps<=0)throw new Error(`maxSteps must be >= 1, got ${i.maxSteps}`);let a=i.maxSteps??15,o=3,r=t.agentServices.getModel(),s=t.domService||new Ie(t.agentServices.getDomServiceOptions()),l={...t,domService:s};k.init(),k.section("Task Execution Started"),k.log(`Task: ${e}`),k.log(`Max steps: ${a}`),k.log(`Model: ${r}`);let d={currentStep:0,maxSteps:a,consecutiveFailures:0,maxFailures:o,lastFailReason:null,stepHistory:[],memory:[],lastGoal:null,lastEvaluation:null},c=[],u=pn(i.customPrompt),m=new fn(u);k.log(`System prompt length: ${u.length} chars`);let f=!1,h="",x=[];try{for(i.onEvent?.({type:"start",task:e,maxSteps:a});d.currentStep<a;){if(i.abortSignal?.aborted)throw new Error("Task aborted by user");d.currentStep++;let y=Date.now();k.section(`Step ${d.currentStep}/${a}`),k.log(`URL: ${l.page.url()}`),i.onEvent?.({type:"step_start",step:d.currentStep});try{k.log("Waiting for page to stabilize..."),await qe(l.page),k.log("Page stabilized")}catch{k.log("Page stabilization timed out, continuing anyway")}let p;try{k.log("Preparing context (DOM + screenshot)...");let L=l.agentServices.getInteractiveClassNames(),F=l.agentServices.getIframeFallbackDomains();p=await Hr(l.page,l.domService,L,F),k.log("Context prepared")}catch(L){if(L.message.includes("Execution context was destroyed")){k.log("Page navigating, waiting for load..."),await qe(l.page);let F=l.agentServices.getInteractiveClassNames(),O=l.agentServices.getIframeFallbackDomains();p=await Hr(l.page,l.domService,F,O)}else throw k.error("Error preparing context",L),L}m.addStateMessage(e,p.currentUrl,p.domTree,p.screenshotBase64,d,{isFinalStep:d.currentStep===a-1,placeholderData:t.variables,sensitiveKeys:t.sensitiveKeys});let b=await rd(m,r,i,p.screenshotBase64);if(b.tokenUsages&&b.tokenUsages.length>0&&c.push(...b.tokenUsages),!b.stepOutput){if(k.error("Failed to get valid LLM response"),d.consecutiveFailures++,d.consecutiveFailures>=o){h="Reached the maximum allowed consecutive failures. Most recent error: Unable to get a valid response from the language model.";break}continue}let E=b.stepOutput;dd(d.currentStep,a,E);let T=await ld(E,l,p.domState,d.currentStep,i.onEvent,p.screenshotBase64,b.debugInfo);x.push(...T.actionEntities);let A=cd(d.currentStep,E,T,d,y,b.debugInfo,b.tokenUsages),I=Date.now()-y;if(i.onEvent?.({type:"step_complete",step:d.currentStep,duration:I}),d.consecutiveFailures>=o){k.error(`Too many consecutive failures (${d.consecutiveFailures}), stopping`),h=`Reached the maximum allowed consecutive failures. Most recent error: ${d.lastFailReason}`;break}if(T.doneResult){f=T.doneResult.success,h=T.doneResult.summary;break}if(T.completesInstruction){f=!0,h="Instruction completed";break}}return d.currentStep>=a&&!f&&(h="Reached the maximum allowed steps."),i.onEvent?.({type:"complete",totalSteps:d.currentStep,duration:Date.now()-n}),k.log(`Build success result: summary=${h}, completed=${f}, actions=${x.length}, tokens=${c.length}`),ud(d,x,f,h,n,c,r)}catch(y){let p=y.message;return k.error(`Task execution failed: ${p}`,y),i.onEvent?.({type:"error",error:p,recoverable:!1}),hd(d,p,n,c,r)}}async function Hr(e,t,i,n){let{domState:a,screenshotBase64:o}=await t.getClickableElementsWithScreenshot(e,{interactiveClassNames:i,playwrightFrameFallbackDomains:n}),r=a.elementTree.clickableElementsToString();return{currentUrl:e.url(),domTree:r,screenshotBase64:o,domState:a}}function od(e){return e.map(t=>({role:t.role,content:Array.isArray(t.content)?t.content.map(i=>{if(i.type==="image"){let n=i.image,a=typeof n=="string"?n:"";return{type:"image",file:a.startsWith("data:")?a:`data:image/png;base64,${a}`}}return{type:"text",text:i.text}}):t.content}))}async function rd(e,t,i,n){let a=i.temperature??0,{system:o,messages:r}=e.getMessages(),s=0;for(let u of r)Array.isArray(u.content)&&(s+=u.content.filter(m=>m.type==="image").length);let l=xe(t,s),d={model:ye(t),system:o,messages:r,temperature:a,providerOptions:l},c=3;for(let u=0;u<c;u++)try{let m=Date.now();k.log(`Calling LLM (${t})...`);let f=await(0,Wr.generateText)(d),h=Date.now()-m,x=f,y=x.usage;k.llmCall(t,h,y);let p=x.reasoningText;p&&(k.thinking(p),i.onEvent?.({type:"thinking",text:p})),e.addAssistantMessage(f.text);let b={systemPrompt:o,userPrompt:od(r),rawLlmResponse:f.text,reasoningContent:p,screenshotWithSom:n},E=[],T=ad(y,t);T&&E.push(T);let A=sd(f.text);if(!A)if(u<c-1){k.log(`Attempt ${u+1}/${c}: Failed to parse response, retrying...`),e.addTextMessage("user","Your response was not valid JSON. Please respond with a properly formatted JSON object according to the expected format."),await new Promise(I=>setTimeout(I,i.retryDelay||1e3));continue}else return k.error("All parsing attempts failed"),{stepOutput:null,debugInfo:b,tokenUsages:E};return{stepOutput:A,debugInfo:b,tokenUsages:E}}catch(m){if(u<c-1){k.log(`Attempt ${u+1}/${c}: LLM call failed (${m.message}), retrying...`),await new Promise(f=>setTimeout(f,i.retryDelay||1e3));continue}else throw k.error("All LLM call attempts failed",m),m}return{stepOutput:null}}function sd(e){let t=e.trim();t.startsWith("```json")?t=t.replace(/^```json\s*/,"").replace(/\s*```\s*$/,""):t.startsWith("```")&&(t=t.replace(/^```\s*/,"").replace(/\s*```\s*$/,""));try{let i=JSON.parse(t);if(!i.current_goal)return k.error("Missing required field: current_goal"),null;if(!i.actions||!Array.isArray(i.actions)||i.actions.length===0)return k.error("Missing required field: actions (must be non-empty array)"),null;for(let n of i.actions){if(!n.action_name)return k.error("Action missing required field: action_name"),null;if(!n.description)return k.error("Action missing required field: description"),null}return i}catch(i){return k.error(`Failed to parse LLM JSON response: ${t.substring(0,500)}`),k.error(`Parse error: ${i.message}`),null}}async function ld(e,t,i,n,a,o,r){let s=[],l=!0,d=null;k.log(`Using pre-captured DOM state with ${i.selectorMap.size} elements for ${e.actions.length} action(s)`);let c=null,u={...t,domState:i},m=o;for(let f of e.actions){if(f.action_name==="done"){c={success:f.kwargs.success??!0,summary:f.kwargs.summary||f.kwargs.text||"Task completed"};break}let h={},x=f.kwargs?.element_index??f.kwargs?.index;if(typeof x=="number"){let p=i.selectorMap.get(x);p&&(h=await D(t.page,p))}let y={...h,action_description:f.description,action_data:{action_name:f.action_name,kwargs:f.kwargs}};try{let p=await W.execute(f.action_name,f.kwargs,u);f.action_name==="perform_accurate_operation"&&(y=p.actionEntity);let b=await u.agentServices.getCurrentPage();if(b&&(u.page=b,t.page=u.page),p?.success===!1){l=!1,k.log("Action failed, stopping execution of remaining actions in this step"),d=p.error||"Action execution failed";break}s.push(y),a?.({type:"action",action_entity:y,step:n,debugInfo:r})}catch(p){l=!1,d=p.message,k.error(`Action execution failed: ${p.message}`);break}}return{allSuccess:l,failReason:d,actionEntities:s,doneResult:c,completesInstruction:e.completes_instruction??!1}}function cd(e,t,i,n,a,o,r){let s={stepNumber:e,thinking:t.thinking,evaluation:t.evaluation_previous_goal,memory:t.memory,goal:t.current_goal,actions:i.actionEntities,timestamp:a,duration:Date.now()-a,outcome:{success:i.allSuccess},debugInfo:o,tokenUsages:r};if(n.lastGoal=t.current_goal,t.evaluation_previous_goal&&(n.lastEvaluation=t.evaluation_previous_goal),t.memory&&t.memory.trim()){let l=t.memory.trim();n.memory.includes(l)||(n.memory.push(l),n.memory.length>10&&(n.memory=n.memory.slice(-10)))}return i.allSuccess?(n.consecutiveFailures=0,n.lastFailReason=null):(n.consecutiveFailures++,n.lastFailReason=i.failReason),n.stepHistory.push(s),s}function dd(e,t,i){if(k.log(`Step ${e}/${t}`),i.thinking&&k.log(`Thinking: ${i.thinking}`),i.evaluation_previous_goal&&k.log(`Evaluation: ${i.evaluation_previous_goal}`),i.memory&&k.log(`Memory: ${i.memory}`),k.log(`Goal: ${i.current_goal}`),i.actions.length===1){let n=i.actions[0];k.log(`Action: ${n.action_name}(${JSON.stringify(n.kwargs)}) - ${n.description}`)}else k.log(`Actions (${i.actions.length}):`),i.actions.forEach((n,a)=>{k.log(` ${a+1}. ${n.action_name}(${JSON.stringify(n.kwargs)}) - ${n.description}`)})}function ud(e,t,i,n,a,o,r){let s=o.reduce((c,u)=>c+u.prompt_tokens,0),l=o.reduce((c,u)=>c+u.completion_tokens,0),d=o.reduce((c,u)=>c+u.total_tokens,0);return{success:!0,completed:i,summary:n,trajectory:{steps:e.currentStep,actions:t,stepRecords:e.stepHistory},metadata:{totalSteps:e.currentStep,totalDuration:Date.now()-a,model:r,successfulSteps:e.stepHistory.filter(c=>c.outcome.success).length,failedSteps:e.stepHistory.filter(c=>!c.outcome.success).length,promptTokens:s,completionTokens:l,totalTokens:d,tokenUsages:o}}}function hd(e,t,i,n,a){let o=n.reduce((l,d)=>l+d.prompt_tokens,0),r=n.reduce((l,d)=>l+d.completion_tokens,0),s=n.reduce((l,d)=>l+d.total_tokens,0);return{success:!1,completed:!1,error:t,trajectory:{steps:e.currentStep,actions:[],stepRecords:e.stepHistory},metadata:{totalSteps:e.currentStep,totalDuration:Date.now()-i,model:a,successfulSteps:e.stepHistory.filter(l=>l.outcome.success).length,failedSteps:e.stepHistory.filter(l=>!l.outcome.success).length,promptTokens:o,completionTokens:r,totalTokens:s,tokenUsages:n}}}var Wr,Br=w(()=>{"use strict";ga();gn();_e();De();te();Pe();ve();j();Wr=require("ai")});var Gr={};He(Gr,{TaskMessageManager:()=>fn,formatFinalStepWarning:()=>Rr,formatTaskContext:()=>mn,getBrowserTaskJSONPrompt:()=>pn,runTaskLoop:()=>Ur});var jr=w(()=>{"use strict";Br();ga();gn();_e();Gi();De();gt();ft();Ke();wt();bt();te();Pe();ii();ve();rt();st();Ue();j();Ne();H();ee();xt();R();we()});async function vt(e,t){try{if(!e.action_data)return{success:!1,error:"Action entity missing action_data"};let{action_name:i,kwargs:n}=e.action_data;if(W.has(i)){let a=await W.execute(i,n,t),o=a?.success!==!1,r=a?.error||a?.message;return{success:o,error:o?void 0:r}}else{let{page:a,agentServices:o}=t;return await(await md()).execute(a,e,o),{success:!0,error:void 0}}}catch(i){return{success:!1,error:i.message}}}async function md(){if(wn)return wn;let e=await Promise.resolve().then(()=>(hn(),un));return wn=new e.default,wn}async function ji(e,t,i,n={},a){let o=a||{page:t,agentServices:i,domService:new Ie(i.getDomServiceOptions()),executionHistory:n.executionHistory,variables:n.variables,sensitiveKeys:n.sensitiveKeys},r=i.replaceVariables(e),s=await Hn(r,o,n);return s.status==="error"?{status:"error",completed:s.goalAccomplished||!1,actionEntities:[],explanation:s.reasoning,error:s.error,debugInfo:s.debugInfo}:{status:"success",completed:s.goalAccomplished||!1,actionEntities:s.actionEntity?[s.actionEntity]:[],explanation:s.reasoning,debugInfo:s.debugInfo}}async function Ki(e,t,i,n={},a){let o=a||{page:t,agentServices:i,domService:new Ie(i.getDomServiceOptions()),executionHistory:n.executionHistory,variables:n.variables,sensitiveKeys:n.sensitiveKeys},r=i.replaceVariables(e),s=await Hn(r,o,n);if(s.status==="error"||!s.actionEntity)return{status:"error",completed:s.goalAccomplished||!1,actionEntities:[],explanation:s.reasoning,error:s.error||"No action generated",debugInfo:s.debugInfo};let{actionEntity:l,reasoning:d,goalAccomplished:c,debugInfo:u}=s,m=await vt(l,o);return m.success?(d&&i.addNote(d),{status:"success",completed:c||!1,actionEntities:[l],explanation:d,debugInfo:u}):{status:"error",completed:!1,actionEntities:[l],error:m.error||"Action execution failed",debugInfo:u}}async function zi(e,t,i,n={}){let a={page:t,agentServices:i,domService:new Ie(i.getDomServiceOptions()),executionHistory:n.executionHistory,variables:n.variables,sensitiveKeys:n.sensitiveKeys},o=i.replaceVariables(e);return n.useCleanScreenshotForAssertion??(n.useCleanScreenshotForAssertion=i.isUseCleanScreenshotForAssertion()),so(o,a,n)}async function Vi(e,t,i,n,a={}){let{runTaskLoop:o}=await Promise.resolve().then(()=>(jr(),Gr)),r=n?l=>{n(l)}:void 0,s=await o(e,{page:t,agentServices:i,domService:void 0,executionHistory:a.executionHistory,variables:a.variables,sensitiveKeys:a.sensitiveKeys},{maxSteps:a.maxSteps,onEvent:r,abortSignal:a.abortSignal});return{status:s.success?"success":"error",completed:s.completed,actionEntities:s.trajectory.actions,explanation:s.summary,error:s.error,tokenUsages:s.metadata.tokenUsages}}var wn,_t=w(()=>{"use strict";Ci();_e();De();wn=null});var Ly,v,Hy,Vy,Jy,cs,Oy,ds,xd,vd,yn,Ny,Dy,us,hs,_d,ls,kd,ni,Sd,Ed,Td,ae,Ad,$d,Fy,Yy,ai=w(()=>{"use strict";we();Ly=require("uuid"),v=require("zod"),Hy=require("yaml"),Vy=require("uuid"),Jy=require("yaml"),cs=112,Oy=1080-cs,ds=(e=>(e.Chromium="chromium",e.Firefox="firefox",e.Webkit="webkit",e))(ds||{}),xd={"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"}},vd={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"]},yn=(e,t=!1)=>{let i=["chromium"];return t&&i.push("webkit"),vd[e].map(n=>xd[n]).filter(n=>n.defaultBrowserType&&i.includes(n.defaultBrowserType))},Ny={desktop:{label:"Desktop",type:"desktop",devices:yn("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:yn("mobile")}},Dy={desktop:{label:"Desktop",type:"desktop",devices:yn("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:yn("mobile",!0)}},us=(e=>(e.PASSWORD="password",e.OAUTH2="oauth2",e.SSO="sso",e.API="api",e))(us||{}),hs=(e=>(e.SMS="sms",e.EMAIL="email",e.TOTP="totp",e))(hs||{}),_d=v.z.enum(["JS_CODE","AI_MODE"]),ls=v.z.object({type:_d,expression:v.z.string()}),kd=v.z.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),ni=v.z.object({uid:v.z.string(),type:kd,comment:v.z.string().optional()}),Sd=v.z.object({action_data:v.z.object({action_name:v.z.string(),kwargs:v.z.record(v.z.any()).optional(),args:v.z.array(v.z.any()).optional()}),action_description:v.z.string().optional(),url:v.z.string().optional(),xpath:v.z.string().nullable().optional(),locator:v.z.string().nullable().optional(),css_selector:v.z.string().nullable().optional(),unique_selector:v.z.string().nullable().optional(),element_index:v.z.number().nullable().optional(),frame_path:v.z.array(v.z.any()).optional(),artifacts:v.z.record(v.z.any()).optional(),feedback:v.z.string().optional(),original_browser_use_action:v.z.any().optional()}).passthrough(),Ed=ni.extend({type:v.z.literal("DRAFT"),description:v.z.string()}),Td=ni.extend({type:v.z.literal("ACTION"),description:v.z.string(),action_entity:Sd.optional(),locator:v.z.string().optional(),use_pure_vision:v.z.boolean().optional()}),ae=v.z.lazy(()=>v.z.union([Ed,Td,ni.extend({type:v.z.literal("STEP"),description:v.z.string().optional().default(""),statements:v.z.array(ae),reference_id:v.z.number().optional()}),ni.extend({type:v.z.literal("IF_ELSE"),description:v.z.string().optional(),condition:ls,then:v.z.array(ae),else:v.z.array(ae).optional()}),ni.extend({type:v.z.literal("WHILE_LOOP"),description:v.z.string().optional(),condition:ls,body:v.z.array(ae),timeout_ms:v.z.number().optional()})])),Ad=v.z.object({name:v.z.string(),statements:v.z.array(ae),teardown:v.z.array(ae).optional(),skip:v.z.union([v.z.boolean(),v.z.string()]).optional(),timeout:v.z.number().optional(),fail:v.z.union([v.z.boolean(),v.z.string()]).optional(),only:v.z.boolean().optional(),slow:v.z.boolean().optional()}),$d=v.z.object({tests:v.z.array(Ad).min(1),beforeAll:v.z.array(ae).optional(),afterAll:v.z.array(ae).optional(),beforeEach:v.z.array(ae).optional(),afterEach:v.z.array(ae).optional()}),Fy=v.z.object({comment:v.z.string().optional(),version:v.z.string().optional(),goal:v.z.string().optional(),url:v.z.string().optional(),baseURL:v.z.string().optional(),final_feedback:v.z.string().optional(),completed:v.z.boolean().optional(),success:v.z.boolean().optional(),statements:v.z.array(ae).optional(),teardown:v.z.array(ae).optional(),last_modified_at:v.z.string().optional(),testGroup:$d.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"}),Yy=1024*1024});var ba=w(()=>{"use strict";te();Pe()});var gs=w(()=>{"use strict"});var fs=w(()=>{"use strict"});var ws=w(()=>{"use strict"});var Dd,bs=w(()=>{"use strict";Dd=require("uuid")});var _,ys,xa,xs,et,vs,_s,ks,ie,Ss,xn,va,_a=w(()=>{"use strict";_=require("zod"),ys=_.z.enum(["JS_CODE","AI_MODE"]),xa=_.z.object({type:ys,expression:_.z.string()}),xs=_.z.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),et=_.z.object({uid:_.z.string(),type:xs,comment:_.z.string().optional()}),vs=_.z.object({action_data:_.z.object({action_name:_.z.string(),kwargs:_.z.record(_.z.any()).optional(),args:_.z.array(_.z.any()).optional()}),action_description:_.z.string().optional(),url:_.z.string().optional(),xpath:_.z.string().nullable().optional(),locator:_.z.string().nullable().optional(),css_selector:_.z.string().nullable().optional(),unique_selector:_.z.string().nullable().optional(),element_index:_.z.number().nullable().optional(),frame_path:_.z.array(_.z.any()).optional(),artifacts:_.z.record(_.z.any()).optional(),feedback:_.z.string().optional(),original_browser_use_action:_.z.any().optional()}).passthrough(),_s=et.extend({type:_.z.literal("DRAFT"),description:_.z.string()}),ks=et.extend({type:_.z.literal("ACTION"),description:_.z.string(),action_entity:vs.optional(),locator:_.z.string().optional(),use_pure_vision:_.z.boolean().optional()}),ie=_.z.lazy(()=>_.z.union([_s,ks,et.extend({type:_.z.literal("STEP"),description:_.z.string().optional().default(""),statements:_.z.array(ie),reference_id:_.z.number().optional()}),et.extend({type:_.z.literal("IF_ELSE"),description:_.z.string().optional(),condition:xa,then:_.z.array(ie),else:_.z.array(ie).optional()}),et.extend({type:_.z.literal("WHILE_LOOP"),description:_.z.string().optional(),condition:xa,body:_.z.array(ie),timeout_ms:_.z.number().optional()})])),Ss=_.z.object({name:_.z.string(),statements:_.z.array(ie),teardown:_.z.array(ie).optional(),skip:_.z.union([_.z.boolean(),_.z.string()]).optional(),timeout:_.z.number().optional(),fail:_.z.union([_.z.boolean(),_.z.string()]).optional(),only:_.z.boolean().optional(),slow:_.z.boolean().optional()}),xn=_.z.object({tests:_.z.array(Ss).min(1),beforeAll:_.z.array(ie).optional(),afterAll:_.z.array(ie).optional(),beforeEach:_.z.array(ie).optional(),afterEach:_.z.array(ie).optional()}),va=_.z.object({comment:_.z.string().optional(),version:_.z.string().optional(),goal:_.z.string().optional(),url:_.z.string().optional(),baseURL:_.z.string().optional(),final_feedback:_.z.string().optional(),completed:_.z.boolean().optional(),success:_.z.boolean().optional(),statements:_.z.array(ie).optional(),teardown:_.z.array(ie).optional(),last_modified_at:_.z.string().optional(),testGroup:xn.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 $s(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(re)};return e.final_feedback&&(i.final_feedback=e.final_feedback),e.teardown&&e.teardown.length>0&&(i.teardown=e.teardown.map(re)),i}function vn(e,t){if(e.testGroup)return Is(e,t);let i=$s(e,t),n=new N.Document(i);return e.comment&&(n.commentBefore=e.comment),Es(n,e.statements??[]),e.teardown&&Es(n,e.teardown,"teardown"),n.toString(Ms)}function Es(e,t,i="statements"){let n=e.contents;if(!n||!(0,N.isMap)(n))return;let a=n.get(i,!0);(0,N.isSeq)(a)&&ri(a,t)}function ri(e,t){for(let i=0;i<Math.min(e.items.length,t.length);i++){let n=t[i],a=e.items[i];if(i>0&&(a.spaceBefore=!0),n.comment&&(i===0?e.commentBefore=n.comment:a.commentBefore=n.comment),(0,N.isMap)(a)){let o=a;if(n.type==="STEP"){let r=o.get("statements",!0);(0,N.isSeq)(r)&&ri(r,n.statements)}else if(n.type==="IF_ELSE"){let r=o.get("THEN",!0);(0,N.isSeq)(r)&&ri(r,n.then);let s=o.get("ELSE",!0);(0,N.isSeq)(s)&&n.else&&ri(s,n.else)}else if(n.type==="WHILE_LOOP"){let r=o.get("DO",!0);(0,N.isSeq)(r)&&ri(r,n.body)}}}}function Is(e,t){let i=e.testGroup;if(!i)throw new Error("suiteToYaml requires a TestFlow with testGroup");let n={};t?.test_case_id!==void 0&&(n.test_case_id=t.test_case_id),t?.name&&(n.name=t.name),t?.tags&&t.tags.length>0&&(n.tags=t.tags),t?.use&&Object.keys(t.use).length>0&&(n.use=t.use);let a={};return e.baseURL&&(a.base_url=e.baseURL),i.beforeAll&&i.beforeAll.length>0&&(a.beforeAll=i.beforeAll.map(re)),i.beforeEach&&i.beforeEach.length>0&&(a.beforeEach=i.beforeEach.map(re)),i.afterEach&&i.afterEach.length>0&&(a.afterEach=i.afterEach.map(re)),i.afterAll&&i.afterAll.length>0&&(a.afterAll=i.afterAll.map(re)),a.tests=i.tests.map(o=>{let r={name:o.name};return o.skip!==void 0&&(r.skip=o.skip),o.timeout!==void 0&&(r.timeout=o.timeout),o.fail!==void 0&&(r.fail=o.fail),o.only!==void 0&&(r.only=o.only),o.slow!==void 0&&(r.slow=o.slow),r.statements=o.statements.map(re),o.teardown&&o.teardown.length>0&&(r.teardown=o.teardown.map(re)),r}),n.suite=a,(0,N.stringify)(n,Ms)}function re(e){switch(e.type){case"DRAFT":return Ld(e);case"ACTION":return Rd(e);case"STEP":return Fd(e);case"IF_ELSE":return Hd(e);case"WHILE_LOOP":return Wd(e)}}function Ld(e){return{intent:e.description}}function Rd(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 l=i?.code;return typeof l=="string"?{VERIFY:s,js:l}:{VERIFY:s}}}if(t==="go_to_url"){let s=i?.url;if(typeof s=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath){let l={URL:s};return i?.new_tab===!0&&(l.new_tab=!0),typeof i?.timeout_seconds=="number"&&(l.timeout_seconds=i.timeout_seconds),l}}if(t==="js_action"){let s=i?.code;if(typeof s=="string"&&e.description)return{intent:e.description,js:s}}if(t==="ai_wait_until"){let s=i?.condition;if(typeof s=="string"){let l={WAIT_UNTIL:s};return typeof i?.timeout_seconds=="number"&&i.timeout_seconds!==60&&(l.timeout_seconds=i.timeout_seconds),l}}if(t==="wait"){let s=i?.seconds,d={WAIT:e.description||`Wait ${s}s`};return typeof s=="number"&&(d.seconds=s),d}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{intent:e.description};let n=e.action_entity.action_data??e.action_entity.action;if(!n)return{intent:e.description};let a={intent:e.description,action:n.action_name},o=e.locator??e.action_entity.locator;o&&(a.locator=o);let r=e.action_entity.xpath;if(r&&(a.xpath=r),e.use_pure_vision&&(a.use_pure_vision=!0),n.kwargs&&Object.keys(n.kwargs).length>0)for(let[s,l]of Object.entries(n.kwargs))a[s]=l;return n.args&&n.args.length>0&&(a.args=n.args),a}function Fd(e){let t={STEP:e.description,statements:e.statements.map(re)};return e.reference_id!==void 0&&(t.reference_id=e.reference_id),t}function Hd(e){let t={IF:Ps(e.condition),THEN:e.then.map(re)};return e.else&&e.else.length>0&&(t.ELSE=e.else.map(re)),t}function Wd(e){let t={WHILE:Ps(e.condition),DO:e.body.map(re)};return e.timeout_ms!==void 0&&(t.timeout_ms=e.timeout_ms),t}function Ps(e){return e.type==="JS_CODE"?`js:${e.expression}`:e.expression}function Sa(e){try{let t=(0,N.parse)(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{}}}function ka(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(ka);let t=e,i=Object.keys(t);if(i.length===1){let a=i[0];if(a.startsWith("{ ")&&a.endsWith(" }")&&t[a]===null)return`{{${a.slice(2,-2)}}}`}let n={};for(let[a,o]of Object.entries(t))n[a]=ka(o);return n}function Ee(e){if(e.length>Ts)throw new Error(`YAML input too large (${e.length} bytes, max ${Ts})`);let t=ka((0,N.parse)(e));if(!t||typeof t!="object")throw new Error("Invalid YAML: expected an object at root level");if(t.suite)return Ud(t);let i={version:"1.3.0",goal:t.goal,url:t.url,baseURL:t.base_url,statements:se(t.statements??[])};t.final_feedback&&(i.final_feedback=t.final_feedback),t.teardown&&Array.isArray(t.teardown)&&(i.teardown=se(t.teardown));let n=va.safeParse(i);if(!n.success)throw new Error(`Invalid TestFlow after YAML conversion: ${JSON.stringify(n.error.errors)}`);let a=n.data;return _n(e,a),a}function Ud(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 a={tests:i.map(s=>{if(!s.name)throw new Error('Each test in a suite must have a "name" field');if(!Array.isArray(s.statements)||s.statements.length===0)throw new Error(`Suite test "${s.name}" must have a non-empty "statements" array`);let l={name:s.name,statements:se(s.statements)};return Array.isArray(s.teardown)&&s.teardown.length>0&&(l.teardown=se(s.teardown)),s.skip!==void 0&&(l.skip=s.skip),typeof s.timeout=="number"&&(l.timeout=s.timeout),s.fail!==void 0&&(l.fail=s.fail),s.only===!0&&(l.only=!0),s.slow===!0&&(l.slow=!0),l})};Array.isArray(t.beforeAll)&&t.beforeAll.length>0&&(a.beforeAll=se(t.beforeAll)),Array.isArray(t.afterAll)&&t.afterAll.length>0&&(a.afterAll=se(t.afterAll)),Array.isArray(t.beforeEach)&&t.beforeEach.length>0&&(a.beforeEach=se(t.beforeEach)),Array.isArray(t.afterEach)&&t.afterEach.length>0&&(a.afterEach=se(t.afterEach));let o=xn.safeParse(a);if(!o.success)throw new Error(`Invalid TestGroup: ${JSON.stringify(o.error.errors)}`);return{version:"1.3.0",baseURL:t.base_url||void 0,testGroup:o.data}}function se(e){if(!Array.isArray(e))throw new Error("Expected an array of statements");return e.map(Bd)}function Bd(e){if(typeof e=="string")throw new Error(`Plain string statements are not supported. Use an object with a "desc" key instead. Example: { "desc": "${e}" }`);if(typeof e!="object"||e===null)throw new Error(`Invalid statement: expected object, got ${typeof e}`);let t=e;if("IF"in t)return Gd(t);if("WHILE"in t)return jd(t);if("STEP"in t)return Kd(t);if("VERIFY"in t){let i=t.VERIFY,n={statement:typeof i=="string"?i:String(i)};return typeof t.js=="string"&&(n.code=t.js),{uid:(0,oe.v4)(),type:"ACTION",description:String(i),action_entity:{action_description:String(i),action_data:{action_name:"verify",kwargs:n}}}}if("URL"in t){let i=t.URL,n=t.new_tab===!0?!0:void 0,a=typeof t.timeout_seconds=="number"?t.timeout_seconds:void 0,o={url:typeof i=="string"?i:String(i)};return n&&(o.new_tab=!0),a!==void 0&&(o.timeout_seconds=a),{uid:(0,oe.v4)(),type:"ACTION",description:`Navigate to ${i}`,action_entity:{action_description:`Navigate to ${i}`,action_data:{action_name:"go_to_url",kwargs:o}}}}if("WAIT_UNTIL"in t){let i=t.WAIT_UNTIL,n=typeof t.timeout_seconds=="number"?t.timeout_seconds:60;return{uid:(0,oe.v4)(),type:"ACTION",description:`Wait until: ${i}`,action_entity:{action_description:`Wait until: ${i}`,action_data:{action_name:"ai_wait_until",kwargs:{condition:typeof i=="string"?i:String(i),timeout_seconds:n}}}}}if("WAIT"in t){let i=t.WAIT,n=typeof t.seconds=="number"?t.seconds:3;return{uid:(0,oe.v4)(),type:"ACTION",description:typeof i=="string"?i:`Wait ${n}s`,action_entity:{action_description:typeof i=="string"?i:`Wait ${n}s`,action_data:{action_name:"wait",kwargs:{seconds:n}}}}}if("CODE"in t){let i=t.CODE;if(i==null)throw new Error('CODE statement has no code. Use "CODE: |" followed by indented code on the next line.');return{uid:(0,oe.v4)(),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&&("intent"in t||"desc"in t)&&!("VERIFY"in t)){let i=t.js,n=typeof t.intent=="string"?t.intent:typeof t.desc=="string"?t.desc:"";return{uid:(0,oe.v4)(),type:"ACTION",description:n,action_entity:{action_description:n,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,...n}=t;return As({...n,action:"function",functionName:i})}if("action"in t)return As(t);if("intent"in t&&typeof t.intent=="string"||"desc"in t&&typeof t.desc=="string")return{uid:(0,oe.v4)(),type:"DRAFT",description:typeof t.intent=="string"?t.intent:t.desc};throw new Error(`Cannot infer statement type from object: ${JSON.stringify(t)}`)}function Cs(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 Gd(e){let t=Cs(e.IF),i=e.THEN;if(!Array.isArray(i))throw new Error("IF_ELSE requires a THEN array");let n={uid:(0,oe.v4)(),type:"IF_ELSE",condition:t,then:se(i)};return"ELSE"in e&&Array.isArray(e.ELSE)&&(n.else=se(e.ELSE)),n}function jd(e){let t=Cs(e.WHILE),i=e.DO;if(!Array.isArray(i))throw new Error("WHILE_LOOP requires a DO array");let n={uid:(0,oe.v4)(),type:"WHILE_LOOP",condition:t,body:se(i)};return typeof e.timeout_ms=="number"&&(n.timeout_ms=e.timeout_ms),n}function Kd(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:(0,oe.v4)(),type:"STEP",description:t,statements:se(e.statements)};return typeof e.reference_id=="number"&&(i.reference_id=e.reference_id),i}function As(e){let t=typeof e.action=="string"?e.action:String(e.action),i=typeof e.intent=="string"?e.intent:typeof e.desc=="string"?e.desc:"",n=typeof e.locator=="string"?e.locator:void 0,a=typeof e.xpath=="string"?e.xpath:void 0,o=typeof e.use_pure_vision=="boolean"?e.use_pure_vision:void 0,r={};for(let[d,c]of Object.entries(e))zd.has(d)||(r[d]=c);let s={action_description:i,action_data:{action_name:t,kwargs:Object.keys(r).length>0?r:{}}};n&&(s.locator=n),a&&(s.xpath=a);let l={uid:(0,oe.v4)(),type:"ACTION",description:i,action_entity:s};return o&&(l.use_pure_vision=!0),l}function _n(e,t){let i;try{i=(0,N.parseDocument)(e)}catch{return}let n=i.contents;if(!n||!(0,N.isMap)(n))return;if(i.commentBefore)t.comment=i.commentBefore;else{let l=n.items?.[0];l?.key&&l.key.commentBefore&&(t.comment=l.key.commentBefore)}let a=n,o=a.get("statements",!0);(0,N.isSeq)(o)&&t.statements&&tt(o,t.statements);let r=a.get("teardown",!0);(0,N.isSeq)(r)&&t.teardown&&tt(r,t.teardown)}function tt(e,t){e.commentBefore&&t.length>0&&(t[0].comment=e.commentBefore);for(let i=0;i<Math.min(e.items.length,t.length);i++){let n=e.items[i];n.commentBefore&&!(i===0&&e.commentBefore)&&(t[i].comment=n.commentBefore);let a=t[i];if(a.type==="STEP"&&(0,N.isMap)(n)){let o=n.get("statements",!0);(0,N.isSeq)(o)&&tt(o,a.statements)}else if(a.type==="IF_ELSE"&&(0,N.isMap)(n)){let o=n.get("THEN",!0);(0,N.isSeq)(o)&&tt(o,a.then);let r=n.get("ELSE",!0);(0,N.isSeq)(r)&&a.else&&tt(r,a.else)}else if(a.type==="WHILE_LOOP"&&(0,N.isMap)(n)){let o=n.get("DO",!0);(0,N.isSeq)(o)&&tt(o,a.body)}}}var N,oe,Ms,Ts,zd,kn=w(()=>{"use strict";_a();N=require("yaml"),oe=require("uuid");Ms={lineWidth:120,defaultKeyType:"PLAIN",defaultStringType:"PLAIN"};Ts=1024*1024;zd=new Set(["action","intent","desc","locator","xpath","use_pure_vision"])});var Os,Ns=w(()=>{"use strict";kn();Os=require("yaml")});var Sn=w(()=>{"use strict"});var Ds=w(()=>{"use strict";kn();Sn()});var En=w(()=>{"use strict"});var Ls=w(()=>{"use strict";En()});var Rs,Yd,Fs,Hs,si,Jd,qd,Ws=w(()=>{"use strict";Rs=112,Yd=1080-Rs,Fs={"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"}},Hs={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"]},si=(e,t=!1)=>{let i=["chromium"];return t&&i.push("webkit"),Hs[e].map(n=>Fs[n]).filter(n=>n.defaultBrowserType&&i.includes(n.defaultBrowserType))},Jd={desktop:{label:"Desktop",type:"desktop",devices:si("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:si("mobile")}},qd={desktop:{label:"Desktop",type:"desktop",devices:si("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:si("mobile",!0)}}});var Us=w(()=>{"use strict"});var Bs=w(()=>{"use strict";Sn()});var Le,Gs=w(()=>{"use strict";Le=(e=>(e.DRAFT="DRAFT",e.STEP="STEP",e.ACTION="ACTION",e.IF_ELSE="IF_ELSE",e.WHILE_LOOP="WHILE_LOOP",e))(Le||{})});var js=w(()=>{"use strict"});var Ks=w(()=>{"use strict"});var zs=w(()=>{"use strict"});var Vs=w(()=>{"use strict";En()});var it=w(()=>{"use strict";gs();fs();ws();bs();Ns();Ds();kn();_a();Ls();Ws();Us();Bs();Sn();Gs();js();Ks();zs();Vs();En()});function nu(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function au(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 qs(e){let t=nu(e),i=e.locator;if(typeof i=="string"&&i.trim())return i=i.trim(),i.endsWith("first()")?`${t}.${i}`:`${t}.${i}.first()`;let n=au(e);if(n){let a=JSON.stringify(n);return`${t}.locator(${a}).first()`}return null}function $(e,t){Z.set(e,t)}function Re(e,t,i=[]){let n=[...i];return t.locator?n.push(`locator: ${JSON.stringify(t.locator)}`):t.xpath&&n.push(`xpath: ${JSON.stringify(t.xpath)}`),t.frame_path&&t.frame_path.length>0&&n.push(`frame_path: ${JSON.stringify(t.frame_path)}`),n.length===0?[`await agent.execAction("${e}", page, {});`]:[`await agent.execAction("${e}", page, {`,...n.map(a=>` ${a},`),"});"]}function Xs(e){let t=e.functionName;if(!t)return null;let i=Array.isArray(e.args)?e.args.map(String):[];if(i.length===0)return`await ${t}()`;let n=["page","testContext","request","agent"],a=["undefined","null","true","false"],o=i.map(r=>n.includes(r)||a.includes(r)||/^-?\d+(\.\d+)?$/.test(r)?r:r.startsWith("$")?`agent.agentServices.readVariable('${r.substring(1)}')`:`"${r}"`);return`await ${t}(${o.join(", ")})`}function el(e,t){let i={expandingPaths:new Set([(0,di.resolve)(t)]),depth:0,referencedPaths:new Set},n={...e};Array.isArray(n.statements)&&(n.statements=Ce(n.statements,t,i)),Array.isArray(n.teardown)&&(n.teardown=Ce(n.teardown,t,i));for(let a of["beforeAll","afterAll","beforeEach","afterEach"])Array.isArray(n[a])&&(n[a]=Ce(n[a],t,i));return{doc:n,referencedTemplatePaths:Array.from(i.referencedPaths)}}function Ce(e,t,i){let n=[];for(let a of e)if(ou(a)){let o=ru(a,t,i);n.push(...o)}else n.push(su(a,t,i));return n}function ou(e){return typeof e=="object"&&e!==null&&typeof e.template=="string"}function ru(e,t,i){if(i.depth>=Ys)throw new Error(`Template expansion exceeded maximum depth of ${Ys}. Check for deeply nested or circular template references.`);let n=(0,di.resolve)((0,di.dirname)(t),e.template);if(i.expandingPaths.has(n))throw new Error(`Circular template reference detected: ${n} is already being expanded. Stack: ${Array.from(i.expandingPaths).join(" \u2192 ")} \u2192 ${n}`);i.referencedPaths.add(n);let a;try{a=(0,Qs.readFileSync)(n,"utf-8")}catch(c){throw new Error(`Failed to read template file: ${n} (referenced from ${t}): ${c.message}`)}let o=(0,li.parse)(a);if(!o||typeof o!="object")throw new Error(`Invalid template file: ${n} \u2014 expected a YAML object`);let r=o.params||[],s=e.params||{};for(let c of r)if(!(c in s))throw new Error(`Template ${e.template} requires param "${c}" but it was not provided. Required params: [${r.join(", ")}]`);let l=o.statements;if(!Array.isArray(l))throw new Error(`Template ${e.template} must have a "statements" array`);if(Object.keys(s).length>0){let u=(0,li.stringify)(l);for(let[m,f]of Object.entries(s))u=u.split(`<<${m}>>`).join(String(f));l=(0,li.parse)(u)}let d={expandingPaths:new Set([...i.expandingPaths,n]),depth:i.depth+1,referencedPaths:i.referencedPaths};return Ce(l,n,d)}function su(e,t,i){if(typeof e!="object"||e===null)return e;let n={...e};return Array.isArray(n.statements)&&(n.statements=Ce(n.statements,t,i)),Array.isArray(n.THEN)&&(n.THEN=Ce(n.THEN,t,i)),Array.isArray(n.ELSE)&&(n.ELSE=Ce(n.ELSE,t,i)),Array.isArray(n.DO)&&(n.DO=Ce(n.DO,t,i)),n}function il(e,t){let i=(0,ci.parse)(e),n=i?.name,a=i?.tags,o=i?.use;if(i&&(i.name!==void 0||i.tags!==void 0||i.use!==void 0)&&(delete i.name,delete i.tags,delete i.use),i?.suite){if(i.goal||i.statements)throw new tl('YAML file cannot have both "suite" and top-level "goal"/"statements". Use either suite format or single-test format.');return cu(i,n,a,o,t)}return lu(i,n,a,o,t)}function lu(e,t,i,n,a){let o=e?.beforeEach,r=e?.afterEach,s=nl(e?.parameters),l=e?.timeout,d=e?.skip,c=e?.fail,u=e?.only,m=e?.slow;if(e&&(delete e.beforeEach,delete e.afterEach,delete e.parameters,delete e.timeout,delete e.skip,delete e.fail,delete e.only,delete e.slow),e?.url)throw new tl(`The "url" field is not supported in local YAML tests. Use "base_url: ${e.url}" and add "- URL: /" as the first statement instead.`);e&&!e.goal&&t&&(e.goal=t);let f=[];if(a&&e&&typeof e=="object"){let y=el(e,a);e=y.doc,f=y.referencedTemplatePaths}let h=(0,ci.stringify)(e),x=Ee(h);return a&&(nt(x.statements??[],a,"main"),x.teardown&&nt(x.teardown,a,"teardown")),{testFlow:x,name:t,tags:i,use:n,beforeEach:o,afterEach:r,parameters:s,timeout:l,skip:d,fail:c,only:u,slow:m,referencedTemplatePaths:f}}function cu(e,t,i,n,a){let o=e.suite;if(!Array.isArray(o.tests)||o.tests.length===0)throw new Error('Suite must have a non-empty "tests" array.');let r=o.beforeAll,s=o.afterAll,l=o.beforeEach,d=o.afterEach,c=[],u=o.tests.map(h=>{if(!h.name)throw new Error('Each test in a suite must have a "name" field.');if(!Array.isArray(h.statements)||h.statements.length===0)throw new Error(`Suite test "${h.name}" must have a non-empty "statements" array.`);let x={goal:h.name,statements:h.statements};h.teardown&&(x.teardown=h.teardown);let y=[],p=x;if(a&&typeof x=="object"){let A=el(x,a);p=A.doc,y=A.referencedTemplatePaths,c.push(...y)}let b=(0,ci.stringify)(p),E=Ee(b),T=nl(h.parameters);return{testFlow:E,name:h.name,tags:Array.isArray(h.tags)?h.tags:void 0,parameters:T,timeout:h.timeout,skip:h.skip,fail:h.fail,only:h.only,slow:h.slow}}),m=o.base_url,f=m?{...n,baseURL:m}:n;return{suite:{beforeAll:r,afterAll:s,beforeEach:l,afterEach:d,tests:u},name:t,tags:i,use:f,referencedTemplatePaths:c}}function nl(e){if(!(!Array.isArray(e)||e.length===0))return e.map((t,i)=>{if(!t.name)throw new Error(`Parameter set at index ${i} must have a "name" field.`);if(!t.values||typeof t.values!="object")throw new Error(`Parameter set "${t.name}" must have a "values" object.`);return{name:t.name,values:t.values}})}function nt(e,t,i){for(let n=0;n<e.length;n++){let a=e[n],o=`${i}.${n}`,r=a.description||"";if(a.uid=du(t,o,r),a.type===Le.STEP)nt(a.statements,t,o);else if(a.type===Le.IF_ELSE){let s=a;nt(s.then,t,`${o}.then`),s.else&&nt(s.else,t,`${o}.else`)}else a.type===Le.WHILE_LOOP&&nt(a.body,t,`${o}.body`)}}function du(e,t,i){let n=(0,Zs.createHash)("sha256").update(`${e}:${t}:${i}`).digest("hex");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20,32)}`}var iu,Zs,ci,Qs,di,li,Js,Z,Ys,tl,al=w(()=>{"use strict";it();iu=require("yaml");it();Zs=require("crypto"),ci=require("yaml");it();Qs=require("fs"),di=require("path"),li=require("yaml");it();Js=5e3;Z=new Map;$("click",e=>{let t=qs(e);if(!t)return['await agent.execAction("click", page, {});'];let i=e.action_data?.kwargs?.timeout_ms??Js;return[`await ${t}.click({ timeout: ${i} });`]});$("click_element",Z.get("click"));$("click_element_by_index",Z.get("click"));$("double_click",e=>Re("double_click",e));$("double_click_on_element",Z.get("double_click"));$("right_click",e=>Re("right_click",e));$("right_click_on_element",Z.get("right_click"));$("hover",e=>Re("hover",e));$("hover_element_by_index",Z.get("hover"));$("input_text",e=>{let t=e.action_data?.kwargs?.text??e.action_data?.kwargs?.value??"";return Re("input_text",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});$("fill",Z.get("input_text"));$("clear_input",e=>Re("clear_input",e));$("press",e=>{let t=e.action_data?.kwargs?.keys;return[`await page.keyboard.press(${JSON.stringify(t)});`]});$("send_keys",Z.get("press"));$("send_keys_on_element",e=>{let t=qs(e),i=e.action_data?.kwargs?.keys||"";if(!t)return['await agent.execAction("send_keys_on_element", page, {',` action_data: { kwargs: { keys: ${JSON.stringify(i)} } },`,"});"];let n=e.action_data?.kwargs?.timeout_ms??Js;return[`await ${t}.press(${JSON.stringify(i)}, { timeout: ${n} });`]});$("select_dropdown_option",e=>{let t=e.action_data?.kwargs?.text||e.action_data?.kwargs?.option||"";return Re("select_dropdown_option",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});$("scroll",e=>{let t=e.action_data?.kwargs?.down??!0;return[`await page.evaluate('window.scrollBy(0, window.innerHeight * ${(e.action_data?.kwargs?.num_pages??1)*(t?1:-1)})');`]});$("scroll_down",Z.get("scroll"));$("scroll_up",Z.get("scroll"));$("scroll_element",Z.get("scroll"));$("scroll_to_text",e=>{let t=e.action_data?.kwargs?.text||"";return[`await page.getByText(${JSON.stringify(t)}, { exact: false }).first().scrollIntoViewIfNeeded();`]});$("scroll_on_element",e=>Re("scroll_on_element",e,[`action_data: { kwargs: ${JSON.stringify(e.action_data?.kwargs||{})} }`]));$("go_to_url",e=>{let t=e.action_data?.kwargs?.url||"";return e.action_data?.kwargs?.new_tab===!0?['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)}, new_tab: true } },`,"});"]:['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)} } },`,"});"]});$("open_tab",Z.get("go_to_url"));$("go_back",()=>['await agent.execAction("go_back", page, {});']);$("reload_page",()=>['await agent.execAction("reload_page", page, {});']);$("wait",e=>[`await page.waitForTimeout(${(e.action_data?.kwargs?.seconds||1)*1e3});`]);$("wait_for_page_ready",()=>["await page.waitForLoadState('domcontentloaded');"]);$("verify",(e,t)=>{let i=e.action_data?.kwargs,n=typeof i?.code=="string",a=n?i?.statement||e.action_description:e.action_description||i?.statement;if(n&&a){let r=i.code.split(`
4302
4302
  `),s=JSON.stringify(a);return["{ const _t = Date.now(); try {",...r.map(l=>` ${l}`),` console.log(\`[VERIFY:JS] \u2713 \${((Date.now()-_t)/1000).toFixed(1)}s: ${s}\`);`,"} catch (_e) {",` console.log(\`[VERIFY:JS\u2192AI] JS failed \${((Date.now()-_t)/1000).toFixed(1)}s: (\${_e instanceof Error ? _e.message : String(_e)}), falling back to AI: ${s}\`);`,` await agent.assert(page, ${s}, ${JSON.stringify(t||"")});`,"} }"]}return n?i.code.split(`
4303
4303
  `):a?[`await agent.assert(page, ${JSON.stringify(a)}, ${JSON.stringify(t||"")});`]:["// Skipping verify: missing statement or code"]});$("ai_assert",Z.get("verify"));$("assert",Z.get("verify"));$("ai_action",(e,t)=>{let i=e.action_data?.kwargs?.statement;if(!i)return["// Skipping ai_action: missing statement"];let n=JSON.stringify(i),a=e.action_data?.kwargs?.use_pure_vision;return[`await agent.execute(page, ${n}, '${t||""}', ${a});`]});$("ai_step",(e,t)=>{let i=e.action_data?.kwargs?.statement;return i?[`await agent.run(page, ${JSON.stringify(i)}, '${t||""}');`]:["// Skipping ai_step: missing statement"]});$("ai_extract",(e,t)=>{let i=e.action_data?.kwargs?.element_description,n=e.action_data?.kwargs?.variable_name;if(!i||!n)return["// Skipping ai_extract: missing element_description or variable_name"];let a=JSON.stringify(i),o=JSON.stringify(n);return[`await agent.extract(page, ${a}, ${o}, '${t||""}');`]});$("ai_wait_until",(e,t)=>{let i=e.action_data?.kwargs?.condition,n=e.action_data?.kwargs?.timeout_seconds||60;return i?[`await agent.waitUntilCondition(page, ${JSON.stringify(i)}, ${n}, '${t||""}');`]:["// Skipping ai_wait_until: missing condition"]});$("save_variable",e=>{let t=e.action_data?.kwargs?.name||"",i=e.action_data?.kwargs?.value;return['await agent.execAction("save_variable", page, {',` action_data: { kwargs: { name: ${JSON.stringify(t)}, value: ${JSON.stringify(i)} } },`,"});"]});$("js_code",e=>{let t=e.action_data?.kwargs?.code;if(!t)return["// Skipping js_code: missing code"];let i=["{"],n=t.split(`
4304
4304
  `);for(let a of n)i.push(` ${a}`);return i.push("}"),i});$("function",(e,t,i)=>{let n=e.action_data?.kwargs||{},a=n.functionName;if(a&&a.includes("#")){let[r,s]=a.split("#");if(r&&s){let l=r.replace(/\.(ts|js|mjs)$/,""),d=`import { ${s} } from '${l}';`;i?.imports?.add(d);let c={...n,functionName:s},u=Xs(c);return u?[u.endsWith(";")?u:`${u};`]:["// Skipping function: invalid export pattern"]}}let o=Xs(n);return o?[o.endsWith(";")?o:`${o};`]:["// Skipping function: missing functionName"]});$("generate_2fa_code",e=>{let t=e.action_data?.kwargs?.otp_secret_key||"";return['await agent.execAction("generate_2fa_code", page, {',` action_data: { kwargs: { otp_secret_key: ${JSON.stringify(t)} } },`,"});"]});$("upload_file",e=>{let t=e.action_data?.kwargs||{},i=[],n={};return t.paths?n.paths=t.paths:t.path&&(n.path=t.path),t.use_file_input&&(n.use_file_input=!0),i.push(`action_data: { kwargs: ${JSON.stringify(n)} }`),e.locator?i.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&i.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("upload_file", page, {',...i.map(a=>` ${a},`),"});"]});$("wait_for_download_complete",e=>['await agent.execAction("wait_for_download_complete", page, {',` action_data: { kwargs: { timeout_seconds: ${e.action_data?.kwargs?.timeout_seconds||10} } },`,"});"]);$("switch_tab",e=>['await agent.execAction("switch_tab", page, {',` action_data: { kwargs: { page_id: ${e.action_data?.kwargs?.page_id??e.action_data?.kwargs?.tab_index??0} } },`,"});"]);$("close_tab",e=>{let t=e.action_data?.kwargs?.page_id;return t=t??e.action_data?.kwargs?.index,['await agent.execAction("close_tab", page, {',` action_data: { kwargs: { page_id: ${t} } },`,"});"]});$("set_date_for_native_date_picker",e=>{let t=e.action_data?.kwargs?.date??"",i=[];return i.push(`action_data: { kwargs: { date: ${JSON.stringify(t)} } }`),e.locator?i.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&i.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("set_date_for_native_date_picker", page, {',...i.map(n=>` ${n},`),"});"]});$("done",()=>["// Done - no action needed"]);$("js_action",e=>{let t=e.action_data?.kwargs?.code;return t?t.split(`