@testspectra/react 1.2.17 → 1.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -2
- package/dist/setup.js +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -64,8 +64,14 @@ function matchesUrlPattern(pattern, url) {
|
|
|
64
64
|
}
|
|
65
65
|
return url.toLowerCase().includes(pattern.toLowerCase());
|
|
66
66
|
}
|
|
67
|
-
function createMockHandle(rule) {
|
|
67
|
+
function createMockHandle(rule, release) {
|
|
68
|
+
let released = false;
|
|
68
69
|
const handle = {
|
|
70
|
+
unroute: () => {
|
|
71
|
+
if (released) return;
|
|
72
|
+
released = true;
|
|
73
|
+
release?.();
|
|
74
|
+
},
|
|
69
75
|
respondWith: async (newFixture, newOptions = {}) => {
|
|
70
76
|
const newObj = newFixture;
|
|
71
77
|
rule.response = newObj && newObj.body !== void 0 ? newObj.body : newFixture;
|
|
@@ -975,7 +981,10 @@ var DomDriverBridge = class {
|
|
|
975
981
|
const rule = parseMockRule(patternOrOptions, method, fixture, options);
|
|
976
982
|
ensureNetworkPatch(() => this.mockRules);
|
|
977
983
|
this.mockRules.push(rule);
|
|
978
|
-
return createMockHandle(rule)
|
|
984
|
+
return createMockHandle(rule, () => {
|
|
985
|
+
const idx = this.mockRules.indexOf(rule);
|
|
986
|
+
if (idx !== -1) this.mockRules.splice(idx, 1);
|
|
987
|
+
});
|
|
979
988
|
}
|
|
980
989
|
clearMocks() {
|
|
981
990
|
this.mockRules = [];
|
package/dist/setup.js
CHANGED
|
@@ -12,7 +12,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
12
12
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BR(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,s;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(l){i=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw s}}return n}}function FR(e){if(Array.isArray(e))return e}function UR(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ef(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
13
13
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,s;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return i=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}}}function Ef(e,t){if(e){if(typeof e=="string")return bf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bf(e,t)}}function bf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ge=[],vf=hf.default.keys();for(Fi=0;Fi<vf.length;Fi++)if(Ui=vf[Fi],ji=hf.default.get(Ui),ji)for(us=[].concat(ji.baseConcepts,ji.relatedConcepts),$i=0;$i<us.length;$i++)cs=us[$i],cs.module==="HTML"&&(function(){var e=cs.concept;if(e){var t=Ge.find(function(i){return(0,yf.dequal)(i,e)}),r;t?r=t[1]:r=[];for(var n=!0,o=0;o<r.length;o++)if(r[o]===Ui){n=!1;break}n&&r.push(Ui),Ge.push([e,r])}})();var Ui,ji,us,cs,$i,Fi,ds={entries:function(){return Ge},forEach:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=UR(Ge),o;try{for(n.s();!(o=n.n()).done;){var i=ls(o.value,2),a=i[0],s=i[1];t.call(r,s,a,Ge)}}catch(l){n.e(l)}finally{n.f()}},get:function(t){var r=Ge.find(function(n){return t.name===n[0].name&&(0,yf.dequal)(t.attributes,n[0].attributes)});return r&&r[1]},has:function(t){return!!ds.get(t)},keys:function(){return Ge.map(function(t){var r=ls(t,1),n=r[0];return n})},values:function(){return Ge.map(function(t){var r=ls(t,2),n=r[1];return n})}},jR=(0,LR.default)(ds,ds.entries());Hi.default=jR});var Sf=p(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.default=void 0;var $R=Tf(Ct()),Pf=Tf(Bi());function Tf(e){return e&&e.__esModule?e:{default:e}}function ps(e,t){return WR(e)||VR(e,t)||Rf(e,t)||HR()}function HR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
14
14
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VR(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,s;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(l){i=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw s}}return n}}function WR(e){if(Array.isArray(e))return e}function zR(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Rf(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
15
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,s;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return i=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}}}function Rf(e,t){if(e){if(typeof e=="string")return _f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _f(e,t)}}function _f(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var rt=[],Cf=Pf.default.keys();for(Vi=0;Vi<Cf.length;Vi++)if(fs=Cf[Vi],Wi=Pf.default.get(fs),zi=[],Wi){for(ms=[].concat(Wi.baseConcepts,Wi.relatedConcepts),Ki=0;Ki<ms.length;Ki++)bs=ms[Ki],bs.module==="HTML"&&(vs=bs.concept,vs!=null&&zi.push(vs));zi.length>0&&rt.push([fs,zi])}var fs,Wi,zi,ms,bs,vs,Ki,Vi,ys={entries:function(){return rt},forEach:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=zR(rt),o;try{for(n.s();!(o=n.n()).done;){var i=ps(o.value,2),a=i[0],s=i[1];t.call(r,s,a,rt)}}catch(l){n.e(l)}finally{n.f()}},get:function(t){var r=rt.find(function(n){return n[0]===t});return r&&r[1]},has:function(t){return!!ys.get(t)},keys:function(){return rt.map(function(t){var r=ps(t,1),n=r[0];return n})},values:function(){return rt.map(function(t){var r=ps(t,2),n=r[1];return n})}},KR=(0,$R.default)(ys,ys.entries());Gi.default=KR});var xf=p(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.roles=me.roleElements=me.elementRoles=me.dom=me.aria=void 0;var GR=sr(Rc()),XR=sr(qc()),QR=sr(Bi()),YR=sr(wf()),JR=sr(Sf());function sr(e){return e&&e.__esModule?e:{default:e}}var ZR=GR.default;me.aria=ZR;var e0=XR.default;me.dom=e0;var t0=QR.default;me.roles=t0;var r0=YR.default;me.elementRoles=r0;var n0=JR.default;me.roleElements=n0});var qf=p((LI,Xi)=>{var hs=(function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",n={};function o(a,s){if(!n[a]){n[a]={};for(var l=0;l<a.length;l++)n[a][a.charAt(l)]=l}return n[a][s]}var i={compressToBase64:function(a){if(a==null)return"";var s=i._compress(a,6,function(l){return t.charAt(l)});switch(s.length%4){default:case 0:return s;case 1:return s+"===";case 2:return s+"==";case 3:return s+"="}},decompressFromBase64:function(a){return a==null?"":a==""?null:i._decompress(a.length,32,function(s){return o(t,a.charAt(s))})},compressToUTF16:function(a){return a==null?"":i._compress(a,15,function(s){return e(s+32)})+" "},decompressFromUTF16:function(a){return a==null?"":a==""?null:i._decompress(a.length,16384,function(s){return a.charCodeAt(s)-32})},compressToUint8Array:function(a){for(var s=i.compress(a),l=new Uint8Array(s.length*2),u=0,c=s.length;u<c;u++){var d=s.charCodeAt(u);l[u*2]=d>>>8,l[u*2+1]=d%256}return l},decompressFromUint8Array:function(a){if(a==null)return i.decompress(a);for(var s=new Array(a.length/2),l=0,u=s.length;l<u;l++)s[l]=a[l*2]*256+a[l*2+1];var c=[];return s.forEach(function(d){c.push(e(d))}),i.decompress(c.join(""))},compressToEncodedURIComponent:function(a){return a==null?"":i._compress(a,6,function(s){return r.charAt(s)})},decompressFromEncodedURIComponent:function(a){return a==null?"":a==""?null:(a=a.replace(/ /g,"+"),i._decompress(a.length,32,function(s){return o(r,a.charAt(s))}))},compress:function(a){return i._compress(a,16,function(s){return e(s)})},_compress:function(a,s,l){if(a==null)return"";var u,c,d={},m={},y="",P="",C="",T=2,f=3,g=2,w=[],h=0,E=0,q;for(q=0;q<a.length;q+=1)if(y=a.charAt(q),Object.prototype.hasOwnProperty.call(d,y)||(d[y]=f++,m[y]=!0),P=C+y,Object.prototype.hasOwnProperty.call(d,P))C=P;else{if(Object.prototype.hasOwnProperty.call(m,C)){if(C.charCodeAt(0)<256){for(u=0;u<g;u++)h=h<<1,E==s-1?(E=0,w.push(l(h)),h=0):E++;for(c=C.charCodeAt(0),u=0;u<8;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1}else{for(c=1,u=0;u<g;u++)h=h<<1|c,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=0;for(c=C.charCodeAt(0),u=0;u<16;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1}T--,T==0&&(T=Math.pow(2,g),g++),delete m[C]}else for(c=d[C],u=0;u<g;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1;T--,T==0&&(T=Math.pow(2,g),g++),d[P]=f++,C=String(y)}if(C!==""){if(Object.prototype.hasOwnProperty.call(m,C)){if(C.charCodeAt(0)<256){for(u=0;u<g;u++)h=h<<1,E==s-1?(E=0,w.push(l(h)),h=0):E++;for(c=C.charCodeAt(0),u=0;u<8;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1}else{for(c=1,u=0;u<g;u++)h=h<<1|c,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=0;for(c=C.charCodeAt(0),u=0;u<16;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1}T--,T==0&&(T=Math.pow(2,g),g++),delete m[C]}else for(c=d[C],u=0;u<g;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1;T--,T==0&&(T=Math.pow(2,g),g++)}for(c=2,u=0;u<g;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1;for(;;)if(h=h<<1,E==s-1){w.push(l(h));break}else E++;return w.join("")},decompress:function(a){return a==null?"":a==""?null:i._decompress(a.length,32768,function(s){return a.charCodeAt(s)})},_decompress:function(a,s,l){var u=[],c,d=4,m=4,y=3,P="",C=[],T,f,g,w,h,E,q,R={val:l(0),position:s,index:1};for(T=0;T<3;T+=1)u[T]=T;for(g=0,h=Math.pow(2,2),E=1;E!=h;)w=R.val&R.position,R.position>>=1,R.position==0&&(R.position=s,R.val=l(R.index++)),g|=(w>0?1:0)*E,E<<=1;switch(c=g){case 0:for(g=0,h=Math.pow(2,8),E=1;E!=h;)w=R.val&R.position,R.position>>=1,R.position==0&&(R.position=s,R.val=l(R.index++)),g|=(w>0?1:0)*E,E<<=1;q=e(g);break;case 1:for(g=0,h=Math.pow(2,16),E=1;E!=h;)w=R.val&R.position,R.position>>=1,R.position==0&&(R.position=s,R.val=l(R.index++)),g|=(w>0?1:0)*E,E<<=1;q=e(g);break;case 2:return""}for(u[3]=q,f=q,C.push(q);;){if(R.index>a)return"";for(g=0,h=Math.pow(2,y),E=1;E!=h;)w=R.val&R.position,R.position>>=1,R.position==0&&(R.position=s,R.val=l(R.index++)),g|=(w>0?1:0)*E,E<<=1;switch(q=g){case 0:for(g=0,h=Math.pow(2,8),E=1;E!=h;)w=R.val&R.position,R.position>>=1,R.position==0&&(R.position=s,R.val=l(R.index++)),g|=(w>0?1:0)*E,E<<=1;u[m++]=e(g),q=m-1,d--;break;case 1:for(g=0,h=Math.pow(2,16),E=1;E!=h;)w=R.val&R.position,R.position>>=1,R.position==0&&(R.position=s,R.val=l(R.index++)),g|=(w>0?1:0)*E,E<<=1;u[m++]=e(g),q=m-1,d--;break;case 2:return C.join("")}if(d==0&&(d=Math.pow(2,y),y++),u[q])P=u[q];else if(q===m)P=f+f.charAt(0);else return null;C.push(P),u[m++]=f+P.charAt(0),d--,f=P,d==0&&(d=Math.pow(2,y),y++)}}};return i})();typeof define=="function"&&define.amd?define(function(){return hs}):typeof Xi<"u"&&Xi!=null?Xi.exports=hs:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return hs})});var qa=null;function ol(e){qa=e}function Pe(){if(!qa)throw new Error("No active driver bound to worker runtime");return qa}var Ot={activePlatform:"web",configuredBaseUrl:"http://localhost:3000",driverServerUrl:"tcp://127.0.0.1:8200",defaultElementWaitMs:5e3,defaultNavigationWaitMs:1e4,defaultPollIntervalMs:20,defaultReadyPollIntervalMs:50},Ie=null;function It(){if(Ie)return Ie;if(globalThis.__TESTSPECTRA_CONFIG__)return Ie=globalThis.__TESTSPECTRA_CONFIG__,Ie;if(typeof process<"u"&&process.env?.TESTSPECTRA_CONFIG)try{return Ie=JSON.parse(process.env.TESTSPECTRA_CONFIG),Ie}catch{}return Ie={rootDir:typeof process<"u"?process.cwd():"",testFilePath:"",activePlatform:Ot.activePlatform,configuredBaseUrl:Ot.configuredBaseUrl,cdpWsUrl:"",driverServerUrl:Ot.driverServerUrl,manifest:{page_objects:[],fixtures:[],steps:[],actions:[],global_hooks:[],suite_hooks:{}}},Ie}var il=null;function al(e,t,r,n){il&&il(e,t,r,n)}function xr(){return It().implicitWaitMs??Ot.defaultElementWaitMs}function L(){return Math.min(xr(),2e3)}function Sr(e,t){console.log(`[${e}] ${t}`)}async function A(e,t,r){let n=It(),o=globalThis.__CURRENT_TEST_TITLE__||globalThis.__CURRENT_TEST_ID__||"",i=globalThis.__TESTSPECTRA_WORKER_ID__;o&&!t.test&&(t.test=o),i!==void 0&&t.workerId===void 0&&(t.workerId=i);let a=JSON.stringify(t);Sr("TESTSPECTRA_STEP_START",a);let s=Date.now();try{let l=await r(),u=Date.now()-s;Sr("TESTSPECTRA_STEP_PASS",`${a} (${u}ms)`),al(`step:${t.key}`,e,u,{test:o,target:t.target});let c=n.stepDelayMs||0;return c>0&&await new Promise(d=>setTimeout(d,c)),l}catch(l){let u=Date.now()-s;throw Sr("TESTSPECTRA_STEP_FAIL",`${a} (${u}ms)`),al(`step:${t.key}`,e,u,{test:o,target:t.target,failed:!0}),Sr("TESTSPECTRA_TEST_ERROR",l?.message||String(l)),l}}async function M(e,t,r=15){let n=t??xr(),o=Date.now();for(;Date.now()-o<n;){try{if(await e())return!0}catch{}await new Promise(i=>setTimeout(i,r))}try{return await e()}catch{return!1}}function sl(e,t,r){let n=()=>Pe(),o=typeof e=="string"?e:e.selector;async function i(b){return A("assertion",{type:"assertion",key:"be.visible",target:e,args:[]},async()=>{if(!await M(()=>r.isVisible(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to be visible`)})}async function a(b){return A("assertion",{type:"assertion",key:"not.be.visible",target:e,args:[]},async()=>{if(!await M(async()=>!await r.isVisible(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to be visible`)})}async function s(b){return A("assertion",{type:"assertion",key:"exist",target:e,args:[]},async()=>{if(!await M(()=>r.isExisting(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to exist in DOM`)})}async function l(b){return A("assertion",{type:"assertion",key:"not.exist",target:e,args:[]},async()=>{if(!await M(async()=>!await r.isExisting(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to exist in DOM`)})}async function u(b){return A("assertion",{type:"assertion",key:"be.enabled",target:e,args:[]},async()=>{if(!await M(()=>r.isEnabled(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to be enabled`)})}async function c(b){return A("assertion",{type:"assertion",key:"be.disabled",target:e,args:[]},async()=>{if(!await M(async()=>!await r.isEnabled(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to be disabled`)})}async function d(b){return A("assertion",{type:"assertion",key:"be.clickable",target:e,args:[]},async()=>{if(!await M(()=>n().isClickable(e,t),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to be clickable`)})}async function m(b){return A("assertion",{type:"assertion",key:"not.be.clickable",target:e,args:[]},async()=>{if(!await M(async()=>!await n().isClickable(e,t),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to be clickable`)})}async function y(b){return A("assertion",{type:"assertion",key:"be.checked",target:e,args:[]},async()=>{if(!await M(()=>r.isChecked(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to be checked`)})}async function P(b){return A("assertion",{type:"assertion",key:"not.be.checked",target:e,args:[]},async()=>{if(!await M(async()=>!await r.isChecked(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to be checked`)})}async function C(b){return A("assertion",{type:"assertion",key:"be.focused",target:e,args:[]},async()=>{if(!await M(()=>r.isFocused(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to be focused`)})}async function T(b){return A("assertion",{type:"assertion",key:"not.be.focused",target:e,args:[]},async()=>{if(!await M(async()=>!await r.isFocused(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to be focused`)})}async function f(b,v){return A("assertion",{type:"assertion",key:"have.value",target:e,args:[b]},async()=>{let S="";if(!await M(async()=>(S=await r.getValue(),S===String(b)),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" to have value "${b}", but got "${S}"`)})}async function g(b,v){return A("assertion",{type:"assertion",key:"not.have.value",target:e,args:[b]},async()=>{if(!await M(async()=>await r.getValue()!==String(b),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to have value "${b}"`)})}async function w(b,v){return A("assertion",{type:"assertion",key:"contain.value",target:e,args:[b]},async()=>{let S="";if(!await M(async()=>(S=await r.getValue(),S.includes(String(b))),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" to contain value "${b}", but got "${S}"`)})}async function h(b,v){return A("assertion",{type:"assertion",key:"not.contain.value",target:e,args:[b]},async()=>{if(!await M(async()=>!(await r.getValue()).includes(String(b)),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to contain value "${b}"`)})}async function E(b,v){return A("assertion",{type:"assertion",key:"have.text",target:e,args:[b]},async()=>{let S="";if(!await M(async()=>(S=await r.getText(),b instanceof RegExp?b.test(S):S===String(b)||S.trim()===String(b).trim()),v?.timeoutMs??L()))throw b instanceof RegExp?new Error(`Expected element "${o}" text to match ${b}, but got "${S}"`):new Error(`Expected element "${o}" to have text "${b}", but got "${S}"`)})}async function q(b,v){return A("assertion",{type:"assertion",key:"not.have.text",target:e,args:[b]},async()=>{let S="";if(!await M(async()=>await r.isExisting()?(S=await r.getText(),b instanceof RegExp?!b.test(S):S!==String(b)&&S.trim()!==String(b).trim()):!1,v?.timeoutMs??L()))throw b instanceof RegExp?new Error(`Expected element "${o}" text not to match ${b}`):new Error(`Expected element "${o}" not to have text "${b}"`)})}async function R(b,v){return A("assertion",{type:"assertion",key:"contain.text",target:e,args:[b]},async()=>{let S="";if(!await M(async()=>(S=await r.getText(),S.includes(String(b))),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" to contain text "${b}", but got "${S}"`)})}async function H(b,v){return A("assertion",{type:"assertion",key:"not.contain.text",target:e,args:[b]},async()=>{if(!await M(async()=>!(await r.getText()).includes(String(b)),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to contain text "${b}"`)})}async function B(b,v){return A("assertion",{type:"assertion",key:"have.class",target:e,args:[b]},async()=>{if(!await M(()=>n().hasClass(e,b,t),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" to have class "${b}"`)})}async function W(b,v){return A("assertion",{type:"assertion",key:"not.have.class",target:e,args:[b]},async()=>{if(!await M(async()=>!await n().hasClass(e,b,t),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to have class "${b}"`)})}async function K(b,v,S){return A("assertion",{type:"assertion",key:"have.attr",target:e,args:v!==void 0?[b,v]:[b]},async()=>{let j=null;if(!await M(async()=>(j=await r.getAttribute(b),v!==void 0?j===String(v):j!==null),S?.timeoutMs??L()))throw v!==void 0?new Error(`Expected element "${o}" to have attribute "${b}" = "${v}", but got "${j}"`):new Error(`Expected element "${o}" to have attribute "${b}"`)})}async function O(b,v){return A("assertion",{type:"assertion",key:"not.have.attr",target:e,args:[b]},async()=>{if(!await M(async()=>await r.getAttribute(b)===null,v?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to have attribute "${b}"`)})}async function G(b,v,S){return A("assertion",{type:"assertion",key:"have.css",target:e,args:[b,v]},async()=>{let j=le=>String(le??"").replace(/\s+/g,"").replace(/rgba\((.+?),1\)/,"rgb($1)").toLowerCase(),N="";if(!await M(async()=>(N=(await r.getCSSProperty(b)).value,j(N)===j(v)),S?.timeoutMs??L()))throw new Error(`Expected element "${o}" to have CSS "${b}" = "${v}", but got "${N}"`)})}async function Y(b,v,S){return A("assertion",{type:"assertion",key:"not.have.css",target:e,args:[b,v]},async()=>{let j=pe=>String(pe??"").replace(/\s+/g,"").replace(/rgba\((.+?),1\)/,"rgb($1)").toLowerCase();if(!await M(async()=>{let pe=await r.getCSSProperty(b);return j(pe.value)!==j(v)},S?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to have CSS "${b}" = "${v}"`)})}return{shouldBeVisible:i,shouldNotBeVisible:a,shouldExist:s,shouldNotExist:l,shouldBeEnabled:u,shouldBeDisabled:c,shouldBeClickable:d,shouldNotBeClickable:m,shouldBeChecked:y,shouldNotBeChecked:P,shouldBeFocused:C,shouldNotBeFocused:T,shouldHaveValue:f,shouldNotHaveValue:g,shouldContainValue:w,shouldNotContainValue:h,shouldHaveText:E,shouldNotHaveText:q,shouldContainText:R,shouldNotContainText:H,shouldHaveClass:B,shouldNotHaveClass:W,shouldHaveAttribute:K,shouldNotHaveAttribute:O,shouldHaveCss:G,shouldNotHaveCss:Y}}var ll=new Map;function ul(e,t){ll.set(e,t)}function cl(){return ll.entries()}var dl=Symbol("testspectra.elementScope");function pl(e,t){Object.defineProperty(e,dl,{value:t,enumerable:!1})}function Aa(e){if(!(e===null||typeof e!="object"))return e[dl]}function fl(e,t){let r=()=>Pe(),n=typeof e=="string"?e:e.selector;async function o(){return await r().getText(e,t)}async function i(){return await r().getValue(e,t)}async function a(){return await r().isDisplayed(e,t)}async function s(){return await a()}async function l(){return await r().isExisting(e,t)}async function u(){return await r().isEnabled(e,t)}async function c(){return await r().isClickable(e,t)}async function d(){return await r().isSelected(e,t)}async function m(){return await d()}async function y(){return await r().isFocused(e,t)}async function P(g){return await r().getAttribute(e,g,t)}async function C(g){return await r().getCSSProperty(e,g,t)}async function T(g){let w=g??xr();if(await M(async()=>r().isExisting(e,t),w))return!0;throw new Error("Element not found: "+JSON.stringify(n))}async function f(g={}){let w=g.timeout||5e3,h=Date.now();for(;Date.now()-h<w;){if(await r().isDisplayed(e,t))return!0;await new Promise(E=>setTimeout(E,20))}throw new Error(`Element ${n} not displayed after ${w}ms`)}return{getText:o,getValue:i,isDisplayed:a,isVisible:s,isExisting:l,isEnabled:u,isClickable:c,isSelected:d,isChecked:m,isFocused:y,getAttribute:P,getCSSProperty:C,waitForElement:T,waitForDisplayed:f}}function ml(e){return typeof e=="string"?e:e.selector}function Ma(e,t){return typeof e=="string"?{selector:e,index:t,parent:void 0}:e}function ue(e,t=null){let r=ml(e),n=typeof e=="string"?t:e.index,o=bl(e,t),i=fl(e,t),a=sl(e,t,i),s={selector:r,index:n,...o,...i,...a,get(u,c=null){return ue({selector:u,index:c,parent:Ma(e,t)},null)},getAll(u){return Te({selector:u,index:null,parent:Ma(e,t)})}};pl(s,Ma(e,t));let l=s;for(let[u,c]of cl())u in l||(l[u]=(...d)=>c.apply(s,d));return s}function Te(e){let t=()=>Pe(),r=ml(e),n=i=>typeof e=="string"?[e,i]:[{...e,index:i},null];return{selector:r,async count(){return await t().count(e)},get length(){return this.count()},first(){return ue(...n(0))},last(){return ue(...n(-1))},nth(i){return ue(...n(i))},async shouldHaveLength(i,a){return A("assertion",{type:"assertion",key:"have.length",target:e,args:[i]},async()=>{let s=0;if(!await M(async()=>(s=await this.count(),s===i),a?.timeoutMs??L()))throw new Error(`Expected collection "${r}" count to equal ${i}, but got ${s}`)})},async shouldNotHaveLength(i,a){return A("assertion",{type:"assertion",key:"not.have.length",target:e,args:[i]},async()=>{let s=0;if(!await M(async()=>(s=await this.count(),s!==i),a?.timeoutMs??L()))throw new Error(`Expected collection "${r}" count not to equal ${i}`)})},async shouldHaveLengthGreaterThan(i,a){return A("assertion",{type:"assertion",key:"have.length.greaterThan",target:e,args:[i]},async()=>{let s=0;if(!await M(async()=>(s=await this.count(),s>i),a?.timeoutMs??L()))throw new Error(`Expected collection "${r}" count to be greater than ${i}, but got ${s}`)})},async shouldHaveLengthLessThan(i,a){return A("assertion",{type:"assertion",key:"have.length.lessThan",target:e,args:[i]},async()=>{let s=0;if(!await M(async()=>(s=await this.count(),s<i),a?.timeoutMs??L()))throw new Error(`Expected collection "${r}" count to be less than ${i}, but got ${s}`)})},async shouldBeEmpty(i){return A("assertion",{type:"assertion",key:"be.empty",target:e,args:[]},async()=>{let a=0;if(!await M(async()=>(a=await this.count(),a===0),i?.timeoutMs??L()))throw new Error(`Expected collection "${r}" to be empty, but got ${a}`)})},async shouldNotBeEmpty(i){return A("assertion",{type:"assertion",key:"not.be.empty",target:e,args:[]},async()=>{let a=0;if(!await M(async()=>(a=await this.count(),a>0),i?.timeoutMs??L()))throw new Error(`Expected collection "${r}" not to be empty`)})}}}function ne(e){if(typeof e=="string")return ue(e,null);if(e&&typeof e=="object"&&"selector"in e)return e;throw new Error(`Invalid element target: ${String(e)}`)}function vl(e){return typeof e=="string"?e:e.selector}function bl(e,t){let r=()=>Pe();async function n(v){return A("action",{type:"action",key:"click",target:e,args:[]},async()=>{await r().click(e,t)})}async function o(){return A("action",{type:"action",key:"doubleClick",target:e,args:[]},async()=>{await r().doubleClick(e,t)})}async function i(){return A("action",{type:"action",key:"rightClick",target:e,args:[]},async()=>{await r().rightClick(e,t)})}async function a(v){return A("action",{type:"action",key:"type",target:e,args:[v]},async()=>{await r().setValue(e,v,t)})}async function s(v,S){S?.clearFirst&&await l(),await a(v)}async function l(){return A("action",{type:"action",key:"clear",target:e,args:[]},async()=>{await r().clearValue(e,t)})}async function u(){await l()}async function c(v){return A("action",{type:"action",key:"select",target:e,args:[v]},async()=>{await r().select(e,v,t)})}async function d(v){await c(v)}async function m(){return A("action",{type:"action",key:"hover",target:e,args:[]},async()=>{await r().hover(e,t)})}async function y(){return A("action",{type:"action",key:"focus",target:e,args:[]},async()=>{await r().focus(e,t)})}async function P(){return A("action",{type:"action",key:"blur",target:e,args:[]},async()=>{await r().blur(e,t)})}async function C(v){return A("action",{type:"action",key:"waitForElementRemoved",target:e,args:[v??5e3]},async()=>{if(!await M(async()=>!await r().isExisting(e,t),v??5e3))throw new Error("Element still exists after timeout: "+JSON.stringify(vl(e)))})}async function T(v){return A("action",{type:"action",key:"waitForUndisplayed",target:e,args:[v?.timeout??5e3]},async()=>{if(!await M(async()=>!await r().isDisplayed(e,t),v?.timeout??5e3))throw new Error("Element still displayed after timeout: "+JSON.stringify(vl(e)))})}async function f(v){return A("action",{type:"action",key:"waitForClickable",target:e,args:[v?.timeout??5e3]},async()=>await M(async()=>await r().isClickable(e,t),v?.timeout??5e3))}async function g(){return A("action",{type:"action",key:"getBounds",target:e,args:[]},async()=>await r().getBounds(e,t))}function w(){let v=typeof e=="string"?e:e.selector,S=typeof e=="string"?t:e.index;return S==null?v:`${v}::nth(${S})`}function h(){return ue(w()+"::parent",null)}async function E(v){return A("action",{type:"action",key:"closest",target:e,args:[v]},async()=>await r().closest(e,v,t)?ue(`${w()}::closest(${v})`,null):null)}function q(v){return Te(`${w()}::children(${v??""})`)}function R(v){return Te(`${w()}::siblings(${v??""})`)}function H(v){return ue(`${w()}::next(${v??""})`,null)}async function B(){await m()}async function W(v){let S=typeof v=="string"?v:v?.selector||String(v);return A("action",{type:"action",key:"dragDrop",target:e,args:[S]},async()=>{await r().dragDrop(e,S,t)})}async function K(v){await W(v)}async function O(v){let S=typeof v=="number"?v:v?.duration||1e3;return A("action",{type:"action",key:"longPress",target:e,args:[S]},async()=>{await r().longPress(e,S,t)})}async function G(){return A("action",{type:"action",key:"scrollIntoView",target:e,args:[]},async()=>{await r().scrollIntoView(e,t)})}async function Y(v){return A("action",{type:"action",key:"upload",target:e,args:[v]},async()=>{await r().upload(e,v,t)})}async function b(v){await Y(v)}return{click:n,doubleClick:o,rightClick:i,setValue:a,type:s,clearValue:l,clear:u,select:c,selectByVisibleText:d,hover:m,focus:y,blur:P,waitForElementRemoved:C,waitForUndisplayed:T,waitForClickable:f,getBounds:g,parent:h,closest:E,children:q,siblings:R,next:H,moveTo:B,dragDrop:W,dragAndDrop:K,longPress:O,scrollIntoView:G,upload:Y,uploadFile:b}}var hl=["number","date","time","color","file","range"],yl=e=>e.replace(/[^\p{L}\p{N}]/gu,"");function ka(e,t,r){return t===null||r===null?!0:t===e||t!==r||yl(t)===yl(e)}function gl(e,t,r){return new Error(`Typed text did not reach element "${e}": expected "${t}", got "${r}"`)}var Kb={Backspace:{code:"Backspace",windowsVirtualKeyCode:8},Tab:{code:"Tab",windowsVirtualKeyCode:9},Enter:{code:"Enter",windowsVirtualKeyCode:13,text:"\r"},Escape:{code:"Escape",windowsVirtualKeyCode:27},Delete:{code:"Delete",windowsVirtualKeyCode:46},ArrowLeft:{code:"ArrowLeft",windowsVirtualKeyCode:37},ArrowUp:{code:"ArrowUp",windowsVirtualKeyCode:38},ArrowRight:{code:"ArrowRight",windowsVirtualKeyCode:39},ArrowDown:{code:"ArrowDown",windowsVirtualKeyCode:40},Home:{code:"Home",windowsVirtualKeyCode:36},End:{code:"End",windowsVirtualKeyCode:35},PageUp:{code:"PageUp",windowsVirtualKeyCode:33},PageDown:{code:"PageDown",windowsVirtualKeyCode:34}};function El(e){if(typeof e!="string")return null;let t=Kb[e];return t?{key:e,...t}:null}function Oa(e,t){if(!e||e==="*"||e==="**"||e==="ALL")return!0;if(e.startsWith("/")&&e.endsWith("/"))try{return new RegExp(e.slice(1,-1)).test(t)}catch{}if(e.includes("*")){let r=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(r,"i").test(t)}catch{}}return t.toLowerCase().includes(e.toLowerCase())}function qr(e){let t={respondWith:async(n,o={})=>{let i=n;e.response=i&&i.body!==void 0?i.body:n,(o.statusCode||i&&i.statusCode)&&(e.statusCode=o.statusCode||i?.statusCode||200),(o.headers||i&&i.headers)&&(e.headers=o.headers||i?.headers),(o.delayMs!==void 0||i&&i.delayMs!==void 0)&&(e.delayMs=o.delayMs??i?.delayMs),e.aborted=!1},respondOnce:async(n,o={})=>{let i=n,a=i&&i.body!==void 0?i.body:n,s=o.statusCode||i&&i.statusCode||e.statusCode||200,l=o.headers||i&&i.headers||e.headers,u=o.delayMs??(i&&i.delayMs)??e.delayMs;e.respondOnceQueue.push({response:a,statusCode:s,headers:l,delayMs:u}),e.aborted=!1},abort:async(n="Failed")=>{e.aborted=!0,e.abortReason=n},waitForCall:async(n={})=>{let o=n.count??1,i=n.timeout??5e3;return e.calls.length>=o?e.calls[o-1]:new Promise((a,s)=>{let l=setTimeout(()=>{let u=e.waitResolvers.findIndex(c=>c.resolve===a);u!==-1&&e.waitResolvers.splice(u,1),s(new Error(`Spectra.intercept waitForCall timed out after ${i}ms (expected at least ${o} call(s), received ${e.calls.length})`))},i);e.waitResolvers.push({count:o,resolve:u=>{clearTimeout(l),a(u)}})})}},r=()=>e.callCount;return t.callCount=Object.assign(r,{valueOf:()=>e.callCount,[Symbol.toPrimitive]:()=>e.callCount}),Object.defineProperty(t,"calls",{get:()=>e.calls,enumerable:!0}),t}function Ar(e,t,r,n){let o,i,a,s,l,u;if(typeof e=="object"&&e!==null)o=e.url||e.pattern||"*",i=(e.method||"GET").toUpperCase(),a=e.response!==void 0?e.response:typeof t=="object"&&t!==null?t:r,s=e.statusCode||n&&n.statusCode||200,l=e.headers||n&&n.headers,u=e.delayMs??(n&&n.delayMs);else if(o=String(e||"*"),typeof t=="string"&&["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","ALL"].includes(t.toUpperCase())){i=t.toUpperCase();let c=r;a=c&&c.body!==void 0?c.body:r,s=n&&n.statusCode||c&&c.statusCode||200,l=n&&n.headers||c&&c.headers,u=(n&&n.delayMs)??(c&&c.delayMs)}else{i="GET";let c=t;a=c&&c.body!==void 0?c.body:t,s=r&&r.statusCode||c&&c.statusCode||200,l=r&&r.headers||c&&c.headers,u=(r&&r.delayMs)??(c&&c.delayMs)}return{pattern:o,method:i,response:a,statusCode:s,headers:l,delayMs:u,callCount:0,respondOnceQueue:[],calls:[],waitResolvers:[]}}function Nt(e,t,r){for(let n of e)if(Oa(n.pattern,t)&&(!n.method||n.method==="ALL"||n.method.toUpperCase()===r.toUpperCase()))return n;return null}function Lt(e,t){e.calls.push(t),e.callCount++;for(let r=e.waitResolvers.length-1;r>=0;r--){let n=e.waitResolvers[r];e.callCount>=n.count&&(e.waitResolvers.splice(r,1),n.resolve(t))}return t}function Dt(e){if(e.respondOnceQueue.length>0){let t=e.respondOnceQueue.shift();return{body:t.response,statusCode:t.statusCode||e.statusCode||200,headers:{...e.headers,...t.headers},delayMs:t.delayMs??e.delayMs}}return{body:e.response,statusCode:e.statusCode||200,headers:{...e.headers},delayMs:e.delayMs}}var Gb={"Content-Type":"application/json; charset=utf-8","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, POST, PUT, DELETE, PATCH, OPTIONS","Access-Control-Allow-Headers":"*"};function Mr(e){let t=new Map;for(let[r,n]of Object.entries(Gb))t.set(r.toLowerCase(),{name:r,value:n});for(let[r,n]of Object.entries(e||{}))t.set(r.toLowerCase(),{name:r,value:String(n)});return[...t.values()]}function Bt(e){return typeof e=="string"?e:typeof e=="object"&&e!==null?JSON.stringify(e):String(e??"")}function wl(e){let t=/^(.*)::nth\((-?\d+)\)$/.exec(e);if(t)return{kind:"nth",base:t[1],arg:t[2]};let r=/^(.*)::closest\((.+)\)$/.exec(e);if(r)return{kind:"closest",base:r[1],arg:r[2]};let n=/^(.*)::children\((.*)\)$/.exec(e);if(n)return{kind:"children",base:n[1],arg:n[2].trim()||null};let o=/^(.*)::children$/.exec(e);if(o)return{kind:"children",base:o[1],arg:null};let i=/^(.*)::siblings\((.*)\)$/.exec(e);if(i)return{kind:"siblings",base:i[1],arg:i[2].trim()||null};let a=/^(.*)::siblings$/.exec(e);if(a)return{kind:"siblings",base:a[1],arg:null};let s=/^(.*)::next\((.*)\)$/.exec(e);if(s)return{kind:"next",base:s[1],arg:s[2].trim()||null};let l=/^(.*)::next$/.exec(e);if(l)return{kind:"next",base:l[1],arg:null};let u=/^(.*)::parent$/.exec(e);return u?{kind:"parent",base:u[1]}:null}function Ia(e){let t=e.trim();if(!t.startsWith("~"))return null;let r=t.slice(1),n=r.indexOf("[");return n!==-1?{name:r.slice(0,n),chainSuffix:r.slice(n)}:{name:r,chainSuffix:""}}function _l(e){let t=Ia(e);if(!t)return null;let{name:r,chainSuffix:n}=t,o=JSON.stringify(r);return`:is([aria-label=${o}], [title=${o}])${n}`}function Cl(e,t,r){let o=Array.from(t.querySelectorAll("[aria-labelledby]")).filter(i=>(i.getAttribute("aria-labelledby")??"").trim().split(/\s+/).map(l=>{let u=document.getElementById(l);return u?(u.textContent??"").trim():""}).filter(Boolean).join(" ").trim()===e);return r===null?o[0]??null:r>=0?o[r]??null:o[o.length+r]??null}var Xb=new Set(["mount","unmount","registerCommand","registerCommands"]),Qb=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function Pl(){let e=()=>Pe(),t={get:r=>ne(r),getAll:r=>Te(r),navigate:r=>e().navigate(r),back:()=>e().back(),forward:()=>e().forward(),refresh:()=>e().refresh(),setViewport:(r,n)=>e().setViewport(r,n),wait:r=>e().pause(r),click:async(r,n)=>{await ne(r).click()},clickAt:async(r,n)=>{await e().clickAt(r,n)},doubleClick:async r=>{await ne(r).doubleClick()},rightClick:async r=>{await ne(r).rightClick()},type:async(r,n,o)=>{await ne(r).type(n,o)},clear:async r=>{await ne(r).clear()},select:async(r,n)=>{await ne(r).select(n)},hover:async r=>{await ne(r).hover()},focus:async r=>{await ne(r).focus()},blur:async r=>{await ne(r).blur()},dragDrop:async(r,n)=>{await ne(r).dragDrop(n)},scrollIntoView:async r=>{await ne(r).scrollIntoView()},scroll:async r=>{await e().scroll(r)},swipe:async r=>{await e().swipe(r)},longPress:async(r,n)=>{await ne(r).longPress(n)},pressKey:async r=>{await e().pressKey(r)},grantPermission:async r=>{await e().grantPermission(r)},waitForElement:async(r,n)=>{await ne(r).waitForElement(n)},intercept:async(r,n,o,i)=>await e().intercept(r,n,o,i),clearMocks:()=>{e().clearMocks()},get browser(){return e()},get env(){return It().environmentVariables||{}}};return t.registerCommand=(r,n)=>{if(typeof n!="function")throw new Error(`[TestSpectra] Custom command "${r}" must be a function.`);if(!Qb.test(r))throw new Error(`[TestSpectra] Invalid custom command name "${r}"; must be a valid identifier.`);if(Xb.has(r)||r in t)throw new Error(`[TestSpectra] Custom command "${r}" collides with a built-in Spectra method.`);t[r]=n,ul(r,n)},t.registerCommands=r=>{for(let[n,o]of Object.entries(r))t.registerCommand(n,o)},t}function Tl(){return typeof globalThis.__TESTSPECTRA_STEP_DELAY_MS__=="number"?globalThis.__TESTSPECTRA_STEP_DELAY_MS__:typeof window<"u"&&typeof window.__TESTSPECTRA_STEP_DELAY_MS__=="number"?window.__TESTSPECTRA_STEP_DELAY_MS__:0}var Yb=5e3;function kr(e,t){(typeof globalThis.__TESTSPECTRA_SEMANTIC_REPORTER__=="boolean"?globalThis.__TESTSPECTRA_SEMANTIC_REPORTER__:!(typeof window<"u"&&typeof window.__TESTSPECTRA_SEMANTIC_REPORTER__=="boolean")||window.__TESTSPECTRA_SEMANTIC_REPORTER__)&&console.log(`[${e}] ${t}`)}function Na(){return Yb}function Jb(){return Math.min(Na(),2e3)}async function Zb(e,t,r){let n=globalThis.__CURRENT_TEST_TITLE__;n&&!t.test&&(t.test=n);let o=JSON.stringify(t);kr("TESTSPECTRA_STEP_START",o);let i=Date.now();try{let a=await r(),s=Date.now()-i;kr("TESTSPECTRA_STEP_PASS",`${o} (${s}ms)`);let l=Tl();return l>0&&await new Promise(u=>setTimeout(u,l)),a}catch(a){let s=Date.now()-i;throw kr("TESTSPECTRA_STEP_FAIL",`${o} (${s}ms)`),a}}async function ev(e,t,r=15){let n=t??Na(),o=Date.now();for(;Date.now()-o<n;){try{if(await e())return!0}catch{}await new Promise(i=>setTimeout(i,r))}try{return await e()}catch{return!1}}globalThis.__TESTSPECTRA_CONFIG__={rootDir:"",activePlatform:"web",configuredBaseUrl:"",cdpWsUrl:"",driverServerUrl:"",stepDelayMs:Tl()};globalThis.__TS_RUNTIME__={activeDriver:null,mobileMockRules:[],lastFocusedSelector:null,emitEvent:kr,trackStep:Zb,pollCondition:ev,getImplicitWaitMs:Na,getAssertionTimeoutMs:Jb,matchesUrlPattern:Oa,createMockHandle:qr,parseMockRule:Ar,findMatchingRule:Nt,recordMockCall:Lt,consumeMockResponse:Dt,mergeMockResponseHeaders:Mr,mockResponseBodyText:Bt,createElementProxy:ue,createCollectionProxy:Te,beforeHook:null,afterHook:null,beforeEachHook:null,afterEachHook:null,suiteBeforeEachHooks:{},suiteAfterEachHooks:{}};var Rl=new Set;async function Sl(e,t=[],r,n={platform:"web"}){for(let o of t)if(!Rl.has(o))try{let i=await r(o),a=i?.default??i?.plugin??i;typeof a=="function"?await a(e,n):a&&typeof a.setup=="function"?await a.setup(e,n):console.error(`[TestSpectra] Plugin "${o}" has no default export function or setup() method \u2014 skipping.`),Rl.add(o)}catch(i){console.error(`[TestSpectra] Failed to load plugin "${o}": ${i?.stack||i?.message||i}`)}}function tv(){let e=globalThis,t;try{t=e.__TESTSPECTRA_AUTO_IMPORT_MANIFEST__}catch{}if(!t&&typeof window<"u"&&(t=window.__TESTSPECTRA_AUTO_IMPORT_MANIFEST__),!t)return null;if(typeof t=="string")try{return JSON.parse(t)}catch{return null}return t}var xl=new Map;async function Or(e){let t=xl.get(e);if(t)return t;let r,o=typeof globalThis.__vitest_browser_runner__<"u"||typeof globalThis.__vitest_worker__<"u"?`/@fs/${e.replace(/\\/g,"/")}`.replace(/\/@fs\/\//g,"/@fs/"):`/test?file=${encodeURIComponent(e)}`;if(e.endsWith(".json"))try{let i=await fetch(o);if(i.ok)r=await i.json();else throw new Error(`Failed to fetch JSON fixture: ${i.status}`)}catch{r=await new Function("specifier",'return import(specifier, { with: { type: "json" } })')(o)}else r=await new Function("specifier","return import(specifier)")(o);return xl.set(e,r),r}async function La(e){let t=e??tv();if(!t)return;let r=t.pageObjects??t.page_objects??[];for(let l of r){let u=l.path??l.file_path;if(u){let c=await Or(u);globalThis[l.name]=c.default??c}}let n={},o=t.fixtures??[];for(let l of o){let u=l.path??l.file_path;if(u){let c=u.split("/").pop()?.split("\\").pop()||`${l.name}.bin`;try{let d=await Or(u),m=d?.default!==void 0?d.default:d??u;typeof m=="string"&&m.startsWith("data:")&&!m.includes("name=")&&(m=m.replace(/^data:([^;,]+)/,y=>`${y};name=${encodeURIComponent(c)}`)),n[l.name]=m}catch{n[l.name]=u}}}globalThis.Fixture=n;let i={},a=t.steps??[];for(let l of a){let u=l.path??l.file_path;if(u){let c=await Or(u);i[l.name]=c.default??c}}globalThis.Step=i;let s=rv();s.length>0&&globalThis.Spectra&&await Sl(globalThis.Spectra,s,Or,{platform:"web"})}function rv(){let e=globalThis,t;try{t=e.__TESTSPECTRA_PLUGINS__}catch{}if(!t&&typeof window<"u"&&(t=window.__TESTSPECTRA_PLUGINS__),!t)return[];if(Array.isArray(t))return t.filter(r=>typeof r=="string");if(typeof t=="string")try{let r=JSON.parse(t);return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}catch{return[]}return[]}globalThis.__bootstrapAutoImports=La;function x(e,t,r){return e.namespaceURI&&e.namespaceURI!=="http://www.w3.org/1999/xhtml"||(t=Array.isArray(t)?t:[t],!t.includes(e.tagName.toLowerCase()))?!1:r?Object.entries(r).every(([n,o])=>e[n]===o):!0}function V(e){var t;if(nv(e)&&e.defaultView)return e.defaultView;if(!((t=e.ownerDocument)===null||t===void 0)&&t.defaultView)return e.ownerDocument.defaultView;throw new Error(`Could not determine window of node. Node was ${ov(e)}`)}function nv(e){return e.nodeType===9}function ov(e){return typeof e=="function"?`function ${e.name}`:e===null?"null":String(e)}function Da(e,t){return new Promise((r,n)=>{let o=new t;o.onerror=n,o.onabort=n,o.onload=()=>{r(String(o.result))},o.readAsText(e)})}function Ft(e,t){let r={...t,length:t.length,item:n=>r[n],[Symbol.iterator]:function*(){for(let o=0;o<r.length;o++)yield r[o]}};return r.constructor=e.FileList,e.FileList&&Object.setPrototypeOf(r,e.FileList.prototype),Object.freeze(r),r}function Ne(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ut=class{getAsFile(){return this.file}getAsString(t){typeof this.data=="string"&&t(this.data)}webkitGetAsEntry(){throw new Error("not implemented")}constructor(t,r){Ne(this,"kind",void 0),Ne(this,"type",void 0),Ne(this,"file",null),Ne(this,"data",void 0),typeof t=="string"?(this.kind="string",this.type=String(r),this.data=t):(this.kind="file",this.type=t.type,this.file=t)}};function ql(e){return e.replace(/[A-Z]/g,t=>t.toLowerCase())}var Fa=class extends Array{add(...t){let r=typeof t[0]=="string"?new Ut(t[0],ql(t[1])):new Ut(t[0]);return this.push(r),r}clear(){this.splice(0,this.length)}remove(t){this.splice(t,1)}};function Ba(e){let t=ql(e);return t==="text"?"text/plain":t==="url"?"text/uri-list":t}function Ir(e,t){let[r,n]=e.split("/"),o=!n||n==="*";return i=>t?i.type===(o?r:e):o?i.type.startsWith(`${r}/`):i.type===r}function iv(e){return new class{getData(r){var n;let o=Ba(r),i=(n=this.items.find(Ir(o,!0)))!==null&&n!==void 0?n:this.items.find(Ir(o,!1)),a="";return i?.getAsString(s=>{a=s}),a}setData(r,n){let o=Ba(r),i=this.items.findIndex(Ir(o,!0)),a=new Ut(n,o);i>=0?this.items.splice(i,1,a):this.items.push(a)}clearData(r){if(r){let n=Ba(r),o=this.items.findIndex(Ir(n,!0));o>=0&&this.items.remove(o)}else this.items.clear()}get types(){let r=[];return this.files.length&&r.push("Files"),this.items.forEach(n=>r.push(n.type)),Object.freeze(r),r}setDragImage(){}constructor(){Ne(this,"dropEffect","none"),Ne(this,"effectAllowed","uninitialized"),Ne(this,"items",new Fa),Ne(this,"files",Ft(e,[]))}}}function vt(e,t=[]){let r=typeof e.DataTransfer>"u"?iv(e):new e.DataTransfer;return Object.defineProperty(r,"files",{get:()=>Ft(e,t)}),r}async function Al(e,t){return t.kind==="file"?t.getAsFile():new e.Blob([await new Promise(r=>t.getAsString(r))],{type:t.type})}function kl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ol(e,...t){let r=Object.fromEntries(t.map(n=>[typeof n=="string"?"text/plain":n.type,Promise.resolve(n)]));return typeof e.ClipboardItem<"u"?new e.ClipboardItem(r):new class{get types(){return Array.from(Object.keys(this.data))}async getType(o){let i=await this.data[o];if(!i)throw new Error(`${o} is not one of the available MIME types on this item.`);return i instanceof e.Blob?i:new e.Blob([i],{type:o})}constructor(o){kl(this,"data",void 0),this.data=o}}(r)}var yt=Symbol("Manage ClipboardSub");function Ml(e,t){return Object.assign(new class extends e.EventTarget{async read(){return Array.from(this.items)}async readText(){let n="";for(let o of this.items){let i=o.types.includes("text/plain")?"text/plain":o.types.find(a=>a.startsWith("text/"));i&&(n+=await o.getType(i).then(a=>Da(a,e.FileReader)))}return n}async write(n){this.items=n}async writeText(n){this.items=[Ol(e,n)]}constructor(...n){super(...n),kl(this,"items",[])}},{[yt]:t})}function Ua(e){return!!e?.[yt]}function Il(e){if(Ua(e.navigator.clipboard))return e.navigator.clipboard[yt];let t=Object.getOwnPropertyDescriptor(e.navigator,"clipboard"),r,n={resetClipboardStub:()=>{r=Ml(e,n)},detachClipboardStub:()=>{t?Object.defineProperty(e.navigator,"clipboard",t):Object.defineProperty(e.navigator,"clipboard",{value:void 0,configurable:!0})}};return r=Ml(e,n),Object.defineProperty(e.navigator,"clipboard",{get:()=>r,configurable:!0}),r[yt]}function av(e){Ua(e.navigator.clipboard)&&e.navigator.clipboard[yt].resetClipboardStub()}function sv(e){Ua(e.navigator.clipboard)&&e.navigator.clipboard[yt].detachClipboardStub()}async function Nl(e){let t=e.defaultView,r=t?.navigator.clipboard,n=r&&await r.read();if(!n)throw new Error("The Clipboard API is unavailable.");let o=vt(t);for(let i of n)for(let a of i.types)o.setData(a,await i.getType(a).then(s=>Da(s,t.FileReader)));return o}async function Lr(e,t){let r=V(e),n=r.navigator.clipboard,o=[];for(let a=0;a<t.items.length;a++){let s=t.items[a],l=await Al(r,s);o.push(Ol(r,l))}if(!(n&&await n.write(o).then(()=>!0,()=>!1)))throw new Error("The Clipboard API is unavailable.")}var Nr=globalThis;typeof Nr.afterEach=="function"&&Nr.afterEach(()=>{typeof globalThis.window<"u"&&av(globalThis.window)});typeof Nr.afterAll=="function"&&Nr.afterAll(()=>{typeof globalThis.window<"u"&&sv(globalThis.window)});var Dr=["input:not([type=hidden]):not([disabled])","button:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contenteditable=""]','[contenteditable="true"]',"a[href]","[tabindex]:not([disabled])","details > summary"].join(", ");function jt(e){return e.matches(Dr)}function Ll(e){return new e.constructor(e.type,e)}function te(e){for(let r=e;r;r=r.parentElement)if(x(r,["button","input","select","textarea","optgroup","option"])){if(r.hasAttribute("disabled"))return!0}else if(x(r,"fieldset")){var t;if(r.hasAttribute("disabled")&&!(!((t=r.querySelector(":scope > legend"))===null||t===void 0)&&t.contains(e)))return!0}else if(r.tagName.includes("-")&&r.constructor.formAssociated&&r.hasAttribute("disabled"))return!0;return!1}function Le(e){let t=e.activeElement;if(t?.shadowRoot){let r=Le(t.shadowRoot);if(r)return r}else if(t&&x(t,"iframe")){let r=t.contentDocument;if(r)return Le(r)}return te(t)?e.ownerDocument?e.ownerDocument.body:e.body:t}function ht(e){var t;return(t=Le(e))!==null&&t!==void 0?t:e.body}function Dl(e,t){let r=e;do{if(t(r))return r;r=r.parentElement}while(r&&r!==e.ownerDocument.body)}function ce(e){return e.hasAttribute("contenteditable")&&(e.getAttribute("contenteditable")=="true"||e.getAttribute("contenteditable")=="")}function De(e){let t=lv(e);return t&&(t.closest('[contenteditable=""]')||t.closest('[contenteditable="true"]'))}function lv(e){return e.nodeType===1?e:e.parentElement}var Bl=(function(e){return e.button="button",e.color="color",e.file="file",e.image="image",e.reset="reset",e.submit="submit",e.checkbox="checkbox",e.radio="radio",e})(Bl||{});function Br(e){return x(e,"button")||x(e,"input")&&e.type in Bl}function ve(e){return ja(e)&&!e.readOnly||ce(e)}var Fl=(function(e){return e.text="text",e.date="date",e["datetime-local"]="datetime-local",e.email="email",e.month="month",e.number="number",e.password="password",e.search="search",e.tel="tel",e.time="time",e.url="url",e.week="week",e})(Fl||{});function ja(e){return x(e,"textarea")||x(e,"input")&&e.type in Fl}function X(e){return jl(e)&&ja(e)}function Ul(e){return jl(e)&&Br(e)}function jl(e){return e.nodeType===1}function $l(e){let t=e.ownerDocument.getSelection();if(t?.focusNode&&X(e)){let n=De(t.focusNode);if(n){if(!t.isCollapsed){var r;let o=((r=n.firstChild)===null||r===void 0?void 0:r.nodeType)===3?n.firstChild:n;t.setBaseAndExtent(o,0,o,0)}}else t.setBaseAndExtent(e,0,e,0)}}function Fr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var ra=xa(ec());var Hy=Object.prototype.toString;function tc(e){return typeof e=="function"||Hy.call(e)==="[object Function]"}function Vy(e){var t=Number(e);return isNaN(t)?0:t===0||!isFinite(t)?t:(t>0?1:-1)*Math.floor(Math.abs(t))}var Wy=Math.pow(2,53)-1;function zy(e){var t=Vy(e);return Math.min(Math.max(t,0),Wy)}function de(e,t){var r=Array,n=Object(e);if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");if(typeof t<"u"&&!tc(t))throw new TypeError("Array.from: when provided, the second argument must be a function");for(var o=zy(n.length),i=tc(r)?Object(new r(o)):new Array(o),a=0,s;a<o;)s=n[a],t?i[a]=t(s,a):i[a]=s,a+=1;return i.length=o,i}function tr(e){"@babel/helpers - typeof";return tr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tr(e)}function Ky(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nc(n.key),n)}}function Gy(e,t,r){return t&&rc(e.prototype,t),r&&rc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xy(e,t,r){return t=nc(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nc(e){var t=Qy(e,"string");return tr(t)==="symbol"?t:String(t)}function Qy(e,t){if(tr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(tr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yy=(function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Ky(this,e),Xy(this,"items",void 0),this.items=t}return Gy(e,[{key:"add",value:function(r){return this.has(r)===!1&&this.items.push(r),this}},{key:"clear",value:function(){this.items=[]}},{key:"delete",value:function(r){var n=this.items.length;return this.items=this.items.filter(function(o){return o!==r}),n!==this.items.length}},{key:"forEach",value:function(r){var n=this;this.items.forEach(function(o){r(o,o,n)})}},{key:"has",value:function(r){return this.items.indexOf(r)!==-1}},{key:"size",get:function(){return this.items.length}}]),e})(),oc=typeof Set>"u"?Set:Yy;function Q(e){var t;return(t=e.localName)!==null&&t!==void 0?t:e.tagName.toLowerCase()}var Jy={article:"article",aside:"complementary",button:"button",datalist:"listbox",dd:"definition",details:"group",dialog:"dialog",dt:"term",fieldset:"group",figure:"figure",form:"form",footer:"contentinfo",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",header:"banner",hr:"separator",html:"document",legend:"legend",li:"listitem",math:"math",main:"main",menu:"list",nav:"navigation",ol:"list",optgroup:"group",option:"option",output:"status",progress:"progressbar",section:"region",summary:"button",table:"table",tbody:"rowgroup",textarea:"textbox",tfoot:"rowgroup",td:"cell",th:"columnheader",thead:"rowgroup",tr:"row",ul:"list"},Zy={caption:new Set(["aria-label","aria-labelledby"]),code:new Set(["aria-label","aria-labelledby"]),deletion:new Set(["aria-label","aria-labelledby"]),emphasis:new Set(["aria-label","aria-labelledby"]),generic:new Set(["aria-label","aria-labelledby","aria-roledescription"]),insertion:new Set(["aria-label","aria-labelledby"]),paragraph:new Set(["aria-label","aria-labelledby"]),presentation:new Set(["aria-label","aria-labelledby"]),strong:new Set(["aria-label","aria-labelledby"]),subscript:new Set(["aria-label","aria-labelledby"]),superscript:new Set(["aria-label","aria-labelledby"])};function eh(e,t){return["aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-dropeffect","aria-flowto","aria-grabbed","aria-hidden","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-owns","aria-relevant","aria-roledescription"].some(function(r){var n;return e.hasAttribute(r)&&!((n=Zy[t])!==null&&n!==void 0&&n.has(r))})}function ic(e,t){return eh(e,t)}function Qr(e){var t=rh(e);if(t===null||t==="presentation"){var r=th(e);if(t!=="presentation"||ic(e,r||""))return r}return t}function th(e){var t=Jy[Q(e)];if(t!==void 0)return t;switch(Q(e)){case"a":case"area":case"link":if(e.hasAttribute("href"))return"link";break;case"img":return e.getAttribute("alt")===""&&!ic(e,"img")?"presentation":"img";case"input":{var r=e,n=r.type;switch(n){case"button":case"image":case"reset":case"submit":return"button";case"checkbox":case"radio":return n;case"range":return"slider";case"email":case"tel":case"text":case"url":return e.hasAttribute("list")?"combobox":"textbox";case"search":return e.hasAttribute("list")?"combobox":"searchbox";case"number":return"spinbutton";default:return null}}case"select":return e.hasAttribute("multiple")||e.size>1?"listbox":"combobox"}return null}function rh(e){var t=e.getAttribute("role");if(t!==null){var r=t.trim().split(" ")[0];if(r.length>0)return r}return null}function $(e){return e!==null&&e.nodeType===e.ELEMENT_NODE}function Ya(e){return $(e)&&Q(e)==="caption"}function rr(e){return $(e)&&Q(e)==="input"}function ac(e){return $(e)&&Q(e)==="optgroup"}function sc(e){return $(e)&&Q(e)==="select"}function lc(e){return $(e)&&Q(e)==="table"}function uc(e){return $(e)&&Q(e)==="textarea"}function cc(e){var t=e.ownerDocument===null?e:e.ownerDocument,r=t.defaultView;if(r===null)throw new TypeError("no window available");return r}function dc(e){return $(e)&&Q(e)==="fieldset"}function pc(e){return $(e)&&Q(e)==="legend"}function fc(e){return $(e)&&Q(e)==="slot"}function nh(e){return $(e)&&e.ownerSVGElement!==void 0}function mc(e){return $(e)&&Q(e)==="svg"}function bc(e){return nh(e)&&Q(e)==="title"}function _t(e,t){if($(e)&&e.hasAttribute(t)){var r=e.getAttribute(t).split(" "),n=e.getRootNode?e.getRootNode():e.ownerDocument;return r.map(function(o){return n.getElementById(o)}).filter(function(o){return o!==null})}return[]}function ge(e,t){return $(e)?t.indexOf(Qr(e))!==-1:!1}function oh(e){return e.trim().replace(/\s\s+/g," ")}function ih(e,t){if(!$(e))return!1;if(e.hasAttribute("hidden")||e.getAttribute("aria-hidden")==="true")return!0;var r=t(e);return r.getPropertyValue("display")==="none"||r.getPropertyValue("visibility")==="hidden"}function ah(e){return ge(e,["button","combobox","listbox","textbox"])||hc(e,"range")}function hc(e,t){if(!$(e))return!1;if(t==="range")return ge(e,["meter","progressbar","scrollbar","slider","spinbutton"]);throw new TypeError("No knowledge about abstract role '".concat(t,"'. This is likely a bug :("))}function vc(e,t){var r=de(e.querySelectorAll(t));return _t(e,"aria-owns").forEach(function(n){r.push.apply(r,de(n.querySelectorAll(t)))}),r}function sh(e){return sc(e)?e.selectedOptions||vc(e,"[selected]"):vc(e,'[aria-selected="true"]')}function lh(e){return ge(e,["none","presentation"])}function uh(e){return Ya(e)}function ch(e){return ge(e,["button","cell","checkbox","columnheader","gridcell","heading","label","legend","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"])}function dh(e){return!1}function ph(e){return rr(e)||uc(e)?e.value:e.textContent||""}function yc(e){var t=e.getPropertyValue("content");return/^["'].*["']$/.test(t)?t.slice(1,-1):""}function gc(e){var t=Q(e);return t==="button"||t==="input"&&e.getAttribute("type")!=="hidden"||t==="meter"||t==="output"||t==="progress"||t==="select"||t==="textarea"}function Ec(e){if(gc(e))return e;var t=null;return e.childNodes.forEach(function(r){if(t===null&&$(r)){var n=Ec(r);n!==null&&(t=n)}}),t}function fh(e){if(e.control!==void 0)return e.control;var t=e.getAttribute("for");return t!==null?e.ownerDocument.getElementById(t):Ec(e)}function mh(e){var t=e.labels;if(t===null)return t;if(t!==void 0)return de(t);if(!gc(e))return null;var r=e.ownerDocument;return de(r.querySelectorAll("label")).filter(function(n){return fh(n)===e})}function bh(e){var t=e.assignedNodes();return t.length===0?de(e.childNodes):t}function Yr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=new oc,n=cc(e),o=t.compute,i=o===void 0?"name":o,a=t.computedStyleSupportsPseudoElements,s=a===void 0?t.getComputedStyle!==void 0:a,l=t.getComputedStyle,u=l===void 0?n.getComputedStyle.bind(n):l,c=t.hidden,d=c===void 0?!1:c;function m(f,g){var w="";if($(f)&&s){var h=u(f,"::before"),E=yc(h);w="".concat(E," ").concat(w)}var q=fc(f)?bh(f):de(f.childNodes).concat(_t(f,"aria-owns"));if(q.forEach(function(B){var W=T(B,{isEmbeddedInLabel:g.isEmbeddedInLabel,isReferenced:!1,recursion:!0}),K=$(B)?u(B).getPropertyValue("display"):"inline",O=K!=="inline"?" ":"";w+="".concat(O).concat(W).concat(O)}),$(f)&&s){var R=u(f,"::after"),H=yc(R);w="".concat(w," ").concat(H)}return w.trim()}function y(f,g){var w=f.getAttributeNode(g);return w!==null&&!r.has(w)&&w.value.trim()!==""?(r.add(w),w.value):null}function P(f){return $(f)?y(f,"title"):null}function C(f){if(!$(f))return null;if(dc(f)){r.add(f);for(var g=de(f.childNodes),w=0;w<g.length;w+=1){var h=g[w];if(pc(h))return T(h,{isEmbeddedInLabel:!1,isReferenced:!1,recursion:!1})}}else if(lc(f)){r.add(f);for(var E=de(f.childNodes),q=0;q<E.length;q+=1){var R=E[q];if(Ya(R))return T(R,{isEmbeddedInLabel:!1,isReferenced:!1,recursion:!1})}}else if(mc(f)){r.add(f);for(var H=de(f.childNodes),B=0;B<H.length;B+=1){var W=H[B];if(bc(W))return W.textContent}return null}else if(Q(f)==="img"||Q(f)==="area"){var K=y(f,"alt");if(K!==null)return K}else if(ac(f)){var O=y(f,"label");if(O!==null)return O}if(rr(f)&&(f.type==="button"||f.type==="submit"||f.type==="reset")){var G=y(f,"value");if(G!==null)return G;if(f.type==="submit")return"Submit";if(f.type==="reset")return"Reset"}var Y=mh(f);if(Y!==null&&Y.length!==0)return r.add(f),de(Y).map(function(j){return T(j,{isEmbeddedInLabel:!0,isReferenced:!1,recursion:!0})}).filter(function(j){return j.length>0}).join(" ");if(rr(f)&&f.type==="image"){var b=y(f,"alt");if(b!==null)return b;var v=y(f,"title");return v!==null?v:"Submit Query"}if(ge(f,["button"])){var S=m(f,{isEmbeddedInLabel:!1,isReferenced:!1});if(S!=="")return S}return null}function T(f,g){if(r.has(f))return"";if(!d&&ih(f,u)&&!g.isReferenced)return r.add(f),"";var w=$(f)?f.getAttributeNode("aria-labelledby"):null,h=w!==null&&!r.has(w)?_t(f,"aria-labelledby"):[];if(i==="name"&&!g.isReferenced&&h.length>0)return r.add(w),h.map(function(K){return T(K,{isEmbeddedInLabel:g.isEmbeddedInLabel,isReferenced:!0,recursion:!1})}).join(" ");var E=g.recursion&&ah(f)&&i==="name";if(!E){var q=($(f)&&f.getAttribute("aria-label")||"").trim();if(q!==""&&i==="name")return r.add(f),q;if(!lh(f)){var R=C(f);if(R!==null)return r.add(f),R}}if(ge(f,["menu"]))return r.add(f),"";if(E||g.isEmbeddedInLabel||g.isReferenced){if(ge(f,["combobox","listbox"])){r.add(f);var H=sh(f);return H.length===0?rr(f)?f.value:"":de(H).map(function(K){return T(K,{isEmbeddedInLabel:g.isEmbeddedInLabel,isReferenced:!1,recursion:!0})}).join(" ")}if(hc(f,"range"))return r.add(f),f.hasAttribute("aria-valuetext")?f.getAttribute("aria-valuetext"):f.hasAttribute("aria-valuenow")?f.getAttribute("aria-valuenow"):f.getAttribute("value")||"";if(ge(f,["textbox"]))return r.add(f),ph(f)}if(ch(f)||$(f)&&g.isReferenced||uh(f)||dh(f)){var B=m(f,{isEmbeddedInLabel:g.isEmbeddedInLabel,isReferenced:!1});if(B!=="")return r.add(f),B}if(f.nodeType===f.TEXT_NODE)return r.add(f),f.textContent||"";if(g.recursion)return r.add(f),m(f,{isEmbeddedInLabel:g.isEmbeddedInLabel,isReferenced:!1});var W=P(f);return W!==null?(r.add(f),W):(r.add(f),"")}return oh(T(e,{isEmbeddedInLabel:!1,isReferenced:i==="description",recursion:!1}))}function nr(e){"@babel/helpers - typeof";return nr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nr(e)}function wc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function _c(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wc(Object(r),!0).forEach(function(n){vh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vh(e,t,r){return t=yh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yh(e){var t=hh(e,"string");return nr(t)==="symbol"?t:String(t)}function hh(e,t){if(nr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(nr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=_t(e,"aria-describedby").map(function(o){return Yr(o,_c(_c({},t),{},{compute:"description"}))}).join(" ");if(r===""){var n=e.getAttribute("title");r=n===null?"":n}return r}function gh(e){return ge(e,["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"])}function or(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return gh(e)?"":Yr(e,t)}var oe=xa(xf()),Lf=xa(qf());function Df(e){return e.replace(/</g,"<").replace(/>/g,">")}var o0=(e,t,r,n,o,i,a)=>{let s=n+r.indent,l=r.colors;return e.map(u=>{let c=t[u],d=a(c,r,s,o,i);return typeof c!="string"&&(d.indexOf(`
|
|
15
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,s;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return i=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}}}function Rf(e,t){if(e){if(typeof e=="string")return _f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _f(e,t)}}function _f(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var rt=[],Cf=Pf.default.keys();for(Vi=0;Vi<Cf.length;Vi++)if(fs=Cf[Vi],Wi=Pf.default.get(fs),zi=[],Wi){for(ms=[].concat(Wi.baseConcepts,Wi.relatedConcepts),Ki=0;Ki<ms.length;Ki++)bs=ms[Ki],bs.module==="HTML"&&(vs=bs.concept,vs!=null&&zi.push(vs));zi.length>0&&rt.push([fs,zi])}var fs,Wi,zi,ms,bs,vs,Ki,Vi,ys={entries:function(){return rt},forEach:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=zR(rt),o;try{for(n.s();!(o=n.n()).done;){var i=ps(o.value,2),a=i[0],s=i[1];t.call(r,s,a,rt)}}catch(l){n.e(l)}finally{n.f()}},get:function(t){var r=rt.find(function(n){return n[0]===t});return r&&r[1]},has:function(t){return!!ys.get(t)},keys:function(){return rt.map(function(t){var r=ps(t,1),n=r[0];return n})},values:function(){return rt.map(function(t){var r=ps(t,2),n=r[1];return n})}},KR=(0,$R.default)(ys,ys.entries());Gi.default=KR});var xf=p(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.roles=me.roleElements=me.elementRoles=me.dom=me.aria=void 0;var GR=sr(Rc()),XR=sr(qc()),QR=sr(Bi()),YR=sr(wf()),JR=sr(Sf());function sr(e){return e&&e.__esModule?e:{default:e}}var ZR=GR.default;me.aria=ZR;var e0=XR.default;me.dom=e0;var t0=QR.default;me.roles=t0;var r0=YR.default;me.elementRoles=r0;var n0=JR.default;me.roleElements=n0});var qf=p((LI,Xi)=>{var hs=(function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",n={};function o(a,s){if(!n[a]){n[a]={};for(var l=0;l<a.length;l++)n[a][a.charAt(l)]=l}return n[a][s]}var i={compressToBase64:function(a){if(a==null)return"";var s=i._compress(a,6,function(l){return t.charAt(l)});switch(s.length%4){default:case 0:return s;case 1:return s+"===";case 2:return s+"==";case 3:return s+"="}},decompressFromBase64:function(a){return a==null?"":a==""?null:i._decompress(a.length,32,function(s){return o(t,a.charAt(s))})},compressToUTF16:function(a){return a==null?"":i._compress(a,15,function(s){return e(s+32)})+" "},decompressFromUTF16:function(a){return a==null?"":a==""?null:i._decompress(a.length,16384,function(s){return a.charCodeAt(s)-32})},compressToUint8Array:function(a){for(var s=i.compress(a),l=new Uint8Array(s.length*2),u=0,c=s.length;u<c;u++){var d=s.charCodeAt(u);l[u*2]=d>>>8,l[u*2+1]=d%256}return l},decompressFromUint8Array:function(a){if(a==null)return i.decompress(a);for(var s=new Array(a.length/2),l=0,u=s.length;l<u;l++)s[l]=a[l*2]*256+a[l*2+1];var c=[];return s.forEach(function(d){c.push(e(d))}),i.decompress(c.join(""))},compressToEncodedURIComponent:function(a){return a==null?"":i._compress(a,6,function(s){return r.charAt(s)})},decompressFromEncodedURIComponent:function(a){return a==null?"":a==""?null:(a=a.replace(/ /g,"+"),i._decompress(a.length,32,function(s){return o(r,a.charAt(s))}))},compress:function(a){return i._compress(a,16,function(s){return e(s)})},_compress:function(a,s,l){if(a==null)return"";var u,c,d={},m={},y="",P="",C="",T=2,f=3,g=2,w=[],h=0,E=0,q;for(q=0;q<a.length;q+=1)if(y=a.charAt(q),Object.prototype.hasOwnProperty.call(d,y)||(d[y]=f++,m[y]=!0),P=C+y,Object.prototype.hasOwnProperty.call(d,P))C=P;else{if(Object.prototype.hasOwnProperty.call(m,C)){if(C.charCodeAt(0)<256){for(u=0;u<g;u++)h=h<<1,E==s-1?(E=0,w.push(l(h)),h=0):E++;for(c=C.charCodeAt(0),u=0;u<8;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1}else{for(c=1,u=0;u<g;u++)h=h<<1|c,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=0;for(c=C.charCodeAt(0),u=0;u<16;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1}T--,T==0&&(T=Math.pow(2,g),g++),delete m[C]}else for(c=d[C],u=0;u<g;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1;T--,T==0&&(T=Math.pow(2,g),g++),d[P]=f++,C=String(y)}if(C!==""){if(Object.prototype.hasOwnProperty.call(m,C)){if(C.charCodeAt(0)<256){for(u=0;u<g;u++)h=h<<1,E==s-1?(E=0,w.push(l(h)),h=0):E++;for(c=C.charCodeAt(0),u=0;u<8;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1}else{for(c=1,u=0;u<g;u++)h=h<<1|c,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=0;for(c=C.charCodeAt(0),u=0;u<16;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1}T--,T==0&&(T=Math.pow(2,g),g++),delete m[C]}else for(c=d[C],u=0;u<g;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1;T--,T==0&&(T=Math.pow(2,g),g++)}for(c=2,u=0;u<g;u++)h=h<<1|c&1,E==s-1?(E=0,w.push(l(h)),h=0):E++,c=c>>1;for(;;)if(h=h<<1,E==s-1){w.push(l(h));break}else E++;return w.join("")},decompress:function(a){return a==null?"":a==""?null:i._decompress(a.length,32768,function(s){return a.charCodeAt(s)})},_decompress:function(a,s,l){var u=[],c,d=4,m=4,y=3,P="",C=[],T,f,g,w,h,E,q,R={val:l(0),position:s,index:1};for(T=0;T<3;T+=1)u[T]=T;for(g=0,h=Math.pow(2,2),E=1;E!=h;)w=R.val&R.position,R.position>>=1,R.position==0&&(R.position=s,R.val=l(R.index++)),g|=(w>0?1:0)*E,E<<=1;switch(c=g){case 0:for(g=0,h=Math.pow(2,8),E=1;E!=h;)w=R.val&R.position,R.position>>=1,R.position==0&&(R.position=s,R.val=l(R.index++)),g|=(w>0?1:0)*E,E<<=1;q=e(g);break;case 1:for(g=0,h=Math.pow(2,16),E=1;E!=h;)w=R.val&R.position,R.position>>=1,R.position==0&&(R.position=s,R.val=l(R.index++)),g|=(w>0?1:0)*E,E<<=1;q=e(g);break;case 2:return""}for(u[3]=q,f=q,C.push(q);;){if(R.index>a)return"";for(g=0,h=Math.pow(2,y),E=1;E!=h;)w=R.val&R.position,R.position>>=1,R.position==0&&(R.position=s,R.val=l(R.index++)),g|=(w>0?1:0)*E,E<<=1;switch(q=g){case 0:for(g=0,h=Math.pow(2,8),E=1;E!=h;)w=R.val&R.position,R.position>>=1,R.position==0&&(R.position=s,R.val=l(R.index++)),g|=(w>0?1:0)*E,E<<=1;u[m++]=e(g),q=m-1,d--;break;case 1:for(g=0,h=Math.pow(2,16),E=1;E!=h;)w=R.val&R.position,R.position>>=1,R.position==0&&(R.position=s,R.val=l(R.index++)),g|=(w>0?1:0)*E,E<<=1;u[m++]=e(g),q=m-1,d--;break;case 2:return C.join("")}if(d==0&&(d=Math.pow(2,y),y++),u[q])P=u[q];else if(q===m)P=f+f.charAt(0);else return null;C.push(P),u[m++]=f+P.charAt(0),d--,f=P,d==0&&(d=Math.pow(2,y),y++)}}};return i})();typeof define=="function"&&define.amd?define(function(){return hs}):typeof Xi<"u"&&Xi!=null?Xi.exports=hs:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return hs})});var qa=null;function ol(e){qa=e}function Pe(){if(!qa)throw new Error("No active driver bound to worker runtime");return qa}var Ot={activePlatform:"web",configuredBaseUrl:"http://localhost:3000",driverServerUrl:"tcp://127.0.0.1:8200",defaultElementWaitMs:5e3,defaultNavigationWaitMs:1e4,defaultPollIntervalMs:20,defaultReadyPollIntervalMs:50},Ie=null;function It(){if(Ie)return Ie;if(globalThis.__TESTSPECTRA_CONFIG__)return Ie=globalThis.__TESTSPECTRA_CONFIG__,Ie;if(typeof process<"u"&&process.env?.TESTSPECTRA_CONFIG)try{return Ie=JSON.parse(process.env.TESTSPECTRA_CONFIG),Ie}catch{}return Ie={rootDir:typeof process<"u"?process.cwd():"",testFilePath:"",activePlatform:Ot.activePlatform,configuredBaseUrl:Ot.configuredBaseUrl,cdpWsUrl:"",driverServerUrl:Ot.driverServerUrl,manifest:{page_objects:[],fixtures:[],steps:[],actions:[],global_hooks:[],suite_hooks:{}}},Ie}var il=null;function al(e,t,r,n){il&&il(e,t,r,n)}function xr(){return It().implicitWaitMs??Ot.defaultElementWaitMs}function L(){return Math.min(xr(),2e3)}function Sr(e,t){console.log(`[${e}] ${t}`)}async function A(e,t,r){let n=It(),o=globalThis.__CURRENT_TEST_TITLE__||globalThis.__CURRENT_TEST_ID__||"",i=globalThis.__TESTSPECTRA_WORKER_ID__;o&&!t.test&&(t.test=o),i!==void 0&&t.workerId===void 0&&(t.workerId=i);let a=JSON.stringify(t);Sr("TESTSPECTRA_STEP_START",a);let s=Date.now();try{let l=await r(),u=Date.now()-s;Sr("TESTSPECTRA_STEP_PASS",`${a} (${u}ms)`),al(`step:${t.key}`,e,u,{test:o,target:t.target});let c=n.stepDelayMs||0;return c>0&&await new Promise(d=>setTimeout(d,c)),l}catch(l){let u=Date.now()-s;throw Sr("TESTSPECTRA_STEP_FAIL",`${a} (${u}ms)`),al(`step:${t.key}`,e,u,{test:o,target:t.target,failed:!0}),Sr("TESTSPECTRA_TEST_ERROR",l?.message||String(l)),l}}async function M(e,t,r=15){let n=t??xr(),o=Date.now();for(;Date.now()-o<n;){try{if(await e())return!0}catch{}await new Promise(i=>setTimeout(i,r))}try{return await e()}catch{return!1}}function sl(e,t,r){let n=()=>Pe(),o=typeof e=="string"?e:e.selector;async function i(b){return A("assertion",{type:"assertion",key:"be.visible",target:e,args:[]},async()=>{if(!await M(()=>r.isVisible(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to be visible`)})}async function a(b){return A("assertion",{type:"assertion",key:"not.be.visible",target:e,args:[]},async()=>{if(!await M(async()=>!await r.isVisible(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to be visible`)})}async function s(b){return A("assertion",{type:"assertion",key:"exist",target:e,args:[]},async()=>{if(!await M(()=>r.isExisting(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to exist in DOM`)})}async function l(b){return A("assertion",{type:"assertion",key:"not.exist",target:e,args:[]},async()=>{if(!await M(async()=>!await r.isExisting(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to exist in DOM`)})}async function u(b){return A("assertion",{type:"assertion",key:"be.enabled",target:e,args:[]},async()=>{if(!await M(()=>r.isEnabled(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to be enabled`)})}async function c(b){return A("assertion",{type:"assertion",key:"be.disabled",target:e,args:[]},async()=>{if(!await M(async()=>!await r.isEnabled(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to be disabled`)})}async function d(b){return A("assertion",{type:"assertion",key:"be.clickable",target:e,args:[]},async()=>{if(!await M(()=>n().isClickable(e,t),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to be clickable`)})}async function m(b){return A("assertion",{type:"assertion",key:"not.be.clickable",target:e,args:[]},async()=>{if(!await M(async()=>!await n().isClickable(e,t),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to be clickable`)})}async function y(b){return A("assertion",{type:"assertion",key:"be.checked",target:e,args:[]},async()=>{if(!await M(()=>r.isChecked(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to be checked`)})}async function P(b){return A("assertion",{type:"assertion",key:"not.be.checked",target:e,args:[]},async()=>{if(!await M(async()=>!await r.isChecked(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to be checked`)})}async function C(b){return A("assertion",{type:"assertion",key:"be.focused",target:e,args:[]},async()=>{if(!await M(()=>r.isFocused(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" to be focused`)})}async function T(b){return A("assertion",{type:"assertion",key:"not.be.focused",target:e,args:[]},async()=>{if(!await M(async()=>!await r.isFocused(),b?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to be focused`)})}async function f(b,v){return A("assertion",{type:"assertion",key:"have.value",target:e,args:[b]},async()=>{let S="";if(!await M(async()=>(S=await r.getValue(),S===String(b)),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" to have value "${b}", but got "${S}"`)})}async function g(b,v){return A("assertion",{type:"assertion",key:"not.have.value",target:e,args:[b]},async()=>{if(!await M(async()=>await r.getValue()!==String(b),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to have value "${b}"`)})}async function w(b,v){return A("assertion",{type:"assertion",key:"contain.value",target:e,args:[b]},async()=>{let S="";if(!await M(async()=>(S=await r.getValue(),S.includes(String(b))),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" to contain value "${b}", but got "${S}"`)})}async function h(b,v){return A("assertion",{type:"assertion",key:"not.contain.value",target:e,args:[b]},async()=>{if(!await M(async()=>!(await r.getValue()).includes(String(b)),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to contain value "${b}"`)})}async function E(b,v){return A("assertion",{type:"assertion",key:"have.text",target:e,args:[b]},async()=>{let S="";if(!await M(async()=>(S=await r.getText(),b instanceof RegExp?b.test(S):S===String(b)||S.trim()===String(b).trim()),v?.timeoutMs??L()))throw b instanceof RegExp?new Error(`Expected element "${o}" text to match ${b}, but got "${S}"`):new Error(`Expected element "${o}" to have text "${b}", but got "${S}"`)})}async function q(b,v){return A("assertion",{type:"assertion",key:"not.have.text",target:e,args:[b]},async()=>{let S="";if(!await M(async()=>await r.isExisting()?(S=await r.getText(),b instanceof RegExp?!b.test(S):S!==String(b)&&S.trim()!==String(b).trim()):!1,v?.timeoutMs??L()))throw b instanceof RegExp?new Error(`Expected element "${o}" text not to match ${b}`):new Error(`Expected element "${o}" not to have text "${b}"`)})}async function R(b,v){return A("assertion",{type:"assertion",key:"contain.text",target:e,args:[b]},async()=>{let S="";if(!await M(async()=>(S=await r.getText(),S.includes(String(b))),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" to contain text "${b}", but got "${S}"`)})}async function H(b,v){return A("assertion",{type:"assertion",key:"not.contain.text",target:e,args:[b]},async()=>{if(!await M(async()=>!(await r.getText()).includes(String(b)),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to contain text "${b}"`)})}async function B(b,v){return A("assertion",{type:"assertion",key:"have.class",target:e,args:[b]},async()=>{if(!await M(()=>n().hasClass(e,b,t),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" to have class "${b}"`)})}async function W(b,v){return A("assertion",{type:"assertion",key:"not.have.class",target:e,args:[b]},async()=>{if(!await M(async()=>!await n().hasClass(e,b,t),v?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to have class "${b}"`)})}async function K(b,v,S){return A("assertion",{type:"assertion",key:"have.attr",target:e,args:v!==void 0?[b,v]:[b]},async()=>{let j=null;if(!await M(async()=>(j=await r.getAttribute(b),v!==void 0?j===String(v):j!==null),S?.timeoutMs??L()))throw v!==void 0?new Error(`Expected element "${o}" to have attribute "${b}" = "${v}", but got "${j}"`):new Error(`Expected element "${o}" to have attribute "${b}"`)})}async function O(b,v){return A("assertion",{type:"assertion",key:"not.have.attr",target:e,args:[b]},async()=>{if(!await M(async()=>await r.getAttribute(b)===null,v?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to have attribute "${b}"`)})}async function G(b,v,S){return A("assertion",{type:"assertion",key:"have.css",target:e,args:[b,v]},async()=>{let j=le=>String(le??"").replace(/\s+/g,"").replace(/rgba\((.+?),1\)/,"rgb($1)").toLowerCase(),N="";if(!await M(async()=>(N=(await r.getCSSProperty(b)).value,j(N)===j(v)),S?.timeoutMs??L()))throw new Error(`Expected element "${o}" to have CSS "${b}" = "${v}", but got "${N}"`)})}async function Y(b,v,S){return A("assertion",{type:"assertion",key:"not.have.css",target:e,args:[b,v]},async()=>{let j=pe=>String(pe??"").replace(/\s+/g,"").replace(/rgba\((.+?),1\)/,"rgb($1)").toLowerCase();if(!await M(async()=>{let pe=await r.getCSSProperty(b);return j(pe.value)!==j(v)},S?.timeoutMs??L()))throw new Error(`Expected element "${o}" not to have CSS "${b}" = "${v}"`)})}return{shouldBeVisible:i,shouldNotBeVisible:a,shouldExist:s,shouldNotExist:l,shouldBeEnabled:u,shouldBeDisabled:c,shouldBeClickable:d,shouldNotBeClickable:m,shouldBeChecked:y,shouldNotBeChecked:P,shouldBeFocused:C,shouldNotBeFocused:T,shouldHaveValue:f,shouldNotHaveValue:g,shouldContainValue:w,shouldNotContainValue:h,shouldHaveText:E,shouldNotHaveText:q,shouldContainText:R,shouldNotContainText:H,shouldHaveClass:B,shouldNotHaveClass:W,shouldHaveAttribute:K,shouldNotHaveAttribute:O,shouldHaveCss:G,shouldNotHaveCss:Y}}var ll=new Map;function ul(e,t){ll.set(e,t)}function cl(){return ll.entries()}var dl=Symbol("testspectra.elementScope");function pl(e,t){Object.defineProperty(e,dl,{value:t,enumerable:!1})}function Aa(e){if(!(e===null||typeof e!="object"))return e[dl]}function fl(e,t){let r=()=>Pe(),n=typeof e=="string"?e:e.selector;async function o(){return await r().getText(e,t)}async function i(){return await r().getValue(e,t)}async function a(){return await r().isDisplayed(e,t)}async function s(){return await a()}async function l(){return await r().isExisting(e,t)}async function u(){return await r().isEnabled(e,t)}async function c(){return await r().isClickable(e,t)}async function d(){return await r().isSelected(e,t)}async function m(){return await d()}async function y(){return await r().isFocused(e,t)}async function P(g){return await r().getAttribute(e,g,t)}async function C(g){return await r().getCSSProperty(e,g,t)}async function T(g){let w=g??xr();if(await M(async()=>r().isExisting(e,t),w))return!0;throw new Error("Element not found: "+JSON.stringify(n))}async function f(g={}){let w=g.timeout||5e3,h=Date.now();for(;Date.now()-h<w;){if(await r().isDisplayed(e,t))return!0;await new Promise(E=>setTimeout(E,20))}throw new Error(`Element ${n} not displayed after ${w}ms`)}return{getText:o,getValue:i,isDisplayed:a,isVisible:s,isExisting:l,isEnabled:u,isClickable:c,isSelected:d,isChecked:m,isFocused:y,getAttribute:P,getCSSProperty:C,waitForElement:T,waitForDisplayed:f}}function ml(e){return typeof e=="string"?e:e.selector}function Ma(e,t){return typeof e=="string"?{selector:e,index:t,parent:void 0}:e}function ue(e,t=null){let r=ml(e),n=typeof e=="string"?t:e.index,o=bl(e,t),i=fl(e,t),a=sl(e,t,i),s={selector:r,index:n,...o,...i,...a,get(u,c=null){return ue({selector:u,index:c,parent:Ma(e,t)},null)},getAll(u){return Te({selector:u,index:null,parent:Ma(e,t)})}};pl(s,Ma(e,t));let l=s;for(let[u,c]of cl())u in l||(l[u]=(...d)=>c.apply(s,d));return s}function Te(e){let t=()=>Pe(),r=ml(e),n=i=>typeof e=="string"?[e,i]:[{...e,index:i},null];return{selector:r,async count(){return await t().count(e)},get length(){return this.count()},first(){return ue(...n(0))},last(){return ue(...n(-1))},nth(i){return ue(...n(i))},async shouldHaveLength(i,a){return A("assertion",{type:"assertion",key:"have.length",target:e,args:[i]},async()=>{let s=0;if(!await M(async()=>(s=await this.count(),s===i),a?.timeoutMs??L()))throw new Error(`Expected collection "${r}" count to equal ${i}, but got ${s}`)})},async shouldNotHaveLength(i,a){return A("assertion",{type:"assertion",key:"not.have.length",target:e,args:[i]},async()=>{let s=0;if(!await M(async()=>(s=await this.count(),s!==i),a?.timeoutMs??L()))throw new Error(`Expected collection "${r}" count not to equal ${i}`)})},async shouldHaveLengthGreaterThan(i,a){return A("assertion",{type:"assertion",key:"have.length.greaterThan",target:e,args:[i]},async()=>{let s=0;if(!await M(async()=>(s=await this.count(),s>i),a?.timeoutMs??L()))throw new Error(`Expected collection "${r}" count to be greater than ${i}, but got ${s}`)})},async shouldHaveLengthLessThan(i,a){return A("assertion",{type:"assertion",key:"have.length.lessThan",target:e,args:[i]},async()=>{let s=0;if(!await M(async()=>(s=await this.count(),s<i),a?.timeoutMs??L()))throw new Error(`Expected collection "${r}" count to be less than ${i}, but got ${s}`)})},async shouldBeEmpty(i){return A("assertion",{type:"assertion",key:"be.empty",target:e,args:[]},async()=>{let a=0;if(!await M(async()=>(a=await this.count(),a===0),i?.timeoutMs??L()))throw new Error(`Expected collection "${r}" to be empty, but got ${a}`)})},async shouldNotBeEmpty(i){return A("assertion",{type:"assertion",key:"not.be.empty",target:e,args:[]},async()=>{let a=0;if(!await M(async()=>(a=await this.count(),a>0),i?.timeoutMs??L()))throw new Error(`Expected collection "${r}" not to be empty`)})}}}function ne(e){if(typeof e=="string")return ue(e,null);if(e&&typeof e=="object"&&"selector"in e)return e;throw new Error(`Invalid element target: ${String(e)}`)}function vl(e){return typeof e=="string"?e:e.selector}function bl(e,t){let r=()=>Pe();async function n(v){return A("action",{type:"action",key:"click",target:e,args:[]},async()=>{await r().click(e,t)})}async function o(){return A("action",{type:"action",key:"doubleClick",target:e,args:[]},async()=>{await r().doubleClick(e,t)})}async function i(){return A("action",{type:"action",key:"rightClick",target:e,args:[]},async()=>{await r().rightClick(e,t)})}async function a(v){return A("action",{type:"action",key:"type",target:e,args:[v]},async()=>{await r().setValue(e,v,t)})}async function s(v,S){S?.clearFirst&&await l(),await a(v)}async function l(){return A("action",{type:"action",key:"clear",target:e,args:[]},async()=>{await r().clearValue(e,t)})}async function u(){await l()}async function c(v){return A("action",{type:"action",key:"select",target:e,args:[v]},async()=>{await r().select(e,v,t)})}async function d(v){await c(v)}async function m(){return A("action",{type:"action",key:"hover",target:e,args:[]},async()=>{await r().hover(e,t)})}async function y(){return A("action",{type:"action",key:"focus",target:e,args:[]},async()=>{await r().focus(e,t)})}async function P(){return A("action",{type:"action",key:"blur",target:e,args:[]},async()=>{await r().blur(e,t)})}async function C(v){return A("action",{type:"action",key:"waitForElementRemoved",target:e,args:[v??5e3]},async()=>{if(!await M(async()=>!await r().isExisting(e,t),v??5e3))throw new Error("Element still exists after timeout: "+JSON.stringify(vl(e)))})}async function T(v){return A("action",{type:"action",key:"waitForUndisplayed",target:e,args:[v?.timeout??5e3]},async()=>{if(!await M(async()=>!await r().isDisplayed(e,t),v?.timeout??5e3))throw new Error("Element still displayed after timeout: "+JSON.stringify(vl(e)))})}async function f(v){return A("action",{type:"action",key:"waitForClickable",target:e,args:[v?.timeout??5e3]},async()=>await M(async()=>await r().isClickable(e,t),v?.timeout??5e3))}async function g(){return A("action",{type:"action",key:"getBounds",target:e,args:[]},async()=>await r().getBounds(e,t))}function w(){let v=typeof e=="string"?e:e.selector,S=typeof e=="string"?t:e.index;return S==null?v:`${v}::nth(${S})`}function h(){return ue(w()+"::parent",null)}async function E(v){return A("action",{type:"action",key:"closest",target:e,args:[v]},async()=>await r().closest(e,v,t)?ue(`${w()}::closest(${v})`,null):null)}function q(v){return Te(`${w()}::children(${v??""})`)}function R(v){return Te(`${w()}::siblings(${v??""})`)}function H(v){return ue(`${w()}::next(${v??""})`,null)}async function B(){await m()}async function W(v){let S=typeof v=="string"?v:v?.selector||String(v);return A("action",{type:"action",key:"dragDrop",target:e,args:[S]},async()=>{await r().dragDrop(e,S,t)})}async function K(v){await W(v)}async function O(v){let S=typeof v=="number"?v:v?.duration||1e3;return A("action",{type:"action",key:"longPress",target:e,args:[S]},async()=>{await r().longPress(e,S,t)})}async function G(){return A("action",{type:"action",key:"scrollIntoView",target:e,args:[]},async()=>{await r().scrollIntoView(e,t)})}async function Y(v){return A("action",{type:"action",key:"upload",target:e,args:[v]},async()=>{await r().upload(e,v,t)})}async function b(v){await Y(v)}return{click:n,doubleClick:o,rightClick:i,setValue:a,type:s,clearValue:l,clear:u,select:c,selectByVisibleText:d,hover:m,focus:y,blur:P,waitForElementRemoved:C,waitForUndisplayed:T,waitForClickable:f,getBounds:g,parent:h,closest:E,children:q,siblings:R,next:H,moveTo:B,dragDrop:W,dragAndDrop:K,longPress:O,scrollIntoView:G,upload:Y,uploadFile:b}}var hl=["number","date","time","color","file","range"],yl=e=>e.replace(/[^\p{L}\p{N}]/gu,"");function ka(e,t,r){return t===null||r===null?!0:t===e||t!==r||yl(t)===yl(e)}function gl(e,t,r){return new Error(`Typed text did not reach element "${e}": expected "${t}", got "${r}"`)}var Kb={Backspace:{code:"Backspace",windowsVirtualKeyCode:8},Tab:{code:"Tab",windowsVirtualKeyCode:9},Enter:{code:"Enter",windowsVirtualKeyCode:13,text:"\r"},Escape:{code:"Escape",windowsVirtualKeyCode:27},Delete:{code:"Delete",windowsVirtualKeyCode:46},ArrowLeft:{code:"ArrowLeft",windowsVirtualKeyCode:37},ArrowUp:{code:"ArrowUp",windowsVirtualKeyCode:38},ArrowRight:{code:"ArrowRight",windowsVirtualKeyCode:39},ArrowDown:{code:"ArrowDown",windowsVirtualKeyCode:40},Home:{code:"Home",windowsVirtualKeyCode:36},End:{code:"End",windowsVirtualKeyCode:35},PageUp:{code:"PageUp",windowsVirtualKeyCode:33},PageDown:{code:"PageDown",windowsVirtualKeyCode:34}};function El(e){if(typeof e!="string")return null;let t=Kb[e];return t?{key:e,...t}:null}function Oa(e,t){if(!e||e==="*"||e==="**"||e==="ALL")return!0;if(e.startsWith("/")&&e.endsWith("/"))try{return new RegExp(e.slice(1,-1)).test(t)}catch{}if(e.includes("*")){let r=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(r,"i").test(t)}catch{}}return t.toLowerCase().includes(e.toLowerCase())}function qr(e,t){let r=!1,n={unroute:()=>{r||(r=!0,t?.())},respondWith:async(i,a={})=>{let s=i;e.response=s&&s.body!==void 0?s.body:i,(a.statusCode||s&&s.statusCode)&&(e.statusCode=a.statusCode||s?.statusCode||200),(a.headers||s&&s.headers)&&(e.headers=a.headers||s?.headers),(a.delayMs!==void 0||s&&s.delayMs!==void 0)&&(e.delayMs=a.delayMs??s?.delayMs),e.aborted=!1},respondOnce:async(i,a={})=>{let s=i,l=s&&s.body!==void 0?s.body:i,u=a.statusCode||s&&s.statusCode||e.statusCode||200,c=a.headers||s&&s.headers||e.headers,d=a.delayMs??(s&&s.delayMs)??e.delayMs;e.respondOnceQueue.push({response:l,statusCode:u,headers:c,delayMs:d}),e.aborted=!1},abort:async(i="Failed")=>{e.aborted=!0,e.abortReason=i},waitForCall:async(i={})=>{let a=i.count??1,s=i.timeout??5e3;return e.calls.length>=a?e.calls[a-1]:new Promise((l,u)=>{let c=setTimeout(()=>{let d=e.waitResolvers.findIndex(m=>m.resolve===l);d!==-1&&e.waitResolvers.splice(d,1),u(new Error(`Spectra.intercept waitForCall timed out after ${s}ms (expected at least ${a} call(s), received ${e.calls.length})`))},s);e.waitResolvers.push({count:a,resolve:d=>{clearTimeout(c),l(d)}})})}},o=()=>e.callCount;return n.callCount=Object.assign(o,{valueOf:()=>e.callCount,[Symbol.toPrimitive]:()=>e.callCount}),Object.defineProperty(n,"calls",{get:()=>e.calls,enumerable:!0}),n}function Ar(e,t,r,n){let o,i,a,s,l,u;if(typeof e=="object"&&e!==null)o=e.url||e.pattern||"*",i=(e.method||"GET").toUpperCase(),a=e.response!==void 0?e.response:typeof t=="object"&&t!==null?t:r,s=e.statusCode||n&&n.statusCode||200,l=e.headers||n&&n.headers,u=e.delayMs??(n&&n.delayMs);else if(o=String(e||"*"),typeof t=="string"&&["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","ALL"].includes(t.toUpperCase())){i=t.toUpperCase();let c=r;a=c&&c.body!==void 0?c.body:r,s=n&&n.statusCode||c&&c.statusCode||200,l=n&&n.headers||c&&c.headers,u=(n&&n.delayMs)??(c&&c.delayMs)}else{i="GET";let c=t;a=c&&c.body!==void 0?c.body:t,s=r&&r.statusCode||c&&c.statusCode||200,l=r&&r.headers||c&&c.headers,u=(r&&r.delayMs)??(c&&c.delayMs)}return{pattern:o,method:i,response:a,statusCode:s,headers:l,delayMs:u,callCount:0,respondOnceQueue:[],calls:[],waitResolvers:[]}}function Nt(e,t,r){for(let n of e)if(Oa(n.pattern,t)&&(!n.method||n.method==="ALL"||n.method.toUpperCase()===r.toUpperCase()))return n;return null}function Lt(e,t){e.calls.push(t),e.callCount++;for(let r=e.waitResolvers.length-1;r>=0;r--){let n=e.waitResolvers[r];e.callCount>=n.count&&(e.waitResolvers.splice(r,1),n.resolve(t))}return t}function Dt(e){if(e.respondOnceQueue.length>0){let t=e.respondOnceQueue.shift();return{body:t.response,statusCode:t.statusCode||e.statusCode||200,headers:{...e.headers,...t.headers},delayMs:t.delayMs??e.delayMs}}return{body:e.response,statusCode:e.statusCode||200,headers:{...e.headers},delayMs:e.delayMs}}var Gb={"Content-Type":"application/json; charset=utf-8","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, POST, PUT, DELETE, PATCH, OPTIONS","Access-Control-Allow-Headers":"*"};function Mr(e){let t=new Map;for(let[r,n]of Object.entries(Gb))t.set(r.toLowerCase(),{name:r,value:n});for(let[r,n]of Object.entries(e||{}))t.set(r.toLowerCase(),{name:r,value:String(n)});return[...t.values()]}function Bt(e){return typeof e=="string"?e:typeof e=="object"&&e!==null?JSON.stringify(e):String(e??"")}function wl(e){let t=/^(.*)::nth\((-?\d+)\)$/.exec(e);if(t)return{kind:"nth",base:t[1],arg:t[2]};let r=/^(.*)::closest\((.+)\)$/.exec(e);if(r)return{kind:"closest",base:r[1],arg:r[2]};let n=/^(.*)::children\((.*)\)$/.exec(e);if(n)return{kind:"children",base:n[1],arg:n[2].trim()||null};let o=/^(.*)::children$/.exec(e);if(o)return{kind:"children",base:o[1],arg:null};let i=/^(.*)::siblings\((.*)\)$/.exec(e);if(i)return{kind:"siblings",base:i[1],arg:i[2].trim()||null};let a=/^(.*)::siblings$/.exec(e);if(a)return{kind:"siblings",base:a[1],arg:null};let s=/^(.*)::next\((.*)\)$/.exec(e);if(s)return{kind:"next",base:s[1],arg:s[2].trim()||null};let l=/^(.*)::next$/.exec(e);if(l)return{kind:"next",base:l[1],arg:null};let u=/^(.*)::parent$/.exec(e);return u?{kind:"parent",base:u[1]}:null}function Ia(e){let t=e.trim();if(!t.startsWith("~"))return null;let r=t.slice(1),n=r.indexOf("[");return n!==-1?{name:r.slice(0,n),chainSuffix:r.slice(n)}:{name:r,chainSuffix:""}}function _l(e){let t=Ia(e);if(!t)return null;let{name:r,chainSuffix:n}=t,o=JSON.stringify(r);return`:is([aria-label=${o}], [title=${o}])${n}`}function Cl(e,t,r){let o=Array.from(t.querySelectorAll("[aria-labelledby]")).filter(i=>(i.getAttribute("aria-labelledby")??"").trim().split(/\s+/).map(l=>{let u=document.getElementById(l);return u?(u.textContent??"").trim():""}).filter(Boolean).join(" ").trim()===e);return r===null?o[0]??null:r>=0?o[r]??null:o[o.length+r]??null}var Xb=new Set(["mount","unmount","registerCommand","registerCommands"]),Qb=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function Pl(){let e=()=>Pe(),t={get:r=>ne(r),getAll:r=>Te(r),navigate:r=>e().navigate(r),back:()=>e().back(),forward:()=>e().forward(),refresh:()=>e().refresh(),setViewport:(r,n)=>e().setViewport(r,n),wait:r=>e().pause(r),click:async(r,n)=>{await ne(r).click()},clickAt:async(r,n)=>{await e().clickAt(r,n)},doubleClick:async r=>{await ne(r).doubleClick()},rightClick:async r=>{await ne(r).rightClick()},type:async(r,n,o)=>{await ne(r).type(n,o)},clear:async r=>{await ne(r).clear()},select:async(r,n)=>{await ne(r).select(n)},hover:async r=>{await ne(r).hover()},focus:async r=>{await ne(r).focus()},blur:async r=>{await ne(r).blur()},dragDrop:async(r,n)=>{await ne(r).dragDrop(n)},scrollIntoView:async r=>{await ne(r).scrollIntoView()},scroll:async r=>{await e().scroll(r)},swipe:async r=>{await e().swipe(r)},longPress:async(r,n)=>{await ne(r).longPress(n)},pressKey:async r=>{await e().pressKey(r)},grantPermission:async r=>{await e().grantPermission(r)},waitForElement:async(r,n)=>{await ne(r).waitForElement(n)},intercept:async(r,n,o,i)=>await e().intercept(r,n,o,i),clearMocks:()=>{e().clearMocks()},get browser(){return e()},get env(){return It().environmentVariables||{}}};return t.registerCommand=(r,n)=>{if(typeof n!="function")throw new Error(`[TestSpectra] Custom command "${r}" must be a function.`);if(!Qb.test(r))throw new Error(`[TestSpectra] Invalid custom command name "${r}"; must be a valid identifier.`);if(Xb.has(r)||r in t)throw new Error(`[TestSpectra] Custom command "${r}" collides with a built-in Spectra method.`);t[r]=n,ul(r,n)},t.registerCommands=r=>{for(let[n,o]of Object.entries(r))t.registerCommand(n,o)},t}function Tl(){return typeof globalThis.__TESTSPECTRA_STEP_DELAY_MS__=="number"?globalThis.__TESTSPECTRA_STEP_DELAY_MS__:typeof window<"u"&&typeof window.__TESTSPECTRA_STEP_DELAY_MS__=="number"?window.__TESTSPECTRA_STEP_DELAY_MS__:0}var Yb=5e3;function kr(e,t){(typeof globalThis.__TESTSPECTRA_SEMANTIC_REPORTER__=="boolean"?globalThis.__TESTSPECTRA_SEMANTIC_REPORTER__:!(typeof window<"u"&&typeof window.__TESTSPECTRA_SEMANTIC_REPORTER__=="boolean")||window.__TESTSPECTRA_SEMANTIC_REPORTER__)&&console.log(`[${e}] ${t}`)}function Na(){return Yb}function Jb(){return Math.min(Na(),2e3)}async function Zb(e,t,r){let n=globalThis.__CURRENT_TEST_TITLE__;n&&!t.test&&(t.test=n);let o=JSON.stringify(t);kr("TESTSPECTRA_STEP_START",o);let i=Date.now();try{let a=await r(),s=Date.now()-i;kr("TESTSPECTRA_STEP_PASS",`${o} (${s}ms)`);let l=Tl();return l>0&&await new Promise(u=>setTimeout(u,l)),a}catch(a){let s=Date.now()-i;throw kr("TESTSPECTRA_STEP_FAIL",`${o} (${s}ms)`),a}}async function ev(e,t,r=15){let n=t??Na(),o=Date.now();for(;Date.now()-o<n;){try{if(await e())return!0}catch{}await new Promise(i=>setTimeout(i,r))}try{return await e()}catch{return!1}}globalThis.__TESTSPECTRA_CONFIG__={rootDir:"",activePlatform:"web",configuredBaseUrl:"",cdpWsUrl:"",driverServerUrl:"",stepDelayMs:Tl()};globalThis.__TS_RUNTIME__={activeDriver:null,mobileMockRules:[],lastFocusedSelector:null,emitEvent:kr,trackStep:Zb,pollCondition:ev,getImplicitWaitMs:Na,getAssertionTimeoutMs:Jb,matchesUrlPattern:Oa,createMockHandle:qr,parseMockRule:Ar,findMatchingRule:Nt,recordMockCall:Lt,consumeMockResponse:Dt,mergeMockResponseHeaders:Mr,mockResponseBodyText:Bt,createElementProxy:ue,createCollectionProxy:Te,beforeHook:null,afterHook:null,beforeEachHook:null,afterEachHook:null,suiteBeforeEachHooks:{},suiteAfterEachHooks:{}};var Rl=new Set;async function Sl(e,t=[],r,n={platform:"web"}){for(let o of t)if(!Rl.has(o))try{let i=await r(o),a=i?.default??i?.plugin??i;typeof a=="function"?await a(e,n):a&&typeof a.setup=="function"?await a.setup(e,n):console.error(`[TestSpectra] Plugin "${o}" has no default export function or setup() method \u2014 skipping.`),Rl.add(o)}catch(i){console.error(`[TestSpectra] Failed to load plugin "${o}": ${i?.stack||i?.message||i}`)}}function tv(){let e=globalThis,t;try{t=e.__TESTSPECTRA_AUTO_IMPORT_MANIFEST__}catch{}if(!t&&typeof window<"u"&&(t=window.__TESTSPECTRA_AUTO_IMPORT_MANIFEST__),!t)return null;if(typeof t=="string")try{return JSON.parse(t)}catch{return null}return t}var xl=new Map;async function Or(e){let t=xl.get(e);if(t)return t;let r,o=typeof globalThis.__vitest_browser_runner__<"u"||typeof globalThis.__vitest_worker__<"u"?`/@fs/${e.replace(/\\/g,"/")}`.replace(/\/@fs\/\//g,"/@fs/"):`/test?file=${encodeURIComponent(e)}`;if(e.endsWith(".json"))try{let i=await fetch(o);if(i.ok)r=await i.json();else throw new Error(`Failed to fetch JSON fixture: ${i.status}`)}catch{r=await new Function("specifier",'return import(specifier, { with: { type: "json" } })')(o)}else r=await new Function("specifier","return import(specifier)")(o);return xl.set(e,r),r}async function La(e){let t=e??tv();if(!t)return;let r=t.pageObjects??t.page_objects??[];for(let l of r){let u=l.path??l.file_path;if(u){let c=await Or(u);globalThis[l.name]=c.default??c}}let n={},o=t.fixtures??[];for(let l of o){let u=l.path??l.file_path;if(u){let c=u.split("/").pop()?.split("\\").pop()||`${l.name}.bin`;try{let d=await Or(u),m=d?.default!==void 0?d.default:d??u;typeof m=="string"&&m.startsWith("data:")&&!m.includes("name=")&&(m=m.replace(/^data:([^;,]+)/,y=>`${y};name=${encodeURIComponent(c)}`)),n[l.name]=m}catch{n[l.name]=u}}}globalThis.Fixture=n;let i={},a=t.steps??[];for(let l of a){let u=l.path??l.file_path;if(u){let c=await Or(u);i[l.name]=c.default??c}}globalThis.Step=i;let s=rv();s.length>0&&globalThis.Spectra&&await Sl(globalThis.Spectra,s,Or,{platform:"web"})}function rv(){let e=globalThis,t;try{t=e.__TESTSPECTRA_PLUGINS__}catch{}if(!t&&typeof window<"u"&&(t=window.__TESTSPECTRA_PLUGINS__),!t)return[];if(Array.isArray(t))return t.filter(r=>typeof r=="string");if(typeof t=="string")try{let r=JSON.parse(t);return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}catch{return[]}return[]}globalThis.__bootstrapAutoImports=La;function x(e,t,r){return e.namespaceURI&&e.namespaceURI!=="http://www.w3.org/1999/xhtml"||(t=Array.isArray(t)?t:[t],!t.includes(e.tagName.toLowerCase()))?!1:r?Object.entries(r).every(([n,o])=>e[n]===o):!0}function V(e){var t;if(nv(e)&&e.defaultView)return e.defaultView;if(!((t=e.ownerDocument)===null||t===void 0)&&t.defaultView)return e.ownerDocument.defaultView;throw new Error(`Could not determine window of node. Node was ${ov(e)}`)}function nv(e){return e.nodeType===9}function ov(e){return typeof e=="function"?`function ${e.name}`:e===null?"null":String(e)}function Da(e,t){return new Promise((r,n)=>{let o=new t;o.onerror=n,o.onabort=n,o.onload=()=>{r(String(o.result))},o.readAsText(e)})}function Ft(e,t){let r={...t,length:t.length,item:n=>r[n],[Symbol.iterator]:function*(){for(let o=0;o<r.length;o++)yield r[o]}};return r.constructor=e.FileList,e.FileList&&Object.setPrototypeOf(r,e.FileList.prototype),Object.freeze(r),r}function Ne(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ut=class{getAsFile(){return this.file}getAsString(t){typeof this.data=="string"&&t(this.data)}webkitGetAsEntry(){throw new Error("not implemented")}constructor(t,r){Ne(this,"kind",void 0),Ne(this,"type",void 0),Ne(this,"file",null),Ne(this,"data",void 0),typeof t=="string"?(this.kind="string",this.type=String(r),this.data=t):(this.kind="file",this.type=t.type,this.file=t)}};function ql(e){return e.replace(/[A-Z]/g,t=>t.toLowerCase())}var Fa=class extends Array{add(...t){let r=typeof t[0]=="string"?new Ut(t[0],ql(t[1])):new Ut(t[0]);return this.push(r),r}clear(){this.splice(0,this.length)}remove(t){this.splice(t,1)}};function Ba(e){let t=ql(e);return t==="text"?"text/plain":t==="url"?"text/uri-list":t}function Ir(e,t){let[r,n]=e.split("/"),o=!n||n==="*";return i=>t?i.type===(o?r:e):o?i.type.startsWith(`${r}/`):i.type===r}function iv(e){return new class{getData(r){var n;let o=Ba(r),i=(n=this.items.find(Ir(o,!0)))!==null&&n!==void 0?n:this.items.find(Ir(o,!1)),a="";return i?.getAsString(s=>{a=s}),a}setData(r,n){let o=Ba(r),i=this.items.findIndex(Ir(o,!0)),a=new Ut(n,o);i>=0?this.items.splice(i,1,a):this.items.push(a)}clearData(r){if(r){let n=Ba(r),o=this.items.findIndex(Ir(n,!0));o>=0&&this.items.remove(o)}else this.items.clear()}get types(){let r=[];return this.files.length&&r.push("Files"),this.items.forEach(n=>r.push(n.type)),Object.freeze(r),r}setDragImage(){}constructor(){Ne(this,"dropEffect","none"),Ne(this,"effectAllowed","uninitialized"),Ne(this,"items",new Fa),Ne(this,"files",Ft(e,[]))}}}function vt(e,t=[]){let r=typeof e.DataTransfer>"u"?iv(e):new e.DataTransfer;return Object.defineProperty(r,"files",{get:()=>Ft(e,t)}),r}async function Al(e,t){return t.kind==="file"?t.getAsFile():new e.Blob([await new Promise(r=>t.getAsString(r))],{type:t.type})}function kl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ol(e,...t){let r=Object.fromEntries(t.map(n=>[typeof n=="string"?"text/plain":n.type,Promise.resolve(n)]));return typeof e.ClipboardItem<"u"?new e.ClipboardItem(r):new class{get types(){return Array.from(Object.keys(this.data))}async getType(o){let i=await this.data[o];if(!i)throw new Error(`${o} is not one of the available MIME types on this item.`);return i instanceof e.Blob?i:new e.Blob([i],{type:o})}constructor(o){kl(this,"data",void 0),this.data=o}}(r)}var yt=Symbol("Manage ClipboardSub");function Ml(e,t){return Object.assign(new class extends e.EventTarget{async read(){return Array.from(this.items)}async readText(){let n="";for(let o of this.items){let i=o.types.includes("text/plain")?"text/plain":o.types.find(a=>a.startsWith("text/"));i&&(n+=await o.getType(i).then(a=>Da(a,e.FileReader)))}return n}async write(n){this.items=n}async writeText(n){this.items=[Ol(e,n)]}constructor(...n){super(...n),kl(this,"items",[])}},{[yt]:t})}function Ua(e){return!!e?.[yt]}function Il(e){if(Ua(e.navigator.clipboard))return e.navigator.clipboard[yt];let t=Object.getOwnPropertyDescriptor(e.navigator,"clipboard"),r,n={resetClipboardStub:()=>{r=Ml(e,n)},detachClipboardStub:()=>{t?Object.defineProperty(e.navigator,"clipboard",t):Object.defineProperty(e.navigator,"clipboard",{value:void 0,configurable:!0})}};return r=Ml(e,n),Object.defineProperty(e.navigator,"clipboard",{get:()=>r,configurable:!0}),r[yt]}function av(e){Ua(e.navigator.clipboard)&&e.navigator.clipboard[yt].resetClipboardStub()}function sv(e){Ua(e.navigator.clipboard)&&e.navigator.clipboard[yt].detachClipboardStub()}async function Nl(e){let t=e.defaultView,r=t?.navigator.clipboard,n=r&&await r.read();if(!n)throw new Error("The Clipboard API is unavailable.");let o=vt(t);for(let i of n)for(let a of i.types)o.setData(a,await i.getType(a).then(s=>Da(s,t.FileReader)));return o}async function Lr(e,t){let r=V(e),n=r.navigator.clipboard,o=[];for(let a=0;a<t.items.length;a++){let s=t.items[a],l=await Al(r,s);o.push(Ol(r,l))}if(!(n&&await n.write(o).then(()=>!0,()=>!1)))throw new Error("The Clipboard API is unavailable.")}var Nr=globalThis;typeof Nr.afterEach=="function"&&Nr.afterEach(()=>{typeof globalThis.window<"u"&&av(globalThis.window)});typeof Nr.afterAll=="function"&&Nr.afterAll(()=>{typeof globalThis.window<"u"&&sv(globalThis.window)});var Dr=["input:not([type=hidden]):not([disabled])","button:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contenteditable=""]','[contenteditable="true"]',"a[href]","[tabindex]:not([disabled])","details > summary"].join(", ");function jt(e){return e.matches(Dr)}function Ll(e){return new e.constructor(e.type,e)}function te(e){for(let r=e;r;r=r.parentElement)if(x(r,["button","input","select","textarea","optgroup","option"])){if(r.hasAttribute("disabled"))return!0}else if(x(r,"fieldset")){var t;if(r.hasAttribute("disabled")&&!(!((t=r.querySelector(":scope > legend"))===null||t===void 0)&&t.contains(e)))return!0}else if(r.tagName.includes("-")&&r.constructor.formAssociated&&r.hasAttribute("disabled"))return!0;return!1}function Le(e){let t=e.activeElement;if(t?.shadowRoot){let r=Le(t.shadowRoot);if(r)return r}else if(t&&x(t,"iframe")){let r=t.contentDocument;if(r)return Le(r)}return te(t)?e.ownerDocument?e.ownerDocument.body:e.body:t}function ht(e){var t;return(t=Le(e))!==null&&t!==void 0?t:e.body}function Dl(e,t){let r=e;do{if(t(r))return r;r=r.parentElement}while(r&&r!==e.ownerDocument.body)}function ce(e){return e.hasAttribute("contenteditable")&&(e.getAttribute("contenteditable")=="true"||e.getAttribute("contenteditable")=="")}function De(e){let t=lv(e);return t&&(t.closest('[contenteditable=""]')||t.closest('[contenteditable="true"]'))}function lv(e){return e.nodeType===1?e:e.parentElement}var Bl=(function(e){return e.button="button",e.color="color",e.file="file",e.image="image",e.reset="reset",e.submit="submit",e.checkbox="checkbox",e.radio="radio",e})(Bl||{});function Br(e){return x(e,"button")||x(e,"input")&&e.type in Bl}function ve(e){return ja(e)&&!e.readOnly||ce(e)}var Fl=(function(e){return e.text="text",e.date="date",e["datetime-local"]="datetime-local",e.email="email",e.month="month",e.number="number",e.password="password",e.search="search",e.tel="tel",e.time="time",e.url="url",e.week="week",e})(Fl||{});function ja(e){return x(e,"textarea")||x(e,"input")&&e.type in Fl}function X(e){return jl(e)&&ja(e)}function Ul(e){return jl(e)&&Br(e)}function jl(e){return e.nodeType===1}function $l(e){let t=e.ownerDocument.getSelection();if(t?.focusNode&&X(e)){let n=De(t.focusNode);if(n){if(!t.isCollapsed){var r;let o=((r=n.firstChild)===null||r===void 0?void 0:r.nodeType)===3?n.firstChild:n;t.setBaseAndExtent(o,0,o,0)}}else t.setBaseAndExtent(e,0,e,0)}}function Fr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var ra=xa(ec());var Hy=Object.prototype.toString;function tc(e){return typeof e=="function"||Hy.call(e)==="[object Function]"}function Vy(e){var t=Number(e);return isNaN(t)?0:t===0||!isFinite(t)?t:(t>0?1:-1)*Math.floor(Math.abs(t))}var Wy=Math.pow(2,53)-1;function zy(e){var t=Vy(e);return Math.min(Math.max(t,0),Wy)}function de(e,t){var r=Array,n=Object(e);if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");if(typeof t<"u"&&!tc(t))throw new TypeError("Array.from: when provided, the second argument must be a function");for(var o=zy(n.length),i=tc(r)?Object(new r(o)):new Array(o),a=0,s;a<o;)s=n[a],t?i[a]=t(s,a):i[a]=s,a+=1;return i.length=o,i}function tr(e){"@babel/helpers - typeof";return tr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tr(e)}function Ky(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nc(n.key),n)}}function Gy(e,t,r){return t&&rc(e.prototype,t),r&&rc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xy(e,t,r){return t=nc(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nc(e){var t=Qy(e,"string");return tr(t)==="symbol"?t:String(t)}function Qy(e,t){if(tr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(tr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yy=(function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Ky(this,e),Xy(this,"items",void 0),this.items=t}return Gy(e,[{key:"add",value:function(r){return this.has(r)===!1&&this.items.push(r),this}},{key:"clear",value:function(){this.items=[]}},{key:"delete",value:function(r){var n=this.items.length;return this.items=this.items.filter(function(o){return o!==r}),n!==this.items.length}},{key:"forEach",value:function(r){var n=this;this.items.forEach(function(o){r(o,o,n)})}},{key:"has",value:function(r){return this.items.indexOf(r)!==-1}},{key:"size",get:function(){return this.items.length}}]),e})(),oc=typeof Set>"u"?Set:Yy;function Q(e){var t;return(t=e.localName)!==null&&t!==void 0?t:e.tagName.toLowerCase()}var Jy={article:"article",aside:"complementary",button:"button",datalist:"listbox",dd:"definition",details:"group",dialog:"dialog",dt:"term",fieldset:"group",figure:"figure",form:"form",footer:"contentinfo",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",header:"banner",hr:"separator",html:"document",legend:"legend",li:"listitem",math:"math",main:"main",menu:"list",nav:"navigation",ol:"list",optgroup:"group",option:"option",output:"status",progress:"progressbar",section:"region",summary:"button",table:"table",tbody:"rowgroup",textarea:"textbox",tfoot:"rowgroup",td:"cell",th:"columnheader",thead:"rowgroup",tr:"row",ul:"list"},Zy={caption:new Set(["aria-label","aria-labelledby"]),code:new Set(["aria-label","aria-labelledby"]),deletion:new Set(["aria-label","aria-labelledby"]),emphasis:new Set(["aria-label","aria-labelledby"]),generic:new Set(["aria-label","aria-labelledby","aria-roledescription"]),insertion:new Set(["aria-label","aria-labelledby"]),paragraph:new Set(["aria-label","aria-labelledby"]),presentation:new Set(["aria-label","aria-labelledby"]),strong:new Set(["aria-label","aria-labelledby"]),subscript:new Set(["aria-label","aria-labelledby"]),superscript:new Set(["aria-label","aria-labelledby"])};function eh(e,t){return["aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-dropeffect","aria-flowto","aria-grabbed","aria-hidden","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-owns","aria-relevant","aria-roledescription"].some(function(r){var n;return e.hasAttribute(r)&&!((n=Zy[t])!==null&&n!==void 0&&n.has(r))})}function ic(e,t){return eh(e,t)}function Qr(e){var t=rh(e);if(t===null||t==="presentation"){var r=th(e);if(t!=="presentation"||ic(e,r||""))return r}return t}function th(e){var t=Jy[Q(e)];if(t!==void 0)return t;switch(Q(e)){case"a":case"area":case"link":if(e.hasAttribute("href"))return"link";break;case"img":return e.getAttribute("alt")===""&&!ic(e,"img")?"presentation":"img";case"input":{var r=e,n=r.type;switch(n){case"button":case"image":case"reset":case"submit":return"button";case"checkbox":case"radio":return n;case"range":return"slider";case"email":case"tel":case"text":case"url":return e.hasAttribute("list")?"combobox":"textbox";case"search":return e.hasAttribute("list")?"combobox":"searchbox";case"number":return"spinbutton";default:return null}}case"select":return e.hasAttribute("multiple")||e.size>1?"listbox":"combobox"}return null}function rh(e){var t=e.getAttribute("role");if(t!==null){var r=t.trim().split(" ")[0];if(r.length>0)return r}return null}function $(e){return e!==null&&e.nodeType===e.ELEMENT_NODE}function Ya(e){return $(e)&&Q(e)==="caption"}function rr(e){return $(e)&&Q(e)==="input"}function ac(e){return $(e)&&Q(e)==="optgroup"}function sc(e){return $(e)&&Q(e)==="select"}function lc(e){return $(e)&&Q(e)==="table"}function uc(e){return $(e)&&Q(e)==="textarea"}function cc(e){var t=e.ownerDocument===null?e:e.ownerDocument,r=t.defaultView;if(r===null)throw new TypeError("no window available");return r}function dc(e){return $(e)&&Q(e)==="fieldset"}function pc(e){return $(e)&&Q(e)==="legend"}function fc(e){return $(e)&&Q(e)==="slot"}function nh(e){return $(e)&&e.ownerSVGElement!==void 0}function mc(e){return $(e)&&Q(e)==="svg"}function bc(e){return nh(e)&&Q(e)==="title"}function _t(e,t){if($(e)&&e.hasAttribute(t)){var r=e.getAttribute(t).split(" "),n=e.getRootNode?e.getRootNode():e.ownerDocument;return r.map(function(o){return n.getElementById(o)}).filter(function(o){return o!==null})}return[]}function ge(e,t){return $(e)?t.indexOf(Qr(e))!==-1:!1}function oh(e){return e.trim().replace(/\s\s+/g," ")}function ih(e,t){if(!$(e))return!1;if(e.hasAttribute("hidden")||e.getAttribute("aria-hidden")==="true")return!0;var r=t(e);return r.getPropertyValue("display")==="none"||r.getPropertyValue("visibility")==="hidden"}function ah(e){return ge(e,["button","combobox","listbox","textbox"])||hc(e,"range")}function hc(e,t){if(!$(e))return!1;if(t==="range")return ge(e,["meter","progressbar","scrollbar","slider","spinbutton"]);throw new TypeError("No knowledge about abstract role '".concat(t,"'. This is likely a bug :("))}function vc(e,t){var r=de(e.querySelectorAll(t));return _t(e,"aria-owns").forEach(function(n){r.push.apply(r,de(n.querySelectorAll(t)))}),r}function sh(e){return sc(e)?e.selectedOptions||vc(e,"[selected]"):vc(e,'[aria-selected="true"]')}function lh(e){return ge(e,["none","presentation"])}function uh(e){return Ya(e)}function ch(e){return ge(e,["button","cell","checkbox","columnheader","gridcell","heading","label","legend","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"])}function dh(e){return!1}function ph(e){return rr(e)||uc(e)?e.value:e.textContent||""}function yc(e){var t=e.getPropertyValue("content");return/^["'].*["']$/.test(t)?t.slice(1,-1):""}function gc(e){var t=Q(e);return t==="button"||t==="input"&&e.getAttribute("type")!=="hidden"||t==="meter"||t==="output"||t==="progress"||t==="select"||t==="textarea"}function Ec(e){if(gc(e))return e;var t=null;return e.childNodes.forEach(function(r){if(t===null&&$(r)){var n=Ec(r);n!==null&&(t=n)}}),t}function fh(e){if(e.control!==void 0)return e.control;var t=e.getAttribute("for");return t!==null?e.ownerDocument.getElementById(t):Ec(e)}function mh(e){var t=e.labels;if(t===null)return t;if(t!==void 0)return de(t);if(!gc(e))return null;var r=e.ownerDocument;return de(r.querySelectorAll("label")).filter(function(n){return fh(n)===e})}function bh(e){var t=e.assignedNodes();return t.length===0?de(e.childNodes):t}function Yr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=new oc,n=cc(e),o=t.compute,i=o===void 0?"name":o,a=t.computedStyleSupportsPseudoElements,s=a===void 0?t.getComputedStyle!==void 0:a,l=t.getComputedStyle,u=l===void 0?n.getComputedStyle.bind(n):l,c=t.hidden,d=c===void 0?!1:c;function m(f,g){var w="";if($(f)&&s){var h=u(f,"::before"),E=yc(h);w="".concat(E," ").concat(w)}var q=fc(f)?bh(f):de(f.childNodes).concat(_t(f,"aria-owns"));if(q.forEach(function(B){var W=T(B,{isEmbeddedInLabel:g.isEmbeddedInLabel,isReferenced:!1,recursion:!0}),K=$(B)?u(B).getPropertyValue("display"):"inline",O=K!=="inline"?" ":"";w+="".concat(O).concat(W).concat(O)}),$(f)&&s){var R=u(f,"::after"),H=yc(R);w="".concat(w," ").concat(H)}return w.trim()}function y(f,g){var w=f.getAttributeNode(g);return w!==null&&!r.has(w)&&w.value.trim()!==""?(r.add(w),w.value):null}function P(f){return $(f)?y(f,"title"):null}function C(f){if(!$(f))return null;if(dc(f)){r.add(f);for(var g=de(f.childNodes),w=0;w<g.length;w+=1){var h=g[w];if(pc(h))return T(h,{isEmbeddedInLabel:!1,isReferenced:!1,recursion:!1})}}else if(lc(f)){r.add(f);for(var E=de(f.childNodes),q=0;q<E.length;q+=1){var R=E[q];if(Ya(R))return T(R,{isEmbeddedInLabel:!1,isReferenced:!1,recursion:!1})}}else if(mc(f)){r.add(f);for(var H=de(f.childNodes),B=0;B<H.length;B+=1){var W=H[B];if(bc(W))return W.textContent}return null}else if(Q(f)==="img"||Q(f)==="area"){var K=y(f,"alt");if(K!==null)return K}else if(ac(f)){var O=y(f,"label");if(O!==null)return O}if(rr(f)&&(f.type==="button"||f.type==="submit"||f.type==="reset")){var G=y(f,"value");if(G!==null)return G;if(f.type==="submit")return"Submit";if(f.type==="reset")return"Reset"}var Y=mh(f);if(Y!==null&&Y.length!==0)return r.add(f),de(Y).map(function(j){return T(j,{isEmbeddedInLabel:!0,isReferenced:!1,recursion:!0})}).filter(function(j){return j.length>0}).join(" ");if(rr(f)&&f.type==="image"){var b=y(f,"alt");if(b!==null)return b;var v=y(f,"title");return v!==null?v:"Submit Query"}if(ge(f,["button"])){var S=m(f,{isEmbeddedInLabel:!1,isReferenced:!1});if(S!=="")return S}return null}function T(f,g){if(r.has(f))return"";if(!d&&ih(f,u)&&!g.isReferenced)return r.add(f),"";var w=$(f)?f.getAttributeNode("aria-labelledby"):null,h=w!==null&&!r.has(w)?_t(f,"aria-labelledby"):[];if(i==="name"&&!g.isReferenced&&h.length>0)return r.add(w),h.map(function(K){return T(K,{isEmbeddedInLabel:g.isEmbeddedInLabel,isReferenced:!0,recursion:!1})}).join(" ");var E=g.recursion&&ah(f)&&i==="name";if(!E){var q=($(f)&&f.getAttribute("aria-label")||"").trim();if(q!==""&&i==="name")return r.add(f),q;if(!lh(f)){var R=C(f);if(R!==null)return r.add(f),R}}if(ge(f,["menu"]))return r.add(f),"";if(E||g.isEmbeddedInLabel||g.isReferenced){if(ge(f,["combobox","listbox"])){r.add(f);var H=sh(f);return H.length===0?rr(f)?f.value:"":de(H).map(function(K){return T(K,{isEmbeddedInLabel:g.isEmbeddedInLabel,isReferenced:!1,recursion:!0})}).join(" ")}if(hc(f,"range"))return r.add(f),f.hasAttribute("aria-valuetext")?f.getAttribute("aria-valuetext"):f.hasAttribute("aria-valuenow")?f.getAttribute("aria-valuenow"):f.getAttribute("value")||"";if(ge(f,["textbox"]))return r.add(f),ph(f)}if(ch(f)||$(f)&&g.isReferenced||uh(f)||dh(f)){var B=m(f,{isEmbeddedInLabel:g.isEmbeddedInLabel,isReferenced:!1});if(B!=="")return r.add(f),B}if(f.nodeType===f.TEXT_NODE)return r.add(f),f.textContent||"";if(g.recursion)return r.add(f),m(f,{isEmbeddedInLabel:g.isEmbeddedInLabel,isReferenced:!1});var W=P(f);return W!==null?(r.add(f),W):(r.add(f),"")}return oh(T(e,{isEmbeddedInLabel:!1,isReferenced:i==="description",recursion:!1}))}function nr(e){"@babel/helpers - typeof";return nr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nr(e)}function wc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function _c(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wc(Object(r),!0).forEach(function(n){vh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vh(e,t,r){return t=yh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yh(e){var t=hh(e,"string");return nr(t)==="symbol"?t:String(t)}function hh(e,t){if(nr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(nr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=_t(e,"aria-describedby").map(function(o){return Yr(o,_c(_c({},t),{},{compute:"description"}))}).join(" ");if(r===""){var n=e.getAttribute("title");r=n===null?"":n}return r}function gh(e){return ge(e,["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"])}function or(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return gh(e)?"":Yr(e,t)}var oe=xa(xf()),Lf=xa(qf());function Df(e){return e.replace(/</g,"<").replace(/>/g,">")}var o0=(e,t,r,n,o,i,a)=>{let s=n+r.indent,l=r.colors;return e.map(u=>{let c=t[u],d=a(c,r,s,o,i);return typeof c!="string"&&(d.indexOf(`
|
|
16
16
|
`)!==-1&&(d=r.spacingOuter+s+d+r.spacingOuter+n),d="{"+d+"}"),r.spacingInner+n+l.prop.open+u+l.prop.close+"="+l.value.open+d+l.value.close}).join("")},i0=3,a0=(e,t,r,n,o,i)=>e.map(a=>{let s=typeof a=="string"?Bf(a,t):i(a,t,r,n,o);return s===""&&typeof a=="object"&&a!==null&&a.nodeType!==i0?"":t.spacingOuter+r+s}).join(""),Bf=(e,t)=>{let r=t.colors.content;return r.open+Df(e)+r.close},s0=(e,t)=>{let r=t.colors.comment;return r.open+"<!--"+Df(e)+"-->"+r.close},l0=(e,t,r,n,o)=>{let i=n.colors.tag;return i.open+"<"+e+(t&&i.close+t+n.spacingOuter+o+i.open)+(r?">"+i.close+r+n.spacingOuter+o+i.open+"</"+e:(t&&!n.min?"":" ")+"/")+">"+i.close},u0=(e,t)=>{let r=t.colors.tag;return r.open+"<"+e+r.close+" \u2026"+r.open+" />"+r.close},c0=1,Ff=3,Uf=8,jf=11,d0=/^((HTML|SVG)\w*)?Element$/,$f=e=>{let t=e.tagName;return!!(typeof t=="string"&&t.includes("-")||typeof e.hasAttribute=="function"&&e.hasAttribute("is"))},p0=e=>{let t=e.constructor.name,r=e.nodeType;return r===c0&&(d0.test(t)||$f(e))||r===Ff&&t==="Text"||r===Uf&&t==="Comment"||r===jf&&t==="DocumentFragment"};function f0(e){return e.nodeType===Ff}function m0(e){return e.nodeType===Uf}function gs(e){return e.nodeType===jf}function b0(e){return{test:t=>{var r;return((t==null||(r=t.constructor)==null?void 0:r.name)||$f(t))&&p0(t)},serialize:(t,r,n,o,i,a)=>{if(f0(t))return Bf(t.data,r);if(m0(t))return s0(t.data,r);let s=gs(t)?"DocumentFragment":t.tagName.toLowerCase();return++o>r.maxDepth?u0(s,r):l0(s,o0(gs(t)?[]:Array.from(t.attributes).map(l=>l.name).sort(),gs(t)?{}:Array.from(t.attributes).reduce((l,u)=>(l[u.name]=u.value,l),{}),r,n+r.indent,o,i,a),a0(Array.prototype.slice.call(t.childNodes||t.children).filter(e),r,n+r.indent,o,i,a),r,n)}}}var Hf=null,ks=null,Os=null;try{let e=module&&module.require;ks=e.call(module,"fs").readFileSync,Os=e.call(module,"@babel/code-frame").codeFrameColumns,Hf=e.call(module,"picocolors")}catch{}function v0(e){let t=e.indexOf("(")+1,r=e.indexOf(")"),n=e.slice(t,r),o=n.split(":"),i=[o[0],parseInt(o[1],10),parseInt(o[2],10)],a=i[0],s=i[1],l=i[2],u="";try{u=ks(a,"utf-8")}catch{return""}let c=Os(u,{start:{line:s,column:l}},{highlightCode:!0,linesBelow:0});return Hf.dim(n)+`
|
|
17
17
|
`+c+`
|
|
18
18
|
`}function y0(){if(!ks||!Os)return"";let t=new Error().stack.split(`
|
|
@@ -60,7 +60,7 @@ Unable to find an `+(i===!1?"accessible ":"")+'element with the role "'+t+'"'+c+
|
|
|
60
60
|
`))}function Vx(e){return e.reverse().map((t,r)=>["".padEnd(r),t.tagName,t.id&&`#${t.id}`,t.hasAttribute("data-testid")&&`(testId=${t.getAttribute("data-testid")})`,Wx(t),e.length>1&&r===0&&" <-- This element declared `pointer-events: none`",e.length>1&&r===e.length-1&&" <-- Asserted pointer events here"].filter(Boolean).join("")).join(`
|
|
61
61
|
`)}function Wx(e){var t;let r;if(e.hasAttribute("aria-label"))r=e.getAttribute("aria-label");else if(e.hasAttribute("aria-labelledby")){var n,o;r=(o=e.ownerDocument.getElementById(e.getAttribute("aria-labelledby")))===null||o===void 0||(n=o.textContent)===null||n===void 0?void 0:n.trim()}else if(x(e,["button","input","meter","output","progress","select","textarea"])&&(!((t=e.labels)===null||t===void 0)&&t.length))r=Array.from(e.labels).map(a=>{var s;return(s=a.textContent)===null||s===void 0?void 0:s.trim()}).join("|");else if(x(e,"button")){var i;r=(i=e.textContent)===null||i===void 0?void 0:i.trim()}return r=r?.replace(/\n/g," "),Number(r?.length)>30&&(r=`${r?.substring(0,29)}\u2026`),r?`(label=${r})`:""}function Ym(e,t){return(e&t)>0}function Oe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ya=class{init(t){let r=this.getTarget(t),[,n]=ct(null,r),o=this.getEventInit();return pt(t,r),t.dispatchUIEvent(r,"pointerover",o),n.forEach(i=>t.dispatchUIEvent(i,"pointerenter",o)),this}move(t,r){let n=this.position,o=this.getTarget(t);if(this.position=r,!ba(n,r))return;let i=this.getTarget(t),a=this.getEventInit(-1),[s,l]=ct(o,i);return{leave:()=>{kt(t,o)&&o!==i&&(t.dispatchUIEvent(o,"pointerout",a),s.forEach(u=>t.dispatchUIEvent(u,"pointerleave",a)))},enter:()=>{pt(t,i),o!==i&&(t.dispatchUIEvent(i,"pointerover",a),l.forEach(u=>t.dispatchUIEvent(u,"pointerenter",a)))},move:()=>{t.dispatchUIEvent(i,"pointermove",a)}}}down(t,r=0){if(this.isDown)return;let n=this.getTarget(t);pt(t,n),this.isDown=!0,this.isPrevented=!t.dispatchUIEvent(n,"pointerdown",this.getEventInit(r))}up(t,r=0){if(!this.isDown)return;let n=this.getTarget(t);pt(t,n),this.isPrevented=!1,this.isDown=!1,t.dispatchUIEvent(n,"pointerup",this.getEventInit(r))}release(t){let r=this.getTarget(t),[n]=ct(r,null),o=this.getEventInit();kt(t,r)&&(t.dispatchUIEvent(r,"pointerout",o),n.forEach(i=>t.dispatchUIEvent(i,"pointerleave",o))),this.isCancelled=!0}getTarget(t){var r;return(r=this.position.target)!==null&&r!==void 0?r:t.config.document.body}getEventInit(t){return{...this.position.coords,pointerId:this.pointerId,pointerType:this.pointerType,isPrimary:this.isPrimary,button:Cr(t),buttons:this.buttons.getButtons()}}constructor({pointerId:t,pointerType:r,isPrimary:n},o){Oe(this,"pointerId",void 0),Oe(this,"pointerType",void 0),Oe(this,"isPrimary",void 0),Oe(this,"buttons",void 0),Oe(this,"isMultitouch",!1),Oe(this,"isCancelled",!1),Oe(this,"isDown",!1),Oe(this,"isPrevented",!1),Oe(this,"position",{}),this.pointerId=t,this.pointerType=r,this.isPrimary=n,this.isMultitouch=!n,this.buttons=o}};function Ze(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ha=class{isKeyPressed(t){return this.devices.get(t.pointerType).isPressed(t)}async press(t,r,n){this.devices.get(r.pointerType).addPressed(r),this.buttons.down(r);let o=this.getPointerName(r),i=r.pointerType==="touch"?this.pointers.new(o,r.pointerType,this.buttons):this.pointers.get(o);i.position=n,i.pointerType!=="touch"&&(this.mouse.position=n),i.pointerType==="touch"&&i.init(t),i.down(t,r.button),i.pointerType!=="touch"&&this.mouse.down(t,r,i.isPrevented)}async move(t,r,n){let o=this.pointers.get(r),i=o.move(t,n),a=o.pointerType==="touch"?void 0:this.mouse.move(t,n,o.isPrevented);i?.leave(),a?.leave(),i?.enter(),a?.enter(),i?.move(),a?.move()}async release(t,r,n){let o=this.devices.get(r.pointerType);o.removePressed(r),this.buttons.up(r);let i=this.pointers.get(this.getPointerName(r)),a=i.isPrevented;if(i.position=n,i.pointerType!=="touch"&&(this.mouse.position=n),o.countPressed===0&&i.up(t,r.button),i.pointerType==="touch"&&i.release(t),i.pointerType==="touch"&&!i.isMultitouch){let s=this.mouse.move(t,n,a);s?.leave(),s?.enter(),s?.move(),this.mouse.down(t,r,a)}if(!i.isMultitouch){let s=this.mouse.move(t,n,a);s?.leave(),s?.enter(),s?.move(),this.mouse.up(t,r,a)}}getPointerName(t){return t.pointerType==="touch"?t.name:t.pointerType}getPreviousPosition(t){return this.pointers.has(t)?this.pointers.get(t).position:void 0}resetClickCount(){this.mouse.resetClickCount()}getMouseTarget(t){var r;return(r=this.mouse.position.target)!==null&&r!==void 0?r:t.config.document.body}setMousePosition(t){this.mouse.position=t,this.pointers.get("mouse").position=t}constructor(t){Ze(this,"system",void 0),Ze(this,"mouse",void 0),Ze(this,"buttons",void 0),Ze(this,"devices",new class{get(r){var n,o,i;return(i=(n=this.registry)[o=r])!==null&&i!==void 0?i:n[o]=new ma}constructor(){Ze(this,"registry",{})}}),Ze(this,"pointers",new class{new(r,n,o){let i=n!=="touch"||!Object.values(this.registry).some(a=>a.pointerType==="touch"&&!a.isCancelled);return i||Object.values(this.registry).forEach(a=>{a.pointerType===n&&!a.isCancelled&&(a.isMultitouch=!0)}),this.registry[r]=new ya({pointerId:this.nextId++,pointerType:n,isPrimary:i},o),this.registry[r]}get(r){if(!this.has(r))throw new Error(`Trying to access pointer "${r}" which does not exist.`);return this.registry[r]}has(r){return r in this.registry}constructor(){Ze(this,"registry",{}),Ze(this,"nextId",1)}}),this.system=t,this.buttons=new Mt,this.mouse=new va,this.pointers.new("mouse","mouse",this.buttons)}};function Zm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Tr=class{getUIEventModifiers(){return{altKey:this.keyboard.modifiers.Alt,ctrlKey:this.keyboard.modifiers.Control,metaKey:this.keyboard.modifiers.Meta,shiftKey:this.keyboard.modifiers.Shift,modifierAltGraph:this.keyboard.modifiers.AltGraph,modifierCapsLock:this.keyboard.modifiers.CapsLock,modifierFn:this.keyboard.modifiers.Fn,modifierFnLock:this.keyboard.modifiers.FnLock,modifierNumLock:this.keyboard.modifiers.NumLock,modifierScrollLock:this.keyboard.modifiers.ScrollLock,modifierSymbol:this.keyboard.modifiers.Symbol,modifierSymbolLock:this.keyboard.modifiers.SymbolLock}}constructor(){Zm(this,"keyboard",new fa(this)),Zm(this,"pointer",new ha(this))}};async function eb(e){let t=[];return this.config.skipHover||t.push({target:e}),t.push({keys:"[MouseLeft]",target:e}),this.pointer(t)}async function tb(e){return this.pointer([{target:e},"[MouseLeft][MouseLeft]"])}async function rb(e){return this.pointer([{target:e},"[MouseLeft][MouseLeft][MouseLeft]"])}async function nb(e){return this.pointer({target:e})}async function ob(e){return pt(this,this.system.pointer.getMouseTarget(this)),this.pointer({target:e.ownerDocument.body})}async function ib({shift:e}={}){return this.keyboard(e===!0?"{Shift>}{Tab}{/Shift}":e===!1?"[/ShiftLeft][/ShiftRight]{Tab}":"{Tab}")}var ab={"{":"}","[":"]"};function ga(e,t){let r=0,n=e[r]in ab?e[r]:"";r+=n.length;let i=new RegExp(`^\\${n}{2}`).test(e)?"":n;return{type:i,...i===""?zx(e,r,t):Kx(e,r,i,t)}}function zx(e,t,r){let n=e[t];return sb(n,e,t,r),t+=n.length,{consumedLength:t,descriptor:n,releasePrevious:!1,releaseSelf:!0,repeat:1}}function Kx(e,t,r,n){var o,i,a;let s=e[t]==="/"?"/":"";t+=s.length;let l=r==="{"&&e[t]==="\\";t+=Number(l);let u=l?e[t]:(i=e.slice(t).match(r==="{"?/^\w+|^[^}>/]/:/^\w+/))===null||i===void 0?void 0:i[0];sb(u,e,t,n),t+=u.length;let c=(o=(a=e.slice(t).match(/^>\d+/))===null||a===void 0?void 0:a[0])!==null&&o!==void 0?o:"";t+=c.length;let d=e[t]==="/"||!c&&e[t]===">"?e[t]:"";t+=d.length;let m=ab[r],y=e[t]===m?m:"";if(!y)throw new Error(lb([!c&&"repeat modifier",!d&&"release modifier",`"${m}"`].filter(Boolean).join(" or "),e[t],e,n));return t+=y.length,{consumedLength:t,descriptor:u,releasePrevious:!!s,repeat:c?Math.max(Number(c.substr(1)),1):1,releaseSelf:Gx(d,c)}}function sb(e,t,r,n){if(!e)throw new Error(lb("key descriptor",t[r],t,n))}function Gx(e,t){if(e)return e==="/";if(t)return!1}function lb(e,t,r,n){return`Expected ${e} but found "${t??""}" in "${r}"
|
|
62
62
|
See ${n==="pointer"?"https://testing-library.com/docs/user-event/pointer#pressing-a-button-or-touching-the-screen":"https://testing-library.com/docs/user-event/keyboard"}
|
|
63
|
-
for more information about how userEvent parses your input.`}function ub(e,t){let r=[];do{var n;let{type:o,descriptor:i,consumedLength:a,releasePrevious:s,releaseSelf:l=!0,repeat:u}=ga(t,"keyboard"),c=(n=e.find(d=>{if(o==="["){var m;return((m=d.code)===null||m===void 0?void 0:m.toLowerCase())===i.toLowerCase()}else if(o==="{"){var y;return((y=d.key)===null||y===void 0?void 0:y.toLowerCase())===i.toLowerCase()}return d.key===i}))!==null&&n!==void 0?n:{key:"Unknown",code:"Unknown",[o==="["?"code":"key"]:i};r.push({keyDef:c,releasePrevious:s,releaseSelf:l,repeat:u}),t=t.slice(a)}while(t);return r}async function cb(e){let t=ub(this.config.keyboardMap,e);for(let r=0;r<t.length;r++)await Re(this.config),await Xx(this,t[r])}async function Xx(e,{keyDef:t,releasePrevious:r,releaseSelf:n,repeat:o}){let{system:i}=e;if(i.keyboard.isKeyPressed(t)&&await i.keyboard.keyup(e,t),!r){for(let a=1;a<=o;a++)await i.keyboard.keydown(e,t,a>1),a<o&&await Re(e.config);n&&await i.keyboard.keyup(e,t)}}async function db(e){for(let t of e.system.keyboard.getPressedKeys())await e.system.keyboard.keyup(e,t)}function Ea(e){let t=X(e)?{"text/plain":Qx(e)}:{"text/plain":String(e.ownerDocument.getSelection())},r=vt(V(e));for(let n in t)t[n]&&r.setData(n,t[n]);return r}function Qx(e){let t=Me(e);return Z(e).substring(t.startOffset,t.endOffset)}async function pb(){var e;let t=this.config.document,r=(e=t.activeElement)!==null&&e!==void 0?e:t.body,n=Ea(r);if(n.items.length!==0)return this.dispatchUIEvent(r,"copy",{clipboardData:n})&&this.config.writeToClipboard&&await Lr(t,n),n}async function fb(){var e;let t=this.config.document,r=(e=t.activeElement)!==null&&e!==void 0?e:t.body,n=Ea(r);if(n.items.length!==0)return this.dispatchUIEvent(r,"cut",{clipboardData:n})&&this.config.writeToClipboard&&await Lr(r.ownerDocument,n),n}async function mb(e){var t,r;let n=this.config.document,o=(t=n.activeElement)!==null&&t!==void 0?t:n.body,i=(r=typeof e=="string"?Yx(n,e):e)!==null&&r!==void 0?r:await Nl(n).catch(()=>{throw new Error("`userEvent.paste()` without `clipboardData` requires the `ClipboardAPI` to be available.")});this.dispatchUIEvent(o,"paste",{clipboardData:i})}function Yx(e,t){let r=vt(V(e));return r.setData("text",t),r}function Xs(e,t){let r=[];do{let{descriptor:n,consumedLength:o,releasePrevious:i,releaseSelf:a=!0}=ga(t,"pointer"),s=e.find(l=>l.name===n);s&&r.push({keyDef:s,releasePrevious:i,releaseSelf:a}),t=t.slice(o)}while(t);return r}async function vb(e){let{pointerMap:t}=this.config,r=[];(Array.isArray(e)?e:[e]).forEach(n=>{typeof n=="string"?r.push(...Xs(t,n)):"keys"in n?r.push(...Xs(t,n.keys).map(o=>({...n,...o}))):r.push(n)});for(let n=0;n<r.length;n++)await Re(this.config),await Jx(this,r[n]);this.system.pointer.resetClickCount()}async function Jx(e,t){var r,n,o,i,a,s;let l="pointerName"in t&&t.pointerName?t.pointerName:"keyDef"in t?e.system.pointer.getPointerName(t.keyDef):"mouse",u=e.system.pointer.getPreviousPosition(l),c={target:(r=t.target)!==null&&r!==void 0?r:Zx(e,u),coords:(n=t.coords)!==null&&n!==void 0?n:u?.coords,caret:{node:(o=t.node)!==null&&o!==void 0?o:bb(t)||u==null||(a=u.caret)===null||a===void 0?void 0:a.node,offset:(i=t.offset)!==null&&i!==void 0?i:bb(t)||u==null||(s=u.caret)===null||s===void 0?void 0:s.offset}};"keyDef"in t?(e.system.pointer.isKeyPressed(t.keyDef)&&(st(e,re.Trigger),await e.system.pointer.release(e,t.keyDef,c)),t.releasePrevious||(st(e,re.Trigger),await e.system.pointer.press(e,t.keyDef,c),t.releaseSelf&&(st(e,re.Trigger),await e.system.pointer.release(e,t.keyDef,c)))):(st(e,re.Trigger),await e.system.pointer.move(e,l,c))}function bb(e){var t,r;return!!((t=(r=e.target)!==null&&r!==void 0?r:e.node)!==null&&t!==void 0?t:e.offset!==void 0)}function Zx(e,t){var r;if(!t)throw new Error("This pointer has no previous position. Provide a target property!");return(r=t.target)!==null&&r!==void 0?r:e.config.document.body}async function yb(e){if(!ve(e)||te(e))throw new Error("clear()` is only supported on editable elements.");if(se(e),e.ownerDocument.activeElement!==e)throw new Error("The element to be cleared could not be focused.");if(pa(e),!Rm(e))throw new Error("The element content to be cleared could not be selected.");_e(this,e,"","deleteContentBackward")}async function hb(e,t){return Eb.call(this,!0,e,t)}async function gb(e,t){return Eb.call(this,!1,e,t)}async function Eb(e,t,r){if(!e&&!t.multiple)throw I().getElementError("Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.",t);let n=Array.isArray(r)?r:[r],o=Array.from(t.querySelectorAll('option, [role="option"]')),i=n.map(s=>{if(typeof s!="string"&&o.includes(s))return s;{let l=o.find(u=>u.value===s||u.innerHTML===s);if(l)return l;throw I().getElementError(`Value "${String(s)}" not found in options`,t)}}).filter(s=>!te(s));if(te(t)||!i.length)return;let a=s=>{s.selected=e,this.dispatchUIEvent(t,"input",{bubbles:!0,cancelable:!1,composed:!0}),this.dispatchUIEvent(t,"change")};if(x(t,"select"))if(t.multiple)for(let s of i){let l=this.config.pointerEventsCheck===0?!0:kt(this,s);l&&(this.dispatchUIEvent(s,"pointerover"),this.dispatchUIEvent(t,"pointerenter"),this.dispatchUIEvent(s,"mouseover"),this.dispatchUIEvent(t,"mouseenter"),this.dispatchUIEvent(s,"pointermove"),this.dispatchUIEvent(s,"mousemove"),this.dispatchUIEvent(s,"pointerdown"),this.dispatchUIEvent(s,"mousedown")),se(t),l&&(this.dispatchUIEvent(s,"pointerup"),this.dispatchUIEvent(s,"mouseup")),a(s),l&&this.dispatchUIEvent(s,"click"),await Re(this.config)}else if(i.length===1){let s=this.config.pointerEventsCheck===0?!0:kt(this,t);s?await this.click(t):se(t),a(i[0]),s&&(this.dispatchUIEvent(t,"pointerover"),this.dispatchUIEvent(t,"pointerenter"),this.dispatchUIEvent(t,"mouseover"),this.dispatchUIEvent(t,"mouseenter"),this.dispatchUIEvent(t,"pointerup"),this.dispatchUIEvent(t,"mouseup"),this.dispatchUIEvent(t,"click")),await Re(this.config)}else throw I().getElementError("Cannot select multiple options on a non-multiple select",t);else if(t.getAttribute("role")==="listbox")for(let s of i)await this.click(s),await this.unhover(s);else throw I().getElementError("Cannot select options on elements that are neither select nor listbox elements",t)}async function wb(e,t,{skipClick:r=this.config.skipClick,skipAutoClose:n=this.config.skipAutoClose,initialSelectionStart:o,initialSelectionEnd:i}={}){e.disabled||(r||await this.click(e),o!==void 0&&at(e,o,i??o),await this.keyboard(t),n||await db(this))}var _b=Symbol("files and value properties are mocked");function Qs(e,t,r){r?Object.defineProperty(e,t,r):delete e[t]}function Cb(e,t){var r;(r=e[_b])===null||r===void 0||r.restore();let n=Object.getOwnPropertyDescriptor(e,"type"),o=Object.getOwnPropertyDescriptor(e,"value"),i=Object.getOwnPropertyDescriptor(e,"files");function a(){Qs(e,"type",n),Qs(e,"value",o),Qs(e,"files",i)}e[_b]={restore:a},Object.defineProperties(e,{files:{configurable:!0,get:()=>t},value:{configurable:!0,get:()=>t.length?`C:\\fakepath\\${t[0].name}`:"",set(s){if(s==="")a();else{var l;o==null||(l=o.set)===null||l===void 0||l.call(e,s)}}},type:{configurable:!0,get:()=>"file",set(s){s!=="file"&&(a(),e.type=s)}}})}async function Pb(e,t){let r=x(e,"label")?e.control:e;if(!r||!x(r,"input",{type:"file"}))throw new TypeError(`The ${r===e?"given":"associated"} ${r?.tagName} element does not accept file uploads`);if(te(e))return;let n=(Array.isArray(t)?t:[t]).filter(i=>!this.config.applyAccept||eq(i,r.accept)).slice(0,r.multiple?void 0:1),o=()=>{var i;n.length===((i=r.files)===null||i===void 0?void 0:i.length)&&n.every((a,s)=>{var l;return a===((l=r.files)===null||l===void 0?void 0:l.item(s))})||(Cb(r,Ft(V(e),n)),this.dispatchUIEvent(r,"input"),this.dispatchUIEvent(r,"change"))};r.addEventListener("fileDialog",o),await this.click(e),r.removeEventListener("fileDialog",o)}function wa(e){return e.toLowerCase().replace(/(\.|\/)jpg\b/g,"$1jpeg")}function eq(e,t){if(!t)return!0;let r=["audio/*","image/*","video/*"];return wa(t).trim().split(/\s*,\s*/).some(n=>n.startsWith(".")?wa(e.name).endsWith(n):r.includes(n)?wa(e.type).startsWith(n.replace("*","")):wa(e.type)===n)}var Ys={click:eb,dblClick:tb,tripleClick:rb,hover:nb,unhover:ob,tab:ib,keyboard:cb,copy:pb,cut:fb,paste:mb,pointer:vb,clear:yb,deselectOptions:gb,selectOptions:hb,type:wb,upload:Pb};function Tb(e){return I().asyncWrapper(e)}var Rb={applyAccept:!0,autoModify:!0,delay:0,document:globalThis.document,keyboardMap:Hm,pointerMap:Vm,pointerEventsCheck:lt.EachApiCall,skipAutoClose:!1,skipClick:!1,skipHover:!1,writeToClipboard:!1,advanceTimers:()=>Promise.resolve()},tq={...Rb,writeToClipboard:!0};function Sb(e={},t=tq,r){let n=oq(e,r,t);return{...t,...e,document:n}}function xb(e={}){var t;let r=Sb(e);Ks(r.document),Ws(V(r.document).HTMLElement);let n=(t=r.document.defaultView)!==null&&t!==void 0?t:globalThis.window;return Il(n),Js(r).api}function ee({keyboardState:e,pointerState:t,...r}={},n){var o;let i=Sb(r,Rb,n);Ks(i.document),Ws(V(i.document).HTMLElement);let a=(o=t??e)!==null&&o!==void 0?o:new Tr;return{api:Js(i,a).api,system:a}}function rq(e){return Js({...this.config,...e},this.system).api}function nq(e,t){function r(...n){return st(e,re.Call),Tb(()=>t.apply(e,n).then(async o=>(await Re(e.config),o)))}return Object.defineProperty(r,"name",{get:()=>t.name}),r}function Js(e,t=new Tr){let r={};return Object.assign(r,{config:e,dispatchEvent:Vs.bind(r),dispatchUIEvent:Om.bind(r),system:t,levelRefs:{},...Ys}),{instance:r,api:{...Object.fromEntries(Object.entries(Ys).map(([n,o])=>[n,nq(r,o)])),setup:rq.bind(r)}}}function oq(e,t,r){var n,o;return(n=(o=e.document)!==null&&o!==void 0?o:t&&Um(t))!==null&&n!==void 0?n:r.document}var Zs={};Wb(Zs,{clear:()=>iq,click:()=>aq,copy:()=>sq,cut:()=>lq,dblClick:()=>uq,deselectOptions:()=>cq,hover:()=>dq,keyboard:()=>pq,paste:()=>mq,pointer:()=>fq,selectOptions:()=>bq,tab:()=>Eq,tripleClick:()=>vq,type:()=>yq,unhover:()=>hq,upload:()=>gq});function iq(e){return ee().api.clear(e)}function aq(e,t={}){return ee(t,e).api.click(e)}function sq(e={}){return ee(e).api.copy()}function lq(e={}){return ee(e).api.cut()}function uq(e,t={}){return ee(t).api.dblClick(e)}function cq(e,t,r={}){return ee(r).api.deselectOptions(e,t)}function dq(e,t={}){return ee(t).api.hover(e)}async function pq(e,t={}){let{api:r,system:n}=ee(t);return r.keyboard(e).then(()=>n)}async function fq(e,t={}){let{api:r,system:n}=ee(t);return r.pointer(e).then(()=>n)}function mq(e,t){return ee(t).api.paste(e)}function bq(e,t,r={}){return ee(r).api.selectOptions(e,t)}function vq(e,t={}){return ee(t).api.tripleClick(e)}function yq(e,t,r={}){return ee(r,e).api.type(e,t,r)}function hq(e,t={}){let{api:r,system:n}=ee(t);return n.pointer.setMousePosition({target:e}),r.unhover(e)}function gq(e,t,r={}){return ee(r).api.upload(e,t)}function Eq(e={}){return ee().api.tab(e)}var _a={...Zs,setup:xb};var qb=!1,Ab=!1,el=null;function wq(e){return new Promise(t=>setTimeout(t,e))}function Mb(e){try{if(typeof e=="string")return new URL(e,_q()).href;if(e instanceof URL)return e.href;if(typeof Request<"u"&&e instanceof Request)return e.url}catch{}return String(e)}function _q(){try{if(typeof location<"u"&&location.href)return location.href}catch{}return"http://localhost/"}function Cq(e,t){if(t?.method)return String(t.method).toUpperCase();try{if(typeof Request<"u"&&e instanceof Request&&e.method)return String(e.method).toUpperCase()}catch{}return"GET"}function Pq(e,t){let r=t?.body;if(typeof r=="string")return r;try{if(typeof Request<"u"&&e instanceof Request)return}catch{}}function Tq(e){let t=Mr(e.headers),r={};for(let n of t)r[n.name]=n.value;return new Response(Bt(e.body),{status:e.statusCode,headers:r})}async function Rq(e,t,r){let n=Mb(t),o=Cq(t,r),i=Nt(el?.()??[],n,o);if(!i)return e(t,r);let a={url:n,method:o,headers:void 0,postData:Pq(t,r),timestamp:Date.now()};if(Lt(i,a),i.aborted)throw new TypeError(`Spectra.intercept() aborted ${o} ${n} (${i.abortReason||"Failed"})`);let s=Dt(i);return s.delayMs&&s.delayMs>0&&await wq(s.delayMs),Tq(s)}function Sq(){let e=globalThis.XMLHttpRequest;function t(){let r=new e,n="GET",o="",i=e.prototype.open.bind(r),a=e.prototype.send.bind(r);return r.open=(s,l,...u)=>{n=String(s).toUpperCase(),o=Mb(l);let[c=!0,d,m]=u;return i(s,l,c,d,m)},r.send=s=>{let l=Nt(el?.()??[],o,n);if(!l)return a(s);let u={url:o,method:n,headers:void 0,postData:typeof s=="string"?s:void 0,timestamp:Date.now()};Lt(l,u);let c=()=>{r.dispatchEvent(new Event("error"))};if(l.aborted){setTimeout(c,0);return}let d=Dt(l),m=()=>{let y=Bt(d.body);Object.defineProperties(r,{status:{value:d.statusCode,configurable:!0},statusText:{value:d.statusCode===200?"OK":`${d.statusCode} Mocked`,configurable:!0},responseText:{value:y,configurable:!0},response:{value:y,configurable:!0},readyState:{value:4,configurable:!0}}),r.dispatchEvent(new Event("readystatechange")),r.dispatchEvent(new Event("load")),r.dispatchEvent(new Event("loadend"))};d.delayMs&&d.delayMs>0?setTimeout(m,d.delayMs):setTimeout(m,0)},r}t.prototype=e.prototype,globalThis.XMLHttpRequest=t}function kb(e){if(el=e,!qb&&typeof globalThis.fetch=="function"){let t=globalThis.fetch.bind(globalThis);globalThis.fetch=(r,n)=>Rq(t,r,n),qb=!0}!Ab&&typeof globalThis.XMLHttpRequest=="function"&&(Sq(),Ab=!0)}function ft(){return _a.setup({delay:null})}function Ca(e){return _l(e.trim())??e.trim()}function Nb(e,t){let r=Ca(e),o=(()=>{if(t===null)return document.querySelector(r);let a=Array.from(document.querySelectorAll(r));return t>=0?a[t]??null:a[a.length+t]??null})();if(o!==null)return o;let i=Ia(e.trim());return i?Cl(i.name,document,t):null}function et(e){return typeof e=="string"?e:e.selector}function Ob(e,t){return t==null?e[0]??null:t>=0?e[t]??null:e[e.length+t]??null}function tl(e,t){if(!t)return!0;try{return e.matches(t)}catch{return!1}}function Pa(e,t){let r=wl(e);if(!r)return;if(r.kind==="nth"){let a=U(r.base,Number.parseInt(r.arg,10));return a?[a]:[]}let n=t?{selector:r.base,index:null,parent:t}:r.base,o=U(n,null);if(r.kind==="parent")return o?.parentElement?[o.parentElement]:[];if(r.kind==="closest"){let a=o?.closest(r.arg)??null;return a?[a]:[]}if(!o)return[];if(r.kind==="children")return Array.from(o.children).filter(a=>tl(a,r.arg));if(r.kind==="siblings"){let a=o.parentElement;return a?Array.from(a.children).filter(s=>s!==o&&tl(s,r.arg)):[]}let i=o.nextElementSibling;for(;i&&!tl(i,r.arg);)i=i.nextElementSibling;return i?[i]:[]}function U(e,t){if(typeof e=="string"){let s=Pa(e,void 0);return s!==void 0?Ob(s,t):Nb(e,t)}let r=Pa(e.selector,e.parent);if(r!==void 0)return Ob(r,e.index??t);let n=e.parent?U(e.parent,e.parent.index):document.documentElement;if(!n)return null;let o=Ca(e.selector),i=Array.from(n.querySelectorAll(o)),a=e.index??t;return a==null?i[0]??null:a>=0?i[a]??null:i[i.length+a]??null}function Ib(e){let t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"}function rl(e){if(e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA")return null;let t=e;return t.tagName==="INPUT"&&hl.includes(t.type)?null:typeof t.value=="string"?t.value:null}var Ta=class{mockRules=[];consoleErrors=[];recordedNetwork=[];async waitForScopedEl(t,r){let n=U(t,r);if(n)return n;let o=null;if(!await globalThis.__TS_RUNTIME__.pollCondition(async()=>(o=U(t,r),o!==null),globalThis.__TS_RUNTIME__.getImplicitWaitMs())||!o)throw new Error("Element not found: "+et(t));return o}async connect(){}async close(){}async navigate(t){throw new Error("Spectra.navigate() is not supported in component testing mode. Use Spectra.mount(<Component />) to render a component tree instead of navigating a URL.")}async setCookies(t,r){let n=Array.isArray(t)?t:[t];for(let o of n)typeof document<"u"&&(document.cookie=o)}async back(){throw new Error("Spectra.back() is not supported in component testing mode.")}async forward(){throw new Error("Spectra.forward() is not supported in component testing mode.")}async refresh(){throw new Error("Spectra.refresh() is not supported in component testing mode.")}async setViewport(t,r){try{window.resizeTo(t,r)}catch{}}async pause(t){await new Promise(r=>setTimeout(r,t))}async click(t,r=null){let n=await this.waitForScopedEl(t,r);await ft().click(n)}async doubleClick(t,r=null){let n=await this.waitForScopedEl(t,r);await ft().dblClick(n)}async rightClick(t,r=null){let n=await this.waitForScopedEl(t,r);await ft().pointer({keys:"[MouseRight]",target:n})}async setValue(t,r,n=null){let o=await this.waitForScopedEl(t,n);if(!Ib(o))throw new Error("Element is not a form field: "+et(t));if(o.tagName==="INPUT"&&o.type==="file")return this.upload(t,r,n);let i=String(r),a=ft();await a.clear(o);let s=rl(o);if(i.length>0){if(await a.type(o,i),ka(i,rl(o),s))return;o.focus(),await a.clear(o),await a.type(o,i);let l=rl(o);if(!ka(i,l,s))throw gl(et(t),i,l??"")}}async upload(t,r,n=null){let o=await this.waitForScopedEl(t,n),i=Array.isArray(r)?r:[r],a=[],s={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",webp:"image/webp",pdf:"application/pdf",json:"application/json",txt:"text/plain",csv:"text/csv"};for(let l of i)if(typeof l=="string"){let u="file.bin",c="application/octet-stream",d;if(l.startsWith("data:")){let m=l.indexOf(","),y=l.slice(0,m),P=l.slice(m+1),C=y.match(/data:([^;]+)/);C&&(c=C[1]);let T=y.match(/(?:name|filename)=([^;]+)/i);T?u=decodeURIComponent(T[1]):u=`fixture.${c.split("/")[1]||"bin"}`;try{let f=atob(P),g=new Uint8Array(f.length);for(let w=0;w<f.length;w++)g[w]=f.charCodeAt(w);d=new Blob([g],{type:c})}catch{d=new Blob([P],{type:c})}}else{u=l.split("?")[0].split("#")[0].split("/").pop()?.split("\\").pop()||"fixture.bin";let y=u.split(".").pop()?.toLowerCase()||"";c=s[y]||"application/octet-stream",d=new Blob(["Mock file content for "+u],{type:c})}a.push(new File([d],u,{type:c}))}else if(l instanceof File)a.push(l);else if(l&&typeof l=="object"&&"name"in l){let u=l,c=u.type||"application/octet-stream",d;if(u.base64)try{let m=atob(u.base64),y=new Uint8Array(m.length);for(let P=0;P<m.length;P++)y[P]=m.charCodeAt(P);d=new Blob([y],{type:c})}catch{d=new Blob([u.base64],{type:c})}else d=new Blob([u.content||"Mock content"],{type:c});a.push(new File([d],u.name,{type:c}))}if(a.length>0){let l=new DataTransfer;for(let u of a)l.items.add(u);o.files=l.files,o.dispatchEvent(new Event("input",{bubbles:!0})),o.dispatchEvent(new Event("change",{bubbles:!0}))}}async clearValue(t,r=null){let n=await this.waitForScopedEl(t,r);await ft().clear(n)}async select(t,r,n=null){if(!await globalThis.__TS_RUNTIME__.pollCondition(async()=>{let i=U(t,n);if(!i||i.tagName!=="SELECT")return!1;for(let a=0;a<i.options.length;a++){let s=i.options[a];if(s.text===r||s.value===r)return i.selectedIndex=a,i.dispatchEvent(new Event("change",{bubbles:!0})),!0}return!1}))throw new Error("Select option not found: "+JSON.stringify(r))}async hover(t,r=null){let n=await this.waitForScopedEl(t,r);await ft().hover(n)}async focus(t,r=null){if(!await globalThis.__TS_RUNTIME__.pollCondition(async()=>{let o=U(t,r);return o?(o.focus?.(),!0):!1}))throw new Error("Element not found: "+et(t))}async blur(t,r=null){if(!await globalThis.__TS_RUNTIME__.pollCondition(async()=>{let o=U(t,r);return o?(o.blur?.(),!0):!1}))throw new Error("Element not found: "+et(t))}async waitForElementRemoved(t,r=5e3,n=null){if(!await globalThis.__TS_RUNTIME__.pollCondition(async()=>!await this.isExisting(t,n),r))throw new Error("Element still exists after timeout: "+et(t))}async waitForUndisplayed(t,r,n=null){if(!await globalThis.__TS_RUNTIME__.pollCondition(async()=>!await this.isDisplayed(t,n),r?.timeout??5e3))throw new Error("Element still displayed after timeout: "+et(t))}async waitForClickable(t,r,n=null){return await globalThis.__TS_RUNTIME__.pollCondition(async()=>this.isClickable(t,n),r?.timeout??5e3)}async getBounds(t,r=null){let n=U(t,r);if(!n)return{x:0,y:0,top:0,right:0,bottom:0,left:0,width:0,height:0};let o=n.getBoundingClientRect();return{x:o.x,y:o.y,top:o.top,right:o.right,bottom:o.bottom,left:o.left,width:o.width,height:o.height}}async closest(t,r,n=null){let o=U(t,n);if(!o)return null;let i=o.closest(r);return i?i.tagName.toLowerCase():null}async clickAt(t,r){document.elementFromPoint(t,r)?.click()}async dragDrop(t,r,n=null){let o=U(t,n),i=Nb(r,null);if(!o||!i)throw new Error("Drag source or destination not found");let a=new DataTransfer;o.dispatchEvent(new DragEvent("dragstart",{bubbles:!0,dataTransfer:a})),i.dispatchEvent(new DragEvent("dragover",{bubbles:!0,dataTransfer:a})),i.dispatchEvent(new DragEvent("drop",{bubbles:!0,dataTransfer:a})),o.dispatchEvent(new DragEvent("dragend",{bubbles:!0,dataTransfer:a}))}async longPress(t,r,n=null){let o=U(t,n);if(!o)throw new Error("Element not found: "+et(t));o.dispatchEvent(new TouchEvent("touchstart",{bubbles:!0})),await this.pause(r),o.dispatchEvent(new TouchEvent("touchend",{bubbles:!0}))}async scrollIntoView(t,r=null){U(t,r)?.scrollIntoView({block:"center",inline:"center"})}async getText(t,r=null){let n=U(t,r);return n?n.textContent??"":""}async getValue(t,r=null){let n=U(t,r);return n?Ib(n)?n.value??"":n.getAttribute("value")||"":""}async isDisplayed(t,r=null){let n=U(t,r);if(!n)return!1;let o=window.getComputedStyle(n);if(o.visibility==="hidden"||o.display==="none"||o.opacity==="0")return!1;let i=n.getBoundingClientRect();return i.width>0&&i.height>0||n.getClientRects().length>0||n.offsetWidth>0&&n.offsetHeight>0}async isExisting(t,r=null){return U(t,r)!==null}async isEnabled(t,r=null){let n=U(t,r);return n?!n.disabled&&!n.hasAttribute("disabled")&&!n.classList.contains("disabled")&&n.getAttribute("aria-disabled")!=="true":!1}async isSelected(t,r=null){let n=U(t,r);return n?!!n.checked||n.getAttribute("aria-checked")==="true"||n.getAttribute("data-state")==="checked":!1}async isFocused(t,r=null){let n=U(t,r);return n?document.activeElement===n||n.matches(":focus"):!1}async isClickable(t,r=null){let n=U(t,r);if(!n)return!1;let o=window.getComputedStyle(n);if(o.visibility==="hidden"||o.display==="none"||o.opacity==="0")return!1;let i=n.getBoundingClientRect();return i.width===0&&i.height===0?!1:!n.disabled&&!n.hasAttribute("disabled")&&!n.classList.contains("disabled")&&n.getAttribute("aria-disabled")!=="true"}async hasClass(t,r,n=null){let o=U(t,n);return o?o.classList.contains(r):!1}async getAttribute(t,r,n=null){let o=U(t,n);return o?o.getAttribute(r):null}async getCSSProperty(t,r,n=null){let o=U(t,n);return{value:o?window.getComputedStyle(o).getPropertyValue(r):""}}async count(t){if(typeof t=="string"){let o=Pa(t,void 0);return o!==void 0?o.length:document.querySelectorAll(Ca(t)).length}let r=Pa(t.selector,t.parent);if(r!==void 0)return r.length;let n=t.parent?U(t.parent,t.parent.index):document.documentElement;return n?n.querySelectorAll(Ca(t.selector)).length:0}async pressKey(t){let r=El(t);if(r?.code){await ft().keyboard(`{${r.code}}`);return}let n=document.activeElement||document.body,o=String(t);n.dispatchEvent(new KeyboardEvent("keydown",{key:o,bubbles:!0})),n.dispatchEvent(new KeyboardEvent("keyup",{key:o,bubbles:!0}))}async scroll(t={}){if(t.selector){await this.scrollIntoView(String(t.selector),null);return}let r=t.direction||"down",n=t.pixels||500,o=r==="up"?-n:r==="down"?n:0,i=r==="left"?-n:r==="right"?n:0;window.scrollBy(i,o)}async swipe(t){let r=t.distance||300,n=t.direction==="up"?r:t.direction==="down"?-r:0,o=t.direction==="left"?r:t.direction==="right"?-r:0;window.scrollBy(o,n)}async grantPermission(t){}async getUrl(){return window.location.href}async getTitle(){return document.title}async execute(t,...r){if(typeof t=="function"){let n=r.map(o=>{let i=Aa(o);return i?U(i,null):o});return t(...n)}return new Function(`return (${t});`)()}async evaluate(t){return new Function(`return (${t});`)()}async waitUntil(t,r){let n=await globalThis.__TS_RUNTIME__.pollCondition(t,r?.timeout);if(!n)throw new Error(r?.timeoutMsg||"waitUntil() condition was not met in time");return n}async getLogs(t){return[]}async shouldHaveUrl(t){let r=await this.getUrl();if(r!==t)throw new Error(`Expected browser URL to be "${t}", but got "${r}"`)}async shouldContainUrl(t){let r=await this.getUrl();if(!r.includes(t))throw new Error(`Expected browser URL to contain "${t}", but got "${r}"`)}async shouldHaveTitle(t){let r=await this.getTitle();if(r!==t)throw new Error(`Expected page title to be "${t}", but got "${r}"`)}async shouldContainTitle(t){let r=await this.getTitle();if(!r.includes(t))throw new Error(`Expected page title to contain "${t}", but got "${r}"`)}async shouldBeLoaded(){if(document.readyState!=="complete"&&document.readyState!=="interactive")throw new Error(`Expected document to be loaded, but readyState is "${document.readyState}"`)}async shouldHaveNoConsoleErrors(){if(this.consoleErrors.length>0)throw new Error(`Expected no console errors, but found ${this.consoleErrors.length}: ${this.consoleErrors.join("; ")}`)}async clearCookies(){document.cookie.split(";").forEach(t=>{let r=t.split("=")[0]?.trim();r&&(document.cookie=`${r}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`)})}async clearLocalStorage(){window.localStorage.clear()}async intercept(t,r,n,o){let i=Ar(t,r,n,o);return kb(()=>this.mockRules),this.mockRules.push(i),qr(i)}clearMocks(){this.mockRules=[]}};var Ra="spectra-root",mt=null,Rr=null;async function xq(){if(typeof window<"u"&&window.__TESTSPECTRA_CREATE_ROOT__)return window.__TESTSPECTRA_CREATE_ROOT__;if(Rr)return Rr;try{let e=await import("react-dom/client");if(Rr=e.createRoot||e.default?.createRoot||e.default,Rr)return Rr}catch{}throw new Error("Could not find react-dom/client createRoot. Ensure react-dom is installed in your project.")}function qq(){let e=document.getElementById(Ra);return e||(e=document.createElement("div"),e.id=Ra,document.body.appendChild(e)),e}function Lb(){if(mt){try{mt.unmount()}catch{try{mt.render(null)}catch{}}mt=null}let e=document.getElementById(Ra);e&&(e.innerHTML="")}async function Db(e){let t=qq();mt||(mt=(await xq())(t));let r=(typeof e.type=="string"?e.type:e.type?.displayName||e.type?.name)||"component";return globalThis.__TS_RUNTIME__.trackStep("action",{type:"action",key:"mount",target:r,args:[]},async()=>(mt.render(e),await new Promise(n=>setTimeout(n,20)),globalThis.__TS_RUNTIME__.createElementProxy(`#${Ra}`)))}var Bb=new Ta;ol(Bb);globalThis.browser=Bb;globalThis.$=function(e){return ue(e)};globalThis.$$=function(e){return Te(e)};var nl=Pl();nl.mount=Db;nl.unmount=Lb;globalThis.Spectra=nl;(typeof globalThis.__vitest_browser_runner__<"u"||typeof globalThis.__vitest_worker__<"u")&&await La();typeof beforeEach=="function"&&beforeEach(e=>{let t=e?.task?.name||globalThis.__CURRENT_TEST_TITLE__;t&&(globalThis.__CURRENT_TEST_TITLE__=t,globalThis.__TS_RUNTIME__.emitEvent("TESTSPECTRA_TEST_START",JSON.stringify({title:t})))});typeof document<"u"&&document.addEventListener("click",e=>{e.target?.closest?.("a[href]")&&e.preventDefault()},!0);globalThis.__SPECTRA_READY__=!0;
|
|
63
|
+
for more information about how userEvent parses your input.`}function ub(e,t){let r=[];do{var n;let{type:o,descriptor:i,consumedLength:a,releasePrevious:s,releaseSelf:l=!0,repeat:u}=ga(t,"keyboard"),c=(n=e.find(d=>{if(o==="["){var m;return((m=d.code)===null||m===void 0?void 0:m.toLowerCase())===i.toLowerCase()}else if(o==="{"){var y;return((y=d.key)===null||y===void 0?void 0:y.toLowerCase())===i.toLowerCase()}return d.key===i}))!==null&&n!==void 0?n:{key:"Unknown",code:"Unknown",[o==="["?"code":"key"]:i};r.push({keyDef:c,releasePrevious:s,releaseSelf:l,repeat:u}),t=t.slice(a)}while(t);return r}async function cb(e){let t=ub(this.config.keyboardMap,e);for(let r=0;r<t.length;r++)await Re(this.config),await Xx(this,t[r])}async function Xx(e,{keyDef:t,releasePrevious:r,releaseSelf:n,repeat:o}){let{system:i}=e;if(i.keyboard.isKeyPressed(t)&&await i.keyboard.keyup(e,t),!r){for(let a=1;a<=o;a++)await i.keyboard.keydown(e,t,a>1),a<o&&await Re(e.config);n&&await i.keyboard.keyup(e,t)}}async function db(e){for(let t of e.system.keyboard.getPressedKeys())await e.system.keyboard.keyup(e,t)}function Ea(e){let t=X(e)?{"text/plain":Qx(e)}:{"text/plain":String(e.ownerDocument.getSelection())},r=vt(V(e));for(let n in t)t[n]&&r.setData(n,t[n]);return r}function Qx(e){let t=Me(e);return Z(e).substring(t.startOffset,t.endOffset)}async function pb(){var e;let t=this.config.document,r=(e=t.activeElement)!==null&&e!==void 0?e:t.body,n=Ea(r);if(n.items.length!==0)return this.dispatchUIEvent(r,"copy",{clipboardData:n})&&this.config.writeToClipboard&&await Lr(t,n),n}async function fb(){var e;let t=this.config.document,r=(e=t.activeElement)!==null&&e!==void 0?e:t.body,n=Ea(r);if(n.items.length!==0)return this.dispatchUIEvent(r,"cut",{clipboardData:n})&&this.config.writeToClipboard&&await Lr(r.ownerDocument,n),n}async function mb(e){var t,r;let n=this.config.document,o=(t=n.activeElement)!==null&&t!==void 0?t:n.body,i=(r=typeof e=="string"?Yx(n,e):e)!==null&&r!==void 0?r:await Nl(n).catch(()=>{throw new Error("`userEvent.paste()` without `clipboardData` requires the `ClipboardAPI` to be available.")});this.dispatchUIEvent(o,"paste",{clipboardData:i})}function Yx(e,t){let r=vt(V(e));return r.setData("text",t),r}function Xs(e,t){let r=[];do{let{descriptor:n,consumedLength:o,releasePrevious:i,releaseSelf:a=!0}=ga(t,"pointer"),s=e.find(l=>l.name===n);s&&r.push({keyDef:s,releasePrevious:i,releaseSelf:a}),t=t.slice(o)}while(t);return r}async function vb(e){let{pointerMap:t}=this.config,r=[];(Array.isArray(e)?e:[e]).forEach(n=>{typeof n=="string"?r.push(...Xs(t,n)):"keys"in n?r.push(...Xs(t,n.keys).map(o=>({...n,...o}))):r.push(n)});for(let n=0;n<r.length;n++)await Re(this.config),await Jx(this,r[n]);this.system.pointer.resetClickCount()}async function Jx(e,t){var r,n,o,i,a,s;let l="pointerName"in t&&t.pointerName?t.pointerName:"keyDef"in t?e.system.pointer.getPointerName(t.keyDef):"mouse",u=e.system.pointer.getPreviousPosition(l),c={target:(r=t.target)!==null&&r!==void 0?r:Zx(e,u),coords:(n=t.coords)!==null&&n!==void 0?n:u?.coords,caret:{node:(o=t.node)!==null&&o!==void 0?o:bb(t)||u==null||(a=u.caret)===null||a===void 0?void 0:a.node,offset:(i=t.offset)!==null&&i!==void 0?i:bb(t)||u==null||(s=u.caret)===null||s===void 0?void 0:s.offset}};"keyDef"in t?(e.system.pointer.isKeyPressed(t.keyDef)&&(st(e,re.Trigger),await e.system.pointer.release(e,t.keyDef,c)),t.releasePrevious||(st(e,re.Trigger),await e.system.pointer.press(e,t.keyDef,c),t.releaseSelf&&(st(e,re.Trigger),await e.system.pointer.release(e,t.keyDef,c)))):(st(e,re.Trigger),await e.system.pointer.move(e,l,c))}function bb(e){var t,r;return!!((t=(r=e.target)!==null&&r!==void 0?r:e.node)!==null&&t!==void 0?t:e.offset!==void 0)}function Zx(e,t){var r;if(!t)throw new Error("This pointer has no previous position. Provide a target property!");return(r=t.target)!==null&&r!==void 0?r:e.config.document.body}async function yb(e){if(!ve(e)||te(e))throw new Error("clear()` is only supported on editable elements.");if(se(e),e.ownerDocument.activeElement!==e)throw new Error("The element to be cleared could not be focused.");if(pa(e),!Rm(e))throw new Error("The element content to be cleared could not be selected.");_e(this,e,"","deleteContentBackward")}async function hb(e,t){return Eb.call(this,!0,e,t)}async function gb(e,t){return Eb.call(this,!1,e,t)}async function Eb(e,t,r){if(!e&&!t.multiple)throw I().getElementError("Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.",t);let n=Array.isArray(r)?r:[r],o=Array.from(t.querySelectorAll('option, [role="option"]')),i=n.map(s=>{if(typeof s!="string"&&o.includes(s))return s;{let l=o.find(u=>u.value===s||u.innerHTML===s);if(l)return l;throw I().getElementError(`Value "${String(s)}" not found in options`,t)}}).filter(s=>!te(s));if(te(t)||!i.length)return;let a=s=>{s.selected=e,this.dispatchUIEvent(t,"input",{bubbles:!0,cancelable:!1,composed:!0}),this.dispatchUIEvent(t,"change")};if(x(t,"select"))if(t.multiple)for(let s of i){let l=this.config.pointerEventsCheck===0?!0:kt(this,s);l&&(this.dispatchUIEvent(s,"pointerover"),this.dispatchUIEvent(t,"pointerenter"),this.dispatchUIEvent(s,"mouseover"),this.dispatchUIEvent(t,"mouseenter"),this.dispatchUIEvent(s,"pointermove"),this.dispatchUIEvent(s,"mousemove"),this.dispatchUIEvent(s,"pointerdown"),this.dispatchUIEvent(s,"mousedown")),se(t),l&&(this.dispatchUIEvent(s,"pointerup"),this.dispatchUIEvent(s,"mouseup")),a(s),l&&this.dispatchUIEvent(s,"click"),await Re(this.config)}else if(i.length===1){let s=this.config.pointerEventsCheck===0?!0:kt(this,t);s?await this.click(t):se(t),a(i[0]),s&&(this.dispatchUIEvent(t,"pointerover"),this.dispatchUIEvent(t,"pointerenter"),this.dispatchUIEvent(t,"mouseover"),this.dispatchUIEvent(t,"mouseenter"),this.dispatchUIEvent(t,"pointerup"),this.dispatchUIEvent(t,"mouseup"),this.dispatchUIEvent(t,"click")),await Re(this.config)}else throw I().getElementError("Cannot select multiple options on a non-multiple select",t);else if(t.getAttribute("role")==="listbox")for(let s of i)await this.click(s),await this.unhover(s);else throw I().getElementError("Cannot select options on elements that are neither select nor listbox elements",t)}async function wb(e,t,{skipClick:r=this.config.skipClick,skipAutoClose:n=this.config.skipAutoClose,initialSelectionStart:o,initialSelectionEnd:i}={}){e.disabled||(r||await this.click(e),o!==void 0&&at(e,o,i??o),await this.keyboard(t),n||await db(this))}var _b=Symbol("files and value properties are mocked");function Qs(e,t,r){r?Object.defineProperty(e,t,r):delete e[t]}function Cb(e,t){var r;(r=e[_b])===null||r===void 0||r.restore();let n=Object.getOwnPropertyDescriptor(e,"type"),o=Object.getOwnPropertyDescriptor(e,"value"),i=Object.getOwnPropertyDescriptor(e,"files");function a(){Qs(e,"type",n),Qs(e,"value",o),Qs(e,"files",i)}e[_b]={restore:a},Object.defineProperties(e,{files:{configurable:!0,get:()=>t},value:{configurable:!0,get:()=>t.length?`C:\\fakepath\\${t[0].name}`:"",set(s){if(s==="")a();else{var l;o==null||(l=o.set)===null||l===void 0||l.call(e,s)}}},type:{configurable:!0,get:()=>"file",set(s){s!=="file"&&(a(),e.type=s)}}})}async function Pb(e,t){let r=x(e,"label")?e.control:e;if(!r||!x(r,"input",{type:"file"}))throw new TypeError(`The ${r===e?"given":"associated"} ${r?.tagName} element does not accept file uploads`);if(te(e))return;let n=(Array.isArray(t)?t:[t]).filter(i=>!this.config.applyAccept||eq(i,r.accept)).slice(0,r.multiple?void 0:1),o=()=>{var i;n.length===((i=r.files)===null||i===void 0?void 0:i.length)&&n.every((a,s)=>{var l;return a===((l=r.files)===null||l===void 0?void 0:l.item(s))})||(Cb(r,Ft(V(e),n)),this.dispatchUIEvent(r,"input"),this.dispatchUIEvent(r,"change"))};r.addEventListener("fileDialog",o),await this.click(e),r.removeEventListener("fileDialog",o)}function wa(e){return e.toLowerCase().replace(/(\.|\/)jpg\b/g,"$1jpeg")}function eq(e,t){if(!t)return!0;let r=["audio/*","image/*","video/*"];return wa(t).trim().split(/\s*,\s*/).some(n=>n.startsWith(".")?wa(e.name).endsWith(n):r.includes(n)?wa(e.type).startsWith(n.replace("*","")):wa(e.type)===n)}var Ys={click:eb,dblClick:tb,tripleClick:rb,hover:nb,unhover:ob,tab:ib,keyboard:cb,copy:pb,cut:fb,paste:mb,pointer:vb,clear:yb,deselectOptions:gb,selectOptions:hb,type:wb,upload:Pb};function Tb(e){return I().asyncWrapper(e)}var Rb={applyAccept:!0,autoModify:!0,delay:0,document:globalThis.document,keyboardMap:Hm,pointerMap:Vm,pointerEventsCheck:lt.EachApiCall,skipAutoClose:!1,skipClick:!1,skipHover:!1,writeToClipboard:!1,advanceTimers:()=>Promise.resolve()},tq={...Rb,writeToClipboard:!0};function Sb(e={},t=tq,r){let n=oq(e,r,t);return{...t,...e,document:n}}function xb(e={}){var t;let r=Sb(e);Ks(r.document),Ws(V(r.document).HTMLElement);let n=(t=r.document.defaultView)!==null&&t!==void 0?t:globalThis.window;return Il(n),Js(r).api}function ee({keyboardState:e,pointerState:t,...r}={},n){var o;let i=Sb(r,Rb,n);Ks(i.document),Ws(V(i.document).HTMLElement);let a=(o=t??e)!==null&&o!==void 0?o:new Tr;return{api:Js(i,a).api,system:a}}function rq(e){return Js({...this.config,...e},this.system).api}function nq(e,t){function r(...n){return st(e,re.Call),Tb(()=>t.apply(e,n).then(async o=>(await Re(e.config),o)))}return Object.defineProperty(r,"name",{get:()=>t.name}),r}function Js(e,t=new Tr){let r={};return Object.assign(r,{config:e,dispatchEvent:Vs.bind(r),dispatchUIEvent:Om.bind(r),system:t,levelRefs:{},...Ys}),{instance:r,api:{...Object.fromEntries(Object.entries(Ys).map(([n,o])=>[n,nq(r,o)])),setup:rq.bind(r)}}}function oq(e,t,r){var n,o;return(n=(o=e.document)!==null&&o!==void 0?o:t&&Um(t))!==null&&n!==void 0?n:r.document}var Zs={};Wb(Zs,{clear:()=>iq,click:()=>aq,copy:()=>sq,cut:()=>lq,dblClick:()=>uq,deselectOptions:()=>cq,hover:()=>dq,keyboard:()=>pq,paste:()=>mq,pointer:()=>fq,selectOptions:()=>bq,tab:()=>Eq,tripleClick:()=>vq,type:()=>yq,unhover:()=>hq,upload:()=>gq});function iq(e){return ee().api.clear(e)}function aq(e,t={}){return ee(t,e).api.click(e)}function sq(e={}){return ee(e).api.copy()}function lq(e={}){return ee(e).api.cut()}function uq(e,t={}){return ee(t).api.dblClick(e)}function cq(e,t,r={}){return ee(r).api.deselectOptions(e,t)}function dq(e,t={}){return ee(t).api.hover(e)}async function pq(e,t={}){let{api:r,system:n}=ee(t);return r.keyboard(e).then(()=>n)}async function fq(e,t={}){let{api:r,system:n}=ee(t);return r.pointer(e).then(()=>n)}function mq(e,t){return ee(t).api.paste(e)}function bq(e,t,r={}){return ee(r).api.selectOptions(e,t)}function vq(e,t={}){return ee(t).api.tripleClick(e)}function yq(e,t,r={}){return ee(r,e).api.type(e,t,r)}function hq(e,t={}){let{api:r,system:n}=ee(t);return n.pointer.setMousePosition({target:e}),r.unhover(e)}function gq(e,t,r={}){return ee(r).api.upload(e,t)}function Eq(e={}){return ee().api.tab(e)}var _a={...Zs,setup:xb};var qb=!1,Ab=!1,el=null;function wq(e){return new Promise(t=>setTimeout(t,e))}function Mb(e){try{if(typeof e=="string")return new URL(e,_q()).href;if(e instanceof URL)return e.href;if(typeof Request<"u"&&e instanceof Request)return e.url}catch{}return String(e)}function _q(){try{if(typeof location<"u"&&location.href)return location.href}catch{}return"http://localhost/"}function Cq(e,t){if(t?.method)return String(t.method).toUpperCase();try{if(typeof Request<"u"&&e instanceof Request&&e.method)return String(e.method).toUpperCase()}catch{}return"GET"}function Pq(e,t){let r=t?.body;if(typeof r=="string")return r;try{if(typeof Request<"u"&&e instanceof Request)return}catch{}}function Tq(e){let t=Mr(e.headers),r={};for(let n of t)r[n.name]=n.value;return new Response(Bt(e.body),{status:e.statusCode,headers:r})}async function Rq(e,t,r){let n=Mb(t),o=Cq(t,r),i=Nt(el?.()??[],n,o);if(!i)return e(t,r);let a={url:n,method:o,headers:void 0,postData:Pq(t,r),timestamp:Date.now()};if(Lt(i,a),i.aborted)throw new TypeError(`Spectra.intercept() aborted ${o} ${n} (${i.abortReason||"Failed"})`);let s=Dt(i);return s.delayMs&&s.delayMs>0&&await wq(s.delayMs),Tq(s)}function Sq(){let e=globalThis.XMLHttpRequest;function t(){let r=new e,n="GET",o="",i=e.prototype.open.bind(r),a=e.prototype.send.bind(r);return r.open=(s,l,...u)=>{n=String(s).toUpperCase(),o=Mb(l);let[c=!0,d,m]=u;return i(s,l,c,d,m)},r.send=s=>{let l=Nt(el?.()??[],o,n);if(!l)return a(s);let u={url:o,method:n,headers:void 0,postData:typeof s=="string"?s:void 0,timestamp:Date.now()};Lt(l,u);let c=()=>{r.dispatchEvent(new Event("error"))};if(l.aborted){setTimeout(c,0);return}let d=Dt(l),m=()=>{let y=Bt(d.body);Object.defineProperties(r,{status:{value:d.statusCode,configurable:!0},statusText:{value:d.statusCode===200?"OK":`${d.statusCode} Mocked`,configurable:!0},responseText:{value:y,configurable:!0},response:{value:y,configurable:!0},readyState:{value:4,configurable:!0}}),r.dispatchEvent(new Event("readystatechange")),r.dispatchEvent(new Event("load")),r.dispatchEvent(new Event("loadend"))};d.delayMs&&d.delayMs>0?setTimeout(m,d.delayMs):setTimeout(m,0)},r}t.prototype=e.prototype,globalThis.XMLHttpRequest=t}function kb(e){if(el=e,!qb&&typeof globalThis.fetch=="function"){let t=globalThis.fetch.bind(globalThis);globalThis.fetch=(r,n)=>Rq(t,r,n),qb=!0}!Ab&&typeof globalThis.XMLHttpRequest=="function"&&(Sq(),Ab=!0)}function ft(){return _a.setup({delay:null})}function Ca(e){return _l(e.trim())??e.trim()}function Nb(e,t){let r=Ca(e),o=(()=>{if(t===null)return document.querySelector(r);let a=Array.from(document.querySelectorAll(r));return t>=0?a[t]??null:a[a.length+t]??null})();if(o!==null)return o;let i=Ia(e.trim());return i?Cl(i.name,document,t):null}function et(e){return typeof e=="string"?e:e.selector}function Ob(e,t){return t==null?e[0]??null:t>=0?e[t]??null:e[e.length+t]??null}function tl(e,t){if(!t)return!0;try{return e.matches(t)}catch{return!1}}function Pa(e,t){let r=wl(e);if(!r)return;if(r.kind==="nth"){let a=U(r.base,Number.parseInt(r.arg,10));return a?[a]:[]}let n=t?{selector:r.base,index:null,parent:t}:r.base,o=U(n,null);if(r.kind==="parent")return o?.parentElement?[o.parentElement]:[];if(r.kind==="closest"){let a=o?.closest(r.arg)??null;return a?[a]:[]}if(!o)return[];if(r.kind==="children")return Array.from(o.children).filter(a=>tl(a,r.arg));if(r.kind==="siblings"){let a=o.parentElement;return a?Array.from(a.children).filter(s=>s!==o&&tl(s,r.arg)):[]}let i=o.nextElementSibling;for(;i&&!tl(i,r.arg);)i=i.nextElementSibling;return i?[i]:[]}function U(e,t){if(typeof e=="string"){let s=Pa(e,void 0);return s!==void 0?Ob(s,t):Nb(e,t)}let r=Pa(e.selector,e.parent);if(r!==void 0)return Ob(r,e.index??t);let n=e.parent?U(e.parent,e.parent.index):document.documentElement;if(!n)return null;let o=Ca(e.selector),i=Array.from(n.querySelectorAll(o)),a=e.index??t;return a==null?i[0]??null:a>=0?i[a]??null:i[i.length+a]??null}function Ib(e){let t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"}function rl(e){if(e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA")return null;let t=e;return t.tagName==="INPUT"&&hl.includes(t.type)?null:typeof t.value=="string"?t.value:null}var Ta=class{mockRules=[];consoleErrors=[];recordedNetwork=[];async waitForScopedEl(t,r){let n=U(t,r);if(n)return n;let o=null;if(!await globalThis.__TS_RUNTIME__.pollCondition(async()=>(o=U(t,r),o!==null),globalThis.__TS_RUNTIME__.getImplicitWaitMs())||!o)throw new Error("Element not found: "+et(t));return o}async connect(){}async close(){}async navigate(t){throw new Error("Spectra.navigate() is not supported in component testing mode. Use Spectra.mount(<Component />) to render a component tree instead of navigating a URL.")}async setCookies(t,r){let n=Array.isArray(t)?t:[t];for(let o of n)typeof document<"u"&&(document.cookie=o)}async back(){throw new Error("Spectra.back() is not supported in component testing mode.")}async forward(){throw new Error("Spectra.forward() is not supported in component testing mode.")}async refresh(){throw new Error("Spectra.refresh() is not supported in component testing mode.")}async setViewport(t,r){try{window.resizeTo(t,r)}catch{}}async pause(t){await new Promise(r=>setTimeout(r,t))}async click(t,r=null){let n=await this.waitForScopedEl(t,r);await ft().click(n)}async doubleClick(t,r=null){let n=await this.waitForScopedEl(t,r);await ft().dblClick(n)}async rightClick(t,r=null){let n=await this.waitForScopedEl(t,r);await ft().pointer({keys:"[MouseRight]",target:n})}async setValue(t,r,n=null){let o=await this.waitForScopedEl(t,n);if(!Ib(o))throw new Error("Element is not a form field: "+et(t));if(o.tagName==="INPUT"&&o.type==="file")return this.upload(t,r,n);let i=String(r),a=ft();await a.clear(o);let s=rl(o);if(i.length>0){if(await a.type(o,i),ka(i,rl(o),s))return;o.focus(),await a.clear(o),await a.type(o,i);let l=rl(o);if(!ka(i,l,s))throw gl(et(t),i,l??"")}}async upload(t,r,n=null){let o=await this.waitForScopedEl(t,n),i=Array.isArray(r)?r:[r],a=[],s={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",webp:"image/webp",pdf:"application/pdf",json:"application/json",txt:"text/plain",csv:"text/csv"};for(let l of i)if(typeof l=="string"){let u="file.bin",c="application/octet-stream",d;if(l.startsWith("data:")){let m=l.indexOf(","),y=l.slice(0,m),P=l.slice(m+1),C=y.match(/data:([^;]+)/);C&&(c=C[1]);let T=y.match(/(?:name|filename)=([^;]+)/i);T?u=decodeURIComponent(T[1]):u=`fixture.${c.split("/")[1]||"bin"}`;try{let f=atob(P),g=new Uint8Array(f.length);for(let w=0;w<f.length;w++)g[w]=f.charCodeAt(w);d=new Blob([g],{type:c})}catch{d=new Blob([P],{type:c})}}else{u=l.split("?")[0].split("#")[0].split("/").pop()?.split("\\").pop()||"fixture.bin";let y=u.split(".").pop()?.toLowerCase()||"";c=s[y]||"application/octet-stream",d=new Blob(["Mock file content for "+u],{type:c})}a.push(new File([d],u,{type:c}))}else if(l instanceof File)a.push(l);else if(l&&typeof l=="object"&&"name"in l){let u=l,c=u.type||"application/octet-stream",d;if(u.base64)try{let m=atob(u.base64),y=new Uint8Array(m.length);for(let P=0;P<m.length;P++)y[P]=m.charCodeAt(P);d=new Blob([y],{type:c})}catch{d=new Blob([u.base64],{type:c})}else d=new Blob([u.content||"Mock content"],{type:c});a.push(new File([d],u.name,{type:c}))}if(a.length>0){let l=new DataTransfer;for(let u of a)l.items.add(u);o.files=l.files,o.dispatchEvent(new Event("input",{bubbles:!0})),o.dispatchEvent(new Event("change",{bubbles:!0}))}}async clearValue(t,r=null){let n=await this.waitForScopedEl(t,r);await ft().clear(n)}async select(t,r,n=null){if(!await globalThis.__TS_RUNTIME__.pollCondition(async()=>{let i=U(t,n);if(!i||i.tagName!=="SELECT")return!1;for(let a=0;a<i.options.length;a++){let s=i.options[a];if(s.text===r||s.value===r)return i.selectedIndex=a,i.dispatchEvent(new Event("change",{bubbles:!0})),!0}return!1}))throw new Error("Select option not found: "+JSON.stringify(r))}async hover(t,r=null){let n=await this.waitForScopedEl(t,r);await ft().hover(n)}async focus(t,r=null){if(!await globalThis.__TS_RUNTIME__.pollCondition(async()=>{let o=U(t,r);return o?(o.focus?.(),!0):!1}))throw new Error("Element not found: "+et(t))}async blur(t,r=null){if(!await globalThis.__TS_RUNTIME__.pollCondition(async()=>{let o=U(t,r);return o?(o.blur?.(),!0):!1}))throw new Error("Element not found: "+et(t))}async waitForElementRemoved(t,r=5e3,n=null){if(!await globalThis.__TS_RUNTIME__.pollCondition(async()=>!await this.isExisting(t,n),r))throw new Error("Element still exists after timeout: "+et(t))}async waitForUndisplayed(t,r,n=null){if(!await globalThis.__TS_RUNTIME__.pollCondition(async()=>!await this.isDisplayed(t,n),r?.timeout??5e3))throw new Error("Element still displayed after timeout: "+et(t))}async waitForClickable(t,r,n=null){return await globalThis.__TS_RUNTIME__.pollCondition(async()=>this.isClickable(t,n),r?.timeout??5e3)}async getBounds(t,r=null){let n=U(t,r);if(!n)return{x:0,y:0,top:0,right:0,bottom:0,left:0,width:0,height:0};let o=n.getBoundingClientRect();return{x:o.x,y:o.y,top:o.top,right:o.right,bottom:o.bottom,left:o.left,width:o.width,height:o.height}}async closest(t,r,n=null){let o=U(t,n);if(!o)return null;let i=o.closest(r);return i?i.tagName.toLowerCase():null}async clickAt(t,r){document.elementFromPoint(t,r)?.click()}async dragDrop(t,r,n=null){let o=U(t,n),i=Nb(r,null);if(!o||!i)throw new Error("Drag source or destination not found");let a=new DataTransfer;o.dispatchEvent(new DragEvent("dragstart",{bubbles:!0,dataTransfer:a})),i.dispatchEvent(new DragEvent("dragover",{bubbles:!0,dataTransfer:a})),i.dispatchEvent(new DragEvent("drop",{bubbles:!0,dataTransfer:a})),o.dispatchEvent(new DragEvent("dragend",{bubbles:!0,dataTransfer:a}))}async longPress(t,r,n=null){let o=U(t,n);if(!o)throw new Error("Element not found: "+et(t));o.dispatchEvent(new TouchEvent("touchstart",{bubbles:!0})),await this.pause(r),o.dispatchEvent(new TouchEvent("touchend",{bubbles:!0}))}async scrollIntoView(t,r=null){U(t,r)?.scrollIntoView({block:"center",inline:"center"})}async getText(t,r=null){let n=U(t,r);return n?n.textContent??"":""}async getValue(t,r=null){let n=U(t,r);return n?Ib(n)?n.value??"":n.getAttribute("value")||"":""}async isDisplayed(t,r=null){let n=U(t,r);if(!n)return!1;let o=window.getComputedStyle(n);if(o.visibility==="hidden"||o.display==="none"||o.opacity==="0")return!1;let i=n.getBoundingClientRect();return i.width>0&&i.height>0||n.getClientRects().length>0||n.offsetWidth>0&&n.offsetHeight>0}async isExisting(t,r=null){return U(t,r)!==null}async isEnabled(t,r=null){let n=U(t,r);return n?!n.disabled&&!n.hasAttribute("disabled")&&!n.classList.contains("disabled")&&n.getAttribute("aria-disabled")!=="true":!1}async isSelected(t,r=null){let n=U(t,r);return n?!!n.checked||n.getAttribute("aria-checked")==="true"||n.getAttribute("data-state")==="checked":!1}async isFocused(t,r=null){let n=U(t,r);return n?document.activeElement===n||n.matches(":focus"):!1}async isClickable(t,r=null){let n=U(t,r);if(!n)return!1;let o=window.getComputedStyle(n);if(o.visibility==="hidden"||o.display==="none"||o.opacity==="0")return!1;let i=n.getBoundingClientRect();return i.width===0&&i.height===0?!1:!n.disabled&&!n.hasAttribute("disabled")&&!n.classList.contains("disabled")&&n.getAttribute("aria-disabled")!=="true"}async hasClass(t,r,n=null){let o=U(t,n);return o?o.classList.contains(r):!1}async getAttribute(t,r,n=null){let o=U(t,n);return o?o.getAttribute(r):null}async getCSSProperty(t,r,n=null){let o=U(t,n);return{value:o?window.getComputedStyle(o).getPropertyValue(r):""}}async count(t){if(typeof t=="string"){let o=Pa(t,void 0);return o!==void 0?o.length:document.querySelectorAll(Ca(t)).length}let r=Pa(t.selector,t.parent);if(r!==void 0)return r.length;let n=t.parent?U(t.parent,t.parent.index):document.documentElement;return n?n.querySelectorAll(Ca(t.selector)).length:0}async pressKey(t){let r=El(t);if(r?.code){await ft().keyboard(`{${r.code}}`);return}let n=document.activeElement||document.body,o=String(t);n.dispatchEvent(new KeyboardEvent("keydown",{key:o,bubbles:!0})),n.dispatchEvent(new KeyboardEvent("keyup",{key:o,bubbles:!0}))}async scroll(t={}){if(t.selector){await this.scrollIntoView(String(t.selector),null);return}let r=t.direction||"down",n=t.pixels||500,o=r==="up"?-n:r==="down"?n:0,i=r==="left"?-n:r==="right"?n:0;window.scrollBy(i,o)}async swipe(t){let r=t.distance||300,n=t.direction==="up"?r:t.direction==="down"?-r:0,o=t.direction==="left"?r:t.direction==="right"?-r:0;window.scrollBy(o,n)}async grantPermission(t){}async getUrl(){return window.location.href}async getTitle(){return document.title}async execute(t,...r){if(typeof t=="function"){let n=r.map(o=>{let i=Aa(o);return i?U(i,null):o});return t(...n)}return new Function(`return (${t});`)()}async evaluate(t){return new Function(`return (${t});`)()}async waitUntil(t,r){let n=await globalThis.__TS_RUNTIME__.pollCondition(t,r?.timeout);if(!n)throw new Error(r?.timeoutMsg||"waitUntil() condition was not met in time");return n}async getLogs(t){return[]}async shouldHaveUrl(t){let r=await this.getUrl();if(r!==t)throw new Error(`Expected browser URL to be "${t}", but got "${r}"`)}async shouldContainUrl(t){let r=await this.getUrl();if(!r.includes(t))throw new Error(`Expected browser URL to contain "${t}", but got "${r}"`)}async shouldHaveTitle(t){let r=await this.getTitle();if(r!==t)throw new Error(`Expected page title to be "${t}", but got "${r}"`)}async shouldContainTitle(t){let r=await this.getTitle();if(!r.includes(t))throw new Error(`Expected page title to contain "${t}", but got "${r}"`)}async shouldBeLoaded(){if(document.readyState!=="complete"&&document.readyState!=="interactive")throw new Error(`Expected document to be loaded, but readyState is "${document.readyState}"`)}async shouldHaveNoConsoleErrors(){if(this.consoleErrors.length>0)throw new Error(`Expected no console errors, but found ${this.consoleErrors.length}: ${this.consoleErrors.join("; ")}`)}async clearCookies(){document.cookie.split(";").forEach(t=>{let r=t.split("=")[0]?.trim();r&&(document.cookie=`${r}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`)})}async clearLocalStorage(){window.localStorage.clear()}async intercept(t,r,n,o){let i=Ar(t,r,n,o);return kb(()=>this.mockRules),this.mockRules.push(i),qr(i,()=>{let a=this.mockRules.indexOf(i);a!==-1&&this.mockRules.splice(a,1)})}clearMocks(){this.mockRules=[]}};var Ra="spectra-root",mt=null,Rr=null;async function xq(){if(typeof window<"u"&&window.__TESTSPECTRA_CREATE_ROOT__)return window.__TESTSPECTRA_CREATE_ROOT__;if(Rr)return Rr;try{let e=await import("react-dom/client");if(Rr=e.createRoot||e.default?.createRoot||e.default,Rr)return Rr}catch{}throw new Error("Could not find react-dom/client createRoot. Ensure react-dom is installed in your project.")}function qq(){let e=document.getElementById(Ra);return e||(e=document.createElement("div"),e.id=Ra,document.body.appendChild(e)),e}function Lb(){if(mt){try{mt.unmount()}catch{try{mt.render(null)}catch{}}mt=null}let e=document.getElementById(Ra);e&&(e.innerHTML="")}async function Db(e){let t=qq();mt||(mt=(await xq())(t));let r=(typeof e.type=="string"?e.type:e.type?.displayName||e.type?.name)||"component";return globalThis.__TS_RUNTIME__.trackStep("action",{type:"action",key:"mount",target:r,args:[]},async()=>(mt.render(e),await new Promise(n=>setTimeout(n,20)),globalThis.__TS_RUNTIME__.createElementProxy(`#${Ra}`)))}var Bb=new Ta;ol(Bb);globalThis.browser=Bb;globalThis.$=function(e){return ue(e)};globalThis.$$=function(e){return Te(e)};var nl=Pl();nl.mount=Db;nl.unmount=Lb;globalThis.Spectra=nl;(typeof globalThis.__vitest_browser_runner__<"u"||typeof globalThis.__vitest_worker__<"u")&&await La();typeof beforeEach=="function"&&beforeEach(e=>{let t=e?.task?.name||globalThis.__CURRENT_TEST_TITLE__;t&&(globalThis.__CURRENT_TEST_TITLE__=t,globalThis.__TS_RUNTIME__.emitEvent("TESTSPECTRA_TEST_START",JSON.stringify({title:t})))});typeof document<"u"&&document.addEventListener("click",e=>{e.target?.closest?.("a[href]")&&e.preventDefault()},!0);globalThis.__SPECTRA_READY__=!0;
|
|
64
64
|
/*! Bundled license information:
|
|
65
65
|
|
|
66
66
|
react-is/cjs/react-is.production.min.js:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testspectra/react",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.19",
|
|
4
4
|
"description": "Bundled Vitest browser-mode runner for React component testing with the TestSpectra Spectra.* DSL",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"testspectra",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"esbuild": "^0.28.2",
|
|
43
43
|
"playwright": "^1.48.0",
|
|
44
44
|
"vitest": "^2.1.8",
|
|
45
|
-
"@testspectra/matchers": "1.2.
|
|
45
|
+
"@testspectra/matchers": "1.2.19"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=18.0.0",
|