@dev-blinq/cucumber_client 1.0.1630-dev → 1.0.1632-dev

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.
@@ -1,29 +1,29 @@
1
- var Ar=class{getActualParent(t){if(!t||!(t instanceof Element))throw new Error("Invalid element provided");if(t.assignedSlot)return t.assignedSlot;let n=t.parentElement;if(n)return n;let r=t.parentNode;return r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host||null}getFullAncestorChain(t){if(!t||!(t instanceof Element))throw new Error("Invalid element provided");let n=[],r=t;for(;r;)n.push(r),r=this.getActualParent(r);return n}getFullAncestorChainToRoot(t,n){if(!t||!(t instanceof Element))throw new Error("Invalid element provided");if(!n||!(n instanceof Element))throw new Error("Invalid root provided");if(!this.containsElementCrossShadow(n,t))throw new Error("Root does not contain the element");let r=[],o=t;for(;o&&o!==n&&this.containsElementCrossShadow(n,o);)r.push(o),o=this.getActualParent(o);return o===n&&r.push(o),r}getClimbCountToParent(t,n){if(!t||!(t instanceof Element))throw new Error("Invalid element provided");if(!n||!(n instanceof Element))throw new Error("Invalid target parent provided");let r=0,o=t;for(;o&&o!==n;)o=this.getActualParent(o),r++;return o===n?r:-1}containsElementCrossShadow(t,n){if(!t||!(t instanceof Element))throw new Error("Invalid element provided");if(!n||!(n instanceof Element))throw new Error("Invalid target provided");let r=n;for(;r;){if(r===t)return!0;r=this.getActualParent(r)}return!1}findLowestCommonAncestor(t){if(!Array.isArray(t)||t.length===0)throw new Error("Invalid elements array provided");for(let r of t)if(!(r instanceof Element))throw new Error("All items in the array must be DOM Elements");let n=this.getFullAncestorChain(t[0]);n.reverse();for(let r=1;r<t.length;r++){let o=this.getFullAncestorChain(t[r]);o.reverse(),n=n.filter(u=>o.includes(u))}return n.length>0?n[n.length-1]:null}findBranchingParent(t,n){if(!Array.isArray(t)||t.length===0)throw new Error("Invalid elements array provided");if(!(n instanceof Element))throw new Error("Target must be a DOM Element");for(let u of t)if(!(u instanceof Element))throw new Error("All items in the array must be DOM Elements");if(!t.includes(n))return console.warn("Target element must be included in the elements array, returning null"),null;let r=this.getFullAncestorChain(n);r.reverse();let o=null;for(let u of r){let l=t.filter(h=>this.containsElementCrossShadow(u,h));if(l.length===1&&l[0]===n){o=u;break}}return o||null}},Ai=Ar;var Ha=Object.defineProperty;var Nt=(e,t)=>{for(var n in t)Ha(e,n,{get:t[n],enumerable:!0})};var Wa={};Nt(Wa,{__PW:()=>Me});var zi={};Nt(zi,{elementMatchesText:()=>an,elementText:()=>Se,getElementLabels:()=>bs,matchesAttributePart:()=>ys,matchesComponentAttribute:()=>ms,shouldSkipForTextMatching:()=>er});var Ji={};Nt(Ji,{cacheNormalizedWhitespaces:()=>Yi,escapeForAttributeSelector:()=>Ne,escapeForTextSelector:()=>Ae,escapeHTML:()=>za,escapeHTMLAttribute:()=>Ga,escapeRegExp:()=>Zt,escapeTemplateString:()=>Ka,escapeWithQuotes:()=>nn,isString:()=>Va,longestCommonSubstring:()=>eo,normalizeEscapedRegexQuotes:()=>rn,normalizeWhiteSpace:()=>we,quoteCSSAttributeValue:()=>et,toSnakeCase:()=>Wr,toTitleCase:()=>Xt,trimString:()=>Xi,trimStringWithEllipsis:()=>Mr});function nn(e,t="'"){let n=JSON.stringify(e),r=n.substring(1,n.length-1).replace(/\\"/g,'"');if(t==="'")return t+r.replace(/[']/g,"\\'")+t;if(t==='"')return t+r.replace(/["]/g,'\\"')+t;if(t==="`")return t+r.replace(/[`]/g,"`")+t;throw new Error("Invalid escape char")}function Ka(e){return e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}function Va(e){return typeof e=="string"||e instanceof String}function Xt(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Wr(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function et(e){return`"${e.replace(/["\\]/g,t=>"\\"+t)}"`}var Kt;function Yi(){Kt=new Map}function we(e){let t=Kt?.get(e);return t===void 0&&(t=e.replace(/[\u200b\u00ad]/g,"").trim().replace(/\s+/g," "),Kt?.set(e,t)),t}function rn(e){return e.replace(/(^|[^\\])(\\\\)*\\(['"`])/g,"$1$2$3")}function Qi(e){return e.unicode||e.unicodeSets?String(e):String(e).replace(/(^|[^\\])(\\\\)*(["'`])/g,"$1$2\\$3").replace(/>>/g,"\\>\\>")}function Ae(e,t){return typeof e!="string"?Qi(e):`${JSON.stringify(e)}${t?"s":"i"}`}function Ne(e,t){return typeof e!="string"?Qi(e):`"${e.replace(/\\/g,"\\\\").replace(/["]/g,'\\"')}"${t?"s":"i"}`}function Xi(e,t,n=""){if(e.length<=t)return e;let r=[...e];return r.length>t?r.slice(0,t-n.length).join("")+n:r.join("")}function Mr(e,t){return Xi(e,t,"\u2026")}function Zt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Zi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Ga(e){return e.replace(/[&<>"']/gu,t=>Zi[t])}function za(e){return e.replace(/[&<]/gu,t=>Zi[t])}function eo(e,t){let n=e.length,r=t.length,o=0,u=0,l=Array(n+1).fill(null).map(()=>Array(r+1).fill(0));for(let h=1;h<=n;h++)for(let p=1;p<=r;p++)e[h-1]===t[p-1]&&(l[h][p]=l[h-1][p-1]+1,l[h][p]>o&&(o=l[h][p],u=h));return e.slice(u-o,u)}var to={};Nt(to,{beginAriaCaches:()=>Xn,endAriaCaches:()=>Zn,getAriaChecked:()=>ns,getAriaDisabled:()=>tn,getAriaExpanded:()=>is,getAriaLabelledByElements:()=>es,getAriaLevel:()=>os,getAriaPressed:()=>ss,getAriaRole:()=>he,getAriaSelected:()=>ts,getCSSContent:()=>_t,getCheckedAllowMixed:()=>Io,getCheckedWithoutMixed:()=>Lo,getElementAccessibleDescription:()=>Rr,getElementAccessibleErrorMessage:()=>Co,getElementAccessibleName:()=>At,getReadonly:()=>Oo,isElementHiddenForAria:()=>Ce,isElementIgnoredForAria:()=>Zr,kAriaCheckedRoles:()=>zn,kAriaDisabledRoles:()=>as,kAriaExpandedRoles:()=>Yn,kAriaLevelRoles:()=>Qn,kAriaPressedRoles:()=>Jn,kAriaSelectedRoles:()=>Gn,receivesPointerEvents:()=>Po});var ce=function(e,t,n){return e>=t&&e<=n};function Te(e){return ce(e,48,57)}function Ni(e){return Te(e)||ce(e,65,70)||ce(e,97,102)}function Ja(e){return ce(e,65,90)}function Ya(e){return ce(e,97,122)}function Qa(e){return Ja(e)||Ya(e)}function Xa(e){return e>=128}function Un(e){return Qa(e)||Xa(e)||e===95}function Ci(e){return Un(e)||Te(e)||e===45}function Za(e){return ce(e,0,8)||e===11||ce(e,14,31)||e===127}function Et(e){return e===10}function De(e){return Et(e)||e===9||e===32}var ec=1114111,Kr=class extends Error{constructor(e){super(e),this.name="InvalidCharacterError"}};function tc(e){let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===13&&e.charCodeAt(n+1)===10&&(r=10,n++),(r===13||r===12)&&(r=10),r===0&&(r=65533),ce(r,55296,56319)&&ce(e.charCodeAt(n+1),56320,57343)){let o=r-55296,u=e.charCodeAt(n+1)-56320;r=Math.pow(2,16)+o*Math.pow(2,10)+u,n++}t.push(r)}return t}function ue(e){if(e<=65535)return String.fromCharCode(e);e-=Math.pow(2,16);let t=Math.floor(e/Math.pow(2,10))+55296,n=e%Math.pow(2,10)+56320;return String.fromCharCode(t)+String.fromCharCode(n)}function no(e){let t=tc(e),n=-1,r=[],o,u=0,l=0,h=0,p=function(){u+=1,h=l,l=0},b={line:u,column:l},v=function(U){return U>=t.length?-1:t[U]},y=function(U){if(U===void 0&&(U=1),U>3)throw"Spec Error: no more than three codepoints of lookahead.";return v(n+U)},m=function(U){return U===void 0&&(U=1),n+=U,o=v(n),Et(o)?p():l+=U,!0},w=function(){return n-=1,Et(o)?(u-=1,l=h):l-=1,b.line=u,b.column=l,!0},A=function(U){return U===void 0&&(U=o),U===-1},I=function(){},P=function(){},B=function(){if(q(),m(),De(o)){for(;De(y());)m();return new Wn}else{if(o===34)return te();if(o===35)if(Ci(y())||le(y(1),y(2))){let U=new mo("");return re(y(1),y(2),y(3))&&(U.type="id"),U.value=ze(),U}else return new de(o);else return o===36?y()===61?(m(),new ic):new de(o):o===39?te():o===40?new fo:o===41?new Vr:o===42?y()===61?(m(),new oc):new de(o):o===43?rt()?(w(),H()):new de(o):o===44?new co:o===45?rt()?(w(),H()):y(1)===45&&y(2)===62?(m(2),new io):Ee()?(w(),ee()):new de(o):o===46?rt()?(w(),H()):new de(o):o===58?new oo:o===59?new ao:o===60?y(1)===33&&y(2)===45&&y(3)===45?(m(3),new so):new de(o):o===64?re(y(1),y(2),y(3))?new go(ze()):new de(o):o===91?new ho:o===92?D()?(w(),ee()):(P(),new de(o)):o===93?new Pr:o===94?y()===61?(m(),new sc):new de(o):o===123?new lo:o===124?y()===61?(m(),new rc):y()===124?(m(),new po):new de(o):o===125?new uo:o===126?y()===61?(m(),new nc):new de(o):Te(o)?(w(),H()):Un(o)?(w(),ee()):A()?new jn:new de(o)}},q=function(){for(;y(1)===47&&y(2)===42;)for(m(2);;)if(m(),o===42&&y()===47){m();break}else if(A()){P();return}},H=function(){let U=ln();if(re(y(1),y(2),y(3))){let z=new ac;return z.value=U.value,z.repr=U.repr,z.type=U.type,z.unit=ze(),z}else if(y()===37){m();let z=new vo;return z.value=U.value,z.repr=U.repr,z}else{let z=new bo;return z.value=U.value,z.repr=U.repr,z.type=U.type,z}},ee=function(){let U=ze();if(U.toLowerCase()==="url"&&y()===40){for(m();De(y(1))&&De(y(2));)m();return y()===34||y()===39?new zt(U):De(y())&&(y(2)===34||y(2)===39)?new zt(U):Z()}else return y()===40?(m(),new zt(U)):new Gr(U)},te=function(U){U===void 0&&(U=o);let z="";for(;m();){if(o===U||A())return new zr(z);if(Et(o))return P(),w(),new ro;o===92?A(y())?I():Et(y())?m():z+=ue(se()):z+=ue(o)}throw new Error("Internal error")},Z=function(){let U=new yo("");for(;De(y());)m();if(A(y()))return U;for(;m();){if(o===41||A())return U;if(De(o)){for(;De(y());)m();return y()===41||A(y())?(m(),U):(ye(),new Bn)}else{if(o===34||o===39||o===40||Za(o))return P(),ye(),new Bn;if(o===92)if(D())U.value+=ue(se());else return P(),ye(),new Bn;else U.value+=ue(o)}}throw new Error("Internal error")},se=function(){if(m(),Ni(o)){let U=[o];for(let be=0;be<5&&Ni(y());be++)m(),U.push(o);De(y())&&m();let z=parseInt(U.map(function(be){return String.fromCharCode(be)}).join(""),16);return z>ec&&(z=65533),z}else return A()?65533:o},le=function(U,z){return!(U!==92||Et(z))},D=function(){return le(o,y())},re=function(U,z,be){return U===45?Un(z)||z===45||le(z,be):Un(U)?!0:U===92?le(U,z):!1},Ee=function(){return re(o,y(1),y(2))},fe=function(U,z,be){return U===43||U===45?!!(Te(z)||z===46&&Te(be)):U===46?!!Te(z):!!Te(U)},rt=function(){return fe(o,y(1),y(2))},ze=function(){let U="";for(;m();)if(Ci(o))U+=ue(o);else if(D())U+=ue(se());else return w(),U;throw new Error("Internal parse error")},ln=function(){let U="",z="integer";for((y()===43||y()===45)&&(m(),U+=ue(o));Te(y());)m(),U+=ue(o);if(y(1)===46&&Te(y(2)))for(m(),U+=ue(o),m(),U+=ue(o),z="number";Te(y());)m(),U+=ue(o);let be=y(1),G=y(2),Je=y(3);if((be===69||be===101)&&Te(G))for(m(),U+=ue(o),m(),U+=ue(o),z="number";Te(y());)m(),U+=ue(o);else if((be===69||be===101)&&(G===43||G===45)&&Te(Je))for(m(),U+=ue(o),m(),U+=ue(o),m(),U+=ue(o),z="number";Te(y());)m(),U+=ue(o);let it=He(U);return{type:z,value:it,repr:U}},He=function(U){return+U},ye=function(){for(;m();){if(o===41||A())return;D()&&se(),I()}},st=0;for(;!A(y());)if(r.push(B()),st++,st>t.length*2)throw new Error("I'm infinite-looping!");return r}var ae=class{tokenType="";value;toJSON(){return{token:this.tokenType}}toString(){return this.tokenType}toSource(){return""+this}},ro=class extends ae{tokenType="BADSTRING"},Bn=class extends ae{tokenType="BADURL"},Wn=class extends ae{tokenType="WHITESPACE";toString(){return"WS"}toSource(){return" "}},so=class extends ae{tokenType="CDO";toSource(){return"<!--"}},io=class extends ae{tokenType="CDC";toSource(){return"-->"}},oo=class extends ae{tokenType=":"},ao=class extends ae{tokenType=";"},co=class extends ae{tokenType=","},Ct=class extends ae{value="";mirror=""},lo=class extends Ct{tokenType="{";constructor(){super(),this.value="{",this.mirror="}"}},uo=class extends Ct{tokenType="}";constructor(){super(),this.value="}",this.mirror="{"}},ho=class extends Ct{tokenType="[";constructor(){super(),this.value="[",this.mirror="]"}},Pr=class extends Ct{tokenType="]";constructor(){super(),this.value="]",this.mirror="["}},fo=class extends Ct{tokenType="(";constructor(){super(),this.value="(",this.mirror=")"}},Vr=class extends Ct{tokenType=")";constructor(){super(),this.value=")",this.mirror="("}},nc=class extends ae{tokenType="~="},rc=class extends ae{tokenType="|="},sc=class extends ae{tokenType="^="},ic=class extends ae{tokenType="$="},oc=class extends ae{tokenType="*="},po=class extends ae{tokenType="||"},jn=class extends ae{tokenType="EOF";toSource(){return""}},de=class extends ae{tokenType="DELIM";value="";constructor(e){super(),this.value=ue(e)}toString(){return"DELIM("+this.value+")"}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e}toSource(){return this.value==="\\"?`\\
1
+ var Ar=class{getActualParent(t){if(!t||!(t instanceof Element))throw new Error("Invalid element provided");if(t.assignedSlot)return t.assignedSlot;let n=t.parentElement;if(n)return n;let r=t.parentNode;return r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host||null}getFullAncestorChain(t){if(!t||!(t instanceof Element))throw new Error("Invalid element provided");let n=[],r=t;for(;r;)n.push(r),r=this.getActualParent(r);return n}getFullAncestorChainToRoot(t,n){if(!t||!(t instanceof Element))throw new Error("Invalid element provided");if(!n||!(n instanceof Element))throw new Error("Invalid root provided");if(!this.containsElementCrossShadow(n,t))throw new Error("Root does not contain the element");let r=[],o=t;for(;o&&o!==n&&this.containsElementCrossShadow(n,o);)r.push(o),o=this.getActualParent(o);return o===n&&r.push(o),r}getClimbCountToParent(t,n){if(!t||!(t instanceof Element))throw new Error("Invalid element provided");if(!n||!(n instanceof Element))throw new Error("Invalid target parent provided");let r=0,o=t;for(;o&&o!==n;)o=this.getActualParent(o),r++;return o===n?r:-1}containsElementCrossShadow(t,n){if(!t||!(t instanceof Element))throw new Error("Invalid element provided");if(!n||!(n instanceof Element))throw new Error("Invalid target provided");let r=n;for(;r;){if(r===t)return!0;r=this.getActualParent(r)}return!1}findLowestCommonAncestor(t){if(!Array.isArray(t)||t.length===0)throw new Error("Invalid elements array provided");for(let r of t)if(!(r instanceof Element))throw new Error("All items in the array must be DOM Elements");let n=this.getFullAncestorChain(t[0]);n.reverse();for(let r=1;r<t.length;r++){let o=this.getFullAncestorChain(t[r]);o.reverse(),n=n.filter(u=>o.includes(u))}return n.length>0?n[n.length-1]:null}findBranchingParent(t,n){if(!Array.isArray(t)||t.length===0)throw new Error("Invalid elements array provided");if(!(n instanceof Element))throw new Error("Target must be a DOM Element");for(let u of t)if(!(u instanceof Element))throw new Error("All items in the array must be DOM Elements");if(!t.includes(n))return console.warn("Target element must be included in the elements array, returning null"),null;let r=this.getFullAncestorChain(n);r.reverse();let o=null;for(let u of r){let l=t.filter(h=>this.containsElementCrossShadow(u,h));if(l.length===1&&l[0]===n){o=u;break}}return o||null}},Ai=Ar;var Ha=Object.defineProperty;var Nt=(e,t)=>{for(var n in t)Ha(e,n,{get:t[n],enumerable:!0})};var Wa={};Nt(Wa,{__PW:()=>Me});var zi={};Nt(zi,{elementMatchesText:()=>an,elementText:()=>Se,getElementLabels:()=>bs,matchesAttributePart:()=>ys,matchesComponentAttribute:()=>ms,shouldSkipForTextMatching:()=>er});var Ji={};Nt(Ji,{cacheNormalizedWhitespaces:()=>Yi,escapeForAttributeSelector:()=>Ne,escapeForTextSelector:()=>Ae,escapeHTML:()=>za,escapeHTMLAttribute:()=>Ga,escapeRegExp:()=>Zt,escapeTemplateString:()=>Ka,escapeWithQuotes:()=>nn,isString:()=>Va,longestCommonSubstring:()=>eo,normalizeEscapedRegexQuotes:()=>rn,normalizeWhiteSpace:()=>we,quoteCSSAttributeValue:()=>et,toSnakeCase:()=>Wr,toTitleCase:()=>Xt,trimString:()=>Xi,trimStringWithEllipsis:()=>Mr});function nn(e,t="'"){let n=JSON.stringify(e),r=n.substring(1,n.length-1).replace(/\\"/g,'"');if(t==="'")return t+r.replace(/[']/g,"\\'")+t;if(t==='"')return t+r.replace(/["]/g,'\\"')+t;if(t==="`")return t+r.replace(/[`]/g,"`")+t;throw new Error("Invalid escape char")}function Ka(e){return e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}function Va(e){return typeof e=="string"||e instanceof String}function Xt(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Wr(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function et(e){return`"${e.replace(/["\\]/g,t=>"\\"+t)}"`}var Kt;function Yi(){Kt=new Map}function we(e){let t=Kt?.get(e);return t===void 0&&(t=e.replace(/[\u200b\u00ad]/g,"").trim().replace(/\s+/g," "),Kt?.set(e,t)),t}function rn(e){return e.replace(/(^|[^\\])(\\\\)*\\(['"`])/g,"$1$2$3")}function Qi(e){return e.unicode||e.unicodeSets?String(e):String(e).replace(/(^|[^\\])(\\\\)*(["'`])/g,"$1$2\\$3").replace(/>>/g,"\\>\\>")}function Ae(e,t){return typeof e!="string"?Qi(e):`${JSON.stringify(e)}${t?"s":"i"}`}function Ne(e,t){return typeof e!="string"?Qi(e):`"${e.replace(/\\/g,"\\\\").replace(/["]/g,'\\"')}"${t?"s":"i"}`}function Xi(e,t,n=""){if(e.length<=t)return e;let r=[...e];return r.length>t?r.slice(0,t-n.length).join("")+n:r.join("")}function Mr(e,t){return Xi(e,t,"\u2026")}function Zt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Zi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Ga(e){return e.replace(/[&<>"']/gu,t=>Zi[t])}function za(e){return e.replace(/[&<]/gu,t=>Zi[t])}function eo(e,t){let n=e.length,r=t.length,o=0,u=0,l=Array(n+1).fill(null).map(()=>Array(r+1).fill(0));for(let h=1;h<=n;h++)for(let p=1;p<=r;p++)e[h-1]===t[p-1]&&(l[h][p]=l[h-1][p-1]+1,l[h][p]>o&&(o=l[h][p],u=h));return e.slice(u-o,u)}var to={};Nt(to,{beginAriaCaches:()=>Xn,endAriaCaches:()=>Zn,getAriaChecked:()=>ns,getAriaDisabled:()=>tn,getAriaExpanded:()=>is,getAriaLabelledByElements:()=>es,getAriaLevel:()=>os,getAriaPressed:()=>ss,getAriaRole:()=>he,getAriaSelected:()=>ts,getCSSContent:()=>_t,getCheckedAllowMixed:()=>Io,getCheckedWithoutMixed:()=>Lo,getElementAccessibleDescription:()=>Rr,getElementAccessibleErrorMessage:()=>Co,getElementAccessibleName:()=>At,getReadonly:()=>Oo,isElementHiddenForAria:()=>Ce,isElementIgnoredForAria:()=>Zr,kAriaCheckedRoles:()=>zn,kAriaDisabledRoles:()=>as,kAriaExpandedRoles:()=>Yn,kAriaLevelRoles:()=>Qn,kAriaPressedRoles:()=>Jn,kAriaSelectedRoles:()=>Gn,receivesPointerEvents:()=>Po});var ce=function(e,t,n){return e>=t&&e<=n};function Te(e){return ce(e,48,57)}function Ni(e){return Te(e)||ce(e,65,70)||ce(e,97,102)}function Ja(e){return ce(e,65,90)}function Ya(e){return ce(e,97,122)}function Qa(e){return Ja(e)||Ya(e)}function Xa(e){return e>=128}function Un(e){return Qa(e)||Xa(e)||e===95}function Ci(e){return Un(e)||Te(e)||e===45}function Za(e){return ce(e,0,8)||e===11||ce(e,14,31)||e===127}function Et(e){return e===10}function De(e){return Et(e)||e===9||e===32}var ec=1114111,Kr=class extends Error{constructor(e){super(e),this.name="InvalidCharacterError"}};function tc(e){let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===13&&e.charCodeAt(n+1)===10&&(r=10,n++),(r===13||r===12)&&(r=10),r===0&&(r=65533),ce(r,55296,56319)&&ce(e.charCodeAt(n+1),56320,57343)){let o=r-55296,u=e.charCodeAt(n+1)-56320;r=Math.pow(2,16)+o*Math.pow(2,10)+u,n++}t.push(r)}return t}function ue(e){if(e<=65535)return String.fromCharCode(e);e-=Math.pow(2,16);let t=Math.floor(e/Math.pow(2,10))+55296,n=e%Math.pow(2,10)+56320;return String.fromCharCode(t)+String.fromCharCode(n)}function no(e){let t=tc(e),n=-1,r=[],o,u=0,l=0,h=0,p=function(){u+=1,h=l,l=0},b={line:u,column:l},v=function(U){return U>=t.length?-1:t[U]},m=function(U){if(U===void 0&&(U=1),U>3)throw"Spec Error: no more than three codepoints of lookahead.";return v(n+U)},y=function(U){return U===void 0&&(U=1),n+=U,o=v(n),Et(o)?p():l+=U,!0},w=function(){return n-=1,Et(o)?(u-=1,l=h):l-=1,b.line=u,b.column=l,!0},A=function(U){return U===void 0&&(U=o),U===-1},I=function(){},P=function(){},B=function(){if(q(),y(),De(o)){for(;De(m());)y();return new Wn}else{if(o===34)return te();if(o===35)if(Ci(m())||le(m(1),m(2))){let U=new mo("");return re(m(1),m(2),m(3))&&(U.type="id"),U.value=ze(),U}else return new de(o);else return o===36?m()===61?(y(),new ic):new de(o):o===39?te():o===40?new fo:o===41?new Vr:o===42?m()===61?(y(),new oc):new de(o):o===43?rt()?(w(),H()):new de(o):o===44?new co:o===45?rt()?(w(),H()):m(1)===45&&m(2)===62?(y(2),new io):Ee()?(w(),ee()):new de(o):o===46?rt()?(w(),H()):new de(o):o===58?new oo:o===59?new ao:o===60?m(1)===33&&m(2)===45&&m(3)===45?(y(3),new so):new de(o):o===64?re(m(1),m(2),m(3))?new go(ze()):new de(o):o===91?new ho:o===92?D()?(w(),ee()):(P(),new de(o)):o===93?new Pr:o===94?m()===61?(y(),new sc):new de(o):o===123?new lo:o===124?m()===61?(y(),new rc):m()===124?(y(),new po):new de(o):o===125?new uo:o===126?m()===61?(y(),new nc):new de(o):Te(o)?(w(),H()):Un(o)?(w(),ee()):A()?new jn:new de(o)}},q=function(){for(;m(1)===47&&m(2)===42;)for(y(2);;)if(y(),o===42&&m()===47){y();break}else if(A()){P();return}},H=function(){let U=ln();if(re(m(1),m(2),m(3))){let z=new ac;return z.value=U.value,z.repr=U.repr,z.type=U.type,z.unit=ze(),z}else if(m()===37){y();let z=new vo;return z.value=U.value,z.repr=U.repr,z}else{let z=new bo;return z.value=U.value,z.repr=U.repr,z.type=U.type,z}},ee=function(){let U=ze();if(U.toLowerCase()==="url"&&m()===40){for(y();De(m(1))&&De(m(2));)y();return m()===34||m()===39?new zt(U):De(m())&&(m(2)===34||m(2)===39)?new zt(U):Z()}else return m()===40?(y(),new zt(U)):new Gr(U)},te=function(U){U===void 0&&(U=o);let z="";for(;y();){if(o===U||A())return new zr(z);if(Et(o))return P(),w(),new ro;o===92?A(m())?I():Et(m())?y():z+=ue(se()):z+=ue(o)}throw new Error("Internal error")},Z=function(){let U=new yo("");for(;De(m());)y();if(A(m()))return U;for(;y();){if(o===41||A())return U;if(De(o)){for(;De(m());)y();return m()===41||A(m())?(y(),U):(ye(),new Bn)}else{if(o===34||o===39||o===40||Za(o))return P(),ye(),new Bn;if(o===92)if(D())U.value+=ue(se());else return P(),ye(),new Bn;else U.value+=ue(o)}}throw new Error("Internal error")},se=function(){if(y(),Ni(o)){let U=[o];for(let be=0;be<5&&Ni(m());be++)y(),U.push(o);De(m())&&y();let z=parseInt(U.map(function(be){return String.fromCharCode(be)}).join(""),16);return z>ec&&(z=65533),z}else return A()?65533:o},le=function(U,z){return!(U!==92||Et(z))},D=function(){return le(o,m())},re=function(U,z,be){return U===45?Un(z)||z===45||le(z,be):Un(U)?!0:U===92?le(U,z):!1},Ee=function(){return re(o,m(1),m(2))},fe=function(U,z,be){return U===43||U===45?!!(Te(z)||z===46&&Te(be)):U===46?!!Te(z):!!Te(U)},rt=function(){return fe(o,m(1),m(2))},ze=function(){let U="";for(;y();)if(Ci(o))U+=ue(o);else if(D())U+=ue(se());else return w(),U;throw new Error("Internal parse error")},ln=function(){let U="",z="integer";for((m()===43||m()===45)&&(y(),U+=ue(o));Te(m());)y(),U+=ue(o);if(m(1)===46&&Te(m(2)))for(y(),U+=ue(o),y(),U+=ue(o),z="number";Te(m());)y(),U+=ue(o);let be=m(1),G=m(2),Je=m(3);if((be===69||be===101)&&Te(G))for(y(),U+=ue(o),y(),U+=ue(o),z="number";Te(m());)y(),U+=ue(o);else if((be===69||be===101)&&(G===43||G===45)&&Te(Je))for(y(),U+=ue(o),y(),U+=ue(o),y(),U+=ue(o),z="number";Te(m());)y(),U+=ue(o);let it=He(U);return{type:z,value:it,repr:U}},He=function(U){return+U},ye=function(){for(;y();){if(o===41||A())return;D()&&se(),I()}},st=0;for(;!A(m());)if(r.push(B()),st++,st>t.length*2)throw new Error("I'm infinite-looping!");return r}var ae=class{tokenType="";value;toJSON(){return{token:this.tokenType}}toString(){return this.tokenType}toSource(){return""+this}},ro=class extends ae{tokenType="BADSTRING"},Bn=class extends ae{tokenType="BADURL"},Wn=class extends ae{tokenType="WHITESPACE";toString(){return"WS"}toSource(){return" "}},so=class extends ae{tokenType="CDO";toSource(){return"<!--"}},io=class extends ae{tokenType="CDC";toSource(){return"-->"}},oo=class extends ae{tokenType=":"},ao=class extends ae{tokenType=";"},co=class extends ae{tokenType=","},Ct=class extends ae{value="";mirror=""},lo=class extends Ct{tokenType="{";constructor(){super(),this.value="{",this.mirror="}"}},uo=class extends Ct{tokenType="}";constructor(){super(),this.value="}",this.mirror="{"}},ho=class extends Ct{tokenType="[";constructor(){super(),this.value="[",this.mirror="]"}},Pr=class extends Ct{tokenType="]";constructor(){super(),this.value="]",this.mirror="["}},fo=class extends Ct{tokenType="(";constructor(){super(),this.value="(",this.mirror=")"}},Vr=class extends Ct{tokenType=")";constructor(){super(),this.value=")",this.mirror="("}},nc=class extends ae{tokenType="~="},rc=class extends ae{tokenType="|="},sc=class extends ae{tokenType="^="},ic=class extends ae{tokenType="$="},oc=class extends ae{tokenType="*="},po=class extends ae{tokenType="||"},jn=class extends ae{tokenType="EOF";toSource(){return""}},de=class extends ae{tokenType="DELIM";value="";constructor(e){super(),this.value=ue(e)}toString(){return"DELIM("+this.value+")"}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e}toSource(){return this.value==="\\"?`\\
2
2
  `:this.value}},It=class extends ae{value="";ASCIIMatch(e){return this.value.toLowerCase()===e.toLowerCase()}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e}},Gr=class extends It{constructor(e){super(),this.value=e}tokenType="IDENT";toString(){return"IDENT("+this.value+")"}toSource(){return sn(this.value)}},zt=class extends It{tokenType="FUNCTION";mirror;constructor(e){super(),this.value=e,this.mirror=")"}toString(){return"FUNCTION("+this.value+")"}toSource(){return sn(this.value)+"("}},go=class extends It{tokenType="AT-KEYWORD";constructor(e){super(),this.value=e}toString(){return"AT("+this.value+")"}toSource(){return"@"+sn(this.value)}},mo=class extends It{tokenType="HASH";type;constructor(e){super(),this.value=e,this.type="unrestricted"}toString(){return"HASH("+this.value+")"}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.type=this.type,e}toSource(){return this.type==="id"?"#"+sn(this.value):"#"+cc(this.value)}},zr=class extends It{tokenType="STRING";constructor(e){super(),this.value=e}toString(){return'"'+wo(this.value)+'"'}},yo=class extends It{tokenType="URL";constructor(e){super(),this.value=e}toString(){return"URL("+this.value+")"}toSource(){return'url("'+wo(this.value)+'")'}},bo=class extends ae{tokenType="NUMBER";type;repr;constructor(){super(),this.type="integer",this.repr=""}toString(){return this.type==="integer"?"INT("+this.value+")":"NUMBER("+this.value+")"}toJSON(){let e=super.toJSON();return e.value=this.value,e.type=this.type,e.repr=this.repr,e}toSource(){return this.repr}},vo=class extends ae{tokenType="PERCENTAGE";repr;constructor(){super(),this.repr=""}toString(){return"PERCENTAGE("+this.value+")"}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.repr=this.repr,e}toSource(){return this.repr+"%"}},ac=class extends ae{tokenType="DIMENSION";type;repr;unit;constructor(){super(),this.type="integer",this.repr="",this.unit=""}toString(){return"DIM("+this.value+","+this.unit+")"}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.type=this.type,e.repr=this.repr,e.unit=this.unit,e}toSource(){let e=this.repr,t=sn(this.unit);return t[0].toLowerCase()==="e"&&(t[1]==="-"||ce(t.charCodeAt(1),48,57))&&(t="\\65 "+t.slice(1,t.length)),e+t}};function sn(e){e=""+e;let t="",n=e.charCodeAt(0);for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o===0)throw new Kr("Invalid character: the input contains U+0000.");ce(o,1,31)||o===127||r===0&&ce(o,48,57)||r===1&&ce(o,48,57)&&n===45?t+="\\"+o.toString(16)+" ":o>=128||o===45||o===95||ce(o,48,57)||ce(o,65,90)||ce(o,97,122)?t+=e[r]:t+="\\"+e[r]}return t}function cc(e){e=""+e;let t="";for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===0)throw new Kr("Invalid character: the input contains U+0000.");r>=128||r===45||r===95||ce(r,48,57)||ce(r,65,90)||ce(r,97,122)?t+=e[n]:t+="\\"+r.toString(16)+" "}return t}function wo(e){e=""+e;let t="";for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===0)throw new Kr("Invalid character: the input contains U+0000.");ce(r,1,31)||r===127?t+="\\"+r.toString(16)+" ":r===34||r===92?t+="\\"+e[n]:t+=e[n]}return t}var Eo={};Nt(Eo,{box:()=>en,closestCrossShadow:()=>xt,elementSafeTagName:()=>pe,enclosingElement:()=>lc,enclosingShadowRootOrDocument:()=>Yr,getElementComputedStyle:()=>Fe,getGlobalOptions:()=>Vn,isElementStyleVisibilityVisible:()=>Qr,isElementVisible:()=>Ge,isInsideScope:()=>on,isVisibleTextNode:()=>Xr,parentElementOrShadowHost:()=>me,setGlobalOptions:()=>So});var Jr={};function So(e){Jr=e}function Vn(){return Jr}function on(e,t){for(;t;){if(e.contains(t))return!0;t=xo(t)}return!1}function lc(e){return e.nodeType===1?e:e.parentElement??void 0}function me(e){if(e.parentElement)return e.parentElement;if(e.parentNode&&e.parentNode.nodeType===11&&e.parentNode.host)return e.parentNode.host}function Yr(e){let t=e;for(;t.parentNode;)t=t.parentNode;if(t.nodeType===11||t.nodeType===9)return t}function xo(e){for(;e.parentElement;)e=e.parentElement;return me(e)}function xt(e,t,n){for(;e;){let r=e.closest(t);if(n&&r!==n&&r?.contains(n))return;if(r)return r;e=xo(e)}}function Fe(e,t){return e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,t):void 0}function Qr(e,t){if(t=t??Fe(e),!t)return!0;if(Element.prototype.checkVisibility&&Jr.browserNameForWorkarounds!=="webkit"){if(!e.checkVisibility())return!1}else{let n=e.closest("details,summary");if(n!==e&&n?.nodeName==="DETAILS"&&!n.open)return!1}return t.visibility==="visible"}function en(e){let t=Fe(e);if(!t)return{visible:!0};if(t.display==="contents"){for(let r=e.firstChild;r;r=r.nextSibling){if(r.nodeType===1&&Ge(r))return{visible:!0,style:t};if(r.nodeType===3&&Xr(r))return{visible:!0,style:t}}return{visible:!1,style:t}}if(!Qr(e,t))return{style:t,visible:!1};let n=e.getBoundingClientRect();return{rect:n,style:t,visible:n.width>0&&n.height>0}}function Ge(e){return en(e).visible}function Xr(e){let t=e.ownerDocument.createRange();t.selectNode(e);let n=t.getBoundingClientRect();return n.width>0&&n.height>0}function pe(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Ii(e){return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")}var Li="article:not([role]), aside:not([role]), main:not([role]), nav:not([role]), section:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]",uc=[["aria-atomic",void 0],["aria-busy",void 0],["aria-controls",void 0],["aria-current",void 0],["aria-describedby",void 0],["aria-details",void 0],["aria-dropeffect",void 0],["aria-flowto",void 0],["aria-grabbed",void 0],["aria-hidden",void 0],["aria-keyshortcuts",void 0],["aria-label",["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"]],["aria-labelledby",["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"]],["aria-live",void 0],["aria-owns",void 0],["aria-relevant",void 0],["aria-roledescription",["generic"]]];function To(e,t){return uc.some(([n,r])=>!r?.includes(t||"")&&e.hasAttribute(n))}function ko(e){return!Number.isNaN(Number(String(e.getAttribute("tabindex"))))}function hc(e){return!$o(e)&&(fc(e)||ko(e))}function fc(e){let t=pe(e);return["BUTTON","DETAILS","SELECT","TEXTAREA"].includes(t)?!0:t==="A"||t==="AREA"?e.hasAttribute("href"):t==="INPUT"?!e.hidden:!1}var Oi={A:e=>e.hasAttribute("href")?"link":null,AREA:e=>e.hasAttribute("href")?"link":null,ARTICLE:()=>"article",ASIDE:()=>"complementary",BLOCKQUOTE:()=>"blockquote",BUTTON:()=>"button",CAPTION:()=>"caption",CODE:()=>"code",DATALIST:()=>"listbox",DD:()=>"definition",DEL:()=>"deletion",DETAILS:()=>"group",DFN:()=>"term",DIALOG:()=>"dialog",DT:()=>"term",EM:()=>"emphasis",FIELDSET:()=>"group",FIGURE:()=>"figure",FOOTER:e=>xt(e,Li)?null:"contentinfo",FORM:e=>Ii(e)?"form":null,H1:()=>"heading",H2:()=>"heading",H3:()=>"heading",H4:()=>"heading",H5:()=>"heading",H6:()=>"heading",HEADER:e=>xt(e,Li)?null:"banner",HR:()=>"separator",HTML:()=>"document",IMG:e=>e.getAttribute("alt")===""&&!e.getAttribute("title")&&!To(e)&&!ko(e)?"presentation":"img",INPUT:e=>{let t=e.type.toLowerCase();if(t==="search")return e.hasAttribute("list")?"combobox":"searchbox";if(["email","tel","text","url",""].includes(t)){let n=Lt(e,e.getAttribute("list"))[0];return n&&pe(n)==="DATALIST"?"combobox":"textbox"}return t==="hidden"?null:t==="file"&&!Vn().inputFileRoleTextbox?"button":Sc[t]||"textbox"},INS:()=>"insertion",LI:()=>"listitem",MAIN:()=>"main",MARK:()=>"mark",MATH:()=>"math",MENU:()=>"list",METER:()=>"meter",NAV:()=>"navigation",OL:()=>"list",OPTGROUP:()=>"group",OPTION:()=>"option",OUTPUT:()=>"status",P:()=>"paragraph",PROGRESS:()=>"progressbar",SECTION:e=>Ii(e)?"region":null,SELECT:e=>e.hasAttribute("multiple")||e.size>1?"listbox":"combobox",STRONG:()=>"strong",SUB:()=>"subscript",SUP:()=>"superscript",SVG:()=>"img",TABLE:()=>"table",TBODY:()=>"rowgroup",TD:e=>{let t=xt(e,"table"),n=t?Kn(t):"";return n==="grid"||n==="treegrid"?"gridcell":"cell"},TEXTAREA:()=>"textbox",TFOOT:()=>"rowgroup",TH:e=>{if(e.getAttribute("scope")==="col")return"columnheader";if(e.getAttribute("scope")==="row")return"rowheader";let t=xt(e,"table"),n=t?Kn(t):"";return n==="grid"||n==="treegrid"?"gridcell":"cell"},THEAD:()=>"rowgroup",TIME:()=>"time",TR:()=>"row",UL:()=>"list"},dc={DD:["DL","DIV"],DIV:["DL"],DT:["DL","DIV"],LI:["OL","UL"],TBODY:["TABLE"],TD:["TR"],TFOOT:["TABLE"],TH:["TR"],THEAD:["TABLE"],TR:["THEAD","TBODY","TFOOT","TABLE"]};function $i(e){var t;let n=((t=Oi[pe(e)])==null?void 0:t.call(Oi,e))||"";if(!n)return null;let r=e;for(;r;){let o=me(r),u=dc[pe(r)];if(!u||!o||!u.includes(pe(o)))break;let l=Kn(o);if((l==="none"||l==="presentation")&&!_o(o,l))return l;r=o}return n}var pc=["alert","alertdialog","application","article","banner","blockquote","button","caption","cell","checkbox","code","columnheader","combobox","complementary","contentinfo","definition","deletion","dialog","directory","document","emphasis","feed","figure","form","generic","grid","gridcell","group","heading","img","insertion","link","list","listbox","listitem","log","main","mark","marquee","math","meter","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","navigation","none","note","option","paragraph","presentation","progressbar","radio","radiogroup","region","row","rowgroup","rowheader","scrollbar","search","searchbox","separator","slider","spinbutton","status","strong","subscript","superscript","switch","tab","table","tablist","tabpanel","term","textbox","time","timer","toolbar","tooltip","tree","treegrid","treeitem"];function Kn(e){return(e.getAttribute("role")||"").split(" ").map(n=>n.trim()).find(n=>pc.includes(n))||null}function _o(e,t){return To(e,t)||hc(e)}function he(e){let t=Kn(e);if(!t)return $i(e);if(t==="none"||t==="presentation"){let n=$i(e);if(_o(e,n))return n}return t}function Ao(e){return e===null?void 0:e.toLowerCase()==="true"}function Zr(e){return["STYLE","SCRIPT","NOSCRIPT","TEMPLATE"].includes(pe(e))}function Ce(e){if(Zr(e))return!0;let t=Fe(e),n=e.nodeName==="SLOT";if(t?.display==="contents"&&!n){for(let o=e.firstChild;o;o=o.nextSibling)if(o.nodeType===1&&!Ce(o)||o.nodeType===3&&Xr(o))return!1;return!0}return!(e.nodeName==="OPTION"&&!!e.closest("select"))&&!n&&!Qr(e,t)?!0:No(e)}function No(e){let t=Tt?.get(e);if(t===void 0){if(t=!1,e.parentElement&&e.parentElement.shadowRoot&&!e.assignedSlot&&(t=!0),!t){let n=Fe(e);t=!n||n.display==="none"||Ao(e.getAttribute("aria-hidden"))===!0}if(!t){let n=me(e);n&&(t=No(n))}Tt?.set(e,t)}return t}function Lt(e,t){if(!t)return[];let n=Yr(e);if(!n)return[];try{let r=t.split(" ").filter(u=>!!u),o=[];for(let u of r){let l=n.querySelector("#"+CSS.escape(u));l&&!o.includes(l)&&o.push(l)}return o}catch{return[]}}function Ue(e){return e.trim()}function Jt(e){return e.split("\xA0").map(t=>t.replace(/\r\n/g,`
3
- `).replace(/[\u200b\u00ad]/g,"").replace(/\s\s*/g," ")).join("\xA0").trim()}function Mi(e,t){let n=[...e.querySelectorAll(t)];for(let r of Lt(e,e.getAttribute("aria-owns")))r.matches(t)&&n.push(r),n.push(...r.querySelectorAll(t));return n}function _t(e,t){let n=t==="::before"?ds:t==="::after"?ps:fs;if(n?.has(e))return n?.get(e);let r=Fe(e,t),o;return r&&r.display!=="none"&&r.visibility!=="hidden"&&(o=gc(e,r.content,!!t)),t&&o!==void 0&&(r?.display||"inline")!=="inline"&&(o=" "+o+" "),n&&n.set(e,o),o}function gc(e,t,n){if(!(!t||t==="none"||t==="normal"))try{let r=no(t).filter(h=>!(h instanceof Wn)),o=r.findIndex(h=>h instanceof de&&h.value==="/");if(o!==-1)r=r.slice(o+1);else if(!n)return;let u=[],l=0;for(;l<r.length;)if(r[l]instanceof zr)u.push(r[l].value),l++;else if(l+2<r.length&&r[l]instanceof zt&&r[l].value==="attr"&&r[l+1]instanceof Gr&&r[l+2]instanceof Vr){let h=r[l+1].value;u.push(e.getAttribute(h)||""),l+=3}else return;return u.join("")}catch{}}function es(e){let t=e.getAttribute("aria-labelledby");if(t===null)return null;let n=Lt(e,t);return n.length?n:null}function mc(e,t){let n=["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"].includes(e),r=t&&["","caption","code","contentinfo","definition","deletion","emphasis","insertion","list","listitem","mark","none","paragraph","presentation","region","row","rowgroup","section","strong","subscript","superscript","table","term","time"].includes(e);return n||r}function At(e,t){let n=t?ls:cs,r=n?.get(e);return r===void 0&&(r="",["caption","code","definition","deletion","emphasis","generic","insertion","mark","paragraph","presentation","strong","subscript","suggestion","superscript","term","time"].includes(he(e)||"")||(r=Jt($e(e,{includeHidden:t,visitedElements:new Set,embeddedInTargetElement:"self"}))),n?.set(e,r)),r}function Rr(e,t){let n=t?hs:us,r=n?.get(e);if(r===void 0){if(r="",e.hasAttribute("aria-describedby")){let o=Lt(e,e.getAttribute("aria-describedby"));r=Jt(o.map(u=>$e(u,{includeHidden:t,visitedElements:new Set,embeddedInDescribedBy:{element:u,hidden:Ce(u)}})).join(" "))}else e.hasAttribute("aria-description")?r=Jt(e.getAttribute("aria-description")||""):r=Jt(e.getAttribute("title")||"");n?.set(e,r)}return r}function yc(e){let t=e.getAttribute("aria-invalid");return!t||t.trim()===""||t.toLocaleLowerCase()==="false"?"false":t==="true"||t==="grammar"||t==="spelling"?t:"true"}function bc(e){if("validity"in e){let t=e.validity;return t?.valid===!1}return!1}function Co(e){let t=Yt,n=Yt?.get(e);if(n===void 0){n="";let r=yc(e)!=="false",o=bc(e);if(r||o){let u=e.getAttribute("aria-errormessage");n=Lt(e,u).map(p=>Jt($e(p,{visitedElements:new Set,embeddedInDescribedBy:{element:p,hidden:Ce(p)}}))).join(" ").trim()}t?.set(e,n)}return n}function $e(e,t){var n,r,o,u;if(t.visitedElements.has(e))return"";let l={...t,embeddedInTargetElement:t.embeddedInTargetElement==="self"?"descendant":t.embeddedInTargetElement};if(!t.includeHidden){let m=!!((n=t.embeddedInLabelledBy)!=null&&n.hidden)||!!((r=t.embeddedInDescribedBy)!=null&&r.hidden)||!!((o=t.embeddedInNativeTextAlternative)!=null&&o.hidden)||!!((u=t.embeddedInLabel)!=null&&u.hidden);if(Zr(e)||!m&&Ce(e))return t.visitedElements.add(e),""}let h=es(e);if(!t.embeddedInLabelledBy){let m=(h||[]).map(w=>$e(w,{...t,embeddedInLabelledBy:{element:w,hidden:Ce(w)},embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0,embeddedInLabel:void 0,embeddedInNativeTextAlternative:void 0})).join(" ");if(m)return m}let p=he(e)||"",b=pe(e);if(t.embeddedInLabel||t.embeddedInLabelledBy||t.embeddedInTargetElement==="descendant"){let m=[...e.labels||[]].includes(e),w=(h||[]).includes(e);if(!m&&!w){if(p==="textbox")return t.visitedElements.add(e),b==="INPUT"||b==="TEXTAREA"?e.value:e.textContent||"";if(["combobox","listbox"].includes(p)){t.visitedElements.add(e);let A;if(b==="SELECT")A=[...e.selectedOptions],!A.length&&e.options.length&&A.push(e.options[0]);else{let I=p==="combobox"?Mi(e,"*").find(P=>he(P)==="listbox"):e;A=I?Mi(I,'[aria-selected="true"]').filter(P=>he(P)==="option"):[]}return!A.length&&b==="INPUT"?e.value:A.map(I=>$e(I,l)).join(" ")}if(["progressbar","scrollbar","slider","spinbutton","meter"].includes(p))return t.visitedElements.add(e),e.hasAttribute("aria-valuetext")?e.getAttribute("aria-valuetext")||"":e.hasAttribute("aria-valuenow")?e.getAttribute("aria-valuenow")||"":e.getAttribute("value")||"";if(["menu"].includes(p))return t.visitedElements.add(e),""}}let v=e.getAttribute("aria-label")||"";if(Ue(v))return t.visitedElements.add(e),v;if(!["presentation","none"].includes(p)){if(b==="INPUT"&&["button","submit","reset"].includes(e.type)){t.visitedElements.add(e);let m=e.value||"";return Ue(m)?m:e.type==="submit"?"Submit":e.type==="reset"?"Reset":e.getAttribute("title")||""}if(!Vn().inputFileRoleTextbox&&b==="INPUT"&&e.type==="file"){t.visitedElements.add(e);let m=e.labels||[];return m.length&&!t.embeddedInLabelledBy?jt(m,t):"Choose File"}if(b==="INPUT"&&e.type==="image"){t.visitedElements.add(e);let m=e.labels||[];if(m.length&&!t.embeddedInLabelledBy)return jt(m,t);let w=e.getAttribute("alt")||"";if(Ue(w))return w;let A=e.getAttribute("title")||"";return Ue(A)?A:"Submit"}if(!h&&b==="BUTTON"){t.visitedElements.add(e);let m=e.labels||[];if(m.length)return jt(m,t)}if(!h&&b==="OUTPUT"){t.visitedElements.add(e);let m=e.labels||[];return m.length?jt(m,t):e.getAttribute("title")||""}if(!h&&(b==="TEXTAREA"||b==="SELECT"||b==="INPUT")){t.visitedElements.add(e);let m=e.labels||[];if(m.length)return jt(m,t);let w=b==="INPUT"&&["text","password","search","tel","email","url"].includes(e.type)||b==="TEXTAREA",A=e.getAttribute("placeholder")||"",I=e.getAttribute("title")||"";return!w||I?I:A}if(!h&&b==="FIELDSET"){t.visitedElements.add(e);for(let w=e.firstElementChild;w;w=w.nextElementSibling)if(pe(w)==="LEGEND")return $e(w,{...l,embeddedInNativeTextAlternative:{element:w,hidden:Ce(w)}});return e.getAttribute("title")||""}if(!h&&b==="FIGURE"){t.visitedElements.add(e);for(let w=e.firstElementChild;w;w=w.nextElementSibling)if(pe(w)==="FIGCAPTION")return $e(w,{...l,embeddedInNativeTextAlternative:{element:w,hidden:Ce(w)}});return e.getAttribute("title")||""}if(b==="IMG"){t.visitedElements.add(e);let m=e.getAttribute("alt")||"";return Ue(m)?m:e.getAttribute("title")||""}if(b==="TABLE"){t.visitedElements.add(e);for(let w=e.firstElementChild;w;w=w.nextElementSibling)if(pe(w)==="CAPTION")return $e(w,{...l,embeddedInNativeTextAlternative:{element:w,hidden:Ce(w)}});let m=e.getAttribute("summary")||"";if(m)return m}if(b==="AREA"){t.visitedElements.add(e);let m=e.getAttribute("alt")||"";return Ue(m)?m:e.getAttribute("title")||""}if(b==="SVG"||e.ownerSVGElement){t.visitedElements.add(e);for(let m=e.firstElementChild;m;m=m.nextElementSibling)if(pe(m)==="TITLE"&&m.ownerSVGElement)return $e(m,{...l,embeddedInLabelledBy:{element:m,hidden:Ce(m)}})}if(e.ownerSVGElement&&b==="A"){let m=e.getAttribute("xlink:title")||"";if(Ue(m))return t.visitedElements.add(e),m}}let y=b==="SUMMARY"&&!["presentation","none"].includes(p);if(mc(p,t.embeddedInTargetElement==="descendant")||y||t.embeddedInLabelledBy||t.embeddedInDescribedBy||t.embeddedInLabel||t.embeddedInNativeTextAlternative){t.visitedElements.add(e);let m=vc(e,l);if(t.embeddedInTargetElement==="self"?Ue(m):m)return m}if(!["presentation","none"].includes(p)||b==="IFRAME"){t.visitedElements.add(e);let m=e.getAttribute("title")||"";if(Ue(m))return m}return t.visitedElements.add(e),""}function vc(e,t){let n=[],r=(u,l)=>{var h;if(!(l&&u.assignedSlot))if(u.nodeType===1){let p=((h=Fe(u))==null?void 0:h.display)||"inline",b=$e(u,t);(p!=="inline"||u.nodeName==="BR")&&(b=" "+b+" "),n.push(b)}else u.nodeType===3&&n.push(u.textContent||"")};n.push(_t(e,"::before")||"");let o=_t(e);if(o!==void 0)n.push(o);else{let u=e.nodeName==="SLOT"?e.assignedNodes():[];if(u.length)for(let l of u)r(l,!1);else{for(let l=e.firstChild;l;l=l.nextSibling)r(l,!0);if(e.shadowRoot)for(let l=e.shadowRoot.firstChild;l;l=l.nextSibling)r(l,!0);for(let l of Lt(e,e.getAttribute("aria-owns")))r(l,!0)}}return n.push(_t(e,"::after")||""),n.join("")}var Gn=["gridcell","option","row","tab","rowheader","columnheader","treeitem"];function ts(e){return pe(e)==="OPTION"?e.selected:Gn.includes(he(e)||"")?Ao(e.getAttribute("aria-selected"))===!0:!1}var zn=["checkbox","menuitemcheckbox","option","radio","switch","menuitemradio","treeitem"];function ns(e){let t=rs(e,!0);return t==="error"?!1:t}function Io(e){return rs(e,!0)}function Lo(e){return rs(e,!1)}function rs(e,t){let n=pe(e);if(t&&n==="INPUT"&&e.indeterminate)return"mixed";if(n==="INPUT"&&["checkbox","radio"].includes(e.type))return e.checked;if(zn.includes(he(e)||"")){let r=e.getAttribute("aria-checked");return r==="true"?!0:t&&r==="mixed"?"mixed":!1}return"error"}var wc=["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox","columnheader","rowheader","searchbox","switch","treegrid"];function Oo(e){let t=pe(e);return["INPUT","TEXTAREA","SELECT"].includes(t)?e.hasAttribute("readonly"):wc.includes(he(e)||"")?e.getAttribute("aria-readonly")==="true":e.isContentEditable?!1:"error"}var Jn=["button"];function ss(e){if(Jn.includes(he(e)||"")){let t=e.getAttribute("aria-pressed");if(t==="true")return!0;if(t==="mixed")return"mixed"}return!1}var Yn=["application","button","checkbox","combobox","gridcell","link","listbox","menuitem","row","rowheader","tab","treeitem","columnheader","menuitemcheckbox","menuitemradio","rowheader","switch"];function is(e){if(pe(e)==="DETAILS")return e.open;if(Yn.includes(he(e)||"")){let t=e.getAttribute("aria-expanded");return t===null?void 0:t==="true"}}var Qn=["heading","listitem","row","treeitem"];function os(e){let t={H1:1,H2:2,H3:3,H4:4,H5:5,H6:6}[pe(e)];if(t)return t;if(Qn.includes(he(e)||"")){let n=e.getAttribute("aria-level"),r=n===null?Number.NaN:Number(n);if(Number.isInteger(r)&&r>=1)return r}return 0}var as=["application","button","composite","gridcell","group","input","link","menuitem","scrollbar","separator","tab","checkbox","columnheader","combobox","grid","listbox","menu","menubar","menuitemcheckbox","menuitemradio","option","radio","radiogroup","row","rowheader","searchbox","select","slider","spinbutton","switch","tablist","textbox","toolbar","tree","treegrid","treeitem"];function tn(e){return $o(e)||Mo(e)}function $o(e){return["BUTTON","INPUT","SELECT","TEXTAREA","OPTION","OPTGROUP"].includes(e.tagName)&&(e.hasAttribute("disabled")||Ec(e))}function Ec(e){let t=e?.closest("FIELDSET[DISABLED]");if(!t)return!1;let n=t.querySelector(":scope > LEGEND");return!n||!n.contains(e)}function Mo(e,t=!1){if(!e)return!1;if(t||as.includes(he(e)||"")){let n=(e.getAttribute("aria-disabled")||"").toLowerCase();return n==="true"?!0:n==="false"?!1:Mo(me(e),!0)}return!1}function jt(e,t){return[...e].map(n=>$e(n,{...t,embeddedInLabel:{element:n,hidden:Ce(n)},embeddedInNativeTextAlternative:void 0,embeddedInLabelledBy:void 0,embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0})).filter(n=>!!n).join(" ")}function Po(e){let t=gs,n=e,r,o=[];for(;n;n=me(n)){let u=t.get(n);if(u!==void 0){r=u;break}o.push(n);let l=Fe(n);if(!l){r=!0;break}let h=l.pointerEvents;if(h){r=h!=="none";break}}r===void 0&&(r=!0);for(let u of o)t.set(u,r);return r}var cs,ls,us,hs,Yt,Tt,fs,ds,ps,gs,Ro=0;function Xn(){++Ro,cs??=new Map,ls??=new Map,us??=new Map,hs??=new Map,Yt??=new Map,Tt??=new Map,fs??=new Map,ds??=new Map,ps??=new Map,gs??=new Map}function Zn(){--Ro||(cs=void 0,ls=void 0,us=void 0,hs=void 0,Yt=void 0,Tt=void 0,fs=void 0,ds=void 0,ps=void 0,gs=void 0)}var Sc={button:"button",checkbox:"checkbox",image:"button",number:"spinbutton",radio:"radio",range:"slider",reset:"button",submit:"button"};function ms(e,t){for(let n of t.jsonPath)e!=null&&(e=e[n]);return ys(e,t)}function ys(e,t){let n=typeof e=="string"&&!t.caseSensitive?e.toUpperCase():e,r=typeof t.value=="string"&&!t.caseSensitive?t.value.toUpperCase():t.value;return t.op==="<truthy>"?!!n:t.op==="="?r instanceof RegExp?typeof n=="string"&&!!n.match(r):n===r:typeof n!="string"||typeof r!="string"?!1:t.op==="*="?n.includes(r):t.op==="^="?n.startsWith(r):t.op==="$="?n.endsWith(r):t.op==="|="?n===r||n.startsWith(r+"-"):t.op==="~="?n.split(" ").includes(r):!1}function er(e){let t=e.ownerDocument;return e.nodeName==="SCRIPT"||e.nodeName==="NOSCRIPT"||e.nodeName==="STYLE"||t.head&&t.head.contains(e)}function Se(e,t){let n=e.get(t);if(n===void 0){if(n={full:"",normalized:"",immediate:[]},!er(t)){let r="";if(t instanceof HTMLInputElement&&(t.type==="submit"||t.type==="button"))n={full:t.value,normalized:we(t.value),immediate:[t.value]};else{for(let o=t.firstChild;o;o=o.nextSibling)if(o.nodeType===Node.TEXT_NODE)n.full+=o.nodeValue||"",r+=o.nodeValue||"";else{if(o.nodeType===Node.COMMENT_NODE)continue;r&&n.immediate.push(r),r="",o.nodeType===Node.ELEMENT_NODE&&(n.full+=Se(e,o).full)}r&&n.immediate.push(r),t.shadowRoot&&(n.full+=Se(e,t.shadowRoot).full),n.full&&(n.normalized=we(n.full))}}e.set(t,n)}return n}function an(e,t,n){if(er(t)||!n(Se(e,t)))return"none";for(let r=t.firstChild;r;r=r.nextSibling)if(r.nodeType===Node.ELEMENT_NODE&&n(Se(e,r)))return"selfAndChildren";return t.shadowRoot&&n(Se(e,t.shadowRoot))?"selfAndChildren":"self"}function bs(e,t){let n=es(t);if(n)return n.map(u=>Se(e,u));let r=t.getAttribute("aria-label");if(r!==null&&r.trim())return[{full:r,normalized:we(r),immediate:[r]}];let o=t.nodeName==="INPUT"&&t.type!=="hidden";if(["BUTTON","METER","OUTPUT","PROGRESS","SELECT","TEXTAREA"].includes(t.nodeName)||o){let u=t.labels;if(u)return[...u].map(l=>Se(e,l))}return[]}var qo={};Nt(qo,{buildNoTextCandidates:()=>Go,buildTextCandidates:()=>zo,generateSelector:()=>qr});var Do=10,Ot=Do/2,Pi=1,xc=2,Tc=10,kc=50,Uo=100,Bo=120,jo=140,Fo=160,Fn=180,Ho=200,Ri=250,_c=Bo+Ot,Ac=jo+Ot,Nc=Uo+Ot,Cc=Fo+Ot,Ic=Fn+Ot,Lc=Ho+Ot,Oc=300,$c=500,Wo=510,Nr=520,Ko=530,Vo=1e4,Mc=1e7,Pc=1e3;function qr(e,t,n){e._evaluator.begin();let r={allowText:new Map,disallowText:new Map};Xn();try{let o=[];if(n.forTextExpect){let h=$n(e,t.ownerDocument.documentElement,n);for(let p=t;p;p=me(p)){let b=yt(r,e,p,{...n,noText:!0});if(!b)continue;if(Ve(b)<=Pc){h=b;break}}o=[Hn(h)]}else{if(!t.matches("input,textarea,select")&&!t.isContentEditable){let h=xt(t,"button,select,input,[role=button],[role=checkbox],[role=radio],a,[role=link]",n.root);h&&Ge(h)&&(t=h)}if(n.multiple){let h=yt(r,e,t,n),p=yt(r,e,t,{...n,noText:!0}),b=[h,p];if(r.allowText.clear(),r.disallowText.clear(),h&&Cr(h)&&b.push(yt(r,e,t,{...n,noCSSId:!0})),p&&Cr(p)&&b.push(yt(r,e,t,{...n,noText:!0,noCSSId:!0})),b=b.filter(Boolean),!b.length){let v=$n(e,t,n);b.push(v),Cr(v)&&b.push($n(e,t,{...n,noCSSId:!0}))}o=[...new Set(b.map(v=>Hn(v)))]}else{let h=yt(r,e,t,n)||$n(e,t,n);o=[Hn(h)]}}let u=o[0],l=e.parseSelector(u);return{selector:u,selectors:o,elements:e.querySelectorAll(l,n.root??t.ownerDocument)}}finally{Zn(),e._evaluator.end()}}function qi(e){return e.filter(t=>t[0].selector[0]!=="/")}function yt(e,t,n,r){if(r.root&&!on(r.root,n))throw new Error("Target element must belong to the root's subtree");if(n===r.root)return[{engine:"css",selector:":scope",score:1}];if(n.ownerDocument.documentElement===n)return[{engine:"css",selector:"html",score:1}];let o=(l,h)=>{let p=l===n,b=h?zo(t,l,l===n):[];l!==n&&(b=qi(b));let v=Go(t,l,r).filter(w=>!r.omitInternalEngines||!w.engine.startsWith("internal:")).map(w=>[w]),y=Di(t,r.root??n.ownerDocument,l,[...b,...v],p);b=qi(b);let m=w=>{let A=h&&!w.length,I=[...w,...v].filter(B=>y?Ve(B)<Ve(y):!0),P=I[0];if(P)for(let B=me(l);B&&B!==r.root;B=me(B)){let q=u(B,A);if(!q||y&&Ve([...q,...P])>=Ve(y))continue;if(P=Di(t,B,l,I,p),!P)return;let H=[...q,...P];(!y||Ve(H)<Ve(y))&&(y=H)}};return m(b),l===n&&b.length&&m([]),y},u=(l,h)=>{let p=h?e.allowText:e.disallowText,b=p.get(l);return b===void 0&&(b=o(l,h),p.set(l,b)),b};return o(n,!r.noText)}function Go(e,t,n){let r=[];{for(let l of["data-testid","data-test-id","data-test"])l!==n.testIdAttributeName&&t.getAttribute(l)&&r.push({engine:"css",selector:`[${l}=${et(t.getAttribute(l))}]`,score:xc});if(!n.noCSSId){let l=t.getAttribute("id");l&&!Rc(l)&&r.push({engine:"css",selector:Jo(l),score:$c})}r.push({engine:"css",selector:Be(t),score:Ko})}if(t.nodeName==="IFRAME"){for(let l of["name","title"])t.getAttribute(l)&&r.push({engine:"css",selector:`${Be(t)}[${l}=${et(t.getAttribute(l))}]`,score:Tc});return t.getAttribute(n.testIdAttributeName)&&r.push({engine:"css",selector:`[${n.testIdAttributeName}=${et(t.getAttribute(n.testIdAttributeName))}]`,score:Pi}),Dr([r]),r}if(t.getAttribute(n.testIdAttributeName)&&r.push({engine:"internal:testid",selector:`[${n.testIdAttributeName}=${Ne(t.getAttribute(n.testIdAttributeName),!0)}]`,score:Pi}),t.nodeName==="INPUT"||t.nodeName==="TEXTAREA"){let l=t;if(l.placeholder){r.push({engine:"internal:attr",selector:`[placeholder=${Ne(l.placeholder,!0)}]`,score:_c});for(let h of kt(l.placeholder))r.push({engine:"internal:attr",selector:`[placeholder=${Ne(h.text,!1)}]`,score:Bo-h.scoreBonus})}}let o=bs(e._evaluator._cacheText,t);for(let l of o){let h=l.normalized;r.push({engine:"internal:label",selector:Ae(h,!0),score:Ac});for(let p of kt(h))r.push({engine:"internal:label",selector:Ae(p.text,!1),score:jo-p.scoreBonus})}let u=he(t);return u&&!["none","presentation"].includes(u)&&r.push({engine:"internal:role",selector:u,score:Wo}),t.getAttribute("name")&&["BUTTON","FORM","FIELDSET","FRAME","IFRAME","INPUT","KEYGEN","OBJECT","OUTPUT","SELECT","TEXTAREA","MAP","META","PARAM"].includes(t.nodeName)&&r.push({engine:"css",selector:`${Be(t)}[name=${et(t.getAttribute("name"))}]`,score:Nr}),["INPUT","TEXTAREA"].includes(t.nodeName)&&t.getAttribute("type")!=="hidden"&&t.getAttribute("type")&&r.push({engine:"css",selector:`${Be(t)}[type=${et(t.getAttribute("type"))}]`,score:Nr}),["INPUT","TEXTAREA","SELECT"].includes(t.nodeName)&&t.getAttribute("type")!=="hidden"&&r.push({engine:"css",selector:Be(t),score:Nr+1}),Dr([r]),r}function zo(e,t,n){if(t.nodeName==="SELECT")return[];let r=[],o=t.getAttribute("title");if(o){r.push([{engine:"internal:attr",selector:`[title=${Ne(o,!0)}]`,score:Lc}]);for(let b of kt(o))r.push([{engine:"internal:attr",selector:`[title=${Ne(b.text,!1)}]`,score:Ho-b.scoreBonus}])}let u=t.getAttribute("alt");if(u&&["APPLET","AREA","IMG","INPUT"].includes(t.nodeName)){r.push([{engine:"internal:attr",selector:`[alt=${Ne(u,!0)}]`,score:Cc}]);for(let b of kt(u))r.push([{engine:"internal:attr",selector:`[alt=${Ne(b.text,!1)}]`,score:Fo-b.scoreBonus}])}let l=Se(e._evaluator._cacheText,t).normalized,h=l?kt(l):[];if(l){if(n){l.length<=80&&r.push([{engine:"internal:text",selector:Ae(l,!0),score:Ic}]);for(let v of h)r.push([{engine:"internal:text",selector:Ae(v.text,!1),score:Fn-v.scoreBonus}])}let b={engine:"css",selector:Be(t),score:Ko};for(let v of h)r.push([b,{engine:"internal:has-text",selector:Ae(v.text,!1),score:Fn-v.scoreBonus}]);if(l.length<=80){let v=new RegExp("^"+Zt(l)+"$");r.push([b,{engine:"internal:has-text",selector:Ae(v,!1),score:Ri}])}}let p=he(t);if(p&&!["none","presentation"].includes(p)){let b=At(t,!1);if(b){let v={engine:"internal:role",selector:`${p}[name=${Ne(b,!0)}]`,score:Nc};r.push([v]);for(let y of kt(b))r.push([{engine:"internal:role",selector:`${p}[name=${Ne(y.text,!1)}]`,score:Uo-y.scoreBonus}])}else{let v={engine:"internal:role",selector:`${p}`,score:Wo};for(let y of h)r.push([v,{engine:"internal:has-text",selector:Ae(y.text,!1),score:Fn-y.scoreBonus}]);if(l.length<=80){let y=new RegExp("^"+Zt(l)+"$");r.push([v,{engine:"internal:has-text",selector:Ae(y,!1),score:Ri}])}}}return Dr(r),r}function Jo(e){return/^[a-zA-Z][a-zA-Z0-9\-\_]+$/.test(e)?"#"+e:`[id=${et(e)}]`}function Cr(e){return e.some(t=>t.engine==="css"&&(t.selector.startsWith("#")||t.selector.startsWith('[id="')))}function $n(e,t,n){let r=n.root??t.ownerDocument,o=[];function u(h){let p=o.slice();h&&p.unshift(h);let b=p.join(" > "),v=e.parseSelector(b);return e.querySelector(v,r,!1)===t?b:void 0}function l(h){let p={engine:"css",selector:h,score:Mc},b=e.parseSelector(h),v=e.querySelectorAll(b,r);if(v.length===1)return[p];let y={engine:"nth",selector:String(v.indexOf(t)),score:Vo};return[p,y]}for(let h=t;h&&h!==r;h=me(h)){let p="";if(h.id&&!n.noCSSId){let y=Jo(h.id),m=u(y);if(m)return l(m);p=y}let b=h.parentNode,v=[...h.classList].map(qc);for(let y=0;y<v.length;++y){let m="."+v.slice(0,y+1).join("."),w=u(m);if(w)return l(w);!p&&b&&b.querySelectorAll(m).length===1&&(p=m)}if(b){let y=[...b.children],m=h.nodeName,A=y.filter(P=>P.nodeName===m).indexOf(h)===0?Be(h):`${Be(h)}:nth-child(${1+y.indexOf(h)})`,I=u(A);if(I)return l(I);p||(p=A)}else p||(p=Be(h));o.unshift(p)}return l(u())}function Dr(e){for(let t of e)for(let n of t)n.score>kc&&n.score<Oc&&(n.score+=Math.min(Do,n.selector.length/10|0))}function Hn(e){let t=[],n="";for(let{engine:r,selector:o}of e)t.length&&(n!=="css"||r!=="css"||o.startsWith(":nth-match("))&&t.push(">>"),n=r,r==="css"?t.push(o):t.push(`${r}=${o}`);return t.join(" ")}function Ve(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].score*(e.length-n);return t}function Di(e,t,n,r,o){let u=r.map(h=>({tokens:h,score:Ve(h)}));u.sort((h,p)=>h.score-p.score);let l=null;for(let{tokens:h}of u){let p=e.parseSelector(Hn(h)),b=e.querySelectorAll(p,t);if(b[0]===n&&b.length===1)return h;let v=b.indexOf(n);if(!o||l||v===-1||b.length>5)continue;let y={engine:"nth",selector:String(v),score:Vo};l=[...h,y]}return l}function Rc(e){let t,n=0;for(let r=0;r<e.length;++r){let o=e[r],u;if(!(o==="-"||o==="_")){if(o>="a"&&o<="z"?u="lower":o>="A"&&o<="Z"?u="upper":o>="0"&&o<="9"?u="digit":u="other",u==="lower"&&t==="upper"){t=u;continue}t&&t!==u&&++n,t=u}}return n>=e.length/4}function Mn(e,t){if(e.length<=t)return e;e=e.substring(0,t);let n=e.match(/^(.*)\b(.+?)$/);return n?n[1].trimEnd():""}function kt(e){let t=[];{let n=e.match(/^([\d.,]+)[^.,\w]/),r=n?n[1].length:0;if(r){let o=Mn(e.substring(r).trimStart(),80);t.push({text:o,scoreBonus:o.length<=30?2:1})}}{let n=e.match(/[^.,\w]([\d.,]+)$/),r=n?n[1].length:0;if(r){let o=Mn(e.substring(0,e.length-r).trimEnd(),80);t.push({text:o,scoreBonus:o.length<=30?2:1})}}return e.length<=30?t.push({text:e,scoreBonus:0}):(t.push({text:Mn(e,80),scoreBonus:0}),t.push({text:Mn(e,30),scoreBonus:1})),t=t.filter(n=>n.text),t.length||t.push({text:e.substring(0,80),scoreBonus:0}),t}function Be(e){return e.nodeName.toLocaleLowerCase().replace(/[:\.]/g,t=>"\\"+t)}function qc(e){let t="";for(let n=0;n<e.length;n++)t+=Dc(e,n);return t}function Dc(e,t){let n=e.charCodeAt(t);return n===0?"\uFFFD":n>=1&&n<=31||n>=48&&n<=57&&(t===0||t===1&&e.charCodeAt(0)===45)?"\\"+n.toString(16)+" ":t===0&&n===45&&e.length===1?"\\"+e.charAt(t):n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122?e.charAt(t):"\\"+e.charAt(t)}function Uc(e,t,n={}){var r;let o=new e.LineCounter,u={keepSourceTokens:!0,lineCounter:o,...n},l=e.parseDocument(t,u),h=[],p=w=>[o.linePos(w[0]),o.linePos(w[1])],b=w=>{h.push({message:w.message,range:[o.linePos(w.pos[0]),o.linePos(w.pos[1])]})},v=(w,A)=>{for(let I of A.items){if(I instanceof e.Scalar&&typeof I.value=="string"){let q=Ui.parse(I,u,h);q&&(w.children=w.children||[],w.children.push(q));continue}if(I instanceof e.YAMLMap){y(w,I);continue}h.push({message:"Sequence items should be strings or maps",range:p(I.range||A.range)})}},y=(w,A)=>{for(let I of A.items){if(w.children=w.children||[],!(I.key instanceof e.Scalar&&typeof I.key.value=="string")){h.push({message:"Only string keys are supported",range:p(I.key.range||A.range)});continue}let B=I.key,q=I.value;if(B.value==="text"){if(!(q instanceof e.Scalar&&typeof q.value=="string")){h.push({message:"Text value should be a string",range:p(I.value.range||A.range)});continue}w.children.push({kind:"text",text:Ir(q.value)});continue}if(B.value==="/children"){if(!(q instanceof e.Scalar&&typeof q.value=="string")||q.value!=="contain"&&q.value!=="equal"&&q.value!=="deep-equal"){h.push({message:'Strict value should be "contain", "equal" or "deep-equal"',range:p(I.value.range||A.range)});continue}w.containerMode=q.value;continue}if(B.value.startsWith("/")){if(!(q instanceof e.Scalar&&typeof q.value=="string")){h.push({message:"Property value should be a string",range:p(I.value.range||A.range)});continue}w.props=w.props??{},w.props[B.value.slice(1)]=Ir(q.value);continue}let H=Ui.parse(B,u,h);if(!H)continue;if(q instanceof e.Scalar){let Z=typeof q.value;if(Z!=="string"&&Z!=="number"&&Z!=="boolean"){h.push({message:"Node value should be a string or a sequence",range:p(I.value.range||A.range)});continue}w.children.push({...H,children:[{kind:"text",text:Ir(String(q.value))}]});continue}if(q instanceof e.YAMLSeq){w.children.push(H),v(H,q);continue}h.push({message:"Map values should be strings or sequences",range:p(I.value.range||A.range)})}},m={kind:"role",role:"fragment"};return l.errors.forEach(b),h.length?{errors:h,fragment:m}:(l.contents instanceof e.YAMLSeq||h.push({message:'Aria snapshot must be a YAML sequence, elements starting with " -"',range:l.contents?p(l.contents.range):[{line:0,col:0},{line:0,col:0}]}),h.length?{errors:h,fragment:m}:(v(m,l.contents),h.length?{errors:h,fragment:Bc}:((r=m.children)==null?void 0:r.length)===1?{fragment:m.children[0],errors:h}:{fragment:m,errors:h}))}var Bc={kind:"role",role:"fragment"};function Yo(e){return e.replace(/[\u200b\u00ad]/g,"").replace(/[\r\n\s\t]+/g," ").trim()}function Ir(e){return e.startsWith("/")&&e.endsWith("/")&&e.length>1?{pattern:e.slice(1,-1)}:Yo(e)}var Ui=class Qo{_input;_pos;_length;static parse(t,n,r){try{return new Qo(t.value)._parse()}catch(o){if(o instanceof Bi){let u=n.prettyErrors===!1?o.message:o.message+`:
3
+ `).replace(/[\u200b\u00ad]/g,"").replace(/\s\s*/g," ")).join("\xA0").trim()}function Mi(e,t){let n=[...e.querySelectorAll(t)];for(let r of Lt(e,e.getAttribute("aria-owns")))r.matches(t)&&n.push(r),n.push(...r.querySelectorAll(t));return n}function _t(e,t){let n=t==="::before"?ds:t==="::after"?ps:fs;if(n?.has(e))return n?.get(e);let r=Fe(e,t),o;return r&&r.display!=="none"&&r.visibility!=="hidden"&&(o=gc(e,r.content,!!t)),t&&o!==void 0&&(r?.display||"inline")!=="inline"&&(o=" "+o+" "),n&&n.set(e,o),o}function gc(e,t,n){if(!(!t||t==="none"||t==="normal"))try{let r=no(t).filter(h=>!(h instanceof Wn)),o=r.findIndex(h=>h instanceof de&&h.value==="/");if(o!==-1)r=r.slice(o+1);else if(!n)return;let u=[],l=0;for(;l<r.length;)if(r[l]instanceof zr)u.push(r[l].value),l++;else if(l+2<r.length&&r[l]instanceof zt&&r[l].value==="attr"&&r[l+1]instanceof Gr&&r[l+2]instanceof Vr){let h=r[l+1].value;u.push(e.getAttribute(h)||""),l+=3}else return;return u.join("")}catch{}}function es(e){let t=e.getAttribute("aria-labelledby");if(t===null)return null;let n=Lt(e,t);return n.length?n:null}function mc(e,t){let n=["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"].includes(e),r=t&&["","caption","code","contentinfo","definition","deletion","emphasis","insertion","list","listitem","mark","none","paragraph","presentation","region","row","rowgroup","section","strong","subscript","superscript","table","term","time"].includes(e);return n||r}function At(e,t){let n=t?ls:cs,r=n?.get(e);return r===void 0&&(r="",["caption","code","definition","deletion","emphasis","generic","insertion","mark","paragraph","presentation","strong","subscript","suggestion","superscript","term","time"].includes(he(e)||"")||(r=Jt($e(e,{includeHidden:t,visitedElements:new Set,embeddedInTargetElement:"self"}))),n?.set(e,r)),r}function Rr(e,t){let n=t?hs:us,r=n?.get(e);if(r===void 0){if(r="",e.hasAttribute("aria-describedby")){let o=Lt(e,e.getAttribute("aria-describedby"));r=Jt(o.map(u=>$e(u,{includeHidden:t,visitedElements:new Set,embeddedInDescribedBy:{element:u,hidden:Ce(u)}})).join(" "))}else e.hasAttribute("aria-description")?r=Jt(e.getAttribute("aria-description")||""):r=Jt(e.getAttribute("title")||"");n?.set(e,r)}return r}function yc(e){let t=e.getAttribute("aria-invalid");return!t||t.trim()===""||t.toLocaleLowerCase()==="false"?"false":t==="true"||t==="grammar"||t==="spelling"?t:"true"}function bc(e){if("validity"in e){let t=e.validity;return t?.valid===!1}return!1}function Co(e){let t=Yt,n=Yt?.get(e);if(n===void 0){n="";let r=yc(e)!=="false",o=bc(e);if(r||o){let u=e.getAttribute("aria-errormessage");n=Lt(e,u).map(p=>Jt($e(p,{visitedElements:new Set,embeddedInDescribedBy:{element:p,hidden:Ce(p)}}))).join(" ").trim()}t?.set(e,n)}return n}function $e(e,t){var n,r,o,u;if(t.visitedElements.has(e))return"";let l={...t,embeddedInTargetElement:t.embeddedInTargetElement==="self"?"descendant":t.embeddedInTargetElement};if(!t.includeHidden){let y=!!((n=t.embeddedInLabelledBy)!=null&&n.hidden)||!!((r=t.embeddedInDescribedBy)!=null&&r.hidden)||!!((o=t.embeddedInNativeTextAlternative)!=null&&o.hidden)||!!((u=t.embeddedInLabel)!=null&&u.hidden);if(Zr(e)||!y&&Ce(e))return t.visitedElements.add(e),""}let h=es(e);if(!t.embeddedInLabelledBy){let y=(h||[]).map(w=>$e(w,{...t,embeddedInLabelledBy:{element:w,hidden:Ce(w)},embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0,embeddedInLabel:void 0,embeddedInNativeTextAlternative:void 0})).join(" ");if(y)return y}let p=he(e)||"",b=pe(e);if(t.embeddedInLabel||t.embeddedInLabelledBy||t.embeddedInTargetElement==="descendant"){let y=[...e.labels||[]].includes(e),w=(h||[]).includes(e);if(!y&&!w){if(p==="textbox")return t.visitedElements.add(e),b==="INPUT"||b==="TEXTAREA"?e.value:e.textContent||"";if(["combobox","listbox"].includes(p)){t.visitedElements.add(e);let A;if(b==="SELECT")A=[...e.selectedOptions],!A.length&&e.options.length&&A.push(e.options[0]);else{let I=p==="combobox"?Mi(e,"*").find(P=>he(P)==="listbox"):e;A=I?Mi(I,'[aria-selected="true"]').filter(P=>he(P)==="option"):[]}return!A.length&&b==="INPUT"?e.value:A.map(I=>$e(I,l)).join(" ")}if(["progressbar","scrollbar","slider","spinbutton","meter"].includes(p))return t.visitedElements.add(e),e.hasAttribute("aria-valuetext")?e.getAttribute("aria-valuetext")||"":e.hasAttribute("aria-valuenow")?e.getAttribute("aria-valuenow")||"":e.getAttribute("value")||"";if(["menu"].includes(p))return t.visitedElements.add(e),""}}let v=e.getAttribute("aria-label")||"";if(Ue(v))return t.visitedElements.add(e),v;if(!["presentation","none"].includes(p)){if(b==="INPUT"&&["button","submit","reset"].includes(e.type)){t.visitedElements.add(e);let y=e.value||"";return Ue(y)?y:e.type==="submit"?"Submit":e.type==="reset"?"Reset":e.getAttribute("title")||""}if(!Vn().inputFileRoleTextbox&&b==="INPUT"&&e.type==="file"){t.visitedElements.add(e);let y=e.labels||[];return y.length&&!t.embeddedInLabelledBy?jt(y,t):"Choose File"}if(b==="INPUT"&&e.type==="image"){t.visitedElements.add(e);let y=e.labels||[];if(y.length&&!t.embeddedInLabelledBy)return jt(y,t);let w=e.getAttribute("alt")||"";if(Ue(w))return w;let A=e.getAttribute("title")||"";return Ue(A)?A:"Submit"}if(!h&&b==="BUTTON"){t.visitedElements.add(e);let y=e.labels||[];if(y.length)return jt(y,t)}if(!h&&b==="OUTPUT"){t.visitedElements.add(e);let y=e.labels||[];return y.length?jt(y,t):e.getAttribute("title")||""}if(!h&&(b==="TEXTAREA"||b==="SELECT"||b==="INPUT")){t.visitedElements.add(e);let y=e.labels||[];if(y.length)return jt(y,t);let w=b==="INPUT"&&["text","password","search","tel","email","url"].includes(e.type)||b==="TEXTAREA",A=e.getAttribute("placeholder")||"",I=e.getAttribute("title")||"";return!w||I?I:A}if(!h&&b==="FIELDSET"){t.visitedElements.add(e);for(let w=e.firstElementChild;w;w=w.nextElementSibling)if(pe(w)==="LEGEND")return $e(w,{...l,embeddedInNativeTextAlternative:{element:w,hidden:Ce(w)}});return e.getAttribute("title")||""}if(!h&&b==="FIGURE"){t.visitedElements.add(e);for(let w=e.firstElementChild;w;w=w.nextElementSibling)if(pe(w)==="FIGCAPTION")return $e(w,{...l,embeddedInNativeTextAlternative:{element:w,hidden:Ce(w)}});return e.getAttribute("title")||""}if(b==="IMG"){t.visitedElements.add(e);let y=e.getAttribute("alt")||"";return Ue(y)?y:e.getAttribute("title")||""}if(b==="TABLE"){t.visitedElements.add(e);for(let w=e.firstElementChild;w;w=w.nextElementSibling)if(pe(w)==="CAPTION")return $e(w,{...l,embeddedInNativeTextAlternative:{element:w,hidden:Ce(w)}});let y=e.getAttribute("summary")||"";if(y)return y}if(b==="AREA"){t.visitedElements.add(e);let y=e.getAttribute("alt")||"";return Ue(y)?y:e.getAttribute("title")||""}if(b==="SVG"||e.ownerSVGElement){t.visitedElements.add(e);for(let y=e.firstElementChild;y;y=y.nextElementSibling)if(pe(y)==="TITLE"&&y.ownerSVGElement)return $e(y,{...l,embeddedInLabelledBy:{element:y,hidden:Ce(y)}})}if(e.ownerSVGElement&&b==="A"){let y=e.getAttribute("xlink:title")||"";if(Ue(y))return t.visitedElements.add(e),y}}let m=b==="SUMMARY"&&!["presentation","none"].includes(p);if(mc(p,t.embeddedInTargetElement==="descendant")||m||t.embeddedInLabelledBy||t.embeddedInDescribedBy||t.embeddedInLabel||t.embeddedInNativeTextAlternative){t.visitedElements.add(e);let y=vc(e,l);if(t.embeddedInTargetElement==="self"?Ue(y):y)return y}if(!["presentation","none"].includes(p)||b==="IFRAME"){t.visitedElements.add(e);let y=e.getAttribute("title")||"";if(Ue(y))return y}return t.visitedElements.add(e),""}function vc(e,t){let n=[],r=(u,l)=>{var h;if(!(l&&u.assignedSlot))if(u.nodeType===1){let p=((h=Fe(u))==null?void 0:h.display)||"inline",b=$e(u,t);(p!=="inline"||u.nodeName==="BR")&&(b=" "+b+" "),n.push(b)}else u.nodeType===3&&n.push(u.textContent||"")};n.push(_t(e,"::before")||"");let o=_t(e);if(o!==void 0)n.push(o);else{let u=e.nodeName==="SLOT"?e.assignedNodes():[];if(u.length)for(let l of u)r(l,!1);else{for(let l=e.firstChild;l;l=l.nextSibling)r(l,!0);if(e.shadowRoot)for(let l=e.shadowRoot.firstChild;l;l=l.nextSibling)r(l,!0);for(let l of Lt(e,e.getAttribute("aria-owns")))r(l,!0)}}return n.push(_t(e,"::after")||""),n.join("")}var Gn=["gridcell","option","row","tab","rowheader","columnheader","treeitem"];function ts(e){return pe(e)==="OPTION"?e.selected:Gn.includes(he(e)||"")?Ao(e.getAttribute("aria-selected"))===!0:!1}var zn=["checkbox","menuitemcheckbox","option","radio","switch","menuitemradio","treeitem"];function ns(e){let t=rs(e,!0);return t==="error"?!1:t}function Io(e){return rs(e,!0)}function Lo(e){return rs(e,!1)}function rs(e,t){let n=pe(e);if(t&&n==="INPUT"&&e.indeterminate)return"mixed";if(n==="INPUT"&&["checkbox","radio"].includes(e.type))return e.checked;if(zn.includes(he(e)||"")){let r=e.getAttribute("aria-checked");return r==="true"?!0:t&&r==="mixed"?"mixed":!1}return"error"}var wc=["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox","columnheader","rowheader","searchbox","switch","treegrid"];function Oo(e){let t=pe(e);return["INPUT","TEXTAREA","SELECT"].includes(t)?e.hasAttribute("readonly"):wc.includes(he(e)||"")?e.getAttribute("aria-readonly")==="true":e.isContentEditable?!1:"error"}var Jn=["button"];function ss(e){if(Jn.includes(he(e)||"")){let t=e.getAttribute("aria-pressed");if(t==="true")return!0;if(t==="mixed")return"mixed"}return!1}var Yn=["application","button","checkbox","combobox","gridcell","link","listbox","menuitem","row","rowheader","tab","treeitem","columnheader","menuitemcheckbox","menuitemradio","rowheader","switch"];function is(e){if(pe(e)==="DETAILS")return e.open;if(Yn.includes(he(e)||"")){let t=e.getAttribute("aria-expanded");return t===null?void 0:t==="true"}}var Qn=["heading","listitem","row","treeitem"];function os(e){let t={H1:1,H2:2,H3:3,H4:4,H5:5,H6:6}[pe(e)];if(t)return t;if(Qn.includes(he(e)||"")){let n=e.getAttribute("aria-level"),r=n===null?Number.NaN:Number(n);if(Number.isInteger(r)&&r>=1)return r}return 0}var as=["application","button","composite","gridcell","group","input","link","menuitem","scrollbar","separator","tab","checkbox","columnheader","combobox","grid","listbox","menu","menubar","menuitemcheckbox","menuitemradio","option","radio","radiogroup","row","rowheader","searchbox","select","slider","spinbutton","switch","tablist","textbox","toolbar","tree","treegrid","treeitem"];function tn(e){return $o(e)||Mo(e)}function $o(e){return["BUTTON","INPUT","SELECT","TEXTAREA","OPTION","OPTGROUP"].includes(e.tagName)&&(e.hasAttribute("disabled")||Ec(e))}function Ec(e){let t=e?.closest("FIELDSET[DISABLED]");if(!t)return!1;let n=t.querySelector(":scope > LEGEND");return!n||!n.contains(e)}function Mo(e,t=!1){if(!e)return!1;if(t||as.includes(he(e)||"")){let n=(e.getAttribute("aria-disabled")||"").toLowerCase();return n==="true"?!0:n==="false"?!1:Mo(me(e),!0)}return!1}function jt(e,t){return[...e].map(n=>$e(n,{...t,embeddedInLabel:{element:n,hidden:Ce(n)},embeddedInNativeTextAlternative:void 0,embeddedInLabelledBy:void 0,embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0})).filter(n=>!!n).join(" ")}function Po(e){let t=gs,n=e,r,o=[];for(;n;n=me(n)){let u=t.get(n);if(u!==void 0){r=u;break}o.push(n);let l=Fe(n);if(!l){r=!0;break}let h=l.pointerEvents;if(h){r=h!=="none";break}}r===void 0&&(r=!0);for(let u of o)t.set(u,r);return r}var cs,ls,us,hs,Yt,Tt,fs,ds,ps,gs,Ro=0;function Xn(){++Ro,cs??=new Map,ls??=new Map,us??=new Map,hs??=new Map,Yt??=new Map,Tt??=new Map,fs??=new Map,ds??=new Map,ps??=new Map,gs??=new Map}function Zn(){--Ro||(cs=void 0,ls=void 0,us=void 0,hs=void 0,Yt=void 0,Tt=void 0,fs=void 0,ds=void 0,ps=void 0,gs=void 0)}var Sc={button:"button",checkbox:"checkbox",image:"button",number:"spinbutton",radio:"radio",range:"slider",reset:"button",submit:"button"};function ms(e,t){for(let n of t.jsonPath)e!=null&&(e=e[n]);return ys(e,t)}function ys(e,t){let n=typeof e=="string"&&!t.caseSensitive?e.toUpperCase():e,r=typeof t.value=="string"&&!t.caseSensitive?t.value.toUpperCase():t.value;return t.op==="<truthy>"?!!n:t.op==="="?r instanceof RegExp?typeof n=="string"&&!!n.match(r):n===r:typeof n!="string"||typeof r!="string"?!1:t.op==="*="?n.includes(r):t.op==="^="?n.startsWith(r):t.op==="$="?n.endsWith(r):t.op==="|="?n===r||n.startsWith(r+"-"):t.op==="~="?n.split(" ").includes(r):!1}function er(e){let t=e.ownerDocument;return e.nodeName==="SCRIPT"||e.nodeName==="NOSCRIPT"||e.nodeName==="STYLE"||t.head&&t.head.contains(e)}function Se(e,t){let n=e.get(t);if(n===void 0){if(n={full:"",normalized:"",immediate:[]},!er(t)){let r="";if(t instanceof HTMLInputElement&&(t.type==="submit"||t.type==="button"))n={full:t.value,normalized:we(t.value),immediate:[t.value]};else{for(let o=t.firstChild;o;o=o.nextSibling)if(o.nodeType===Node.TEXT_NODE)n.full+=o.nodeValue||"",r+=o.nodeValue||"";else{if(o.nodeType===Node.COMMENT_NODE)continue;r&&n.immediate.push(r),r="",o.nodeType===Node.ELEMENT_NODE&&(n.full+=Se(e,o).full)}r&&n.immediate.push(r),t.shadowRoot&&(n.full+=Se(e,t.shadowRoot).full),n.full&&(n.normalized=we(n.full))}}e.set(t,n)}return n}function an(e,t,n){if(er(t)||!n(Se(e,t)))return"none";for(let r=t.firstChild;r;r=r.nextSibling)if(r.nodeType===Node.ELEMENT_NODE&&n(Se(e,r)))return"selfAndChildren";return t.shadowRoot&&n(Se(e,t.shadowRoot))?"selfAndChildren":"self"}function bs(e,t){let n=es(t);if(n)return n.map(u=>Se(e,u));let r=t.getAttribute("aria-label");if(r!==null&&r.trim())return[{full:r,normalized:we(r),immediate:[r]}];let o=t.nodeName==="INPUT"&&t.type!=="hidden";if(["BUTTON","METER","OUTPUT","PROGRESS","SELECT","TEXTAREA"].includes(t.nodeName)||o){let u=t.labels;if(u)return[...u].map(l=>Se(e,l))}return[]}var qo={};Nt(qo,{buildNoTextCandidates:()=>Go,buildTextCandidates:()=>zo,generateSelector:()=>qr});var Do=10,Ot=Do/2,Pi=1,xc=2,Tc=10,kc=50,Uo=100,Bo=120,jo=140,Fo=160,Fn=180,Ho=200,Ri=250,_c=Bo+Ot,Ac=jo+Ot,Nc=Uo+Ot,Cc=Fo+Ot,Ic=Fn+Ot,Lc=Ho+Ot,Oc=300,$c=500,Wo=510,Nr=520,Ko=530,Vo=1e4,Mc=1e7,Pc=1e3;function qr(e,t,n){e._evaluator.begin();let r={allowText:new Map,disallowText:new Map};Xn();try{let o=[];if(n.forTextExpect){let h=$n(e,t.ownerDocument.documentElement,n);for(let p=t;p;p=me(p)){let b=yt(r,e,p,{...n,noText:!0});if(!b)continue;if(Ve(b)<=Pc){h=b;break}}o=[Hn(h)]}else{if(!t.matches("input,textarea,select")&&!t.isContentEditable){let h=xt(t,"button,select,input,[role=button],[role=checkbox],[role=radio],a,[role=link]",n.root);h&&Ge(h)&&(t=h)}if(n.multiple){let h=yt(r,e,t,n),p=yt(r,e,t,{...n,noText:!0}),b=[h,p];if(r.allowText.clear(),r.disallowText.clear(),h&&Cr(h)&&b.push(yt(r,e,t,{...n,noCSSId:!0})),p&&Cr(p)&&b.push(yt(r,e,t,{...n,noText:!0,noCSSId:!0})),b=b.filter(Boolean),!b.length){let v=$n(e,t,n);b.push(v),Cr(v)&&b.push($n(e,t,{...n,noCSSId:!0}))}o=[...new Set(b.map(v=>Hn(v)))]}else{let h=yt(r,e,t,n)||$n(e,t,n);o=[Hn(h)]}}let u=o[0],l=e.parseSelector(u);return{selector:u,selectors:o,elements:e.querySelectorAll(l,n.root??t.ownerDocument)}}finally{Zn(),e._evaluator.end()}}function qi(e){return e.filter(t=>t[0].selector[0]!=="/")}function yt(e,t,n,r){if(r.root&&!on(r.root,n))throw new Error("Target element must belong to the root's subtree");if(n===r.root)return[{engine:"css",selector:":scope",score:1}];if(n.ownerDocument.documentElement===n)return[{engine:"css",selector:"html",score:1}];let o=(l,h)=>{let p=l===n,b=h?zo(t,l,l===n):[];l!==n&&(b=qi(b));let v=Go(t,l,r).filter(w=>!r.omitInternalEngines||!w.engine.startsWith("internal:")).map(w=>[w]),m=Di(t,r.root??n.ownerDocument,l,[...b,...v],p);b=qi(b);let y=w=>{let A=h&&!w.length,I=[...w,...v].filter(B=>m?Ve(B)<Ve(m):!0),P=I[0];if(P)for(let B=me(l);B&&B!==r.root;B=me(B)){let q=u(B,A);if(!q||m&&Ve([...q,...P])>=Ve(m))continue;if(P=Di(t,B,l,I,p),!P)return;let H=[...q,...P];(!m||Ve(H)<Ve(m))&&(m=H)}};return y(b),l===n&&b.length&&y([]),m},u=(l,h)=>{let p=h?e.allowText:e.disallowText,b=p.get(l);return b===void 0&&(b=o(l,h),p.set(l,b)),b};return o(n,!r.noText)}function Go(e,t,n){let r=[];{for(let l of["data-testid","data-test-id","data-test"])l!==n.testIdAttributeName&&t.getAttribute(l)&&r.push({engine:"css",selector:`[${l}=${et(t.getAttribute(l))}]`,score:xc});if(!n.noCSSId){let l=t.getAttribute("id");l&&!Rc(l)&&r.push({engine:"css",selector:Jo(l),score:$c})}r.push({engine:"css",selector:Be(t),score:Ko})}if(t.nodeName==="IFRAME"){for(let l of["name","title"])t.getAttribute(l)&&r.push({engine:"css",selector:`${Be(t)}[${l}=${et(t.getAttribute(l))}]`,score:Tc});return t.getAttribute(n.testIdAttributeName)&&r.push({engine:"css",selector:`[${n.testIdAttributeName}=${et(t.getAttribute(n.testIdAttributeName))}]`,score:Pi}),Dr([r]),r}if(t.getAttribute(n.testIdAttributeName)&&r.push({engine:"internal:testid",selector:`[${n.testIdAttributeName}=${Ne(t.getAttribute(n.testIdAttributeName),!0)}]`,score:Pi}),t.nodeName==="INPUT"||t.nodeName==="TEXTAREA"){let l=t;if(l.placeholder){r.push({engine:"internal:attr",selector:`[placeholder=${Ne(l.placeholder,!0)}]`,score:_c});for(let h of kt(l.placeholder))r.push({engine:"internal:attr",selector:`[placeholder=${Ne(h.text,!1)}]`,score:Bo-h.scoreBonus})}}let o=bs(e._evaluator._cacheText,t);for(let l of o){let h=l.normalized;r.push({engine:"internal:label",selector:Ae(h,!0),score:Ac});for(let p of kt(h))r.push({engine:"internal:label",selector:Ae(p.text,!1),score:jo-p.scoreBonus})}let u=he(t);return u&&!["none","presentation"].includes(u)&&r.push({engine:"internal:role",selector:u,score:Wo}),t.getAttribute("name")&&["BUTTON","FORM","FIELDSET","FRAME","IFRAME","INPUT","KEYGEN","OBJECT","OUTPUT","SELECT","TEXTAREA","MAP","META","PARAM"].includes(t.nodeName)&&r.push({engine:"css",selector:`${Be(t)}[name=${et(t.getAttribute("name"))}]`,score:Nr}),["INPUT","TEXTAREA"].includes(t.nodeName)&&t.getAttribute("type")!=="hidden"&&t.getAttribute("type")&&r.push({engine:"css",selector:`${Be(t)}[type=${et(t.getAttribute("type"))}]`,score:Nr}),["INPUT","TEXTAREA","SELECT"].includes(t.nodeName)&&t.getAttribute("type")!=="hidden"&&r.push({engine:"css",selector:Be(t),score:Nr+1}),Dr([r]),r}function zo(e,t,n){if(t.nodeName==="SELECT")return[];let r=[],o=t.getAttribute("title");if(o){r.push([{engine:"internal:attr",selector:`[title=${Ne(o,!0)}]`,score:Lc}]);for(let b of kt(o))r.push([{engine:"internal:attr",selector:`[title=${Ne(b.text,!1)}]`,score:Ho-b.scoreBonus}])}let u=t.getAttribute("alt");if(u&&["APPLET","AREA","IMG","INPUT"].includes(t.nodeName)){r.push([{engine:"internal:attr",selector:`[alt=${Ne(u,!0)}]`,score:Cc}]);for(let b of kt(u))r.push([{engine:"internal:attr",selector:`[alt=${Ne(b.text,!1)}]`,score:Fo-b.scoreBonus}])}let l=Se(e._evaluator._cacheText,t).normalized,h=l?kt(l):[];if(l){if(n){l.length<=80&&r.push([{engine:"internal:text",selector:Ae(l,!0),score:Ic}]);for(let v of h)r.push([{engine:"internal:text",selector:Ae(v.text,!1),score:Fn-v.scoreBonus}])}let b={engine:"css",selector:Be(t),score:Ko};for(let v of h)r.push([b,{engine:"internal:has-text",selector:Ae(v.text,!1),score:Fn-v.scoreBonus}]);if(l.length<=80){let v=new RegExp("^"+Zt(l)+"$");r.push([b,{engine:"internal:has-text",selector:Ae(v,!1),score:Ri}])}}let p=he(t);if(p&&!["none","presentation"].includes(p)){let b=At(t,!1);if(b){let v={engine:"internal:role",selector:`${p}[name=${Ne(b,!0)}]`,score:Nc};r.push([v]);for(let m of kt(b))r.push([{engine:"internal:role",selector:`${p}[name=${Ne(m.text,!1)}]`,score:Uo-m.scoreBonus}])}else{let v={engine:"internal:role",selector:`${p}`,score:Wo};for(let m of h)r.push([v,{engine:"internal:has-text",selector:Ae(m.text,!1),score:Fn-m.scoreBonus}]);if(l.length<=80){let m=new RegExp("^"+Zt(l)+"$");r.push([v,{engine:"internal:has-text",selector:Ae(m,!1),score:Ri}])}}}return Dr(r),r}function Jo(e){return/^[a-zA-Z][a-zA-Z0-9\-\_]+$/.test(e)?"#"+e:`[id=${et(e)}]`}function Cr(e){return e.some(t=>t.engine==="css"&&(t.selector.startsWith("#")||t.selector.startsWith('[id="')))}function $n(e,t,n){let r=n.root??t.ownerDocument,o=[];function u(h){let p=o.slice();h&&p.unshift(h);let b=p.join(" > "),v=e.parseSelector(b);return e.querySelector(v,r,!1)===t?b:void 0}function l(h){let p={engine:"css",selector:h,score:Mc},b=e.parseSelector(h),v=e.querySelectorAll(b,r);if(v.length===1)return[p];let m={engine:"nth",selector:String(v.indexOf(t)),score:Vo};return[p,m]}for(let h=t;h&&h!==r;h=me(h)){let p="";if(h.id&&!n.noCSSId){let m=Jo(h.id),y=u(m);if(y)return l(y);p=m}let b=h.parentNode,v=[...h.classList].map(qc);for(let m=0;m<v.length;++m){let y="."+v.slice(0,m+1).join("."),w=u(y);if(w)return l(w);!p&&b&&b.querySelectorAll(y).length===1&&(p=y)}if(b){let m=[...b.children],y=h.nodeName,A=m.filter(P=>P.nodeName===y).indexOf(h)===0?Be(h):`${Be(h)}:nth-child(${1+m.indexOf(h)})`,I=u(A);if(I)return l(I);p||(p=A)}else p||(p=Be(h));o.unshift(p)}return l(u())}function Dr(e){for(let t of e)for(let n of t)n.score>kc&&n.score<Oc&&(n.score+=Math.min(Do,n.selector.length/10|0))}function Hn(e){let t=[],n="";for(let{engine:r,selector:o}of e)t.length&&(n!=="css"||r!=="css"||o.startsWith(":nth-match("))&&t.push(">>"),n=r,r==="css"?t.push(o):t.push(`${r}=${o}`);return t.join(" ")}function Ve(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].score*(e.length-n);return t}function Di(e,t,n,r,o){let u=r.map(h=>({tokens:h,score:Ve(h)}));u.sort((h,p)=>h.score-p.score);let l=null;for(let{tokens:h}of u){let p=e.parseSelector(Hn(h)),b=e.querySelectorAll(p,t);if(b[0]===n&&b.length===1)return h;let v=b.indexOf(n);if(!o||l||v===-1||b.length>5)continue;let m={engine:"nth",selector:String(v),score:Vo};l=[...h,m]}return l}function Rc(e){let t,n=0;for(let r=0;r<e.length;++r){let o=e[r],u;if(!(o==="-"||o==="_")){if(o>="a"&&o<="z"?u="lower":o>="A"&&o<="Z"?u="upper":o>="0"&&o<="9"?u="digit":u="other",u==="lower"&&t==="upper"){t=u;continue}t&&t!==u&&++n,t=u}}return n>=e.length/4}function Mn(e,t){if(e.length<=t)return e;e=e.substring(0,t);let n=e.match(/^(.*)\b(.+?)$/);return n?n[1].trimEnd():""}function kt(e){let t=[];{let n=e.match(/^([\d.,]+)[^.,\w]/),r=n?n[1].length:0;if(r){let o=Mn(e.substring(r).trimStart(),80);t.push({text:o,scoreBonus:o.length<=30?2:1})}}{let n=e.match(/[^.,\w]([\d.,]+)$/),r=n?n[1].length:0;if(r){let o=Mn(e.substring(0,e.length-r).trimEnd(),80);t.push({text:o,scoreBonus:o.length<=30?2:1})}}return e.length<=30?t.push({text:e,scoreBonus:0}):(t.push({text:Mn(e,80),scoreBonus:0}),t.push({text:Mn(e,30),scoreBonus:1})),t=t.filter(n=>n.text),t.length||t.push({text:e.substring(0,80),scoreBonus:0}),t}function Be(e){return e.nodeName.toLocaleLowerCase().replace(/[:\.]/g,t=>"\\"+t)}function qc(e){let t="";for(let n=0;n<e.length;n++)t+=Dc(e,n);return t}function Dc(e,t){let n=e.charCodeAt(t);return n===0?"\uFFFD":n>=1&&n<=31||n>=48&&n<=57&&(t===0||t===1&&e.charCodeAt(0)===45)?"\\"+n.toString(16)+" ":t===0&&n===45&&e.length===1?"\\"+e.charAt(t):n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122?e.charAt(t):"\\"+e.charAt(t)}function Uc(e,t,n={}){var r;let o=new e.LineCounter,u={keepSourceTokens:!0,lineCounter:o,...n},l=e.parseDocument(t,u),h=[],p=w=>[o.linePos(w[0]),o.linePos(w[1])],b=w=>{h.push({message:w.message,range:[o.linePos(w.pos[0]),o.linePos(w.pos[1])]})},v=(w,A)=>{for(let I of A.items){if(I instanceof e.Scalar&&typeof I.value=="string"){let q=Ui.parse(I,u,h);q&&(w.children=w.children||[],w.children.push(q));continue}if(I instanceof e.YAMLMap){m(w,I);continue}h.push({message:"Sequence items should be strings or maps",range:p(I.range||A.range)})}},m=(w,A)=>{for(let I of A.items){if(w.children=w.children||[],!(I.key instanceof e.Scalar&&typeof I.key.value=="string")){h.push({message:"Only string keys are supported",range:p(I.key.range||A.range)});continue}let B=I.key,q=I.value;if(B.value==="text"){if(!(q instanceof e.Scalar&&typeof q.value=="string")){h.push({message:"Text value should be a string",range:p(I.value.range||A.range)});continue}w.children.push({kind:"text",text:Ir(q.value)});continue}if(B.value==="/children"){if(!(q instanceof e.Scalar&&typeof q.value=="string")||q.value!=="contain"&&q.value!=="equal"&&q.value!=="deep-equal"){h.push({message:'Strict value should be "contain", "equal" or "deep-equal"',range:p(I.value.range||A.range)});continue}w.containerMode=q.value;continue}if(B.value.startsWith("/")){if(!(q instanceof e.Scalar&&typeof q.value=="string")){h.push({message:"Property value should be a string",range:p(I.value.range||A.range)});continue}w.props=w.props??{},w.props[B.value.slice(1)]=Ir(q.value);continue}let H=Ui.parse(B,u,h);if(!H)continue;if(q instanceof e.Scalar){let Z=typeof q.value;if(Z!=="string"&&Z!=="number"&&Z!=="boolean"){h.push({message:"Node value should be a string or a sequence",range:p(I.value.range||A.range)});continue}w.children.push({...H,children:[{kind:"text",text:Ir(String(q.value))}]});continue}if(q instanceof e.YAMLSeq){w.children.push(H),v(H,q);continue}h.push({message:"Map values should be strings or sequences",range:p(I.value.range||A.range)})}},y={kind:"role",role:"fragment"};return l.errors.forEach(b),h.length?{errors:h,fragment:y}:(l.contents instanceof e.YAMLSeq||h.push({message:'Aria snapshot must be a YAML sequence, elements starting with " -"',range:l.contents?p(l.contents.range):[{line:0,col:0},{line:0,col:0}]}),h.length?{errors:h,fragment:y}:(v(y,l.contents),h.length?{errors:h,fragment:Bc}:((r=y.children)==null?void 0:r.length)===1?{fragment:y.children[0],errors:h}:{fragment:y,errors:h}))}var Bc={kind:"role",role:"fragment"};function Yo(e){return e.replace(/[\u200b\u00ad]/g,"").replace(/[\r\n\s\t]+/g," ").trim()}function Ir(e){return e.startsWith("/")&&e.endsWith("/")&&e.length>1?{pattern:e.slice(1,-1)}:Yo(e)}var Ui=class Qo{_input;_pos;_length;static parse(t,n,r){try{return new Qo(t.value)._parse()}catch(o){if(o instanceof Bi){let u=n.prettyErrors===!1?o.message:o.message+`:
4
4
 
5
5
  `+t.value+`
6
6
  `+" ".repeat(o.pos)+`^
7
- `;return r.push({message:u,range:[n.lineCounter.linePos(t.range[0]),n.lineCounter.linePos(t.range[0]+o.pos)]}),null}throw o}}constructor(t){this._input=t,this._pos=0,this._length=t.length}_peek(){return this._input[this._pos]||""}_next(){return this._pos<this._length?this._input[this._pos++]:null}_eof(){return this._pos>=this._length}_isWhitespace(){return!this._eof()&&/\s/.test(this._peek())}_skipWhitespace(){for(;this._isWhitespace();)this._pos++}_readIdentifier(t){this._eof()&&this._throwError(`Unexpected end of input when expecting ${t}`);let n=this._pos;for(;!this._eof()&&/[a-zA-Z]/.test(this._peek());)this._pos++;return this._input.slice(n,this._pos)}_readString(){let t="",n=!1;for(;!this._eof();){let r=this._next();if(n)t+=r,n=!1;else if(r==="\\")n=!0;else{if(r==='"')return t;t+=r}}this._throwError("Unterminated string")}_throwError(t,n=0){throw new Bi(t,n||this._pos)}_readRegex(){let t="",n=!1,r=!1;for(;!this._eof();){let o=this._next();if(n)t+=o,n=!1;else if(o==="\\")n=!0,t+=o;else{if(o==="/"&&!r)return{pattern:t};o==="["?(r=!0,t+=o):o==="]"&&r?(t+=o,r=!1):t+=o}}this._throwError("Unterminated regex")}_readStringOrRegex(){let t=this._peek();return t==='"'?(this._next(),Yo(this._readString())):t==="/"?(this._next(),this._readRegex()):null}_readAttributes(t){let n=this._pos;for(;this._skipWhitespace(),this._peek()==="[";){this._next(),this._skipWhitespace(),n=this._pos;let r=this._readIdentifier("attribute");this._skipWhitespace();let o="";if(this._peek()==="=")for(this._next(),this._skipWhitespace(),n=this._pos;this._peek()!=="]"&&!this._isWhitespace()&&!this._eof();)o+=this._next();this._skipWhitespace(),this._peek()!=="]"&&this._throwError("Expected ]"),this._next(),this._applyAttribute(t,r,o||"true",n)}}_parse(){this._skipWhitespace();let t=this._readIdentifier("role");this._skipWhitespace();let n=this._readStringOrRegex()||"",r={kind:"role",role:t,name:n};return this._readAttributes(r),this._skipWhitespace(),this._eof()||this._throwError("Unexpected input"),r}_applyAttribute(t,n,r,o){if(n==="checked"){this._assert(r==="true"||r==="false"||r==="mixed",'Value of "checked" attribute must be a boolean or "mixed"',o),t.checked=r==="true"?!0:r==="false"?!1:"mixed";return}if(n==="disabled"){this._assert(r==="true"||r==="false",'Value of "disabled" attribute must be a boolean',o),t.disabled=r==="true";return}if(n==="expanded"){this._assert(r==="true"||r==="false",'Value of "expanded" attribute must be a boolean',o),t.expanded=r==="true";return}if(n==="level"){this._assert(!isNaN(Number(r)),'Value of "level" attribute must be a number',o),t.level=Number(r);return}if(n==="pressed"){this._assert(r==="true"||r==="false"||r==="mixed",'Value of "pressed" attribute must be a boolean or "mixed"',o),t.pressed=r==="true"?!0:r==="false"?!1:"mixed";return}if(n==="selected"){this._assert(r==="true"||r==="false",'Value of "selected" attribute must be a boolean',o),t.selected=r==="true";return}this._assert(!1,`Unsupported attribute [${n}]`,o)}_assert(t,n,r){t||this._throwError(n||"Assertion error",r)}},Bi=class extends Error{pos;constructor(e,t){super(e),this.pos=t}},ke=class extends Error{};function jc(e,t){let n;try{n=no(e),n[n.length-1]instanceof jn||n.push(new jn)}catch(D){let re=D.message+` while parsing css selector "${e}". Did you mean to CSS.escape it?`,Ee=(D.stack||"").indexOf(D.message);throw Ee!==-1&&(D.stack=D.stack.substring(0,Ee)+re+D.stack.substring(Ee+D.message.length)),D.message=re,D}let r=n.find(D=>D instanceof go||D instanceof ro||D instanceof Bn||D instanceof po||D instanceof so||D instanceof io||D instanceof ao||D instanceof lo||D instanceof uo||D instanceof yo||D instanceof vo);if(r)throw new ke(`Unsupported token "${r.toSource()}" while parsing css selector "${e}". Did you mean to CSS.escape it?`);let o=0,u=new Set;function l(){return new ke(`Unexpected token "${n[o].toSource()}" while parsing css selector "${e}". Did you mean to CSS.escape it?`)}function h(){for(;n[o]instanceof Wn;)o++}function p(D=o){return n[D]instanceof Gr}function b(D=o){return n[D]instanceof zr}function v(D=o){return n[D]instanceof bo}function y(D=o){return n[D]instanceof co}function m(D=o){return n[D]instanceof fo}function w(D=o){return n[D]instanceof Vr}function A(D=o){return n[D]instanceof zt}function I(D=o){return n[D]instanceof de&&n[D].value==="*"}function P(D=o){return n[D]instanceof jn}function B(D=o){return n[D]instanceof de&&[">","+","~"].includes(n[D].value)}function q(D=o){return y(D)||w(D)||P(D)||B(D)||n[D]instanceof Wn}function H(){let D=[ee()];for(;h(),!!y();)o++,D.push(ee());return D}function ee(){return h(),v()||b()?n[o++].value:te()}function te(){let D={simples:[]};for(h(),B()?D.simples.push({selector:{functions:[{name:"scope",args:[]}]},combinator:""}):D.simples.push({selector:Z(),combinator:""});;){if(h(),B())D.simples[D.simples.length-1].combinator=n[o++].value,h();else if(q())break;D.simples.push({combinator:"",selector:Z()})}return D}function Z(){let D="",re=[];for(;!q();)if(p()||I())D+=n[o++].toSource();else if(n[o]instanceof mo)D+=n[o++].toSource();else if(n[o]instanceof de&&n[o].value===".")if(o++,p())D+="."+n[o++].toSource();else throw l();else if(n[o]instanceof oo)if(o++,p())if(!t.has(n[o].value.toLowerCase()))D+=":"+n[o++].toSource();else{let Ee=n[o++].value.toLowerCase();re.push({name:Ee,args:[]}),u.add(Ee)}else if(A()){let Ee=n[o++].value.toLowerCase();if(t.has(Ee)?(re.push({name:Ee,args:H()}),u.add(Ee)):D+=`:${Ee}(${se()})`,h(),!w())throw l();o++}else throw l();else if(n[o]instanceof ho){for(D+="[",o++;!(n[o]instanceof Pr)&&!P();)D+=n[o++].toSource();if(!(n[o]instanceof Pr))throw l();D+="]",o++}else throw l();if(!D&&!re.length)throw l();return{css:D||void 0,functions:re}}function se(){let D="",re=1;for(;!P()&&((m()||A())&&re++,w()&&re--,!!re);)D+=n[o++].toSource();return D}let le=H();if(!P())throw l();if(le.some(D=>typeof D!="object"||!("simples"in D)))throw new ke(`Error while parsing css selector "${e}". Did you mean to CSS.escape it?`);return{selector:le,names:Array.from(u)}}var Ur=new Set(["internal:has","internal:has-not","internal:and","internal:or","internal:chain","left-of","right-of","above","below","near"]),Fc=new Set(["left-of","right-of","above","below","near"]),Xo=new Set(["not","is","where","has","scope","light","visible","text","text-matches","text-is","has-text","above","below","right-of","left-of","near","nth-match"]);function vs(e){let t=Kc(e),n=[];for(let r of t.parts){if(r.name==="css"||r.name==="css:light"){r.name==="css:light"&&(r.body=":light("+r.body+")");let o=jc(r.body,Xo);n.push({name:"css",body:o.selector,source:r.body});continue}if(Ur.has(r.name)){let o,u;try{let b=JSON.parse("["+r.body+"]");if(!Array.isArray(b)||b.length<1||b.length>2||typeof b[0]!="string")throw new ke(`Malformed selector: ${r.name}=`+r.body);if(o=b[0],b.length===2){if(typeof b[1]!="number"||!Fc.has(r.name))throw new ke(`Malformed selector: ${r.name}=`+r.body);u=b[1]}}catch{throw new ke(`Malformed selector: ${r.name}=`+r.body)}let l={name:r.name,source:r.body,body:{parsed:vs(o),distance:u}},h=[...l.body.parsed.parts].reverse().find(b=>b.name==="internal:control"&&b.body==="enter-frame"),p=h?l.body.parsed.parts.indexOf(h):-1;p!==-1&&Hc(l.body.parsed.parts.slice(0,p+1),n.slice(0,p+1))&&l.body.parsed.parts.splice(0,p+1),n.push(l);continue}n.push({...r,source:r.body})}if(Ur.has(n[0].name))throw new ke(`"${n[0].name}" selector cannot be first`);return{capture:t.capture,parts:n}}function Hc(e,t){return je({parts:e})===je({parts:t})}function je(e,t){return typeof e=="string"?e:e.parts.map((n,r)=>{let o=!0;!t&&r!==e.capture&&(n.name==="css"||n.name==="xpath"&&n.source.startsWith("//")||n.source.startsWith(".."))&&(o=!1);let u=o?n.name+"=":"";return`${r===e.capture?"*":""}${u}${n.source}`}).join(" >> ")}function Wc(e,t){let n=(r,o)=>{for(let u of r.parts)t(u,o),Ur.has(u.name)&&n(u.body.parsed,!0)};n(e,!1)}function Kc(e){let t=0,n,r=0,o={parts:[]},u=()=>{let h=e.substring(r,t).trim(),p=h.indexOf("="),b,v;p!==-1&&h.substring(0,p).trim().match(/^[a-zA-Z_0-9-+:*]+$/)?(b=h.substring(0,p).trim(),v=h.substring(p+1)):h.length>1&&h[0]==='"'&&h[h.length-1]==='"'||h.length>1&&h[0]==="'"&&h[h.length-1]==="'"?(b="text",v=h):/^\(*\/\//.test(h)||h.startsWith("..")?(b="xpath",v=h):(b="css",v=h);let y=!1;if(b[0]==="*"&&(y=!0,b=b.substring(1)),o.parts.push({name:b,body:v}),y){if(o.capture!==void 0)throw new ke("Only one of the selectors can capture using * modifier");o.capture=o.parts.length-1}};if(!e.includes(">>"))return t=e.length,u(),o;let l=()=>{let p=e.substring(r,t).match(/^\s*text\s*=(.*)$/);return!!p&&!!p[1]};for(;t<e.length;){let h=e[t];h==="\\"&&t+1<e.length?t+=2:h===n?(n=void 0,t++):!n&&(h==='"'||h==="'"||h==="`")&&!l()?(n=h,t++):!n&&h===">"&&e[t+1]===">"?(u(),t+=2,r=t):t++}return u(),o}function tt(e,t){let n=0,r=e.length===0,o=()=>e[n]||"",u=()=>{let P=o();return++n,r=n>=e.length,P},l=P=>{throw r?new ke(`Unexpected end of selector while parsing selector \`${e}\``):new ke(`Error while parsing selector \`${e}\` - unexpected symbol "${o()}" at position ${n}`+(P?" during "+P:""))};function h(){for(;!r&&/\s/.test(o());)u()}function p(P){return P>="\x80"||P>="0"&&P<="9"||P>="A"&&P<="Z"||P>="a"&&P<="z"||P>="0"&&P<="9"||P==="_"||P==="-"}function b(){let P="";for(h();!r&&p(o());)P+=u();return P}function v(P){let B=u();for(B!==P&&l("parsing quoted string");!r&&o()!==P;)o()==="\\"&&u(),B+=u();return o()!==P&&l("parsing quoted string"),B+=u(),B}function y(){u()!=="/"&&l("parsing regular expression");let P="",B=!1;for(;!r;){if(o()==="\\")P+=u(),r&&l("parsing regular expression");else if(B&&o()==="]")B=!1;else if(!B&&o()==="[")B=!0;else if(!B&&o()==="/")break;P+=u()}u()!=="/"&&l("parsing regular expression");let q="";for(;!r&&o().match(/[dgimsuy]/);)q+=u();try{return new RegExp(P,q)}catch(H){throw new ke(`Error while parsing selector \`${e}\`: ${H.message}`)}}function m(){let P="";return h(),o()==="'"||o()==='"'?P=v(o()).slice(1,-1):P=b(),P||l("parsing property path"),P}function w(){h();let P="";return r||(P+=u()),!r&&P!=="="&&(P+=u()),["=","*=","^=","$=","|=","~="].includes(P)||l("parsing operator"),P}function A(){u();let P=[];for(P.push(m()),h();o()===".";)u(),P.push(m()),h();if(o()==="]")return u(),{name:P.join("."),jsonPath:P,op:"<truthy>",value:null,caseSensitive:!1};let B=w(),q,H=!0;if(h(),o()==="/"){if(B!=="=")throw new ke(`Error while parsing selector \`${e}\` - cannot use ${B} in attribute with regular expression`);q=y()}else if(o()==="'"||o()==='"')q=v(o()).slice(1,-1),h(),o()==="i"||o()==="I"?(H=!1,u()):(o()==="s"||o()==="S")&&(H=!0,u());else{for(q="";!r&&(p(o())||o()==="+"||o()===".");)q+=u();q==="true"?q=!0:q==="false"?q=!1:t||(q=+q,Number.isNaN(q)&&l("parsing attribute value"))}if(h(),o()!=="]"&&l("parsing attribute value"),u(),B!=="="&&typeof q!="string")throw new ke(`Error while parsing selector \`${e}\` - cannot use ${B} in attribute with non-string matching value - ${q}`);return{name:P.join("."),jsonPath:P,op:B,value:q,caseSensitive:H}}let I={name:"",attributes:[]};for(I.name=b(),h();o()==="[";)I.attributes.push(A()),h();if(r||l(void 0),!I.name&&!I.attributes.length)throw new ke(`Error while parsing selector \`${e}\` - selector cannot be empty`);return I}function Qt(e,t,n=!1){return Vc(e,t,n,1)[0]}function Vc(e,t,n=!1,r=20,o){try{return St(new Zc[e](o),vs(t),n,r)}catch{return[t]}}function St(e,t,n=!1,r=20){let o=[...t.parts],u=[],l=n?"frame-locator":"page";for(let h=0;h<o.length;h++){let p=o[h],b=l;if(l="locator",p.name==="internal:describe")continue;if(p.name==="nth"){p.body==="0"?u.push([e.generateLocator(b,"first",""),e.generateLocator(b,"nth","0")]):p.body==="-1"?u.push([e.generateLocator(b,"last",""),e.generateLocator(b,"nth","-1")]):u.push([e.generateLocator(b,"nth",p.body)]);continue}if(p.name==="visible"){u.push([e.generateLocator(b,"visible",p.body),e.generateLocator(b,"default",`visible=${p.body}`)]);continue}if(p.name==="internal:text"){let{exact:A,text:I}=Ft(p.body);u.push([e.generateLocator(b,"text",I,{exact:A})]);continue}if(p.name==="internal:has-text"){let{exact:A,text:I}=Ft(p.body);if(!A){u.push([e.generateLocator(b,"has-text",I,{exact:A})]);continue}}if(p.name==="internal:has-not-text"){let{exact:A,text:I}=Ft(p.body);if(!A){u.push([e.generateLocator(b,"has-not-text",I,{exact:A})]);continue}}if(p.name==="internal:has"){let A=St(e,p.body.parsed,!1,r);u.push(A.map(I=>e.generateLocator(b,"has",I)));continue}if(p.name==="internal:has-not"){let A=St(e,p.body.parsed,!1,r);u.push(A.map(I=>e.generateLocator(b,"hasNot",I)));continue}if(p.name==="internal:and"){let A=St(e,p.body.parsed,!1,r);u.push(A.map(I=>e.generateLocator(b,"and",I)));continue}if(p.name==="internal:or"){let A=St(e,p.body.parsed,!1,r);u.push(A.map(I=>e.generateLocator(b,"or",I)));continue}if(p.name==="internal:chain"){let A=St(e,p.body.parsed,!1,r);u.push(A.map(I=>e.generateLocator(b,"chain",I)));continue}if(p.name==="internal:label"){let{exact:A,text:I}=Ft(p.body);u.push([e.generateLocator(b,"label",I,{exact:A})]);continue}if(p.name==="internal:role"){let A=tt(p.body,!0),I={attrs:[]};for(let P of A.attributes)P.name==="name"?(I.exact=P.caseSensitive,I.name=P.value):(P.name==="level"&&typeof P.value=="string"&&(P.value=+P.value),I.attrs.push({name:P.name==="include-hidden"?"includeHidden":P.name,value:P.value}));u.push([e.generateLocator(b,"role",A.name,I)]);continue}if(p.name==="internal:testid"){let A=tt(p.body,!0),{value:I}=A.attributes[0];u.push([e.generateLocator(b,"test-id",I)]);continue}if(p.name==="internal:attr"){let A=tt(p.body,!0),{name:I,value:P,caseSensitive:B}=A.attributes[0],q=P,H=!!B;if(I==="placeholder"){u.push([e.generateLocator(b,"placeholder",q,{exact:H})]);continue}if(I==="alt"){u.push([e.generateLocator(b,"alt",q,{exact:H})]);continue}if(I==="title"){u.push([e.generateLocator(b,"title",q,{exact:H})]);continue}}if(p.name==="internal:control"&&p.body==="enter-frame"){let A=u[u.length-1],I=o[h-1],P=A.map(B=>e.chainLocators([B,e.generateLocator(b,"frame","")]));["xpath","css"].includes(I.name)&&P.push(e.generateLocator(b,"frame-locator",je({parts:[I]})),e.generateLocator(b,"frame-locator",je({parts:[I]},!0))),A.splice(0,A.length,...P),l="frame-locator";continue}let v=o[h+1],y=je({parts:[p]}),m=e.generateLocator(b,"default",y);if(v&&["internal:has-text","internal:has-not-text"].includes(v.name)){let{exact:A,text:I}=Ft(v.body);if(!A){let P=e.generateLocator("locator",v.name==="internal:has-text"?"has-text":"has-not-text",I,{exact:A}),B={};v.name==="internal:has-text"?B.hasText=I:B.hasNotText=I;let q=e.generateLocator(b,"default",y,B);u.push([e.chainLocators([m,P]),q]),h++;continue}}let w;if(["xpath","css"].includes(p.name)){let A=je({parts:[p]},!0);w=e.generateLocator(b,"default",A)}u.push([m,w].filter(Boolean))}return Gc(e,u,r)}function Gc(e,t,n){let r=t.map(()=>""),o=[],u=l=>{if(l===t.length)return o.push(e.chainLocators(r)),o.length<n;for(let h of t[l])if(r[l]=h,!u(l+1))return!1;return!0};return u(0),o}function Ft(e){let t=!1,n=e.match(/^\/(.*)\/([igm]*)$/);return n?{text:new RegExp(n[1],n[2])}:(e.endsWith('"')?(e=JSON.parse(e),t=!0):e.endsWith('"s')?(e=JSON.parse(e.substring(0,e.length-1)),t=!0):e.endsWith('"i')&&(e=JSON.parse(e.substring(0,e.length-1)),t=!1),{exact:t,text:e})}var zc=class{constructor(e){this.preferredQuote=e}generateLocator(e,t,n,r={}){switch(t){case"default":return r.hasText!==void 0?`locator(${this.quote(n)}, { hasText: ${this.toHasText(r.hasText)} })`:r.hasNotText!==void 0?`locator(${this.quote(n)}, { hasNotText: ${this.toHasText(r.hasNotText)} })`:`locator(${this.quote(n)})`;case"frame-locator":return`frameLocator(${this.quote(n)})`;case"frame":return"contentFrame()";case"nth":return`nth(${n})`;case"first":return"first()";case"last":return"last()";case"visible":return`filter({ visible: ${n==="true"?"true":"false"} })`;case"role":let o=[];ge(r.name)?o.push(`name: ${this.regexToSourceString(r.name)}`):typeof r.name=="string"&&(o.push(`name: ${this.quote(r.name)}`),r.exact&&o.push("exact: true"));for(let{name:l,value:h}of r.attrs)o.push(`${l}: ${typeof h=="string"?this.quote(h):h}`);let u=o.length?`, { ${o.join(", ")} }`:"";return`getByRole(${this.quote(n)}${u})`;case"has-text":return`filter({ hasText: ${this.toHasText(n)} })`;case"has-not-text":return`filter({ hasNotText: ${this.toHasText(n)} })`;case"has":return`filter({ has: ${n} })`;case"hasNot":return`filter({ hasNot: ${n} })`;case"and":return`and(${n})`;case"or":return`or(${n})`;case"chain":return`locator(${n})`;case"test-id":return`getByTestId(${this.toTestIdValue(n)})`;case"text":return this.toCallWithExact("getByText",n,!!r.exact);case"alt":return this.toCallWithExact("getByAltText",n,!!r.exact);case"placeholder":return this.toCallWithExact("getByPlaceholder",n,!!r.exact);case"label":return this.toCallWithExact("getByLabel",n,!!r.exact);case"title":return this.toCallWithExact("getByTitle",n,!!r.exact);default:throw new Error("Unknown selector kind "+t)}}chainLocators(e){return e.join(".")}regexToSourceString(e){return rn(String(e))}toCallWithExact(e,t,n){return ge(t)?`${e}(${this.regexToSourceString(t)})`:n?`${e}(${this.quote(t)}, { exact: true })`:`${e}(${this.quote(t)})`}toHasText(e){return ge(e)?this.regexToSourceString(e):this.quote(e)}toTestIdValue(e){return ge(e)?this.regexToSourceString(e):this.quote(e)}quote(e){return nn(e,this.preferredQuote??"'")}},Jc=class{generateLocator(e,t,n,r={}){switch(t){case"default":return r.hasText!==void 0?`locator(${this.quote(n)}, has_text=${this.toHasText(r.hasText)})`:r.hasNotText!==void 0?`locator(${this.quote(n)}, has_not_text=${this.toHasText(r.hasNotText)})`:`locator(${this.quote(n)})`;case"frame-locator":return`frame_locator(${this.quote(n)})`;case"frame":return"content_frame";case"nth":return`nth(${n})`;case"first":return"first";case"last":return"last";case"visible":return`filter(visible=${n==="true"?"True":"False"})`;case"role":let o=[];ge(r.name)?o.push(`name=${this.regexToString(r.name)}`):typeof r.name=="string"&&(o.push(`name=${this.quote(r.name)}`),r.exact&&o.push("exact=True"));for(let{name:l,value:h}of r.attrs){let p=typeof h=="string"?this.quote(h):h;typeof h=="boolean"&&(p=h?"True":"False"),o.push(`${Wr(l)}=${p}`)}let u=o.length?`, ${o.join(", ")}`:"";return`get_by_role(${this.quote(n)}${u})`;case"has-text":return`filter(has_text=${this.toHasText(n)})`;case"has-not-text":return`filter(has_not_text=${this.toHasText(n)})`;case"has":return`filter(has=${n})`;case"hasNot":return`filter(has_not=${n})`;case"and":return`and_(${n})`;case"or":return`or_(${n})`;case"chain":return`locator(${n})`;case"test-id":return`get_by_test_id(${this.toTestIdValue(n)})`;case"text":return this.toCallWithExact("get_by_text",n,!!r.exact);case"alt":return this.toCallWithExact("get_by_alt_text",n,!!r.exact);case"placeholder":return this.toCallWithExact("get_by_placeholder",n,!!r.exact);case"label":return this.toCallWithExact("get_by_label",n,!!r.exact);case"title":return this.toCallWithExact("get_by_title",n,!!r.exact);default:throw new Error("Unknown selector kind "+t)}}chainLocators(e){return e.join(".")}regexToString(e){let t=e.flags.includes("i")?", re.IGNORECASE":"";return`re.compile(r"${rn(e.source).replace(/\\\//,"/").replace(/"/g,'\\"')}"${t})`}toCallWithExact(e,t,n){return ge(t)?`${e}(${this.regexToString(t)})`:n?`${e}(${this.quote(t)}, exact=True)`:`${e}(${this.quote(t)})`}toHasText(e){return ge(e)?this.regexToString(e):`${this.quote(e)}`}toTestIdValue(e){return ge(e)?this.regexToString(e):this.quote(e)}quote(e){return nn(e,'"')}},Yc=class{generateLocator(e,t,n,r={}){let o;switch(e){case"page":o="Page";break;case"frame-locator":o="FrameLocator";break;case"locator":o="Locator";break}switch(t){case"default":return r.hasText!==void 0?`locator(${this.quote(n)}, new ${o}.LocatorOptions().setHasText(${this.toHasText(r.hasText)}))`:r.hasNotText!==void 0?`locator(${this.quote(n)}, new ${o}.LocatorOptions().setHasNotText(${this.toHasText(r.hasNotText)}))`:`locator(${this.quote(n)})`;case"frame-locator":return`frameLocator(${this.quote(n)})`;case"frame":return"contentFrame()";case"nth":return`nth(${n})`;case"first":return"first()";case"last":return"last()";case"visible":return`filter(new ${o}.FilterOptions().setVisible(${n==="true"?"true":"false"}))`;case"role":let u=[];ge(r.name)?u.push(`.setName(${this.regexToString(r.name)})`):typeof r.name=="string"&&(u.push(`.setName(${this.quote(r.name)})`),r.exact&&u.push(".setExact(true)"));for(let{name:h,value:p}of r.attrs)u.push(`.set${Xt(h)}(${typeof p=="string"?this.quote(p):p})`);let l=u.length?`, new ${o}.GetByRoleOptions()${u.join("")}`:"";return`getByRole(AriaRole.${Wr(n).toUpperCase()}${l})`;case"has-text":return`filter(new ${o}.FilterOptions().setHasText(${this.toHasText(n)}))`;case"has-not-text":return`filter(new ${o}.FilterOptions().setHasNotText(${this.toHasText(n)}))`;case"has":return`filter(new ${o}.FilterOptions().setHas(${n}))`;case"hasNot":return`filter(new ${o}.FilterOptions().setHasNot(${n}))`;case"and":return`and(${n})`;case"or":return`or(${n})`;case"chain":return`locator(${n})`;case"test-id":return`getByTestId(${this.toTestIdValue(n)})`;case"text":return this.toCallWithExact(o,"getByText",n,!!r.exact);case"alt":return this.toCallWithExact(o,"getByAltText",n,!!r.exact);case"placeholder":return this.toCallWithExact(o,"getByPlaceholder",n,!!r.exact);case"label":return this.toCallWithExact(o,"getByLabel",n,!!r.exact);case"title":return this.toCallWithExact(o,"getByTitle",n,!!r.exact);default:throw new Error("Unknown selector kind "+t)}}chainLocators(e){return e.join(".")}regexToString(e){let t=e.flags.includes("i")?", Pattern.CASE_INSENSITIVE":"";return`Pattern.compile(${this.quote(rn(e.source))}${t})`}toCallWithExact(e,t,n,r){return ge(n)?`${t}(${this.regexToString(n)})`:r?`${t}(${this.quote(n)}, new ${e}.${Xt(t)}Options().setExact(true))`:`${t}(${this.quote(n)})`}toHasText(e){return ge(e)?this.regexToString(e):this.quote(e)}toTestIdValue(e){return ge(e)?this.regexToString(e):this.quote(e)}quote(e){return nn(e,'"')}},Qc=class{generateLocator(e,t,n,r={}){switch(t){case"default":return r.hasText!==void 0?`Locator(${this.quote(n)}, new() { ${this.toHasText(r.hasText)} })`:r.hasNotText!==void 0?`Locator(${this.quote(n)}, new() { ${this.toHasNotText(r.hasNotText)} })`:`Locator(${this.quote(n)})`;case"frame-locator":return`FrameLocator(${this.quote(n)})`;case"frame":return"ContentFrame";case"nth":return`Nth(${n})`;case"first":return"First";case"last":return"Last";case"visible":return`Filter(new() { Visible = ${n==="true"?"true":"false"} })`;case"role":let o=[];ge(r.name)?o.push(`NameRegex = ${this.regexToString(r.name)}`):typeof r.name=="string"&&(o.push(`Name = ${this.quote(r.name)}`),r.exact&&o.push("Exact = true"));for(let{name:l,value:h}of r.attrs)o.push(`${Xt(l)} = ${typeof h=="string"?this.quote(h):h}`);let u=o.length?`, new() { ${o.join(", ")} }`:"";return`GetByRole(AriaRole.${Xt(n)}${u})`;case"has-text":return`Filter(new() { ${this.toHasText(n)} })`;case"has-not-text":return`Filter(new() { ${this.toHasNotText(n)} })`;case"has":return`Filter(new() { Has = ${n} })`;case"hasNot":return`Filter(new() { HasNot = ${n} })`;case"and":return`And(${n})`;case"or":return`Or(${n})`;case"chain":return`Locator(${n})`;case"test-id":return`GetByTestId(${this.toTestIdValue(n)})`;case"text":return this.toCallWithExact("GetByText",n,!!r.exact);case"alt":return this.toCallWithExact("GetByAltText",n,!!r.exact);case"placeholder":return this.toCallWithExact("GetByPlaceholder",n,!!r.exact);case"label":return this.toCallWithExact("GetByLabel",n,!!r.exact);case"title":return this.toCallWithExact("GetByTitle",n,!!r.exact);default:throw new Error("Unknown selector kind "+t)}}chainLocators(e){return e.join(".")}regexToString(e){let t=e.flags.includes("i")?", RegexOptions.IgnoreCase":"";return`new Regex(${this.quote(rn(e.source))}${t})`}toCallWithExact(e,t,n){return ge(t)?`${e}(${this.regexToString(t)})`:n?`${e}(${this.quote(t)}, new() { Exact = true })`:`${e}(${this.quote(t)})`}toHasText(e){return ge(e)?`HasTextRegex = ${this.regexToString(e)}`:`HasText = ${this.quote(e)}`}toTestIdValue(e){return ge(e)?this.regexToString(e):this.quote(e)}toHasNotText(e){return ge(e)?`HasNotTextRegex = ${this.regexToString(e)}`:`HasNotText = ${this.quote(e)}`}quote(e){return nn(e,'"')}},Xc=class{generateLocator(e,t,n,r={}){return JSON.stringify({kind:t,body:n,options:r})}chainLocators(e){let t=e.map(n=>JSON.parse(n));for(let n=0;n<t.length-1;++n)t[n].next=t[n+1];return JSON.stringify(t[0])}},Zc={javascript:zc,python:Jc,java:Yc,csharp:Qc,jsonl:Xc};function ge(e){return e instanceof RegExp}function el(e){return Zo(e)?"'"+e.replace(/'/g,"''")+"'":e}function Lr(e){return Zo(e)?'"'+e.replace(/[\\"\x00-\x1f\x7f-\x9f]/g,t=>{switch(t){case"\\":return"\\\\";case'"':return'\\"';case"\b":return"\\b";case"\f":return"\\f";case`
8
- `:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return"\\x"+t.charCodeAt(0).toString(16).padStart(2,"0")}})+'"':e}function Zo(e){return!!(e.length===0||/^\s|\s$/.test(e)||/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(e)||/^-/.test(e)||/[\n:](\s|$)/.test(e)||/\s#/.test(e)||/[\n\r]/.test(e)||/^[&*\],?!>|@"'#%]/.test(e)||/[{}`]/.test(e)||/^\[/.test(e)||!isNaN(Number(e))||["y","n","yes","no","true","false","on","off","null"].includes(e.toLowerCase()))}var tl=0;function ws(e,t){let n=new Set,r={root:{role:"fragment",name:"",children:[],element:e,props:{},box:en(e),receivesPointerEvents:!0},elements:new Map},o=(l,h)=>{if(n.has(h))return;if(n.add(h),h.nodeType===Node.TEXT_NODE&&h.nodeValue){let m=h.nodeValue;l.role!=="textbox"&&m&&l.children.push(h.nodeValue||"");return}if(h.nodeType!==Node.ELEMENT_NODE)return;let p=h,b=!Ce(p);if(t?.forAI&&(b=b||Ge(p)),!b)return;let v=[];if(p.hasAttribute("aria-owns")){let m=p.getAttribute("aria-owns").split(/\s+/);for(let w of m){let A=e.ownerDocument.getElementById(w);A&&v.push(A)}}let y=nl(p,t);y&&(y.ref&&r.elements.set(y.ref,p),l.children.push(y)),u(y||l,p,v)};function u(l,h,p=[]){var b;let y=(((b=Fe(h))==null?void 0:b.display)||"inline")!=="inline"||h.nodeName==="BR"?" ":"";y&&l.children.push(y),l.children.push(_t(h,"::before")||"");let m=h.nodeName==="SLOT"?h.assignedNodes():[];if(m.length)for(let w of m)o(l,w);else{for(let w=h.firstChild;w;w=w.nextSibling)w.assignedSlot||o(l,w);if(h.shadowRoot)for(let w=h.shadowRoot.firstChild;w;w=w.nextSibling)o(l,w)}for(let w of p)o(l,w);if(l.children.push(_t(h,"::after")||""),y&&l.children.push(y),l.children.length===1&&l.name===l.children[0]&&(l.children=[]),l.role==="link"&&h.hasAttribute("href")){let w=h.getAttribute("href");l.props.url=w}}Xn();try{o(r.root,e)}finally{Zn()}return sl(r.root),rl(r.root),r}function ji(e,t,n,r){if(!r?.forAI)return;let o;return o=e._ariaRef,(!o||o.role!==t||o.name!==n)&&(o={role:t,name:n,ref:(r?.refPrefix??"")+"e"+ ++tl},e._ariaRef=o),o.ref}function nl(e,t){if(e.nodeName==="IFRAME")return{role:"iframe",name:"",ref:ji(e,"iframe","",t),children:[],props:{},element:e,box:en(e),receivesPointerEvents:!0};let n=t?.forAI?"generic":null,r=he(e)??n;if(!r||r==="presentation"||r==="none")return null;let o=we(At(e,!1)||""),u=Po(e),l={role:r,name:o,ref:ji(e,r,o,t),children:[],props:{},element:e,box:en(e),receivesPointerEvents:u};return zn.includes(r)&&(l.checked=ns(e)),as.includes(r)&&(l.disabled=tn(e)),Yn.includes(r)&&(l.expanded=is(e)),Qn.includes(r)&&(l.level=os(e)),Jn.includes(r)&&(l.pressed=ss(e)),Gn.includes(r)&&(l.selected=ts(e)),(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.type!=="checkbox"&&e.type!=="radio"&&(e.type!=="file"||Vn().inputFileRoleTextbox)&&(l.children=[e.value]),l}function rl(e){let t=n=>{let r=[];for(let u of n.children||[]){if(typeof u=="string"){r.push(u);continue}let l=t(u);r.push(...l)}return n.role==="generic"&&r.length<=1&&r.every(u=>typeof u!="string"&&ta(u))?r:(n.children=r,[n])};t(e)}function sl(e){let t=(r,o)=>{if(!r.length)return;let u=we(r.join(""));u&&o.push(u),r.length=0},n=r=>{let o=[],u=[];for(let l of r.children||[])typeof l=="string"?u.push(l):(t(u,o),n(l),o.push(l));t(u,o),r.children=o.length?o:[],r.children.length===1&&r.children[0]===r.name&&(r.children=[])};n(e)}function Es(e,t){return t?e?typeof t=="string"?e===t:!!e.match(new RegExp(t.pattern)):!1:!0}function il(e,t){return Es(e,t.text)}function ol(e,t){return Es(e,t.name)}function al(e,t){let n=ws(e);return{matches:ea(n.root,t,!1,!1),received:{raw:Br(n,{mode:"raw"}),regex:Br(n,{mode:"regex"})}}}function cl(e,t){let n=ws(e).root;return ea(n,t,!0,!1).map(o=>o.element)}function Ss(e,t,n){var r;return typeof e=="string"&&t.kind==="text"?il(e,t):e===null||typeof e!="object"||t.kind!=="role"||t.role!=="fragment"&&t.role!==e.role||t.checked!==void 0&&t.checked!==e.checked||t.disabled!==void 0&&t.disabled!==e.disabled||t.expanded!==void 0&&t.expanded!==e.expanded||t.level!==void 0&&t.level!==e.level||t.pressed!==void 0&&t.pressed!==e.pressed||t.selected!==void 0&&t.selected!==e.selected||!ol(e.name,t)||!Es(e.props.url,(r=t.props)==null?void 0:r.url)?!1:t.containerMode==="contain"?Hi(e.children||[],t.children||[]):t.containerMode==="equal"?Fi(e.children||[],t.children||[],!1):t.containerMode==="deep-equal"||n?Fi(e.children||[],t.children||[],!0):Hi(e.children||[],t.children||[])}function Fi(e,t,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!Ss(e[r],t[r],n))return!1;return!0}function Hi(e,t){if(t.length>e.length)return!1;let n=e.slice(),r=t.slice();for(let o of r){let u=n.shift();for(;u&&!Ss(u,o,!1);)u=n.shift();if(!u)return!1}return!0}function ea(e,t,n,r){let o=[],u=(l,h)=>{if(Ss(l,t,r)){let p=typeof l=="string"?h:l;return p&&o.push(p),!n}if(typeof l=="string")return!1;for(let p of l.children||[])if(u(p,l))return!0;return!1};return u(e,null),o}function Br(e,t){let n=[],r=t?.mode==="regex"?ul:()=>!0,o=t?.mode==="regex"?ll:h=>h,u=(h,p,b)=>{if(typeof h=="string"){if(p&&!r(p,h))return;let w=Lr(o(h));w&&n.push(b+"- text: "+w);return}let v=h.role;if(h.name&&h.name.length<=900){let w=o(h.name);if(w){let A=w.startsWith("/")&&w.endsWith("/")?w:JSON.stringify(w);v+=" "+A}}if(h.checked==="mixed"&&(v+=" [checked=mixed]"),h.checked===!0&&(v+=" [checked]"),h.disabled&&(v+=" [disabled]"),h.expanded&&(v+=" [expanded]"),h.level&&(v+=` [level=${h.level}]`),h.pressed==="mixed"&&(v+=" [pressed=mixed]"),h.pressed===!0&&(v+=" [pressed]"),h.selected===!0&&(v+=" [selected]"),t?.forAI&&ta(h)){let w=h.ref,A=hl(h)?" [cursor=pointer]":"";w&&(v+=` [ref=${w}]${A}`)}let y=b+"- "+el(v),m=!!Object.keys(h.props).length;if(!h.children.length&&!m)n.push(y);else if(h.children.length===1&&typeof h.children[0]=="string"&&!m){let w=r(h,h.children[0])?o(h.children[0]):null;w?n.push(y+": "+Lr(w)):n.push(y)}else{n.push(y+":");for(let[w,A]of Object.entries(h.props))n.push(b+" - /"+w+": "+Lr(A));for(let w of h.children||[])u(w,h,b+" ")}},l=e.root;if(l.role==="fragment")for(let h of l.children||[])u(h,l,"");else u(l,null,"");return n.join(`
9
- `)}function ll(e){let t=[{regex:/\b[\d,.]+[bkmBKM]+\b/,replacement:"[\\d,.]+[bkmBKM]+"},{regex:/\b\d+[hmsp]+\b/,replacement:"\\d+[hmsp]+"},{regex:/\b[\d,.]+[hmsp]+\b/,replacement:"[\\d,.]+[hmsp]+"},{regex:/\b\d+,\d+\b/,replacement:"\\d+,\\d+"},{regex:/\b\d+\.\d{2,}\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\.\d+\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\b/,replacement:"\\d+"}],n="",r=0,o=new RegExp(t.map(u=>"("+u.regex.source+")").join("|"),"g");return e.replace(o,(u,...l)=>{let h=l[l.length-2],p=l.slice(0,-2);n+=Zt(e.slice(r,h));for(let b=0;b<p.length;b++)if(p[b]){let{replacement:v}=t[b];n+=v;break}return r=h+u.length,u}),n?(n+=Zt(e.slice(r)),String(new RegExp(n))):e}function ul(e,t){if(!t.length)return!1;if(!e.name)return!0;if(e.name.length>t.length)return!1;let n=t.length<=200&&e.name.length<=200?eo(t,e.name):"",r=t;for(;n&&r.includes(n);)r=r.replace(n,"");return r.trim().length/t.length>.1}function ta(e){return e.box.visible&&e.receivesPointerEvents}function hl(e){var t;return((t=e.box.style)==null?void 0:t.cursor)==="pointer"}var Wi={},Or=class{_glassPaneElement;_glassPaneShadow;_renderedEntries=[];_actionPointElement;_isUnderTest;_injectedScript;_rafRequest;_language="javascript";constructor(e){this._injectedScript=e;let t=e.document;this._isUnderTest=e.isUnderTest,this._glassPaneElement=t.createElement("x-pw-glass"),this._glassPaneElement.style.position="fixed",this._glassPaneElement.style.top="0",this._glassPaneElement.style.right="0",this._glassPaneElement.style.bottom="0",this._glassPaneElement.style.left="0",this._glassPaneElement.style.zIndex="2147483646",this._glassPaneElement.style.pointerEvents="none",this._glassPaneElement.style.display="flex",this._glassPaneElement.style.backgroundColor="transparent";for(let n of["click","auxclick","dragstart","input","keydown","keyup","pointerdown","pointerup","mousedown","mouseup","mouseleave","focus","scroll"])this._glassPaneElement.addEventListener(n,r=>{r.stopPropagation(),r.stopImmediatePropagation()});if(this._actionPointElement=t.createElement("x-pw-action-point"),this._actionPointElement.setAttribute("hidden","true"),this._glassPaneShadow=this._glassPaneElement.attachShadow({mode:this._isUnderTest?"open":"closed"}),typeof this._glassPaneShadow.adoptedStyleSheets.push=="function"){let n=new this._injectedScript.window.CSSStyleSheet;n.replaceSync(Wi),this._glassPaneShadow.adoptedStyleSheets.push(n)}else{let n=this._injectedScript.document.createElement("style");n.textContent=Wi,this._glassPaneShadow.appendChild(n)}this._glassPaneShadow.appendChild(this._actionPointElement)}install(){this._injectedScript.document.documentElement&&!this._injectedScript.document.documentElement.contains(this._glassPaneElement)&&this._injectedScript.document.documentElement.appendChild(this._glassPaneElement)}setLanguage(e){this._language=e}runHighlightOnRaf(e){this._rafRequest&&this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest);let t=this._injectedScript.querySelectorAll(e,this._injectedScript.document.documentElement),n=Qt(this._language,je(e)),r=t.length>1?"#f6b26b7f":"#6fa8dc7f";this.updateHighlight(t.map((o,u)=>{let l=t.length>1?` [${u+1} of ${t.length}]`:"";return{element:o,color:r,tooltipText:n+l}})),this._rafRequest=this._injectedScript.utils.builtins.requestAnimationFrame(()=>this.runHighlightOnRaf(e))}uninstall(){this._rafRequest&&this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest),this._glassPaneElement.remove()}showActionPoint(e,t){this._actionPointElement.style.top=t+"px",this._actionPointElement.style.left=e+"px",this._actionPointElement.hidden=!1}hideActionPoint(){this._actionPointElement.hidden=!0}clearHighlight(){var e,t;for(let n of this._renderedEntries)(e=n.highlightElement)==null||e.remove(),(t=n.tooltipElement)==null||t.remove();this._renderedEntries=[]}maskElements(e,t){this.updateHighlight(e.map(n=>({element:n,color:t})))}updateHighlight(e){if(!this._highlightIsUpToDate(e)){this.clearHighlight();for(let t of e){let n=this._createHighlightElement();this._glassPaneShadow.appendChild(n);let r;if(t.tooltipText){r=this._injectedScript.document.createElement("x-pw-tooltip"),this._glassPaneShadow.appendChild(r),r.style.top="0",r.style.left="0",r.style.display="flex";let o=this._injectedScript.document.createElement("x-pw-tooltip-line");o.textContent=t.tooltipText,r.appendChild(o)}this._renderedEntries.push({targetElement:t.element,color:t.color,tooltipElement:r,highlightElement:n})}for(let t of this._renderedEntries){if(t.box=t.targetElement.getBoundingClientRect(),!t.tooltipElement)continue;let{anchorLeft:n,anchorTop:r}=this.tooltipPosition(t.box,t.tooltipElement);t.tooltipTop=r,t.tooltipLeft=n}for(let t of this._renderedEntries){t.tooltipElement&&(t.tooltipElement.style.top=t.tooltipTop+"px",t.tooltipElement.style.left=t.tooltipLeft+"px");let n=t.box;t.highlightElement.style.backgroundColor=t.color,t.highlightElement.style.left=n.x+"px",t.highlightElement.style.top=n.y+"px",t.highlightElement.style.width=n.width+"px",t.highlightElement.style.height=n.height+"px",t.highlightElement.style.display="block",this._isUnderTest&&console.error("Highlight box for test: "+JSON.stringify({x:n.x,y:n.y,width:n.width,height:n.height}))}}}firstBox(){var e;return(e=this._renderedEntries[0])==null?void 0:e.box}tooltipPosition(e,t){let n=t.offsetWidth,r=t.offsetHeight,o=this._glassPaneElement.offsetWidth,u=this._glassPaneElement.offsetHeight,l=e.left;l+n>o-5&&(l=o-n-5);let h=e.bottom+5;return h+r>u-5&&(e.top>r+5?h=e.top-r-5:h=u-5-r),{anchorLeft:l,anchorTop:h}}_highlightIsUpToDate(e){if(e.length!==this._renderedEntries.length)return!1;for(let t=0;t<this._renderedEntries.length;++t){if(e[t].element!==this._renderedEntries[t].targetElement||e[t].color!==this._renderedEntries[t].color)return!1;let n=this._renderedEntries[t].box;if(!n)return!1;let r=e[t].element.getBoundingClientRect();if(r.top!==n.top||r.right!==n.right||r.bottom!==n.bottom||r.left!==n.left)return!1}return!0}_createHighlightElement(){return this._injectedScript.document.createElement("x-pw-highlight")}appendChild(e){this._glassPaneShadow.appendChild(e)}};function fl(e,t,n){let r=e.left-t.right;if(!(r<0||n!==void 0&&r>n))return r+Math.max(t.bottom-e.bottom,0)+Math.max(e.top-t.top,0)}function dl(e,t,n){let r=t.left-e.right;if(!(r<0||n!==void 0&&r>n))return r+Math.max(t.bottom-e.bottom,0)+Math.max(e.top-t.top,0)}function pl(e,t,n){let r=t.top-e.bottom;if(!(r<0||n!==void 0&&r>n))return r+Math.max(e.left-t.left,0)+Math.max(t.right-e.right,0)}function gl(e,t,n){let r=e.top-t.bottom;if(!(r<0||n!==void 0&&r>n))return r+Math.max(e.left-t.left,0)+Math.max(t.right-e.right,0)}function ml(e,t,n){let r=n===void 0?50:n,o=0;return e.left-t.right>=0&&(o+=e.left-t.right),t.left-e.right>=0&&(o+=t.left-e.right),t.top-e.bottom>=0&&(o+=t.top-e.bottom),e.top-t.bottom>=0&&(o+=e.top-t.bottom),o>r?void 0:o}var yl=["left-of","right-of","above","below","near"];function na(e,t,n,r){let o=t.getBoundingClientRect(),u={"left-of":dl,"right-of":fl,above:pl,below:gl,near:ml}[e],l;for(let h of n){if(h===t)continue;let p=u(o,h.getBoundingClientRect(),r);p!==void 0&&(l===void 0||p<l)&&(l=p)}return l}function Ki(e){return e.displayName||e.name||"Anonymous"}function bl(e){if(e.type)switch(typeof e.type){case"function":return Ki(e.type);case"string":return e.type;case"object":return e.type.displayName||(e.type.render?Ki(e.type.render):"")}if(e._currentElement){let t=e._currentElement.type;if(typeof t=="string")return t;if(typeof t=="function")return t.displayName||t.name||"Anonymous"}return""}function vl(e){var t;return e.key??((t=e._currentElement)==null?void 0:t.key)}function wl(e){if(e.child){let n=[];for(let r=e.child;r;r=r.sibling)n.push(r);return n}if(!e._currentElement)return[];let t=n=>{var r;let o=(r=n._currentElement)==null?void 0:r.type;return typeof o=="function"||typeof o=="string"};if(e._renderedComponent){let n=e._renderedComponent;return t(n)?[n]:[]}return e._renderedChildren?[...Object.values(e._renderedChildren)].filter(t):[]}function El(e){var t;let n=e.memoizedProps||((t=e._currentElement)==null?void 0:t.props);if(!n||typeof n=="string")return n;let r={...n};return delete r.children,r}function ra(e){var t;let n={key:vl(e),name:bl(e),children:wl(e).map(ra),rootElements:[],props:El(e)},r=e.stateNode||e._hostNode||((t=e._renderedComponent)==null?void 0:t._hostNode);if(r instanceof Element)n.rootElements.push(r);else for(let o of n.children)n.rootElements.push(...o.rootElements);return n}function sa(e,t,n=[]){t(e)&&n.push(e);for(let r of e.children)sa(r,t,n);return n}function ia(e,t=[]){let r=(e.ownerDocument||e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);do{let o=r.currentNode,u=o,l=Object.keys(u).find(p=>p.startsWith("__reactContainer")&&u[p]!==null);if(l)t.push(u[l].stateNode.current);else{let p="_reactRootContainer";u.hasOwnProperty(p)&&u[p]!==null&&t.push(u[p]._internalRoot.current)}if(o instanceof Element&&o.hasAttribute("data-reactroot"))for(let p of Object.keys(o))(p.startsWith("__reactInternalInstance")||p.startsWith("__reactFiber"))&&t.push(o[p]);let h=o instanceof Element?o.shadowRoot:null;h&&ia(h,t)}while(r.nextNode());return t}var Sl=()=>({queryAll(e,t){let{name:n,attributes:r}=tt(t,!1),l=ia(e.ownerDocument||e).map(p=>ra(p)).map(p=>sa(p,b=>{let v=b.props??{};if(b.key!==void 0&&(v.key=b.key),n&&b.name!==n||b.rootElements.some(y=>!on(e,y)))return!1;for(let y of r)if(!ms(v,y))return!1;return!0})).flat(),h=new Set;for(let p of l)for(let b of p.rootElements)h.add(b);return[...h]}}),oa=["selected","checked","pressed","expanded","level","disabled","name","include-hidden"];oa.sort();function Ht(e,t,n){if(!t.includes(n))throw new Error(`"${e}" attribute is only supported for roles: ${t.slice().sort().map(r=>`"${r}"`).join(", ")}`)}function bt(e,t){if(e.op!=="<truthy>"&&!t.includes(e.value))throw new Error(`"${e.name}" must be one of ${t.map(n=>JSON.stringify(n)).join(", ")}`)}function vt(e,t){if(!t.includes(e.op))throw new Error(`"${e.name}" does not support "${e.op}" matcher`)}function xl(e,t){let n={role:t};for(let r of e)switch(r.name){case"checked":{Ht(r.name,zn,t),bt(r,[!0,!1,"mixed"]),vt(r,["<truthy>","="]),n.checked=r.op==="<truthy>"?!0:r.value;break}case"pressed":{Ht(r.name,Jn,t),bt(r,[!0,!1,"mixed"]),vt(r,["<truthy>","="]),n.pressed=r.op==="<truthy>"?!0:r.value;break}case"selected":{Ht(r.name,Gn,t),bt(r,[!0,!1]),vt(r,["<truthy>","="]),n.selected=r.op==="<truthy>"?!0:r.value;break}case"expanded":{Ht(r.name,Yn,t),bt(r,[!0,!1]),vt(r,["<truthy>","="]),n.expanded=r.op==="<truthy>"?!0:r.value;break}case"level":{if(Ht(r.name,Qn,t),typeof r.value=="string"&&(r.value=+r.value),r.op!=="="||typeof r.value!="number"||Number.isNaN(r.value))throw new Error('"level" attribute must be compared to a number');n.level=r.value;break}case"disabled":{bt(r,[!0,!1]),vt(r,["<truthy>","="]),n.disabled=r.op==="<truthy>"?!0:r.value;break}case"name":{if(r.op==="<truthy>")throw new Error('"name" attribute must have a value');if(typeof r.value!="string"&&!(r.value instanceof RegExp))throw new Error('"name" attribute must be a string or a regular expression');n.name=r.value,n.nameOp=r.op,n.exact=r.caseSensitive;break}case"include-hidden":{bt(r,[!0,!1]),vt(r,["<truthy>","="]),n.includeHidden=r.op==="<truthy>"?!0:r.value;break}default:throw new Error(`Unknown attribute "${r.name}", must be one of ${oa.map(o=>`"${o}"`).join(", ")}.`)}return n}function Tl(e,t,n){let r=[],o=l=>{if(he(l)===t.role&&!(t.selected!==void 0&&ts(l)!==t.selected)&&!(t.checked!==void 0&&ns(l)!==t.checked)&&!(t.pressed!==void 0&&ss(l)!==t.pressed)&&!(t.expanded!==void 0&&is(l)!==t.expanded)&&!(t.level!==void 0&&os(l)!==t.level)&&!(t.disabled!==void 0&&tn(l)!==t.disabled)&&!(!t.includeHidden&&Ce(l))){if(t.name!==void 0){let h=we(At(l,!!t.includeHidden));if(typeof t.name=="string"&&(t.name=we(t.name)),n&&!t.exact&&t.nameOp==="="&&(t.nameOp="*="),!ys(h,{name:"",jsonPath:[],op:t.nameOp||"=",value:t.name,caseSensitive:!!t.exact}))return}r.push(l)}},u=l=>{let h=[];l.shadowRoot&&h.push(l.shadowRoot);for(let p of l.querySelectorAll("*"))o(p),p.shadowRoot&&h.push(p.shadowRoot);h.forEach(u)};return u(e),r}function Vi(e){return{queryAll:(t,n)=>{let r=tt(n,!0),o=r.name.toLowerCase();if(!o)throw new Error("Role must not be empty");let u=xl(r.attributes,o);Xn();try{return Tl(t,u,e)}finally{Zn()}}}}var kl=class{_engines;_cacheQueryCSS;_cacheMatches;_cacheQuery;_cacheMatchesSimple;_cacheMatchesParents;_cacheCallMatches;_cacheCallQuery;_cacheQuerySimple;_cacheText;_scoreMap;_retainCacheCounter=0;constructor(){this._cacheText=new Map,this._cacheQueryCSS=new Map,this._cacheMatches=new Map,this._cacheQuery=new Map,this._cacheMatchesSimple=new Map,this._cacheMatchesParents=new Map,this._cacheCallMatches=new Map,this._cacheCallQuery=new Map,this._cacheQuerySimple=new Map,this._engines=new Map,this._engines.set("not",Nl),this._engines.set("is",Vt),this._engines.set("where",Vt),this._engines.set("has",_l),this._engines.set("scope",Al),this._engines.set("light",Cl),this._engines.set("visible",Il),this._engines.set("text",Ll),this._engines.set("text-is",Ol),this._engines.set("text-matches",$l),this._engines.set("has-text",Ml),this._engines.set("right-of",Wt("right-of")),this._engines.set("left-of",Wt("left-of")),this._engines.set("above",Wt("above")),this._engines.set("below",Wt("below")),this._engines.set("near",Wt("near")),this._engines.set("nth-match",Pl);let e=[...this._engines.keys()];e.sort();let t=[...Xo];if(t.sort(),e.join("|")!==t.join("|"))throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${e.join("|")} vs ${t.join("|")}`)}begin(){++this._retainCacheCounter}end(){--this._retainCacheCounter,this._retainCacheCounter||(this._cacheQueryCSS.clear(),this._cacheMatches.clear(),this._cacheQuery.clear(),this._cacheMatchesSimple.clear(),this._cacheMatchesParents.clear(),this._cacheCallMatches.clear(),this._cacheCallQuery.clear(),this._cacheQuerySimple.clear(),this._cacheText.clear())}_cached(e,t,n,r){e.has(t)||e.set(t,[]);let o=e.get(t),u=o.find(h=>n.every((p,b)=>h.rest[b]===p));if(u)return u.result;let l=r();return o.push({rest:n,result:l}),l}_checkSelector(e){if(!(typeof e=="object"&&e&&(Array.isArray(e)||"simples"in e&&e.simples.length)))throw new Error(`Malformed selector "${e}"`);return e}matches(e,t,n){let r=this._checkSelector(t);this.begin();try{return this._cached(this._cacheMatches,e,[r,n.scope,n.pierceShadow,n.originalScope],()=>Array.isArray(r)?this._matchesEngine(Vt,e,r,n):(this._hasScopeClause(r)&&(n=this._expandContextForScopeMatching(n)),this._matchesSimple(e,r.simples[r.simples.length-1].selector,n)?this._matchesParents(e,r,r.simples.length-2,n):!1))}finally{this.end()}}query(e,t){let n=this._checkSelector(t);this.begin();try{return this._cached(this._cacheQuery,n,[e.scope,e.pierceShadow,e.originalScope],()=>{if(Array.isArray(n))return this._queryEngine(Vt,e,n);this._hasScopeClause(n)&&(e=this._expandContextForScopeMatching(e));let r=this._scoreMap;this._scoreMap=new Map;let o=this._querySimple(e,n.simples[n.simples.length-1].selector);return o=o.filter(u=>this._matchesParents(u,n,n.simples.length-2,e)),this._scoreMap.size&&o.sort((u,l)=>{let h=this._scoreMap.get(u),p=this._scoreMap.get(l);return h===p?0:h===void 0?1:p===void 0?-1:h-p}),this._scoreMap=r,o})}finally{this.end()}}_markScore(e,t){this._scoreMap&&this._scoreMap.set(e,t)}_hasScopeClause(e){return e.simples.some(t=>t.selector.functions.some(n=>n.name==="scope"))}_expandContextForScopeMatching(e){if(e.scope.nodeType!==1)return e;let t=me(e.scope);return t?{...e,scope:t,originalScope:e.originalScope||e.scope}:e}_matchesSimple(e,t,n){return this._cached(this._cacheMatchesSimple,e,[t,n.scope,n.pierceShadow,n.originalScope],()=>{if(e===n.scope||t.css&&!this._matchesCSS(e,t.css))return!1;for(let r of t.functions)if(!this._matchesEngine(this._getEngine(r.name),e,r.args,n))return!1;return!0})}_querySimple(e,t){return t.functions.length?this._cached(this._cacheQuerySimple,t,[e.scope,e.pierceShadow,e.originalScope],()=>{let n=t.css,r=t.functions;n==="*"&&r.length&&(n=void 0);let o,u=-1;n!==void 0?o=this._queryCSS(e,n):(u=r.findIndex(l=>this._getEngine(l.name).query!==void 0),u===-1&&(u=0),o=this._queryEngine(this._getEngine(r[u].name),e,r[u].args));for(let l=0;l<r.length;l++){if(l===u)continue;let h=this._getEngine(r[l].name);h.matches!==void 0&&(o=o.filter(p=>this._matchesEngine(h,p,r[l].args,e)))}for(let l=0;l<r.length;l++){if(l===u)continue;let h=this._getEngine(r[l].name);h.matches===void 0&&(o=o.filter(p=>this._matchesEngine(h,p,r[l].args,e)))}return o}):this._queryCSS(e,t.css||"*")}_matchesParents(e,t,n,r){return n<0?!0:this._cached(this._cacheMatchesParents,e,[t,n,r.scope,r.pierceShadow,r.originalScope],()=>{let{selector:o,combinator:u}=t.simples[n];if(u===">"){let l=Pn(e,r);return!l||!this._matchesSimple(l,o,r)?!1:this._matchesParents(l,t,n-1,r)}if(u==="+"){let l=$r(e,r);return!l||!this._matchesSimple(l,o,r)?!1:this._matchesParents(l,t,n-1,r)}if(u===""){let l=Pn(e,r);for(;l;){if(this._matchesSimple(l,o,r)){if(this._matchesParents(l,t,n-1,r))return!0;if(t.simples[n-1].combinator==="")break}l=Pn(l,r)}return!1}if(u==="~"){let l=$r(e,r);for(;l;){if(this._matchesSimple(l,o,r)){if(this._matchesParents(l,t,n-1,r))return!0;if(t.simples[n-1].combinator==="~")break}l=$r(l,r)}return!1}if(u===">="){let l=e;for(;l;){if(this._matchesSimple(l,o,r)){if(this._matchesParents(l,t,n-1,r))return!0;if(t.simples[n-1].combinator==="")break}l=Pn(l,r)}return!1}throw new Error(`Unsupported combinator "${u}"`)})}_matchesEngine(e,t,n,r){if(e.matches)return this._callMatches(e,t,n,r);if(e.query)return this._callQuery(e,n,r).includes(t);throw new Error('Selector engine should implement "matches" or "query"')}_queryEngine(e,t,n){if(e.query)return this._callQuery(e,n,t);if(e.matches)return this._queryCSS(t,"*").filter(r=>this._callMatches(e,r,n,t));throw new Error('Selector engine should implement "matches" or "query"')}_callMatches(e,t,n,r){return this._cached(this._cacheCallMatches,t,[e,r.scope,r.pierceShadow,r.originalScope,...n],()=>e.matches(t,n,r,this))}_callQuery(e,t,n){return this._cached(this._cacheCallQuery,e,[n.scope,n.pierceShadow,n.originalScope,...t],()=>e.query(n,t,this))}_matchesCSS(e,t){return e.matches(t)}_queryCSS(e,t){return this._cached(this._cacheQueryCSS,t,[e.scope,e.pierceShadow,e.originalScope],()=>{let n=[];function r(o){if(n=n.concat([...o.querySelectorAll(t)]),!!e.pierceShadow){o.shadowRoot&&r(o.shadowRoot);for(let u of o.querySelectorAll("*"))u.shadowRoot&&r(u.shadowRoot)}}return r(e.scope),n})}_getEngine(e){let t=this._engines.get(e);if(!t)throw new Error(`Unknown selector engine "${e}"`);return t}},Vt={matches(e,t,n,r){if(t.length===0)throw new Error('"is" engine expects non-empty selector list');return t.some(o=>r.matches(e,o,n))},query(e,t,n){if(t.length===0)throw new Error('"is" engine expects non-empty selector list');let r=[];for(let o of t)r=r.concat(n.query(e,o));return t.length===1?r:aa(r)}},_l={matches(e,t,n,r){if(t.length===0)throw new Error('"has" engine expects non-empty selector list');return r.query({...n,scope:e},t).length>0}},Al={matches(e,t,n,r){if(t.length!==0)throw new Error('"scope" engine expects no arguments');let o=n.originalScope||n.scope;return o.nodeType===9?e===o.documentElement:e===o},query(e,t,n){if(t.length!==0)throw new Error('"scope" engine expects no arguments');let r=e.originalScope||e.scope;if(r.nodeType===9){let o=r.documentElement;return o?[o]:[]}return r.nodeType===1?[r]:[]}},Nl={matches(e,t,n,r){if(t.length===0)throw new Error('"not" engine expects non-empty selector list');return!r.matches(e,t,n)}},Cl={query(e,t,n){return n.query({...e,pierceShadow:!1},t)},matches(e,t,n,r){return r.matches(e,t,{...n,pierceShadow:!1})}},Il={matches(e,t,n,r){if(t.length)throw new Error('"visible" engine expects no arguments');return Ge(e)}},Ll={matches(e,t,n,r){if(t.length!==1||typeof t[0]!="string")throw new Error('"text" engine expects a single string');let o=we(t[0]).toLowerCase(),u=l=>l.normalized.toLowerCase().includes(o);return an(r._cacheText,e,u)==="self"}},Ol={matches(e,t,n,r){if(t.length!==1||typeof t[0]!="string")throw new Error('"text-is" engine expects a single string');let o=we(t[0]),u=l=>!o&&!l.immediate.length?!0:l.immediate.some(h=>we(h)===o);return an(r._cacheText,e,u)!=="none"}},$l={matches(e,t,n,r){if(t.length===0||typeof t[0]!="string"||t.length>2||t.length===2&&typeof t[1]!="string")throw new Error('"text-matches" engine expects a regexp body and optional regexp flags');let o=new RegExp(t[0],t.length===2?t[1]:void 0),u=l=>o.test(l.full);return an(r._cacheText,e,u)==="self"}},Ml={matches(e,t,n,r){if(t.length!==1||typeof t[0]!="string")throw new Error('"has-text" engine expects a single string');if(er(e))return!1;let o=we(t[0]).toLowerCase();return(l=>l.normalized.toLowerCase().includes(o))(Se(r._cacheText,e))}};function Wt(e){return{matches(t,n,r,o){let u=n.length&&typeof n[n.length-1]=="number"?n[n.length-1]:void 0,l=u===void 0?n:n.slice(0,n.length-1);if(n.length<1+(u===void 0?0:1))throw new Error(`"${e}" engine expects a selector list and optional maximum distance in pixels`);let h=o.query(r,l),p=na(e,t,h,u);return p===void 0?!1:(o._markScore(t,p),!0)}}}var Pl={query(e,t,n){let r=t[t.length-1];if(t.length<2)throw new Error('"nth-match" engine expects non-empty selector list and an index argument');if(typeof r!="number"||r<1)throw new Error('"nth-match" engine expects a one-based index as the last argument');let o=Vt.query(e,t.slice(0,t.length-1),n);return r--,r<o.length?[o[r]]:[]}};function Pn(e,t){if(e!==t.scope)return t.pierceShadow?me(e):e.parentElement||void 0}function $r(e,t){if(e!==t.scope)return e.previousElementSibling||void 0}function aa(e){let t=new Map,n=[],r=[];function o(l){let h=t.get(l);if(h)return h;let p=me(l);return p?o(p).children.push(l):n.push(l),h={children:[],taken:!1},t.set(l,h),h}for(let l of e)o(l).taken=!0;function u(l){let h=t.get(l);if(h.taken&&r.push(l),h.children.length>1){let p=new Set(h.children);h.children=[];let b=l.firstElementChild;for(;b&&h.children.length<p.size;)p.has(b)&&h.children.push(b),b=b.nextElementSibling;for(b=l.shadowRoot?l.shadowRoot.firstElementChild:null;b&&h.children.length<p.size;)p.has(b)&&h.children.push(b),b=b.nextElementSibling}h.children.forEach(u)}return n.forEach(u),r}function ca(e,t){let n=e.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"),r=n.substring(n.lastIndexOf("/")+1);return t&&r.endsWith(t)&&(r=r.substring(0,r.length-t.length)),r}function Rl(e,t){return t?t.toUpperCase():""}var ql=/(?:^|[-_/])(\w)/g,la=e=>e&&e.replace(ql,Rl);function Dl(e){function t(v){let y=v.name||v._componentTag||v.__playwright_guessedName;if(y)return y;let m=v.__file;if(m)return la(ca(m,".vue"))}function n(v,y){return v.type.__playwright_guessedName=y,y}function r(v){var y,m,w,A;let I=t(v.type||{});if(I)return I;if(v.root===v)return"Root";for(let P in(m=(y=v.parent)==null?void 0:y.type)==null?void 0:m.components)if(((w=v.parent)==null?void 0:w.type.components[P])===v.type)return n(v,P);for(let P in(A=v.appContext)==null?void 0:A.components)if(v.appContext.components[P]===v.type)return n(v,P);return"Anonymous Component"}function o(v){return v._isBeingDestroyed||v.isUnmounted}function u(v){return v.subTree.type.toString()==="Symbol(Fragment)"}function l(v){let y=[];return v.component&&y.push(v.component),v.suspense&&y.push(...l(v.suspense.activeBranch)),Array.isArray(v.children)&&v.children.forEach(m=>{m.component?y.push(m.component):y.push(...l(m))}),y.filter(m=>{var w;return!o(m)&&!((w=m.type.devtools)!=null&&w.hide)})}function h(v){return u(v)?p(v.subTree):[v.subTree.el]}function p(v){if(!v.children)return[];let y=[];for(let m=0,w=v.children.length;m<w;m++){let A=v.children[m];A.component?y.push(...h(A.component)):A.el&&y.push(A.el)}return y}function b(v){return{name:r(v),children:l(v.subTree).map(b),rootElements:h(v),props:v.props}}return b(e)}function Ul(e){function t(u){let l=u.displayName||u.name||u._componentTag;if(l)return l;let h=u.__file;if(h)return la(ca(h,".vue"))}function n(u){let l=t(u.$options||u.fnOptions||{});return l||(u.$root===u?"Root":"Anonymous Component")}function r(u){return u.$children?u.$children:Array.isArray(u.subTree.children)?u.subTree.children.filter(l=>!!l.component).map(l=>l.component):[]}function o(u){return{name:n(u),children:r(u).map(o),rootElements:[u.$el],props:u._props}}return o(e)}function ua(e,t,n=[]){t(e)&&n.push(e);for(let r of e.children)ua(r,t,n);return n}function ha(e,t=[]){let r=(e.ownerDocument||e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT),o=new Set;do{let u=r.currentNode;u.__vue__&&o.add(u.__vue__.$root),u.__vue_app__&&u._vnode&&u._vnode.component&&t.push({root:u._vnode.component,version:3});let l=u instanceof Element?u.shadowRoot:null;l&&ha(l,t)}while(r.nextNode());for(let u of o)t.push({version:2,root:u});return t}var Bl=()=>({queryAll(e,t){let n=e.ownerDocument||e,{name:r,attributes:o}=tt(t,!1),h=ha(n).map(b=>b.version===3?Dl(b.root):Ul(b.root)).map(b=>ua(b,v=>{if(r&&v.name!==r||v.rootElements.some(y=>!on(e,y)))return!1;for(let y of o)if(!ms(v.props,y))return!1;return!0})).flat(),p=new Set;for(let b of h)for(let v of b.rootElements)p.add(v);return[...p]}}),Gi={queryAll(e,t){t.startsWith("/")&&e.nodeType!==Node.DOCUMENT_NODE&&(t="."+t);let n=[],r=e.ownerDocument||e;if(!r)return n;let o=r.evaluate(t,e,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE);for(let u=o.iterateNext();u;u=o.iterateNext())u.nodeType===Node.ELEMENT_NODE&&n.push(u);return n}};function xs(e,t,n){return`internal:attr=[${e}=${Ne(t,n?.exact||!1)}]`}function jl(e,t){return`internal:testid=[${e}=${Ne(t,!0)}]`}function Fl(e,t){return"internal:label="+Ae(e,!!t?.exact)}function Hl(e,t){return xs("alt",e,t)}function Wl(e,t){return xs("title",e,t)}function Kl(e,t){return xs("placeholder",e,t)}function Vl(e,t){return"internal:text="+Ae(e,!!t?.exact)}function Gl(e,t={}){let n=[];return t.checked!==void 0&&n.push(["checked",String(t.checked)]),t.disabled!==void 0&&n.push(["disabled",String(t.disabled)]),t.selected!==void 0&&n.push(["selected",String(t.selected)]),t.expanded!==void 0&&n.push(["expanded",String(t.expanded)]),t.includeHidden!==void 0&&n.push(["include-hidden",String(t.includeHidden)]),t.level!==void 0&&n.push(["level",String(t.level)]),t.name!==void 0&&n.push(["name",Ne(t.name,!!t.exact)]),t.pressed!==void 0&&n.push(["pressed",String(t.pressed)]),`internal:role=${e}${n.map(([r,o])=>`[${r}=${o}]`).join("")}`}var wt=Symbol("selector"),zl=class Gt{[wt];element;elements;constructor(t,n,r){if(r?.hasText&&(n+=` >> internal:has-text=${Ae(r.hasText,!1)}`),r?.hasNotText&&(n+=` >> internal:has-not-text=${Ae(r.hasNotText,!1)}`),r?.has&&(n+=" >> internal:has="+JSON.stringify(r.has[wt])),r?.hasNot&&(n+=" >> internal:has-not="+JSON.stringify(r.hasNot[wt])),r?.visible!==void 0&&(n+=` >> visible=${r.visible?"true":"false"}`),this[wt]=n,n){let l=t.parseSelector(n);this.element=t.querySelector(l,t.document,!1),this.elements=t.querySelectorAll(l,t.document)}let o=n,u=this;u.locator=(l,h)=>new Gt(t,o?o+" >> "+l:l,h),u.getByTestId=l=>u.locator(jl(t.testIdAttributeNameForStrictErrorAndConsoleCodegen(),l)),u.getByAltText=(l,h)=>u.locator(Hl(l,h)),u.getByLabel=(l,h)=>u.locator(Fl(l,h)),u.getByPlaceholder=(l,h)=>u.locator(Kl(l,h)),u.getByText=(l,h)=>u.locator(Vl(l,h)),u.getByTitle=(l,h)=>u.locator(Wl(l,h)),u.getByRole=(l,h={})=>u.locator(Gl(l,h)),u.filter=l=>new Gt(t,n,l),u.first=()=>u.locator("nth=0"),u.last=()=>u.locator("nth=-1"),u.nth=l=>u.locator(`nth=${l}`),u.and=l=>new Gt(t,o+" >> internal:and="+JSON.stringify(l[wt])),u.or=l=>new Gt(t,o+" >> internal:or="+JSON.stringify(l[wt]))}},Jl=class{_injectedScript;constructor(e){this._injectedScript=e}install(){this._injectedScript.window.playwright||(this._injectedScript.window.playwright={$:(e,t)=>this._querySelector(e,!!t),$$:e=>this._querySelectorAll(e),inspect:e=>this._inspect(e),selector:e=>this._selector(e),generateLocator:(e,t)=>this._generateLocator(e,t),ariaSnapshot:(e,t)=>this._injectedScript.ariaSnapshot(e||this._injectedScript.document.body,t),resume:()=>this._resume(),...new zl(this._injectedScript,"")},delete this._injectedScript.window.playwright.filter,delete this._injectedScript.window.playwright.first,delete this._injectedScript.window.playwright.last,delete this._injectedScript.window.playwright.nth,delete this._injectedScript.window.playwright.and,delete this._injectedScript.window.playwright.or)}_querySelector(e,t){if(typeof e!="string")throw new Error("Usage: playwright.query('Playwright >> selector').");let n=this._injectedScript.parseSelector(e);return this._injectedScript.querySelector(n,this._injectedScript.document,t)}_querySelectorAll(e){if(typeof e!="string")throw new Error("Usage: playwright.$$('Playwright >> selector').");let t=this._injectedScript.parseSelector(e);return this._injectedScript.querySelectorAll(t,this._injectedScript.document)}_inspect(e){if(typeof e!="string")throw new Error("Usage: playwright.inspect('Playwright >> selector').");this._injectedScript.window.inspect(this._querySelector(e,!1))}_selector(e){if(!(e instanceof Element))throw new Error("Usage: playwright.selector(element).");return this._injectedScript.generateSelectorSimple(e)}_generateLocator(e,t){if(!(e instanceof Element))throw new Error("Usage: playwright.locator(element).");let n=this._injectedScript.generateSelectorSimple(e);return Qt(t||"javascript",n)}_resume(){this._injectedScript.window.__pw_resume().catch(()=>{})}};function Yl(e){try{return e instanceof RegExp||Object.prototype.toString.call(e)==="[object RegExp]"}catch{return!1}}function Ql(e){try{return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}catch{return!1}}function Xl(e){try{return e instanceof URL||Object.prototype.toString.call(e)==="[object URL]"}catch{return!1}}function Zl(e){var t;try{return e instanceof Error||e&&((t=Object.getPrototypeOf(e))==null?void 0:t.name)==="Error"}catch{return!1}}function eu(e,t){try{return e instanceof t||Object.prototype.toString.call(e)===`[object ${t.name}]`}catch{return!1}}var fa={i8:Int8Array,ui8:Uint8Array,ui8c:Uint8ClampedArray,i16:Int16Array,ui16:Uint16Array,i32:Int32Array,ui32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:BigInt64Array,bui64:BigUint64Array};function tu(e){if("toBase64"in e)return e.toBase64();let t=Array.from(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).map(n=>String.fromCharCode(n)).join("");return btoa(t)}function nu(e,t){let n=atob(e),r=new Uint8Array(n.length);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return new t(r.buffer)}function jr(e,t=[],n=new Map){if(!Object.is(e,void 0)){if(typeof e=="object"&&e){if("ref"in e)return n.get(e.ref);if("v"in e)return e.v==="undefined"?void 0:e.v==="null"?null:e.v==="NaN"?NaN:e.v==="Infinity"?1/0:e.v==="-Infinity"?-1/0:e.v==="-0"?-0:void 0;if("d"in e)return new Date(e.d);if("u"in e)return new URL(e.u);if("bi"in e)return BigInt(e.bi);if("e"in e){let r=new Error(e.e.m);return r.name=e.e.n,r.stack=e.e.s,r}if("r"in e)return new RegExp(e.r.p,e.r.f);if("a"in e){let r=[];n.set(e.id,r);for(let o of e.a)r.push(jr(o,t,n));return r}if("o"in e){let r={};n.set(e.id,r);for(let{k:o,v:u}of e.o)o!=="__proto__"&&(r[o]=jr(u,t,n));return r}if("h"in e)return t[e.h];if("ta"in e)return nu(e.ta.b,fa[e.ta.k])}return e}}function ru(e,t){return Fr(e,t,{visited:new Map,lastId:0})}function Fr(e,t,n){if(e&&typeof e=="object"){if(typeof globalThis.Window=="function"&&e instanceof globalThis.Window)return"ref: <Window>";if(typeof globalThis.Document=="function"&&e instanceof globalThis.Document)return"ref: <Document>";if(typeof globalThis.Node=="function"&&e instanceof globalThis.Node)return"ref: <Node>"}return da(e,t,n)}function da(e,t,n){var r;let o=t(e);if("fallThrough"in o)e=o.fallThrough;else return o;if(typeof e=="symbol")return{v:"undefined"};if(Object.is(e,void 0))return{v:"undefined"};if(Object.is(e,null))return{v:"null"};if(Object.is(e,NaN))return{v:"NaN"};if(Object.is(e,1/0))return{v:"Infinity"};if(Object.is(e,-1/0))return{v:"-Infinity"};if(Object.is(e,-0))return{v:"-0"};if(typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e;if(typeof e=="bigint")return{bi:e.toString()};if(Zl(e)){let l;return(r=e.stack)!=null&&r.startsWith(e.name+": "+e.message)?l=e.stack:l=`${e.name}: ${e.message}
10
- ${e.stack}`,{e:{n:e.name,m:e.message,s:l}}}if(Ql(e))return{d:e.toJSON()};if(Xl(e))return{u:e.toJSON()};if(Yl(e))return{r:{p:e.source,f:e.flags}};for(let[l,h]of Object.entries(fa))if(eu(e,h))return{ta:{b:tu(e),k:l}};let u=n.visited.get(e);if(u)return{ref:u};if(Array.isArray(e)){let l=[],h=++n.lastId;n.visited.set(e,h);for(let p=0;p<e.length;++p)l.push(Fr(e[p],t,n));return{a:l,id:h}}if(typeof e=="object"){let l=[],h=++n.lastId;n.visited.set(e,h);for(let b of Object.keys(e)){let v;try{v=e[b]}catch{continue}b==="toJSON"&&typeof v=="function"?l.push({k:b,v:{o:[],id:0}}):l.push({k:b,v:Fr(v,t,n)})}let p;try{l.length===0&&e.toJSON&&typeof e.toJSON=="function"&&(p={value:e.toJSON()})}catch{}return p?da(p.value,t,n):{o:l,id:h}}}var su=class{global;builtins;isUnderTest;constructor(e,t){var n,r,o,u,l,h,p,b;this.global=e,this.isUnderTest=t,e.__pwClock?this.builtins=e.__pwClock.builtins:this.builtins={setTimeout:(n=e.setTimeout)==null?void 0:n.bind(e),clearTimeout:(r=e.clearTimeout)==null?void 0:r.bind(e),setInterval:(o=e.setInterval)==null?void 0:o.bind(e),clearInterval:(u=e.clearInterval)==null?void 0:u.bind(e),requestAnimationFrame:(l=e.requestAnimationFrame)==null?void 0:l.bind(e),cancelAnimationFrame:(h=e.cancelAnimationFrame)==null?void 0:h.bind(e),requestIdleCallback:(p=e.requestIdleCallback)==null?void 0:p.bind(e),cancelIdleCallback:(b=e.cancelIdleCallback)==null?void 0:b.bind(e),performance:e.performance,Intl:e.Intl,Date:e.Date},this.isUnderTest&&(e.builtins=this.builtins)}evaluate(e,t,n,r,...o){let u=o.slice(0,r),l=o.slice(r),h=[];for(let b=0;b<u.length;b++)h[b]=jr(u[b],l);let p=this.global.eval(n);return e===!0?p=p(...h):e===!1?p=p:typeof p=="function"&&(p=p(...h)),t?this._promiseAwareJsonValueNoThrow(p):p}jsonValue(e,t){if(t!==void 0)return ru(t,n=>({fallThrough:n}))}_promiseAwareJsonValueNoThrow(e){let t=n=>{try{return this.jsonValue(!0,n)}catch{return}};return e&&typeof e=="object"&&typeof e.then=="function"?(async()=>{let n=await e;return t(n)})():t(e)}},iu=class{_engines;_evaluator;_stableRafCount;_browserName;onGlobalListenersRemoved;_hitTargetInterceptor;_highlight;isUnderTest;_sdkLanguage;_testIdAttributeNameForStrictErrorAndConsoleCodegen="data-testid";_markedElements;window;document;consoleApi;_lastAriaSnapshot;utils={asLocator:Qt,cacheNormalizedWhitespaces:Yi,elementText:Se,getAriaRole:he,getElementAccessibleDescription:Rr,getElementAccessibleName:At,isElementVisible:Ge,isInsideScope:on,normalizeWhiteSpace:we,parseAriaSnapshot:Uc,builtins:null};_autoClosingTags;_booleanAttributes;_eventTypes;_hoverHitTargetInterceptorEvents;_tapHitTargetInterceptorEvents;_mouseHitTargetInterceptorEvents;_allHitTargetInterceptorEvents;constructor(e,t){this.window=e,this.document=e.document,this.isUnderTest=t.isUnderTest,this.utils.builtins=new su(e,t.isUnderTest).builtins,this._sdkLanguage=t.sdkLanguage,this._testIdAttributeNameForStrictErrorAndConsoleCodegen=t.testIdAttributeName,this._evaluator=new kl,this.consoleApi=new Jl(this),this.onGlobalListenersRemoved=new Set,this._autoClosingTags=new Set(["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","MENUITEM","META","PARAM","SOURCE","TRACK","WBR"]),this._booleanAttributes=new Set(["checked","selected","disabled","readonly","multiple"]),this._eventTypes=new Map([["auxclick","mouse"],["click","mouse"],["dblclick","mouse"],["mousedown","mouse"],["mouseeenter","mouse"],["mouseleave","mouse"],["mousemove","mouse"],["mouseout","mouse"],["mouseover","mouse"],["mouseup","mouse"],["mouseleave","mouse"],["mousewheel","mouse"],["keydown","keyboard"],["keyup","keyboard"],["keypress","keyboard"],["textInput","keyboard"],["touchstart","touch"],["touchmove","touch"],["touchend","touch"],["touchcancel","touch"],["pointerover","pointer"],["pointerout","pointer"],["pointerenter","pointer"],["pointerleave","pointer"],["pointerdown","pointer"],["pointerup","pointer"],["pointermove","pointer"],["pointercancel","pointer"],["gotpointercapture","pointer"],["lostpointercapture","pointer"],["focus","focus"],["blur","focus"],["drag","drag"],["dragstart","drag"],["dragend","drag"],["dragover","drag"],["dragenter","drag"],["dragleave","drag"],["dragexit","drag"],["drop","drag"],["wheel","wheel"],["deviceorientation","deviceorientation"],["deviceorientationabsolute","deviceorientation"],["devicemotion","devicemotion"]]),this._hoverHitTargetInterceptorEvents=new Set(["mousemove"]),this._tapHitTargetInterceptorEvents=new Set(["pointerdown","pointerup","touchstart","touchend","touchcancel"]),this._mouseHitTargetInterceptorEvents=new Set(["mousedown","mouseup","pointerdown","pointerup","click","auxclick","dblclick","contextmenu"]),this._allHitTargetInterceptorEvents=new Set([...this._hoverHitTargetInterceptorEvents,...this._tapHitTargetInterceptorEvents,...this._mouseHitTargetInterceptorEvents]),this._engines=new Map,this._engines.set("xpath",Gi),this._engines.set("xpath:light",Gi),this._engines.set("_react",Sl()),this._engines.set("_vue",Bl()),this._engines.set("role",Vi(!1)),this._engines.set("text",this._createTextEngine(!0,!1)),this._engines.set("text:light",this._createTextEngine(!1,!1)),this._engines.set("id",this._createAttributeEngine("id",!0)),this._engines.set("id:light",this._createAttributeEngine("id",!1)),this._engines.set("data-testid",this._createAttributeEngine("data-testid",!0)),this._engines.set("data-testid:light",this._createAttributeEngine("data-testid",!1)),this._engines.set("data-test-id",this._createAttributeEngine("data-test-id",!0)),this._engines.set("data-test-id:light",this._createAttributeEngine("data-test-id",!1)),this._engines.set("data-test",this._createAttributeEngine("data-test",!0)),this._engines.set("data-test:light",this._createAttributeEngine("data-test",!1)),this._engines.set("css",this._createCSSEngine()),this._engines.set("nth",{queryAll:()=>[]}),this._engines.set("visible",this._createVisibleEngine()),this._engines.set("internal:control",this._createControlEngine()),this._engines.set("internal:has",this._createHasEngine()),this._engines.set("internal:has-not",this._createHasNotEngine()),this._engines.set("internal:and",{queryAll:()=>[]}),this._engines.set("internal:or",{queryAll:()=>[]}),this._engines.set("internal:chain",this._createInternalChainEngine()),this._engines.set("internal:label",this._createInternalLabelEngine()),this._engines.set("internal:text",this._createTextEngine(!0,!0)),this._engines.set("internal:has-text",this._createInternalHasTextEngine()),this._engines.set("internal:has-not-text",this._createInternalHasNotTextEngine()),this._engines.set("internal:attr",this._createNamedAttributeEngine()),this._engines.set("internal:testid",this._createNamedAttributeEngine()),this._engines.set("internal:role",Vi(!0)),this._engines.set("internal:describe",this._createDescribeEngine()),this._engines.set("aria-ref",this._createAriaRefEngine());for(let{name:n,source:r}of t.customEngines)this._engines.set(n,this.eval(r));this._stableRafCount=t.stableRafCount,this._browserName=t.browserName,So({browserNameForWorkarounds:t.browserName,inputFileRoleTextbox:t.inputFileRoleTextbox}),this._setupGlobalListenersRemovalDetection(),this._setupHitTargetInterceptors(),this.isUnderTest&&(this.window.__injectedScript=this)}eval(e){return this.window.eval(e)}testIdAttributeNameForStrictErrorAndConsoleCodegen(){return this._testIdAttributeNameForStrictErrorAndConsoleCodegen}parseSelector(e){let t=vs(e);return Wc(t,n=>{if(!this._engines.has(n.name))throw this.createStacklessError(`Unknown engine "${n.name}" while parsing selector ${e}`)}),t}generateSelector(e,t){return qr(this,e,t)}generateSelectorSimple(e,t){return qr(this,e,{...t,testIdAttributeName:this._testIdAttributeNameForStrictErrorAndConsoleCodegen}).selector}querySelector(e,t,n){let r=this.querySelectorAll(e,t);if(n&&r.length>1)throw this.strictModeViolationError(e,r);return r[0]}_queryNth(e,t){let n=[...e],r=+t.body;return r===-1&&(r=n.length-1),new Set(n.slice(r,r+1))}_queryLayoutSelector(e,t,n){let r=t.name,o=t.body,u=[],l=this.querySelectorAll(o.parsed,n);for(let h of e){let p=na(r,h,l,o.distance);p!==void 0&&u.push({element:h,score:p})}return u.sort((h,p)=>h.score-p.score),new Set(u.map(h=>h.element))}ariaSnapshot(e,t){if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Can only capture aria snapshot of Element nodes.");return this._lastAriaSnapshot=ws(e,t),Br(this._lastAriaSnapshot,t)}getAllByAria(e,t){return cl(e.documentElement,t)}querySelectorAll(e,t){if(e.capture!==void 0){if(e.parts.some(r=>r.name==="nth"))throw this.createStacklessError("Can't query n-th element in a request with the capture.");let n={parts:e.parts.slice(0,e.capture+1)};if(e.capture<e.parts.length-1){let r={parts:e.parts.slice(e.capture+1)},o={name:"internal:has",body:{parsed:r},source:je(r)};n.parts.push(o)}return this.querySelectorAll(n,t)}if(!t.querySelectorAll)throw this.createStacklessError("Node is not queryable.");if(e.capture!==void 0)throw this.createStacklessError("Internal error: there should not be a capture in the selector.");if(t.nodeType===11&&e.parts.length===1&&e.parts[0].name==="css"&&e.parts[0].source===":scope")return[t];this._evaluator.begin();try{let n=new Set([t]);for(let r of e.parts)if(r.name==="nth")n=this._queryNth(n,r);else if(r.name==="internal:and"){let o=this.querySelectorAll(r.body.parsed,t);n=new Set(o.filter(u=>n.has(u)))}else if(r.name==="internal:or"){let o=this.querySelectorAll(r.body.parsed,t);n=new Set(aa(new Set([...n,...o])))}else if(yl.includes(r.name))n=this._queryLayoutSelector(n,r,t);else{let o=new Set;for(let u of n){let l=this._queryEngineAll(r,u);for(let h of l)o.add(h)}n=o}return[...n]}finally{this._evaluator.end()}}_queryEngineAll(e,t){let n=this._engines.get(e.name).queryAll(t,e.body);for(let r of n)if(!("nodeName"in r))throw this.createStacklessError(`Expected a Node but got ${Object.prototype.toString.call(r)}`);return n}_createAttributeEngine(e,t){let n=r=>[{simples:[{selector:{css:`[${e}=${JSON.stringify(r)}]`,functions:[]},combinator:""}]}];return{queryAll:(r,o)=>this._evaluator.query({scope:r,pierceShadow:t},n(o))}}_createCSSEngine(){return{queryAll:(e,t)=>this._evaluator.query({scope:e,pierceShadow:!0},t)}}_createTextEngine(e,t){return{queryAll:(r,o)=>{let{matcher:u,kind:l}=qn(o,t),h=[],p=null,b=y=>{if(l==="lax"&&p&&p.contains(y))return!1;let m=an(this._evaluator._cacheText,y,u);m==="none"&&(p=y),(m==="self"||m==="selfAndChildren"&&l==="strict"&&!t)&&h.push(y)};r.nodeType===Node.ELEMENT_NODE&&b(r);let v=this._evaluator._queryCSS({scope:r,pierceShadow:e},"*");for(let y of v)b(y);return h}}}_createInternalHasTextEngine(){return{queryAll:(e,t)=>{if(e.nodeType!==1)return[];let n=e,r=Se(this._evaluator._cacheText,n),{matcher:o}=qn(t,!0);return o(r)?[n]:[]}}}_createInternalHasNotTextEngine(){return{queryAll:(e,t)=>{if(e.nodeType!==1)return[];let n=e,r=Se(this._evaluator._cacheText,n),{matcher:o}=qn(t,!0);return o(r)?[]:[n]}}}_createInternalLabelEngine(){return{queryAll:(e,t)=>{let{matcher:n}=qn(t,!0);return this._evaluator._queryCSS({scope:e,pierceShadow:!0},"*").filter(o=>bs(this._evaluator._cacheText,o).some(u=>n(u)))}}}_createNamedAttributeEngine(){return{queryAll:(t,n)=>{let r=tt(n,!0);if(r.name||r.attributes.length!==1)throw new Error("Malformed attribute selector: "+n);let{name:o,value:u,caseSensitive:l}=r.attributes[0],h=l?null:u.toLowerCase(),p;return u instanceof RegExp?p=v=>!!v.match(u):l?p=v=>v===u:p=v=>v.toLowerCase().includes(h),this._evaluator._queryCSS({scope:t,pierceShadow:!0},`[${o}]`).filter(v=>p(v.getAttribute(o)))}}}_createDescribeEngine(){return{queryAll:t=>t.nodeType!==1?[]:[t]}}_createControlEngine(){return{queryAll(e,t){if(t==="enter-frame")return[];if(t==="return-empty")return[];if(t==="component")return e.nodeType!==1?[]:[e.childElementCount===1?e.firstElementChild:e];throw new Error(`Internal error, unknown internal:control selector ${t}`)}}}_createHasEngine(){return{queryAll:(t,n)=>t.nodeType!==1?[]:!!this.querySelector(n.parsed,t,!1)?[t]:[]}}_createHasNotEngine(){return{queryAll:(t,n)=>t.nodeType!==1?[]:!!this.querySelector(n.parsed,t,!1)?[]:[t]}}_createVisibleEngine(){return{queryAll:(t,n)=>{if(t.nodeType!==1)return[];let r=n==="true";return Ge(t)===r?[t]:[]}}}_createInternalChainEngine(){return{queryAll:(t,n)=>this.querySelectorAll(n.parsed,t)}}extend(e,t){let n=this.window.eval(`
7
+ `;return r.push({message:u,range:[n.lineCounter.linePos(t.range[0]),n.lineCounter.linePos(t.range[0]+o.pos)]}),null}throw o}}constructor(t){this._input=t,this._pos=0,this._length=t.length}_peek(){return this._input[this._pos]||""}_next(){return this._pos<this._length?this._input[this._pos++]:null}_eof(){return this._pos>=this._length}_isWhitespace(){return!this._eof()&&/\s/.test(this._peek())}_skipWhitespace(){for(;this._isWhitespace();)this._pos++}_readIdentifier(t){this._eof()&&this._throwError(`Unexpected end of input when expecting ${t}`);let n=this._pos;for(;!this._eof()&&/[a-zA-Z]/.test(this._peek());)this._pos++;return this._input.slice(n,this._pos)}_readString(){let t="",n=!1;for(;!this._eof();){let r=this._next();if(n)t+=r,n=!1;else if(r==="\\")n=!0;else{if(r==='"')return t;t+=r}}this._throwError("Unterminated string")}_throwError(t,n=0){throw new Bi(t,n||this._pos)}_readRegex(){let t="",n=!1,r=!1;for(;!this._eof();){let o=this._next();if(n)t+=o,n=!1;else if(o==="\\")n=!0,t+=o;else{if(o==="/"&&!r)return{pattern:t};o==="["?(r=!0,t+=o):o==="]"&&r?(t+=o,r=!1):t+=o}}this._throwError("Unterminated regex")}_readStringOrRegex(){let t=this._peek();return t==='"'?(this._next(),Yo(this._readString())):t==="/"?(this._next(),this._readRegex()):null}_readAttributes(t){let n=this._pos;for(;this._skipWhitespace(),this._peek()==="[";){this._next(),this._skipWhitespace(),n=this._pos;let r=this._readIdentifier("attribute");this._skipWhitespace();let o="";if(this._peek()==="=")for(this._next(),this._skipWhitespace(),n=this._pos;this._peek()!=="]"&&!this._isWhitespace()&&!this._eof();)o+=this._next();this._skipWhitespace(),this._peek()!=="]"&&this._throwError("Expected ]"),this._next(),this._applyAttribute(t,r,o||"true",n)}}_parse(){this._skipWhitespace();let t=this._readIdentifier("role");this._skipWhitespace();let n=this._readStringOrRegex()||"",r={kind:"role",role:t,name:n};return this._readAttributes(r),this._skipWhitespace(),this._eof()||this._throwError("Unexpected input"),r}_applyAttribute(t,n,r,o){if(n==="checked"){this._assert(r==="true"||r==="false"||r==="mixed",'Value of "checked" attribute must be a boolean or "mixed"',o),t.checked=r==="true"?!0:r==="false"?!1:"mixed";return}if(n==="disabled"){this._assert(r==="true"||r==="false",'Value of "disabled" attribute must be a boolean',o),t.disabled=r==="true";return}if(n==="expanded"){this._assert(r==="true"||r==="false",'Value of "expanded" attribute must be a boolean',o),t.expanded=r==="true";return}if(n==="level"){this._assert(!isNaN(Number(r)),'Value of "level" attribute must be a number',o),t.level=Number(r);return}if(n==="pressed"){this._assert(r==="true"||r==="false"||r==="mixed",'Value of "pressed" attribute must be a boolean or "mixed"',o),t.pressed=r==="true"?!0:r==="false"?!1:"mixed";return}if(n==="selected"){this._assert(r==="true"||r==="false",'Value of "selected" attribute must be a boolean',o),t.selected=r==="true";return}this._assert(!1,`Unsupported attribute [${n}]`,o)}_assert(t,n,r){t||this._throwError(n||"Assertion error",r)}},Bi=class extends Error{pos;constructor(e,t){super(e),this.pos=t}},ke=class extends Error{};function jc(e,t){let n;try{n=no(e),n[n.length-1]instanceof jn||n.push(new jn)}catch(D){let re=D.message+` while parsing css selector "${e}". Did you mean to CSS.escape it?`,Ee=(D.stack||"").indexOf(D.message);throw Ee!==-1&&(D.stack=D.stack.substring(0,Ee)+re+D.stack.substring(Ee+D.message.length)),D.message=re,D}let r=n.find(D=>D instanceof go||D instanceof ro||D instanceof Bn||D instanceof po||D instanceof so||D instanceof io||D instanceof ao||D instanceof lo||D instanceof uo||D instanceof yo||D instanceof vo);if(r)throw new ke(`Unsupported token "${r.toSource()}" while parsing css selector "${e}". Did you mean to CSS.escape it?`);let o=0,u=new Set;function l(){return new ke(`Unexpected token "${n[o].toSource()}" while parsing css selector "${e}". Did you mean to CSS.escape it?`)}function h(){for(;n[o]instanceof Wn;)o++}function p(D=o){return n[D]instanceof Gr}function b(D=o){return n[D]instanceof zr}function v(D=o){return n[D]instanceof bo}function m(D=o){return n[D]instanceof co}function y(D=o){return n[D]instanceof fo}function w(D=o){return n[D]instanceof Vr}function A(D=o){return n[D]instanceof zt}function I(D=o){return n[D]instanceof de&&n[D].value==="*"}function P(D=o){return n[D]instanceof jn}function B(D=o){return n[D]instanceof de&&[">","+","~"].includes(n[D].value)}function q(D=o){return m(D)||w(D)||P(D)||B(D)||n[D]instanceof Wn}function H(){let D=[ee()];for(;h(),!!m();)o++,D.push(ee());return D}function ee(){return h(),v()||b()?n[o++].value:te()}function te(){let D={simples:[]};for(h(),B()?D.simples.push({selector:{functions:[{name:"scope",args:[]}]},combinator:""}):D.simples.push({selector:Z(),combinator:""});;){if(h(),B())D.simples[D.simples.length-1].combinator=n[o++].value,h();else if(q())break;D.simples.push({combinator:"",selector:Z()})}return D}function Z(){let D="",re=[];for(;!q();)if(p()||I())D+=n[o++].toSource();else if(n[o]instanceof mo)D+=n[o++].toSource();else if(n[o]instanceof de&&n[o].value===".")if(o++,p())D+="."+n[o++].toSource();else throw l();else if(n[o]instanceof oo)if(o++,p())if(!t.has(n[o].value.toLowerCase()))D+=":"+n[o++].toSource();else{let Ee=n[o++].value.toLowerCase();re.push({name:Ee,args:[]}),u.add(Ee)}else if(A()){let Ee=n[o++].value.toLowerCase();if(t.has(Ee)?(re.push({name:Ee,args:H()}),u.add(Ee)):D+=`:${Ee}(${se()})`,h(),!w())throw l();o++}else throw l();else if(n[o]instanceof ho){for(D+="[",o++;!(n[o]instanceof Pr)&&!P();)D+=n[o++].toSource();if(!(n[o]instanceof Pr))throw l();D+="]",o++}else throw l();if(!D&&!re.length)throw l();return{css:D||void 0,functions:re}}function se(){let D="",re=1;for(;!P()&&((y()||A())&&re++,w()&&re--,!!re);)D+=n[o++].toSource();return D}let le=H();if(!P())throw l();if(le.some(D=>typeof D!="object"||!("simples"in D)))throw new ke(`Error while parsing css selector "${e}". Did you mean to CSS.escape it?`);return{selector:le,names:Array.from(u)}}var Ur=new Set(["internal:has","internal:has-not","internal:and","internal:or","internal:chain","left-of","right-of","above","below","near"]),Fc=new Set(["left-of","right-of","above","below","near"]),Xo=new Set(["not","is","where","has","scope","light","visible","text","text-matches","text-is","has-text","above","below","right-of","left-of","near","nth-match"]);function vs(e){let t=Kc(e),n=[];for(let r of t.parts){if(r.name==="css"||r.name==="css:light"){r.name==="css:light"&&(r.body=":light("+r.body+")");let o=jc(r.body,Xo);n.push({name:"css",body:o.selector,source:r.body});continue}if(Ur.has(r.name)){let o,u;try{let b=JSON.parse("["+r.body+"]");if(!Array.isArray(b)||b.length<1||b.length>2||typeof b[0]!="string")throw new ke(`Malformed selector: ${r.name}=`+r.body);if(o=b[0],b.length===2){if(typeof b[1]!="number"||!Fc.has(r.name))throw new ke(`Malformed selector: ${r.name}=`+r.body);u=b[1]}}catch{throw new ke(`Malformed selector: ${r.name}=`+r.body)}let l={name:r.name,source:r.body,body:{parsed:vs(o),distance:u}},h=[...l.body.parsed.parts].reverse().find(b=>b.name==="internal:control"&&b.body==="enter-frame"),p=h?l.body.parsed.parts.indexOf(h):-1;p!==-1&&Hc(l.body.parsed.parts.slice(0,p+1),n.slice(0,p+1))&&l.body.parsed.parts.splice(0,p+1),n.push(l);continue}n.push({...r,source:r.body})}if(Ur.has(n[0].name))throw new ke(`"${n[0].name}" selector cannot be first`);return{capture:t.capture,parts:n}}function Hc(e,t){return je({parts:e})===je({parts:t})}function je(e,t){return typeof e=="string"?e:e.parts.map((n,r)=>{let o=!0;!t&&r!==e.capture&&(n.name==="css"||n.name==="xpath"&&n.source.startsWith("//")||n.source.startsWith(".."))&&(o=!1);let u=o?n.name+"=":"";return`${r===e.capture?"*":""}${u}${n.source}`}).join(" >> ")}function Wc(e,t){let n=(r,o)=>{for(let u of r.parts)t(u,o),Ur.has(u.name)&&n(u.body.parsed,!0)};n(e,!1)}function Kc(e){let t=0,n,r=0,o={parts:[]},u=()=>{let h=e.substring(r,t).trim(),p=h.indexOf("="),b,v;p!==-1&&h.substring(0,p).trim().match(/^[a-zA-Z_0-9-+:*]+$/)?(b=h.substring(0,p).trim(),v=h.substring(p+1)):h.length>1&&h[0]==='"'&&h[h.length-1]==='"'||h.length>1&&h[0]==="'"&&h[h.length-1]==="'"?(b="text",v=h):/^\(*\/\//.test(h)||h.startsWith("..")?(b="xpath",v=h):(b="css",v=h);let m=!1;if(b[0]==="*"&&(m=!0,b=b.substring(1)),o.parts.push({name:b,body:v}),m){if(o.capture!==void 0)throw new ke("Only one of the selectors can capture using * modifier");o.capture=o.parts.length-1}};if(!e.includes(">>"))return t=e.length,u(),o;let l=()=>{let p=e.substring(r,t).match(/^\s*text\s*=(.*)$/);return!!p&&!!p[1]};for(;t<e.length;){let h=e[t];h==="\\"&&t+1<e.length?t+=2:h===n?(n=void 0,t++):!n&&(h==='"'||h==="'"||h==="`")&&!l()?(n=h,t++):!n&&h===">"&&e[t+1]===">"?(u(),t+=2,r=t):t++}return u(),o}function tt(e,t){let n=0,r=e.length===0,o=()=>e[n]||"",u=()=>{let P=o();return++n,r=n>=e.length,P},l=P=>{throw r?new ke(`Unexpected end of selector while parsing selector \`${e}\``):new ke(`Error while parsing selector \`${e}\` - unexpected symbol "${o()}" at position ${n}`+(P?" during "+P:""))};function h(){for(;!r&&/\s/.test(o());)u()}function p(P){return P>="\x80"||P>="0"&&P<="9"||P>="A"&&P<="Z"||P>="a"&&P<="z"||P>="0"&&P<="9"||P==="_"||P==="-"}function b(){let P="";for(h();!r&&p(o());)P+=u();return P}function v(P){let B=u();for(B!==P&&l("parsing quoted string");!r&&o()!==P;)o()==="\\"&&u(),B+=u();return o()!==P&&l("parsing quoted string"),B+=u(),B}function m(){u()!=="/"&&l("parsing regular expression");let P="",B=!1;for(;!r;){if(o()==="\\")P+=u(),r&&l("parsing regular expression");else if(B&&o()==="]")B=!1;else if(!B&&o()==="[")B=!0;else if(!B&&o()==="/")break;P+=u()}u()!=="/"&&l("parsing regular expression");let q="";for(;!r&&o().match(/[dgimsuy]/);)q+=u();try{return new RegExp(P,q)}catch(H){throw new ke(`Error while parsing selector \`${e}\`: ${H.message}`)}}function y(){let P="";return h(),o()==="'"||o()==='"'?P=v(o()).slice(1,-1):P=b(),P||l("parsing property path"),P}function w(){h();let P="";return r||(P+=u()),!r&&P!=="="&&(P+=u()),["=","*=","^=","$=","|=","~="].includes(P)||l("parsing operator"),P}function A(){u();let P=[];for(P.push(y()),h();o()===".";)u(),P.push(y()),h();if(o()==="]")return u(),{name:P.join("."),jsonPath:P,op:"<truthy>",value:null,caseSensitive:!1};let B=w(),q,H=!0;if(h(),o()==="/"){if(B!=="=")throw new ke(`Error while parsing selector \`${e}\` - cannot use ${B} in attribute with regular expression`);q=m()}else if(o()==="'"||o()==='"')q=v(o()).slice(1,-1),h(),o()==="i"||o()==="I"?(H=!1,u()):(o()==="s"||o()==="S")&&(H=!0,u());else{for(q="";!r&&(p(o())||o()==="+"||o()===".");)q+=u();q==="true"?q=!0:q==="false"?q=!1:t||(q=+q,Number.isNaN(q)&&l("parsing attribute value"))}if(h(),o()!=="]"&&l("parsing attribute value"),u(),B!=="="&&typeof q!="string")throw new ke(`Error while parsing selector \`${e}\` - cannot use ${B} in attribute with non-string matching value - ${q}`);return{name:P.join("."),jsonPath:P,op:B,value:q,caseSensitive:H}}let I={name:"",attributes:[]};for(I.name=b(),h();o()==="[";)I.attributes.push(A()),h();if(r||l(void 0),!I.name&&!I.attributes.length)throw new ke(`Error while parsing selector \`${e}\` - selector cannot be empty`);return I}function Qt(e,t,n=!1){return Vc(e,t,n,1)[0]}function Vc(e,t,n=!1,r=20,o){try{return St(new Zc[e](o),vs(t),n,r)}catch{return[t]}}function St(e,t,n=!1,r=20){let o=[...t.parts],u=[],l=n?"frame-locator":"page";for(let h=0;h<o.length;h++){let p=o[h],b=l;if(l="locator",p.name==="internal:describe")continue;if(p.name==="nth"){p.body==="0"?u.push([e.generateLocator(b,"first",""),e.generateLocator(b,"nth","0")]):p.body==="-1"?u.push([e.generateLocator(b,"last",""),e.generateLocator(b,"nth","-1")]):u.push([e.generateLocator(b,"nth",p.body)]);continue}if(p.name==="visible"){u.push([e.generateLocator(b,"visible",p.body),e.generateLocator(b,"default",`visible=${p.body}`)]);continue}if(p.name==="internal:text"){let{exact:A,text:I}=Ft(p.body);u.push([e.generateLocator(b,"text",I,{exact:A})]);continue}if(p.name==="internal:has-text"){let{exact:A,text:I}=Ft(p.body);if(!A){u.push([e.generateLocator(b,"has-text",I,{exact:A})]);continue}}if(p.name==="internal:has-not-text"){let{exact:A,text:I}=Ft(p.body);if(!A){u.push([e.generateLocator(b,"has-not-text",I,{exact:A})]);continue}}if(p.name==="internal:has"){let A=St(e,p.body.parsed,!1,r);u.push(A.map(I=>e.generateLocator(b,"has",I)));continue}if(p.name==="internal:has-not"){let A=St(e,p.body.parsed,!1,r);u.push(A.map(I=>e.generateLocator(b,"hasNot",I)));continue}if(p.name==="internal:and"){let A=St(e,p.body.parsed,!1,r);u.push(A.map(I=>e.generateLocator(b,"and",I)));continue}if(p.name==="internal:or"){let A=St(e,p.body.parsed,!1,r);u.push(A.map(I=>e.generateLocator(b,"or",I)));continue}if(p.name==="internal:chain"){let A=St(e,p.body.parsed,!1,r);u.push(A.map(I=>e.generateLocator(b,"chain",I)));continue}if(p.name==="internal:label"){let{exact:A,text:I}=Ft(p.body);u.push([e.generateLocator(b,"label",I,{exact:A})]);continue}if(p.name==="internal:role"){let A=tt(p.body,!0),I={attrs:[]};for(let P of A.attributes)P.name==="name"?(I.exact=P.caseSensitive,I.name=P.value):(P.name==="level"&&typeof P.value=="string"&&(P.value=+P.value),I.attrs.push({name:P.name==="include-hidden"?"includeHidden":P.name,value:P.value}));u.push([e.generateLocator(b,"role",A.name,I)]);continue}if(p.name==="internal:testid"){let A=tt(p.body,!0),{value:I}=A.attributes[0];u.push([e.generateLocator(b,"test-id",I)]);continue}if(p.name==="internal:attr"){let A=tt(p.body,!0),{name:I,value:P,caseSensitive:B}=A.attributes[0],q=P,H=!!B;if(I==="placeholder"){u.push([e.generateLocator(b,"placeholder",q,{exact:H})]);continue}if(I==="alt"){u.push([e.generateLocator(b,"alt",q,{exact:H})]);continue}if(I==="title"){u.push([e.generateLocator(b,"title",q,{exact:H})]);continue}}if(p.name==="internal:control"&&p.body==="enter-frame"){let A=u[u.length-1],I=o[h-1],P=A.map(B=>e.chainLocators([B,e.generateLocator(b,"frame","")]));["xpath","css"].includes(I.name)&&P.push(e.generateLocator(b,"frame-locator",je({parts:[I]})),e.generateLocator(b,"frame-locator",je({parts:[I]},!0))),A.splice(0,A.length,...P),l="frame-locator";continue}let v=o[h+1],m=je({parts:[p]}),y=e.generateLocator(b,"default",m);if(v&&["internal:has-text","internal:has-not-text"].includes(v.name)){let{exact:A,text:I}=Ft(v.body);if(!A){let P=e.generateLocator("locator",v.name==="internal:has-text"?"has-text":"has-not-text",I,{exact:A}),B={};v.name==="internal:has-text"?B.hasText=I:B.hasNotText=I;let q=e.generateLocator(b,"default",m,B);u.push([e.chainLocators([y,P]),q]),h++;continue}}let w;if(["xpath","css"].includes(p.name)){let A=je({parts:[p]},!0);w=e.generateLocator(b,"default",A)}u.push([y,w].filter(Boolean))}return Gc(e,u,r)}function Gc(e,t,n){let r=t.map(()=>""),o=[],u=l=>{if(l===t.length)return o.push(e.chainLocators(r)),o.length<n;for(let h of t[l])if(r[l]=h,!u(l+1))return!1;return!0};return u(0),o}function Ft(e){let t=!1,n=e.match(/^\/(.*)\/([igm]*)$/);return n?{text:new RegExp(n[1],n[2])}:(e.endsWith('"')?(e=JSON.parse(e),t=!0):e.endsWith('"s')?(e=JSON.parse(e.substring(0,e.length-1)),t=!0):e.endsWith('"i')&&(e=JSON.parse(e.substring(0,e.length-1)),t=!1),{exact:t,text:e})}var zc=class{constructor(e){this.preferredQuote=e}generateLocator(e,t,n,r={}){switch(t){case"default":return r.hasText!==void 0?`locator(${this.quote(n)}, { hasText: ${this.toHasText(r.hasText)} })`:r.hasNotText!==void 0?`locator(${this.quote(n)}, { hasNotText: ${this.toHasText(r.hasNotText)} })`:`locator(${this.quote(n)})`;case"frame-locator":return`frameLocator(${this.quote(n)})`;case"frame":return"contentFrame()";case"nth":return`nth(${n})`;case"first":return"first()";case"last":return"last()";case"visible":return`filter({ visible: ${n==="true"?"true":"false"} })`;case"role":let o=[];ge(r.name)?o.push(`name: ${this.regexToSourceString(r.name)}`):typeof r.name=="string"&&(o.push(`name: ${this.quote(r.name)}`),r.exact&&o.push("exact: true"));for(let{name:l,value:h}of r.attrs)o.push(`${l}: ${typeof h=="string"?this.quote(h):h}`);let u=o.length?`, { ${o.join(", ")} }`:"";return`getByRole(${this.quote(n)}${u})`;case"has-text":return`filter({ hasText: ${this.toHasText(n)} })`;case"has-not-text":return`filter({ hasNotText: ${this.toHasText(n)} })`;case"has":return`filter({ has: ${n} })`;case"hasNot":return`filter({ hasNot: ${n} })`;case"and":return`and(${n})`;case"or":return`or(${n})`;case"chain":return`locator(${n})`;case"test-id":return`getByTestId(${this.toTestIdValue(n)})`;case"text":return this.toCallWithExact("getByText",n,!!r.exact);case"alt":return this.toCallWithExact("getByAltText",n,!!r.exact);case"placeholder":return this.toCallWithExact("getByPlaceholder",n,!!r.exact);case"label":return this.toCallWithExact("getByLabel",n,!!r.exact);case"title":return this.toCallWithExact("getByTitle",n,!!r.exact);default:throw new Error("Unknown selector kind "+t)}}chainLocators(e){return e.join(".")}regexToSourceString(e){return rn(String(e))}toCallWithExact(e,t,n){return ge(t)?`${e}(${this.regexToSourceString(t)})`:n?`${e}(${this.quote(t)}, { exact: true })`:`${e}(${this.quote(t)})`}toHasText(e){return ge(e)?this.regexToSourceString(e):this.quote(e)}toTestIdValue(e){return ge(e)?this.regexToSourceString(e):this.quote(e)}quote(e){return nn(e,this.preferredQuote??"'")}},Jc=class{generateLocator(e,t,n,r={}){switch(t){case"default":return r.hasText!==void 0?`locator(${this.quote(n)}, has_text=${this.toHasText(r.hasText)})`:r.hasNotText!==void 0?`locator(${this.quote(n)}, has_not_text=${this.toHasText(r.hasNotText)})`:`locator(${this.quote(n)})`;case"frame-locator":return`frame_locator(${this.quote(n)})`;case"frame":return"content_frame";case"nth":return`nth(${n})`;case"first":return"first";case"last":return"last";case"visible":return`filter(visible=${n==="true"?"True":"False"})`;case"role":let o=[];ge(r.name)?o.push(`name=${this.regexToString(r.name)}`):typeof r.name=="string"&&(o.push(`name=${this.quote(r.name)}`),r.exact&&o.push("exact=True"));for(let{name:l,value:h}of r.attrs){let p=typeof h=="string"?this.quote(h):h;typeof h=="boolean"&&(p=h?"True":"False"),o.push(`${Wr(l)}=${p}`)}let u=o.length?`, ${o.join(", ")}`:"";return`get_by_role(${this.quote(n)}${u})`;case"has-text":return`filter(has_text=${this.toHasText(n)})`;case"has-not-text":return`filter(has_not_text=${this.toHasText(n)})`;case"has":return`filter(has=${n})`;case"hasNot":return`filter(has_not=${n})`;case"and":return`and_(${n})`;case"or":return`or_(${n})`;case"chain":return`locator(${n})`;case"test-id":return`get_by_test_id(${this.toTestIdValue(n)})`;case"text":return this.toCallWithExact("get_by_text",n,!!r.exact);case"alt":return this.toCallWithExact("get_by_alt_text",n,!!r.exact);case"placeholder":return this.toCallWithExact("get_by_placeholder",n,!!r.exact);case"label":return this.toCallWithExact("get_by_label",n,!!r.exact);case"title":return this.toCallWithExact("get_by_title",n,!!r.exact);default:throw new Error("Unknown selector kind "+t)}}chainLocators(e){return e.join(".")}regexToString(e){let t=e.flags.includes("i")?", re.IGNORECASE":"";return`re.compile(r"${rn(e.source).replace(/\\\//,"/").replace(/"/g,'\\"')}"${t})`}toCallWithExact(e,t,n){return ge(t)?`${e}(${this.regexToString(t)})`:n?`${e}(${this.quote(t)}, exact=True)`:`${e}(${this.quote(t)})`}toHasText(e){return ge(e)?this.regexToString(e):`${this.quote(e)}`}toTestIdValue(e){return ge(e)?this.regexToString(e):this.quote(e)}quote(e){return nn(e,'"')}},Yc=class{generateLocator(e,t,n,r={}){let o;switch(e){case"page":o="Page";break;case"frame-locator":o="FrameLocator";break;case"locator":o="Locator";break}switch(t){case"default":return r.hasText!==void 0?`locator(${this.quote(n)}, new ${o}.LocatorOptions().setHasText(${this.toHasText(r.hasText)}))`:r.hasNotText!==void 0?`locator(${this.quote(n)}, new ${o}.LocatorOptions().setHasNotText(${this.toHasText(r.hasNotText)}))`:`locator(${this.quote(n)})`;case"frame-locator":return`frameLocator(${this.quote(n)})`;case"frame":return"contentFrame()";case"nth":return`nth(${n})`;case"first":return"first()";case"last":return"last()";case"visible":return`filter(new ${o}.FilterOptions().setVisible(${n==="true"?"true":"false"}))`;case"role":let u=[];ge(r.name)?u.push(`.setName(${this.regexToString(r.name)})`):typeof r.name=="string"&&(u.push(`.setName(${this.quote(r.name)})`),r.exact&&u.push(".setExact(true)"));for(let{name:h,value:p}of r.attrs)u.push(`.set${Xt(h)}(${typeof p=="string"?this.quote(p):p})`);let l=u.length?`, new ${o}.GetByRoleOptions()${u.join("")}`:"";return`getByRole(AriaRole.${Wr(n).toUpperCase()}${l})`;case"has-text":return`filter(new ${o}.FilterOptions().setHasText(${this.toHasText(n)}))`;case"has-not-text":return`filter(new ${o}.FilterOptions().setHasNotText(${this.toHasText(n)}))`;case"has":return`filter(new ${o}.FilterOptions().setHas(${n}))`;case"hasNot":return`filter(new ${o}.FilterOptions().setHasNot(${n}))`;case"and":return`and(${n})`;case"or":return`or(${n})`;case"chain":return`locator(${n})`;case"test-id":return`getByTestId(${this.toTestIdValue(n)})`;case"text":return this.toCallWithExact(o,"getByText",n,!!r.exact);case"alt":return this.toCallWithExact(o,"getByAltText",n,!!r.exact);case"placeholder":return this.toCallWithExact(o,"getByPlaceholder",n,!!r.exact);case"label":return this.toCallWithExact(o,"getByLabel",n,!!r.exact);case"title":return this.toCallWithExact(o,"getByTitle",n,!!r.exact);default:throw new Error("Unknown selector kind "+t)}}chainLocators(e){return e.join(".")}regexToString(e){let t=e.flags.includes("i")?", Pattern.CASE_INSENSITIVE":"";return`Pattern.compile(${this.quote(rn(e.source))}${t})`}toCallWithExact(e,t,n,r){return ge(n)?`${t}(${this.regexToString(n)})`:r?`${t}(${this.quote(n)}, new ${e}.${Xt(t)}Options().setExact(true))`:`${t}(${this.quote(n)})`}toHasText(e){return ge(e)?this.regexToString(e):this.quote(e)}toTestIdValue(e){return ge(e)?this.regexToString(e):this.quote(e)}quote(e){return nn(e,'"')}},Qc=class{generateLocator(e,t,n,r={}){switch(t){case"default":return r.hasText!==void 0?`Locator(${this.quote(n)}, new() { ${this.toHasText(r.hasText)} })`:r.hasNotText!==void 0?`Locator(${this.quote(n)}, new() { ${this.toHasNotText(r.hasNotText)} })`:`Locator(${this.quote(n)})`;case"frame-locator":return`FrameLocator(${this.quote(n)})`;case"frame":return"ContentFrame";case"nth":return`Nth(${n})`;case"first":return"First";case"last":return"Last";case"visible":return`Filter(new() { Visible = ${n==="true"?"true":"false"} })`;case"role":let o=[];ge(r.name)?o.push(`NameRegex = ${this.regexToString(r.name)}`):typeof r.name=="string"&&(o.push(`Name = ${this.quote(r.name)}`),r.exact&&o.push("Exact = true"));for(let{name:l,value:h}of r.attrs)o.push(`${Xt(l)} = ${typeof h=="string"?this.quote(h):h}`);let u=o.length?`, new() { ${o.join(", ")} }`:"";return`GetByRole(AriaRole.${Xt(n)}${u})`;case"has-text":return`Filter(new() { ${this.toHasText(n)} })`;case"has-not-text":return`Filter(new() { ${this.toHasNotText(n)} })`;case"has":return`Filter(new() { Has = ${n} })`;case"hasNot":return`Filter(new() { HasNot = ${n} })`;case"and":return`And(${n})`;case"or":return`Or(${n})`;case"chain":return`Locator(${n})`;case"test-id":return`GetByTestId(${this.toTestIdValue(n)})`;case"text":return this.toCallWithExact("GetByText",n,!!r.exact);case"alt":return this.toCallWithExact("GetByAltText",n,!!r.exact);case"placeholder":return this.toCallWithExact("GetByPlaceholder",n,!!r.exact);case"label":return this.toCallWithExact("GetByLabel",n,!!r.exact);case"title":return this.toCallWithExact("GetByTitle",n,!!r.exact);default:throw new Error("Unknown selector kind "+t)}}chainLocators(e){return e.join(".")}regexToString(e){let t=e.flags.includes("i")?", RegexOptions.IgnoreCase":"";return`new Regex(${this.quote(rn(e.source))}${t})`}toCallWithExact(e,t,n){return ge(t)?`${e}(${this.regexToString(t)})`:n?`${e}(${this.quote(t)}, new() { Exact = true })`:`${e}(${this.quote(t)})`}toHasText(e){return ge(e)?`HasTextRegex = ${this.regexToString(e)}`:`HasText = ${this.quote(e)}`}toTestIdValue(e){return ge(e)?this.regexToString(e):this.quote(e)}toHasNotText(e){return ge(e)?`HasNotTextRegex = ${this.regexToString(e)}`:`HasNotText = ${this.quote(e)}`}quote(e){return nn(e,'"')}},Xc=class{generateLocator(e,t,n,r={}){return JSON.stringify({kind:t,body:n,options:r})}chainLocators(e){let t=e.map(n=>JSON.parse(n));for(let n=0;n<t.length-1;++n)t[n].next=t[n+1];return JSON.stringify(t[0])}},Zc={javascript:zc,python:Jc,java:Yc,csharp:Qc,jsonl:Xc};function ge(e){return e instanceof RegExp}function el(e){return Zo(e)?"'"+e.replace(/'/g,"''")+"'":e}function Lr(e){return Zo(e)?'"'+e.replace(/[\\"\x00-\x1f\x7f-\x9f]/g,t=>{switch(t){case"\\":return"\\\\";case'"':return'\\"';case"\b":return"\\b";case"\f":return"\\f";case`
8
+ `:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return"\\x"+t.charCodeAt(0).toString(16).padStart(2,"0")}})+'"':e}function Zo(e){return!!(e.length===0||/^\s|\s$/.test(e)||/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(e)||/^-/.test(e)||/[\n:](\s|$)/.test(e)||/\s#/.test(e)||/[\n\r]/.test(e)||/^[&*\],?!>|@"'#%]/.test(e)||/[{}`]/.test(e)||/^\[/.test(e)||!isNaN(Number(e))||["y","n","yes","no","true","false","on","off","null"].includes(e.toLowerCase()))}var tl=0;function ws(e,t){let n=new Set,r={root:{role:"fragment",name:"",children:[],element:e,props:{},box:en(e),receivesPointerEvents:!0},elements:new Map},o=(l,h)=>{if(n.has(h))return;if(n.add(h),h.nodeType===Node.TEXT_NODE&&h.nodeValue){let y=h.nodeValue;l.role!=="textbox"&&y&&l.children.push(h.nodeValue||"");return}if(h.nodeType!==Node.ELEMENT_NODE)return;let p=h,b=!Ce(p);if(t?.forAI&&(b=b||Ge(p)),!b)return;let v=[];if(p.hasAttribute("aria-owns")){let y=p.getAttribute("aria-owns").split(/\s+/);for(let w of y){let A=e.ownerDocument.getElementById(w);A&&v.push(A)}}let m=nl(p,t);m&&(m.ref&&r.elements.set(m.ref,p),l.children.push(m)),u(m||l,p,v)};function u(l,h,p=[]){var b;let m=(((b=Fe(h))==null?void 0:b.display)||"inline")!=="inline"||h.nodeName==="BR"?" ":"";m&&l.children.push(m),l.children.push(_t(h,"::before")||"");let y=h.nodeName==="SLOT"?h.assignedNodes():[];if(y.length)for(let w of y)o(l,w);else{for(let w=h.firstChild;w;w=w.nextSibling)w.assignedSlot||o(l,w);if(h.shadowRoot)for(let w=h.shadowRoot.firstChild;w;w=w.nextSibling)o(l,w)}for(let w of p)o(l,w);if(l.children.push(_t(h,"::after")||""),m&&l.children.push(m),l.children.length===1&&l.name===l.children[0]&&(l.children=[]),l.role==="link"&&h.hasAttribute("href")){let w=h.getAttribute("href");l.props.url=w}}Xn();try{o(r.root,e)}finally{Zn()}return sl(r.root),rl(r.root),r}function ji(e,t,n,r){if(!r?.forAI)return;let o;return o=e._ariaRef,(!o||o.role!==t||o.name!==n)&&(o={role:t,name:n,ref:(r?.refPrefix??"")+"e"+ ++tl},e._ariaRef=o),o.ref}function nl(e,t){if(e.nodeName==="IFRAME")return{role:"iframe",name:"",ref:ji(e,"iframe","",t),children:[],props:{},element:e,box:en(e),receivesPointerEvents:!0};let n=t?.forAI?"generic":null,r=he(e)??n;if(!r||r==="presentation"||r==="none")return null;let o=we(At(e,!1)||""),u=Po(e),l={role:r,name:o,ref:ji(e,r,o,t),children:[],props:{},element:e,box:en(e),receivesPointerEvents:u};return zn.includes(r)&&(l.checked=ns(e)),as.includes(r)&&(l.disabled=tn(e)),Yn.includes(r)&&(l.expanded=is(e)),Qn.includes(r)&&(l.level=os(e)),Jn.includes(r)&&(l.pressed=ss(e)),Gn.includes(r)&&(l.selected=ts(e)),(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.type!=="checkbox"&&e.type!=="radio"&&(e.type!=="file"||Vn().inputFileRoleTextbox)&&(l.children=[e.value]),l}function rl(e){let t=n=>{let r=[];for(let u of n.children||[]){if(typeof u=="string"){r.push(u);continue}let l=t(u);r.push(...l)}return n.role==="generic"&&r.length<=1&&r.every(u=>typeof u!="string"&&ta(u))?r:(n.children=r,[n])};t(e)}function sl(e){let t=(r,o)=>{if(!r.length)return;let u=we(r.join(""));u&&o.push(u),r.length=0},n=r=>{let o=[],u=[];for(let l of r.children||[])typeof l=="string"?u.push(l):(t(u,o),n(l),o.push(l));t(u,o),r.children=o.length?o:[],r.children.length===1&&r.children[0]===r.name&&(r.children=[])};n(e)}function Es(e,t){return t?e?typeof t=="string"?e===t:!!e.match(new RegExp(t.pattern)):!1:!0}function il(e,t){return Es(e,t.text)}function ol(e,t){return Es(e,t.name)}function al(e,t){let n=ws(e);return{matches:ea(n.root,t,!1,!1),received:{raw:Br(n,{mode:"raw"}),regex:Br(n,{mode:"regex"})}}}function cl(e,t){let n=ws(e).root;return ea(n,t,!0,!1).map(o=>o.element)}function Ss(e,t,n){var r;return typeof e=="string"&&t.kind==="text"?il(e,t):e===null||typeof e!="object"||t.kind!=="role"||t.role!=="fragment"&&t.role!==e.role||t.checked!==void 0&&t.checked!==e.checked||t.disabled!==void 0&&t.disabled!==e.disabled||t.expanded!==void 0&&t.expanded!==e.expanded||t.level!==void 0&&t.level!==e.level||t.pressed!==void 0&&t.pressed!==e.pressed||t.selected!==void 0&&t.selected!==e.selected||!ol(e.name,t)||!Es(e.props.url,(r=t.props)==null?void 0:r.url)?!1:t.containerMode==="contain"?Hi(e.children||[],t.children||[]):t.containerMode==="equal"?Fi(e.children||[],t.children||[],!1):t.containerMode==="deep-equal"||n?Fi(e.children||[],t.children||[],!0):Hi(e.children||[],t.children||[])}function Fi(e,t,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!Ss(e[r],t[r],n))return!1;return!0}function Hi(e,t){if(t.length>e.length)return!1;let n=e.slice(),r=t.slice();for(let o of r){let u=n.shift();for(;u&&!Ss(u,o,!1);)u=n.shift();if(!u)return!1}return!0}function ea(e,t,n,r){let o=[],u=(l,h)=>{if(Ss(l,t,r)){let p=typeof l=="string"?h:l;return p&&o.push(p),!n}if(typeof l=="string")return!1;for(let p of l.children||[])if(u(p,l))return!0;return!1};return u(e,null),o}function Br(e,t){let n=[],r=t?.mode==="regex"?ul:()=>!0,o=t?.mode==="regex"?ll:h=>h,u=(h,p,b)=>{if(typeof h=="string"){if(p&&!r(p,h))return;let w=Lr(o(h));w&&n.push(b+"- text: "+w);return}let v=h.role;if(h.name&&h.name.length<=900){let w=o(h.name);if(w){let A=w.startsWith("/")&&w.endsWith("/")?w:JSON.stringify(w);v+=" "+A}}if(h.checked==="mixed"&&(v+=" [checked=mixed]"),h.checked===!0&&(v+=" [checked]"),h.disabled&&(v+=" [disabled]"),h.expanded&&(v+=" [expanded]"),h.level&&(v+=` [level=${h.level}]`),h.pressed==="mixed"&&(v+=" [pressed=mixed]"),h.pressed===!0&&(v+=" [pressed]"),h.selected===!0&&(v+=" [selected]"),t?.forAI&&ta(h)){let w=h.ref,A=hl(h)?" [cursor=pointer]":"";w&&(v+=` [ref=${w}]${A}`)}let m=b+"- "+el(v),y=!!Object.keys(h.props).length;if(!h.children.length&&!y)n.push(m);else if(h.children.length===1&&typeof h.children[0]=="string"&&!y){let w=r(h,h.children[0])?o(h.children[0]):null;w?n.push(m+": "+Lr(w)):n.push(m)}else{n.push(m+":");for(let[w,A]of Object.entries(h.props))n.push(b+" - /"+w+": "+Lr(A));for(let w of h.children||[])u(w,h,b+" ")}},l=e.root;if(l.role==="fragment")for(let h of l.children||[])u(h,l,"");else u(l,null,"");return n.join(`
9
+ `)}function ll(e){let t=[{regex:/\b[\d,.]+[bkmBKM]+\b/,replacement:"[\\d,.]+[bkmBKM]+"},{regex:/\b\d+[hmsp]+\b/,replacement:"\\d+[hmsp]+"},{regex:/\b[\d,.]+[hmsp]+\b/,replacement:"[\\d,.]+[hmsp]+"},{regex:/\b\d+,\d+\b/,replacement:"\\d+,\\d+"},{regex:/\b\d+\.\d{2,}\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\.\d+\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\b/,replacement:"\\d+"}],n="",r=0,o=new RegExp(t.map(u=>"("+u.regex.source+")").join("|"),"g");return e.replace(o,(u,...l)=>{let h=l[l.length-2],p=l.slice(0,-2);n+=Zt(e.slice(r,h));for(let b=0;b<p.length;b++)if(p[b]){let{replacement:v}=t[b];n+=v;break}return r=h+u.length,u}),n?(n+=Zt(e.slice(r)),String(new RegExp(n))):e}function ul(e,t){if(!t.length)return!1;if(!e.name)return!0;if(e.name.length>t.length)return!1;let n=t.length<=200&&e.name.length<=200?eo(t,e.name):"",r=t;for(;n&&r.includes(n);)r=r.replace(n,"");return r.trim().length/t.length>.1}function ta(e){return e.box.visible&&e.receivesPointerEvents}function hl(e){var t;return((t=e.box.style)==null?void 0:t.cursor)==="pointer"}var Wi={},Or=class{_glassPaneElement;_glassPaneShadow;_renderedEntries=[];_actionPointElement;_isUnderTest;_injectedScript;_rafRequest;_language="javascript";constructor(e){this._injectedScript=e;let t=e.document;this._isUnderTest=e.isUnderTest,this._glassPaneElement=t.createElement("x-pw-glass"),this._glassPaneElement.style.position="fixed",this._glassPaneElement.style.top="0",this._glassPaneElement.style.right="0",this._glassPaneElement.style.bottom="0",this._glassPaneElement.style.left="0",this._glassPaneElement.style.zIndex="2147483646",this._glassPaneElement.style.pointerEvents="none",this._glassPaneElement.style.display="flex",this._glassPaneElement.style.backgroundColor="transparent";for(let n of["click","auxclick","dragstart","input","keydown","keyup","pointerdown","pointerup","mousedown","mouseup","mouseleave","focus","scroll"])this._glassPaneElement.addEventListener(n,r=>{r.stopPropagation(),r.stopImmediatePropagation()});if(this._actionPointElement=t.createElement("x-pw-action-point"),this._actionPointElement.setAttribute("hidden","true"),this._glassPaneShadow=this._glassPaneElement.attachShadow({mode:this._isUnderTest?"open":"closed"}),typeof this._glassPaneShadow.adoptedStyleSheets.push=="function"){let n=new this._injectedScript.window.CSSStyleSheet;n.replaceSync(Wi),this._glassPaneShadow.adoptedStyleSheets.push(n)}else{let n=this._injectedScript.document.createElement("style");n.textContent=Wi,this._glassPaneShadow.appendChild(n)}this._glassPaneShadow.appendChild(this._actionPointElement)}install(){this._injectedScript.document.documentElement&&!this._injectedScript.document.documentElement.contains(this._glassPaneElement)&&this._injectedScript.document.documentElement.appendChild(this._glassPaneElement)}setLanguage(e){this._language=e}runHighlightOnRaf(e){this._rafRequest&&this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest);let t=this._injectedScript.querySelectorAll(e,this._injectedScript.document.documentElement),n=Qt(this._language,je(e)),r=t.length>1?"#f6b26b7f":"#6fa8dc7f";this.updateHighlight(t.map((o,u)=>{let l=t.length>1?` [${u+1} of ${t.length}]`:"";return{element:o,color:r,tooltipText:n+l}})),this._rafRequest=this._injectedScript.utils.builtins.requestAnimationFrame(()=>this.runHighlightOnRaf(e))}uninstall(){this._rafRequest&&this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest),this._glassPaneElement.remove()}showActionPoint(e,t){this._actionPointElement.style.top=t+"px",this._actionPointElement.style.left=e+"px",this._actionPointElement.hidden=!1}hideActionPoint(){this._actionPointElement.hidden=!0}clearHighlight(){var e,t;for(let n of this._renderedEntries)(e=n.highlightElement)==null||e.remove(),(t=n.tooltipElement)==null||t.remove();this._renderedEntries=[]}maskElements(e,t){this.updateHighlight(e.map(n=>({element:n,color:t})))}updateHighlight(e){if(!this._highlightIsUpToDate(e)){this.clearHighlight();for(let t of e){let n=this._createHighlightElement();this._glassPaneShadow.appendChild(n);let r;if(t.tooltipText){r=this._injectedScript.document.createElement("x-pw-tooltip"),this._glassPaneShadow.appendChild(r),r.style.top="0",r.style.left="0",r.style.display="flex";let o=this._injectedScript.document.createElement("x-pw-tooltip-line");o.textContent=t.tooltipText,r.appendChild(o)}this._renderedEntries.push({targetElement:t.element,color:t.color,tooltipElement:r,highlightElement:n})}for(let t of this._renderedEntries){if(t.box=t.targetElement.getBoundingClientRect(),!t.tooltipElement)continue;let{anchorLeft:n,anchorTop:r}=this.tooltipPosition(t.box,t.tooltipElement);t.tooltipTop=r,t.tooltipLeft=n}for(let t of this._renderedEntries){t.tooltipElement&&(t.tooltipElement.style.top=t.tooltipTop+"px",t.tooltipElement.style.left=t.tooltipLeft+"px");let n=t.box;t.highlightElement.style.backgroundColor=t.color,t.highlightElement.style.left=n.x+"px",t.highlightElement.style.top=n.y+"px",t.highlightElement.style.width=n.width+"px",t.highlightElement.style.height=n.height+"px",t.highlightElement.style.display="block",this._isUnderTest&&console.error("Highlight box for test: "+JSON.stringify({x:n.x,y:n.y,width:n.width,height:n.height}))}}}firstBox(){var e;return(e=this._renderedEntries[0])==null?void 0:e.box}tooltipPosition(e,t){let n=t.offsetWidth,r=t.offsetHeight,o=this._glassPaneElement.offsetWidth,u=this._glassPaneElement.offsetHeight,l=e.left;l+n>o-5&&(l=o-n-5);let h=e.bottom+5;return h+r>u-5&&(e.top>r+5?h=e.top-r-5:h=u-5-r),{anchorLeft:l,anchorTop:h}}_highlightIsUpToDate(e){if(e.length!==this._renderedEntries.length)return!1;for(let t=0;t<this._renderedEntries.length;++t){if(e[t].element!==this._renderedEntries[t].targetElement||e[t].color!==this._renderedEntries[t].color)return!1;let n=this._renderedEntries[t].box;if(!n)return!1;let r=e[t].element.getBoundingClientRect();if(r.top!==n.top||r.right!==n.right||r.bottom!==n.bottom||r.left!==n.left)return!1}return!0}_createHighlightElement(){return this._injectedScript.document.createElement("x-pw-highlight")}appendChild(e){this._glassPaneShadow.appendChild(e)}};function fl(e,t,n){let r=e.left-t.right;if(!(r<0||n!==void 0&&r>n))return r+Math.max(t.bottom-e.bottom,0)+Math.max(e.top-t.top,0)}function dl(e,t,n){let r=t.left-e.right;if(!(r<0||n!==void 0&&r>n))return r+Math.max(t.bottom-e.bottom,0)+Math.max(e.top-t.top,0)}function pl(e,t,n){let r=t.top-e.bottom;if(!(r<0||n!==void 0&&r>n))return r+Math.max(e.left-t.left,0)+Math.max(t.right-e.right,0)}function gl(e,t,n){let r=e.top-t.bottom;if(!(r<0||n!==void 0&&r>n))return r+Math.max(e.left-t.left,0)+Math.max(t.right-e.right,0)}function ml(e,t,n){let r=n===void 0?50:n,o=0;return e.left-t.right>=0&&(o+=e.left-t.right),t.left-e.right>=0&&(o+=t.left-e.right),t.top-e.bottom>=0&&(o+=t.top-e.bottom),e.top-t.bottom>=0&&(o+=e.top-t.bottom),o>r?void 0:o}var yl=["left-of","right-of","above","below","near"];function na(e,t,n,r){let o=t.getBoundingClientRect(),u={"left-of":dl,"right-of":fl,above:pl,below:gl,near:ml}[e],l;for(let h of n){if(h===t)continue;let p=u(o,h.getBoundingClientRect(),r);p!==void 0&&(l===void 0||p<l)&&(l=p)}return l}function Ki(e){return e.displayName||e.name||"Anonymous"}function bl(e){if(e.type)switch(typeof e.type){case"function":return Ki(e.type);case"string":return e.type;case"object":return e.type.displayName||(e.type.render?Ki(e.type.render):"")}if(e._currentElement){let t=e._currentElement.type;if(typeof t=="string")return t;if(typeof t=="function")return t.displayName||t.name||"Anonymous"}return""}function vl(e){var t;return e.key??((t=e._currentElement)==null?void 0:t.key)}function wl(e){if(e.child){let n=[];for(let r=e.child;r;r=r.sibling)n.push(r);return n}if(!e._currentElement)return[];let t=n=>{var r;let o=(r=n._currentElement)==null?void 0:r.type;return typeof o=="function"||typeof o=="string"};if(e._renderedComponent){let n=e._renderedComponent;return t(n)?[n]:[]}return e._renderedChildren?[...Object.values(e._renderedChildren)].filter(t):[]}function El(e){var t;let n=e.memoizedProps||((t=e._currentElement)==null?void 0:t.props);if(!n||typeof n=="string")return n;let r={...n};return delete r.children,r}function ra(e){var t;let n={key:vl(e),name:bl(e),children:wl(e).map(ra),rootElements:[],props:El(e)},r=e.stateNode||e._hostNode||((t=e._renderedComponent)==null?void 0:t._hostNode);if(r instanceof Element)n.rootElements.push(r);else for(let o of n.children)n.rootElements.push(...o.rootElements);return n}function sa(e,t,n=[]){t(e)&&n.push(e);for(let r of e.children)sa(r,t,n);return n}function ia(e,t=[]){let r=(e.ownerDocument||e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);do{let o=r.currentNode,u=o,l=Object.keys(u).find(p=>p.startsWith("__reactContainer")&&u[p]!==null);if(l)t.push(u[l].stateNode.current);else{let p="_reactRootContainer";u.hasOwnProperty(p)&&u[p]!==null&&t.push(u[p]._internalRoot.current)}if(o instanceof Element&&o.hasAttribute("data-reactroot"))for(let p of Object.keys(o))(p.startsWith("__reactInternalInstance")||p.startsWith("__reactFiber"))&&t.push(o[p]);let h=o instanceof Element?o.shadowRoot:null;h&&ia(h,t)}while(r.nextNode());return t}var Sl=()=>({queryAll(e,t){let{name:n,attributes:r}=tt(t,!1),l=ia(e.ownerDocument||e).map(p=>ra(p)).map(p=>sa(p,b=>{let v=b.props??{};if(b.key!==void 0&&(v.key=b.key),n&&b.name!==n||b.rootElements.some(m=>!on(e,m)))return!1;for(let m of r)if(!ms(v,m))return!1;return!0})).flat(),h=new Set;for(let p of l)for(let b of p.rootElements)h.add(b);return[...h]}}),oa=["selected","checked","pressed","expanded","level","disabled","name","include-hidden"];oa.sort();function Ht(e,t,n){if(!t.includes(n))throw new Error(`"${e}" attribute is only supported for roles: ${t.slice().sort().map(r=>`"${r}"`).join(", ")}`)}function bt(e,t){if(e.op!=="<truthy>"&&!t.includes(e.value))throw new Error(`"${e.name}" must be one of ${t.map(n=>JSON.stringify(n)).join(", ")}`)}function vt(e,t){if(!t.includes(e.op))throw new Error(`"${e.name}" does not support "${e.op}" matcher`)}function xl(e,t){let n={role:t};for(let r of e)switch(r.name){case"checked":{Ht(r.name,zn,t),bt(r,[!0,!1,"mixed"]),vt(r,["<truthy>","="]),n.checked=r.op==="<truthy>"?!0:r.value;break}case"pressed":{Ht(r.name,Jn,t),bt(r,[!0,!1,"mixed"]),vt(r,["<truthy>","="]),n.pressed=r.op==="<truthy>"?!0:r.value;break}case"selected":{Ht(r.name,Gn,t),bt(r,[!0,!1]),vt(r,["<truthy>","="]),n.selected=r.op==="<truthy>"?!0:r.value;break}case"expanded":{Ht(r.name,Yn,t),bt(r,[!0,!1]),vt(r,["<truthy>","="]),n.expanded=r.op==="<truthy>"?!0:r.value;break}case"level":{if(Ht(r.name,Qn,t),typeof r.value=="string"&&(r.value=+r.value),r.op!=="="||typeof r.value!="number"||Number.isNaN(r.value))throw new Error('"level" attribute must be compared to a number');n.level=r.value;break}case"disabled":{bt(r,[!0,!1]),vt(r,["<truthy>","="]),n.disabled=r.op==="<truthy>"?!0:r.value;break}case"name":{if(r.op==="<truthy>")throw new Error('"name" attribute must have a value');if(typeof r.value!="string"&&!(r.value instanceof RegExp))throw new Error('"name" attribute must be a string or a regular expression');n.name=r.value,n.nameOp=r.op,n.exact=r.caseSensitive;break}case"include-hidden":{bt(r,[!0,!1]),vt(r,["<truthy>","="]),n.includeHidden=r.op==="<truthy>"?!0:r.value;break}default:throw new Error(`Unknown attribute "${r.name}", must be one of ${oa.map(o=>`"${o}"`).join(", ")}.`)}return n}function Tl(e,t,n){let r=[],o=l=>{if(he(l)===t.role&&!(t.selected!==void 0&&ts(l)!==t.selected)&&!(t.checked!==void 0&&ns(l)!==t.checked)&&!(t.pressed!==void 0&&ss(l)!==t.pressed)&&!(t.expanded!==void 0&&is(l)!==t.expanded)&&!(t.level!==void 0&&os(l)!==t.level)&&!(t.disabled!==void 0&&tn(l)!==t.disabled)&&!(!t.includeHidden&&Ce(l))){if(t.name!==void 0){let h=we(At(l,!!t.includeHidden));if(typeof t.name=="string"&&(t.name=we(t.name)),n&&!t.exact&&t.nameOp==="="&&(t.nameOp="*="),!ys(h,{name:"",jsonPath:[],op:t.nameOp||"=",value:t.name,caseSensitive:!!t.exact}))return}r.push(l)}},u=l=>{let h=[];l.shadowRoot&&h.push(l.shadowRoot);for(let p of l.querySelectorAll("*"))o(p),p.shadowRoot&&h.push(p.shadowRoot);h.forEach(u)};return u(e),r}function Vi(e){return{queryAll:(t,n)=>{let r=tt(n,!0),o=r.name.toLowerCase();if(!o)throw new Error("Role must not be empty");let u=xl(r.attributes,o);Xn();try{return Tl(t,u,e)}finally{Zn()}}}}var kl=class{_engines;_cacheQueryCSS;_cacheMatches;_cacheQuery;_cacheMatchesSimple;_cacheMatchesParents;_cacheCallMatches;_cacheCallQuery;_cacheQuerySimple;_cacheText;_scoreMap;_retainCacheCounter=0;constructor(){this._cacheText=new Map,this._cacheQueryCSS=new Map,this._cacheMatches=new Map,this._cacheQuery=new Map,this._cacheMatchesSimple=new Map,this._cacheMatchesParents=new Map,this._cacheCallMatches=new Map,this._cacheCallQuery=new Map,this._cacheQuerySimple=new Map,this._engines=new Map,this._engines.set("not",Nl),this._engines.set("is",Vt),this._engines.set("where",Vt),this._engines.set("has",_l),this._engines.set("scope",Al),this._engines.set("light",Cl),this._engines.set("visible",Il),this._engines.set("text",Ll),this._engines.set("text-is",Ol),this._engines.set("text-matches",$l),this._engines.set("has-text",Ml),this._engines.set("right-of",Wt("right-of")),this._engines.set("left-of",Wt("left-of")),this._engines.set("above",Wt("above")),this._engines.set("below",Wt("below")),this._engines.set("near",Wt("near")),this._engines.set("nth-match",Pl);let e=[...this._engines.keys()];e.sort();let t=[...Xo];if(t.sort(),e.join("|")!==t.join("|"))throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${e.join("|")} vs ${t.join("|")}`)}begin(){++this._retainCacheCounter}end(){--this._retainCacheCounter,this._retainCacheCounter||(this._cacheQueryCSS.clear(),this._cacheMatches.clear(),this._cacheQuery.clear(),this._cacheMatchesSimple.clear(),this._cacheMatchesParents.clear(),this._cacheCallMatches.clear(),this._cacheCallQuery.clear(),this._cacheQuerySimple.clear(),this._cacheText.clear())}_cached(e,t,n,r){e.has(t)||e.set(t,[]);let o=e.get(t),u=o.find(h=>n.every((p,b)=>h.rest[b]===p));if(u)return u.result;let l=r();return o.push({rest:n,result:l}),l}_checkSelector(e){if(!(typeof e=="object"&&e&&(Array.isArray(e)||"simples"in e&&e.simples.length)))throw new Error(`Malformed selector "${e}"`);return e}matches(e,t,n){let r=this._checkSelector(t);this.begin();try{return this._cached(this._cacheMatches,e,[r,n.scope,n.pierceShadow,n.originalScope],()=>Array.isArray(r)?this._matchesEngine(Vt,e,r,n):(this._hasScopeClause(r)&&(n=this._expandContextForScopeMatching(n)),this._matchesSimple(e,r.simples[r.simples.length-1].selector,n)?this._matchesParents(e,r,r.simples.length-2,n):!1))}finally{this.end()}}query(e,t){let n=this._checkSelector(t);this.begin();try{return this._cached(this._cacheQuery,n,[e.scope,e.pierceShadow,e.originalScope],()=>{if(Array.isArray(n))return this._queryEngine(Vt,e,n);this._hasScopeClause(n)&&(e=this._expandContextForScopeMatching(e));let r=this._scoreMap;this._scoreMap=new Map;let o=this._querySimple(e,n.simples[n.simples.length-1].selector);return o=o.filter(u=>this._matchesParents(u,n,n.simples.length-2,e)),this._scoreMap.size&&o.sort((u,l)=>{let h=this._scoreMap.get(u),p=this._scoreMap.get(l);return h===p?0:h===void 0?1:p===void 0?-1:h-p}),this._scoreMap=r,o})}finally{this.end()}}_markScore(e,t){this._scoreMap&&this._scoreMap.set(e,t)}_hasScopeClause(e){return e.simples.some(t=>t.selector.functions.some(n=>n.name==="scope"))}_expandContextForScopeMatching(e){if(e.scope.nodeType!==1)return e;let t=me(e.scope);return t?{...e,scope:t,originalScope:e.originalScope||e.scope}:e}_matchesSimple(e,t,n){return this._cached(this._cacheMatchesSimple,e,[t,n.scope,n.pierceShadow,n.originalScope],()=>{if(e===n.scope||t.css&&!this._matchesCSS(e,t.css))return!1;for(let r of t.functions)if(!this._matchesEngine(this._getEngine(r.name),e,r.args,n))return!1;return!0})}_querySimple(e,t){return t.functions.length?this._cached(this._cacheQuerySimple,t,[e.scope,e.pierceShadow,e.originalScope],()=>{let n=t.css,r=t.functions;n==="*"&&r.length&&(n=void 0);let o,u=-1;n!==void 0?o=this._queryCSS(e,n):(u=r.findIndex(l=>this._getEngine(l.name).query!==void 0),u===-1&&(u=0),o=this._queryEngine(this._getEngine(r[u].name),e,r[u].args));for(let l=0;l<r.length;l++){if(l===u)continue;let h=this._getEngine(r[l].name);h.matches!==void 0&&(o=o.filter(p=>this._matchesEngine(h,p,r[l].args,e)))}for(let l=0;l<r.length;l++){if(l===u)continue;let h=this._getEngine(r[l].name);h.matches===void 0&&(o=o.filter(p=>this._matchesEngine(h,p,r[l].args,e)))}return o}):this._queryCSS(e,t.css||"*")}_matchesParents(e,t,n,r){return n<0?!0:this._cached(this._cacheMatchesParents,e,[t,n,r.scope,r.pierceShadow,r.originalScope],()=>{let{selector:o,combinator:u}=t.simples[n];if(u===">"){let l=Pn(e,r);return!l||!this._matchesSimple(l,o,r)?!1:this._matchesParents(l,t,n-1,r)}if(u==="+"){let l=$r(e,r);return!l||!this._matchesSimple(l,o,r)?!1:this._matchesParents(l,t,n-1,r)}if(u===""){let l=Pn(e,r);for(;l;){if(this._matchesSimple(l,o,r)){if(this._matchesParents(l,t,n-1,r))return!0;if(t.simples[n-1].combinator==="")break}l=Pn(l,r)}return!1}if(u==="~"){let l=$r(e,r);for(;l;){if(this._matchesSimple(l,o,r)){if(this._matchesParents(l,t,n-1,r))return!0;if(t.simples[n-1].combinator==="~")break}l=$r(l,r)}return!1}if(u===">="){let l=e;for(;l;){if(this._matchesSimple(l,o,r)){if(this._matchesParents(l,t,n-1,r))return!0;if(t.simples[n-1].combinator==="")break}l=Pn(l,r)}return!1}throw new Error(`Unsupported combinator "${u}"`)})}_matchesEngine(e,t,n,r){if(e.matches)return this._callMatches(e,t,n,r);if(e.query)return this._callQuery(e,n,r).includes(t);throw new Error('Selector engine should implement "matches" or "query"')}_queryEngine(e,t,n){if(e.query)return this._callQuery(e,n,t);if(e.matches)return this._queryCSS(t,"*").filter(r=>this._callMatches(e,r,n,t));throw new Error('Selector engine should implement "matches" or "query"')}_callMatches(e,t,n,r){return this._cached(this._cacheCallMatches,t,[e,r.scope,r.pierceShadow,r.originalScope,...n],()=>e.matches(t,n,r,this))}_callQuery(e,t,n){return this._cached(this._cacheCallQuery,e,[n.scope,n.pierceShadow,n.originalScope,...t],()=>e.query(n,t,this))}_matchesCSS(e,t){return e.matches(t)}_queryCSS(e,t){return this._cached(this._cacheQueryCSS,t,[e.scope,e.pierceShadow,e.originalScope],()=>{let n=[];function r(o){if(n=n.concat([...o.querySelectorAll(t)]),!!e.pierceShadow){o.shadowRoot&&r(o.shadowRoot);for(let u of o.querySelectorAll("*"))u.shadowRoot&&r(u.shadowRoot)}}return r(e.scope),n})}_getEngine(e){let t=this._engines.get(e);if(!t)throw new Error(`Unknown selector engine "${e}"`);return t}},Vt={matches(e,t,n,r){if(t.length===0)throw new Error('"is" engine expects non-empty selector list');return t.some(o=>r.matches(e,o,n))},query(e,t,n){if(t.length===0)throw new Error('"is" engine expects non-empty selector list');let r=[];for(let o of t)r=r.concat(n.query(e,o));return t.length===1?r:aa(r)}},_l={matches(e,t,n,r){if(t.length===0)throw new Error('"has" engine expects non-empty selector list');return r.query({...n,scope:e},t).length>0}},Al={matches(e,t,n,r){if(t.length!==0)throw new Error('"scope" engine expects no arguments');let o=n.originalScope||n.scope;return o.nodeType===9?e===o.documentElement:e===o},query(e,t,n){if(t.length!==0)throw new Error('"scope" engine expects no arguments');let r=e.originalScope||e.scope;if(r.nodeType===9){let o=r.documentElement;return o?[o]:[]}return r.nodeType===1?[r]:[]}},Nl={matches(e,t,n,r){if(t.length===0)throw new Error('"not" engine expects non-empty selector list');return!r.matches(e,t,n)}},Cl={query(e,t,n){return n.query({...e,pierceShadow:!1},t)},matches(e,t,n,r){return r.matches(e,t,{...n,pierceShadow:!1})}},Il={matches(e,t,n,r){if(t.length)throw new Error('"visible" engine expects no arguments');return Ge(e)}},Ll={matches(e,t,n,r){if(t.length!==1||typeof t[0]!="string")throw new Error('"text" engine expects a single string');let o=we(t[0]).toLowerCase(),u=l=>l.normalized.toLowerCase().includes(o);return an(r._cacheText,e,u)==="self"}},Ol={matches(e,t,n,r){if(t.length!==1||typeof t[0]!="string")throw new Error('"text-is" engine expects a single string');let o=we(t[0]),u=l=>!o&&!l.immediate.length?!0:l.immediate.some(h=>we(h)===o);return an(r._cacheText,e,u)!=="none"}},$l={matches(e,t,n,r){if(t.length===0||typeof t[0]!="string"||t.length>2||t.length===2&&typeof t[1]!="string")throw new Error('"text-matches" engine expects a regexp body and optional regexp flags');let o=new RegExp(t[0],t.length===2?t[1]:void 0),u=l=>o.test(l.full);return an(r._cacheText,e,u)==="self"}},Ml={matches(e,t,n,r){if(t.length!==1||typeof t[0]!="string")throw new Error('"has-text" engine expects a single string');if(er(e))return!1;let o=we(t[0]).toLowerCase();return(l=>l.normalized.toLowerCase().includes(o))(Se(r._cacheText,e))}};function Wt(e){return{matches(t,n,r,o){let u=n.length&&typeof n[n.length-1]=="number"?n[n.length-1]:void 0,l=u===void 0?n:n.slice(0,n.length-1);if(n.length<1+(u===void 0?0:1))throw new Error(`"${e}" engine expects a selector list and optional maximum distance in pixels`);let h=o.query(r,l),p=na(e,t,h,u);return p===void 0?!1:(o._markScore(t,p),!0)}}}var Pl={query(e,t,n){let r=t[t.length-1];if(t.length<2)throw new Error('"nth-match" engine expects non-empty selector list and an index argument');if(typeof r!="number"||r<1)throw new Error('"nth-match" engine expects a one-based index as the last argument');let o=Vt.query(e,t.slice(0,t.length-1),n);return r--,r<o.length?[o[r]]:[]}};function Pn(e,t){if(e!==t.scope)return t.pierceShadow?me(e):e.parentElement||void 0}function $r(e,t){if(e!==t.scope)return e.previousElementSibling||void 0}function aa(e){let t=new Map,n=[],r=[];function o(l){let h=t.get(l);if(h)return h;let p=me(l);return p?o(p).children.push(l):n.push(l),h={children:[],taken:!1},t.set(l,h),h}for(let l of e)o(l).taken=!0;function u(l){let h=t.get(l);if(h.taken&&r.push(l),h.children.length>1){let p=new Set(h.children);h.children=[];let b=l.firstElementChild;for(;b&&h.children.length<p.size;)p.has(b)&&h.children.push(b),b=b.nextElementSibling;for(b=l.shadowRoot?l.shadowRoot.firstElementChild:null;b&&h.children.length<p.size;)p.has(b)&&h.children.push(b),b=b.nextElementSibling}h.children.forEach(u)}return n.forEach(u),r}function ca(e,t){let n=e.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"),r=n.substring(n.lastIndexOf("/")+1);return t&&r.endsWith(t)&&(r=r.substring(0,r.length-t.length)),r}function Rl(e,t){return t?t.toUpperCase():""}var ql=/(?:^|[-_/])(\w)/g,la=e=>e&&e.replace(ql,Rl);function Dl(e){function t(v){let m=v.name||v._componentTag||v.__playwright_guessedName;if(m)return m;let y=v.__file;if(y)return la(ca(y,".vue"))}function n(v,m){return v.type.__playwright_guessedName=m,m}function r(v){var m,y,w,A;let I=t(v.type||{});if(I)return I;if(v.root===v)return"Root";for(let P in(y=(m=v.parent)==null?void 0:m.type)==null?void 0:y.components)if(((w=v.parent)==null?void 0:w.type.components[P])===v.type)return n(v,P);for(let P in(A=v.appContext)==null?void 0:A.components)if(v.appContext.components[P]===v.type)return n(v,P);return"Anonymous Component"}function o(v){return v._isBeingDestroyed||v.isUnmounted}function u(v){return v.subTree.type.toString()==="Symbol(Fragment)"}function l(v){let m=[];return v.component&&m.push(v.component),v.suspense&&m.push(...l(v.suspense.activeBranch)),Array.isArray(v.children)&&v.children.forEach(y=>{y.component?m.push(y.component):m.push(...l(y))}),m.filter(y=>{var w;return!o(y)&&!((w=y.type.devtools)!=null&&w.hide)})}function h(v){return u(v)?p(v.subTree):[v.subTree.el]}function p(v){if(!v.children)return[];let m=[];for(let y=0,w=v.children.length;y<w;y++){let A=v.children[y];A.component?m.push(...h(A.component)):A.el&&m.push(A.el)}return m}function b(v){return{name:r(v),children:l(v.subTree).map(b),rootElements:h(v),props:v.props}}return b(e)}function Ul(e){function t(u){let l=u.displayName||u.name||u._componentTag;if(l)return l;let h=u.__file;if(h)return la(ca(h,".vue"))}function n(u){let l=t(u.$options||u.fnOptions||{});return l||(u.$root===u?"Root":"Anonymous Component")}function r(u){return u.$children?u.$children:Array.isArray(u.subTree.children)?u.subTree.children.filter(l=>!!l.component).map(l=>l.component):[]}function o(u){return{name:n(u),children:r(u).map(o),rootElements:[u.$el],props:u._props}}return o(e)}function ua(e,t,n=[]){t(e)&&n.push(e);for(let r of e.children)ua(r,t,n);return n}function ha(e,t=[]){let r=(e.ownerDocument||e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT),o=new Set;do{let u=r.currentNode;u.__vue__&&o.add(u.__vue__.$root),u.__vue_app__&&u._vnode&&u._vnode.component&&t.push({root:u._vnode.component,version:3});let l=u instanceof Element?u.shadowRoot:null;l&&ha(l,t)}while(r.nextNode());for(let u of o)t.push({version:2,root:u});return t}var Bl=()=>({queryAll(e,t){let n=e.ownerDocument||e,{name:r,attributes:o}=tt(t,!1),h=ha(n).map(b=>b.version===3?Dl(b.root):Ul(b.root)).map(b=>ua(b,v=>{if(r&&v.name!==r||v.rootElements.some(m=>!on(e,m)))return!1;for(let m of o)if(!ms(v.props,m))return!1;return!0})).flat(),p=new Set;for(let b of h)for(let v of b.rootElements)p.add(v);return[...p]}}),Gi={queryAll(e,t){t.startsWith("/")&&e.nodeType!==Node.DOCUMENT_NODE&&(t="."+t);let n=[],r=e.ownerDocument||e;if(!r)return n;let o=r.evaluate(t,e,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE);for(let u=o.iterateNext();u;u=o.iterateNext())u.nodeType===Node.ELEMENT_NODE&&n.push(u);return n}};function xs(e,t,n){return`internal:attr=[${e}=${Ne(t,n?.exact||!1)}]`}function jl(e,t){return`internal:testid=[${e}=${Ne(t,!0)}]`}function Fl(e,t){return"internal:label="+Ae(e,!!t?.exact)}function Hl(e,t){return xs("alt",e,t)}function Wl(e,t){return xs("title",e,t)}function Kl(e,t){return xs("placeholder",e,t)}function Vl(e,t){return"internal:text="+Ae(e,!!t?.exact)}function Gl(e,t={}){let n=[];return t.checked!==void 0&&n.push(["checked",String(t.checked)]),t.disabled!==void 0&&n.push(["disabled",String(t.disabled)]),t.selected!==void 0&&n.push(["selected",String(t.selected)]),t.expanded!==void 0&&n.push(["expanded",String(t.expanded)]),t.includeHidden!==void 0&&n.push(["include-hidden",String(t.includeHidden)]),t.level!==void 0&&n.push(["level",String(t.level)]),t.name!==void 0&&n.push(["name",Ne(t.name,!!t.exact)]),t.pressed!==void 0&&n.push(["pressed",String(t.pressed)]),`internal:role=${e}${n.map(([r,o])=>`[${r}=${o}]`).join("")}`}var wt=Symbol("selector"),zl=class Gt{[wt];element;elements;constructor(t,n,r){if(r?.hasText&&(n+=` >> internal:has-text=${Ae(r.hasText,!1)}`),r?.hasNotText&&(n+=` >> internal:has-not-text=${Ae(r.hasNotText,!1)}`),r?.has&&(n+=" >> internal:has="+JSON.stringify(r.has[wt])),r?.hasNot&&(n+=" >> internal:has-not="+JSON.stringify(r.hasNot[wt])),r?.visible!==void 0&&(n+=` >> visible=${r.visible?"true":"false"}`),this[wt]=n,n){let l=t.parseSelector(n);this.element=t.querySelector(l,t.document,!1),this.elements=t.querySelectorAll(l,t.document)}let o=n,u=this;u.locator=(l,h)=>new Gt(t,o?o+" >> "+l:l,h),u.getByTestId=l=>u.locator(jl(t.testIdAttributeNameForStrictErrorAndConsoleCodegen(),l)),u.getByAltText=(l,h)=>u.locator(Hl(l,h)),u.getByLabel=(l,h)=>u.locator(Fl(l,h)),u.getByPlaceholder=(l,h)=>u.locator(Kl(l,h)),u.getByText=(l,h)=>u.locator(Vl(l,h)),u.getByTitle=(l,h)=>u.locator(Wl(l,h)),u.getByRole=(l,h={})=>u.locator(Gl(l,h)),u.filter=l=>new Gt(t,n,l),u.first=()=>u.locator("nth=0"),u.last=()=>u.locator("nth=-1"),u.nth=l=>u.locator(`nth=${l}`),u.and=l=>new Gt(t,o+" >> internal:and="+JSON.stringify(l[wt])),u.or=l=>new Gt(t,o+" >> internal:or="+JSON.stringify(l[wt]))}},Jl=class{_injectedScript;constructor(e){this._injectedScript=e}install(){this._injectedScript.window.playwright||(this._injectedScript.window.playwright={$:(e,t)=>this._querySelector(e,!!t),$$:e=>this._querySelectorAll(e),inspect:e=>this._inspect(e),selector:e=>this._selector(e),generateLocator:(e,t)=>this._generateLocator(e,t),ariaSnapshot:(e,t)=>this._injectedScript.ariaSnapshot(e||this._injectedScript.document.body,t),resume:()=>this._resume(),...new zl(this._injectedScript,"")},delete this._injectedScript.window.playwright.filter,delete this._injectedScript.window.playwright.first,delete this._injectedScript.window.playwright.last,delete this._injectedScript.window.playwright.nth,delete this._injectedScript.window.playwright.and,delete this._injectedScript.window.playwright.or)}_querySelector(e,t){if(typeof e!="string")throw new Error("Usage: playwright.query('Playwright >> selector').");let n=this._injectedScript.parseSelector(e);return this._injectedScript.querySelector(n,this._injectedScript.document,t)}_querySelectorAll(e){if(typeof e!="string")throw new Error("Usage: playwright.$$('Playwright >> selector').");let t=this._injectedScript.parseSelector(e);return this._injectedScript.querySelectorAll(t,this._injectedScript.document)}_inspect(e){if(typeof e!="string")throw new Error("Usage: playwright.inspect('Playwright >> selector').");this._injectedScript.window.inspect(this._querySelector(e,!1))}_selector(e){if(!(e instanceof Element))throw new Error("Usage: playwright.selector(element).");return this._injectedScript.generateSelectorSimple(e)}_generateLocator(e,t){if(!(e instanceof Element))throw new Error("Usage: playwright.locator(element).");let n=this._injectedScript.generateSelectorSimple(e);return Qt(t||"javascript",n)}_resume(){this._injectedScript.window.__pw_resume().catch(()=>{})}};function Yl(e){try{return e instanceof RegExp||Object.prototype.toString.call(e)==="[object RegExp]"}catch{return!1}}function Ql(e){try{return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}catch{return!1}}function Xl(e){try{return e instanceof URL||Object.prototype.toString.call(e)==="[object URL]"}catch{return!1}}function Zl(e){var t;try{return e instanceof Error||e&&((t=Object.getPrototypeOf(e))==null?void 0:t.name)==="Error"}catch{return!1}}function eu(e,t){try{return e instanceof t||Object.prototype.toString.call(e)===`[object ${t.name}]`}catch{return!1}}var fa={i8:Int8Array,ui8:Uint8Array,ui8c:Uint8ClampedArray,i16:Int16Array,ui16:Uint16Array,i32:Int32Array,ui32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:BigInt64Array,bui64:BigUint64Array};function tu(e){if("toBase64"in e)return e.toBase64();let t=Array.from(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).map(n=>String.fromCharCode(n)).join("");return btoa(t)}function nu(e,t){let n=atob(e),r=new Uint8Array(n.length);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return new t(r.buffer)}function jr(e,t=[],n=new Map){if(!Object.is(e,void 0)){if(typeof e=="object"&&e){if("ref"in e)return n.get(e.ref);if("v"in e)return e.v==="undefined"?void 0:e.v==="null"?null:e.v==="NaN"?NaN:e.v==="Infinity"?1/0:e.v==="-Infinity"?-1/0:e.v==="-0"?-0:void 0;if("d"in e)return new Date(e.d);if("u"in e)return new URL(e.u);if("bi"in e)return BigInt(e.bi);if("e"in e){let r=new Error(e.e.m);return r.name=e.e.n,r.stack=e.e.s,r}if("r"in e)return new RegExp(e.r.p,e.r.f);if("a"in e){let r=[];n.set(e.id,r);for(let o of e.a)r.push(jr(o,t,n));return r}if("o"in e){let r={};n.set(e.id,r);for(let{k:o,v:u}of e.o)o!=="__proto__"&&(r[o]=jr(u,t,n));return r}if("h"in e)return t[e.h];if("ta"in e)return nu(e.ta.b,fa[e.ta.k])}return e}}function ru(e,t){return Fr(e,t,{visited:new Map,lastId:0})}function Fr(e,t,n){if(e&&typeof e=="object"){if(typeof globalThis.Window=="function"&&e instanceof globalThis.Window)return"ref: <Window>";if(typeof globalThis.Document=="function"&&e instanceof globalThis.Document)return"ref: <Document>";if(typeof globalThis.Node=="function"&&e instanceof globalThis.Node)return"ref: <Node>"}return da(e,t,n)}function da(e,t,n){var r;let o=t(e);if("fallThrough"in o)e=o.fallThrough;else return o;if(typeof e=="symbol")return{v:"undefined"};if(Object.is(e,void 0))return{v:"undefined"};if(Object.is(e,null))return{v:"null"};if(Object.is(e,NaN))return{v:"NaN"};if(Object.is(e,1/0))return{v:"Infinity"};if(Object.is(e,-1/0))return{v:"-Infinity"};if(Object.is(e,-0))return{v:"-0"};if(typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e;if(typeof e=="bigint")return{bi:e.toString()};if(Zl(e)){let l;return(r=e.stack)!=null&&r.startsWith(e.name+": "+e.message)?l=e.stack:l=`${e.name}: ${e.message}
10
+ ${e.stack}`,{e:{n:e.name,m:e.message,s:l}}}if(Ql(e))return{d:e.toJSON()};if(Xl(e))return{u:e.toJSON()};if(Yl(e))return{r:{p:e.source,f:e.flags}};for(let[l,h]of Object.entries(fa))if(eu(e,h))return{ta:{b:tu(e),k:l}};let u=n.visited.get(e);if(u)return{ref:u};if(Array.isArray(e)){let l=[],h=++n.lastId;n.visited.set(e,h);for(let p=0;p<e.length;++p)l.push(Fr(e[p],t,n));return{a:l,id:h}}if(typeof e=="object"){let l=[],h=++n.lastId;n.visited.set(e,h);for(let b of Object.keys(e)){let v;try{v=e[b]}catch{continue}b==="toJSON"&&typeof v=="function"?l.push({k:b,v:{o:[],id:0}}):l.push({k:b,v:Fr(v,t,n)})}let p;try{l.length===0&&e.toJSON&&typeof e.toJSON=="function"&&(p={value:e.toJSON()})}catch{}return p?da(p.value,t,n):{o:l,id:h}}}var su=class{global;builtins;isUnderTest;constructor(e,t){var n,r,o,u,l,h,p,b;this.global=e,this.isUnderTest=t,e.__pwClock?this.builtins=e.__pwClock.builtins:this.builtins={setTimeout:(n=e.setTimeout)==null?void 0:n.bind(e),clearTimeout:(r=e.clearTimeout)==null?void 0:r.bind(e),setInterval:(o=e.setInterval)==null?void 0:o.bind(e),clearInterval:(u=e.clearInterval)==null?void 0:u.bind(e),requestAnimationFrame:(l=e.requestAnimationFrame)==null?void 0:l.bind(e),cancelAnimationFrame:(h=e.cancelAnimationFrame)==null?void 0:h.bind(e),requestIdleCallback:(p=e.requestIdleCallback)==null?void 0:p.bind(e),cancelIdleCallback:(b=e.cancelIdleCallback)==null?void 0:b.bind(e),performance:e.performance,Intl:e.Intl,Date:e.Date},this.isUnderTest&&(e.builtins=this.builtins)}evaluate(e,t,n,r,...o){let u=o.slice(0,r),l=o.slice(r),h=[];for(let b=0;b<u.length;b++)h[b]=jr(u[b],l);let p=this.global.eval(n);return e===!0?p=p(...h):e===!1?p=p:typeof p=="function"&&(p=p(...h)),t?this._promiseAwareJsonValueNoThrow(p):p}jsonValue(e,t){if(t!==void 0)return ru(t,n=>({fallThrough:n}))}_promiseAwareJsonValueNoThrow(e){let t=n=>{try{return this.jsonValue(!0,n)}catch{return}};return e&&typeof e=="object"&&typeof e.then=="function"?(async()=>{let n=await e;return t(n)})():t(e)}},iu=class{_engines;_evaluator;_stableRafCount;_browserName;onGlobalListenersRemoved;_hitTargetInterceptor;_highlight;isUnderTest;_sdkLanguage;_testIdAttributeNameForStrictErrorAndConsoleCodegen="data-testid";_markedElements;window;document;consoleApi;_lastAriaSnapshot;utils={asLocator:Qt,cacheNormalizedWhitespaces:Yi,elementText:Se,getAriaRole:he,getElementAccessibleDescription:Rr,getElementAccessibleName:At,isElementVisible:Ge,isInsideScope:on,normalizeWhiteSpace:we,parseAriaSnapshot:Uc,builtins:null};_autoClosingTags;_booleanAttributes;_eventTypes;_hoverHitTargetInterceptorEvents;_tapHitTargetInterceptorEvents;_mouseHitTargetInterceptorEvents;_allHitTargetInterceptorEvents;constructor(e,t){this.window=e,this.document=e.document,this.isUnderTest=t.isUnderTest,this.utils.builtins=new su(e,t.isUnderTest).builtins,this._sdkLanguage=t.sdkLanguage,this._testIdAttributeNameForStrictErrorAndConsoleCodegen=t.testIdAttributeName,this._evaluator=new kl,this.consoleApi=new Jl(this),this.onGlobalListenersRemoved=new Set,this._autoClosingTags=new Set(["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","MENUITEM","META","PARAM","SOURCE","TRACK","WBR"]),this._booleanAttributes=new Set(["checked","selected","disabled","readonly","multiple"]),this._eventTypes=new Map([["auxclick","mouse"],["click","mouse"],["dblclick","mouse"],["mousedown","mouse"],["mouseeenter","mouse"],["mouseleave","mouse"],["mousemove","mouse"],["mouseout","mouse"],["mouseover","mouse"],["mouseup","mouse"],["mouseleave","mouse"],["mousewheel","mouse"],["keydown","keyboard"],["keyup","keyboard"],["keypress","keyboard"],["textInput","keyboard"],["touchstart","touch"],["touchmove","touch"],["touchend","touch"],["touchcancel","touch"],["pointerover","pointer"],["pointerout","pointer"],["pointerenter","pointer"],["pointerleave","pointer"],["pointerdown","pointer"],["pointerup","pointer"],["pointermove","pointer"],["pointercancel","pointer"],["gotpointercapture","pointer"],["lostpointercapture","pointer"],["focus","focus"],["blur","focus"],["drag","drag"],["dragstart","drag"],["dragend","drag"],["dragover","drag"],["dragenter","drag"],["dragleave","drag"],["dragexit","drag"],["drop","drag"],["wheel","wheel"],["deviceorientation","deviceorientation"],["deviceorientationabsolute","deviceorientation"],["devicemotion","devicemotion"]]),this._hoverHitTargetInterceptorEvents=new Set(["mousemove"]),this._tapHitTargetInterceptorEvents=new Set(["pointerdown","pointerup","touchstart","touchend","touchcancel"]),this._mouseHitTargetInterceptorEvents=new Set(["mousedown","mouseup","pointerdown","pointerup","click","auxclick","dblclick","contextmenu"]),this._allHitTargetInterceptorEvents=new Set([...this._hoverHitTargetInterceptorEvents,...this._tapHitTargetInterceptorEvents,...this._mouseHitTargetInterceptorEvents]),this._engines=new Map,this._engines.set("xpath",Gi),this._engines.set("xpath:light",Gi),this._engines.set("_react",Sl()),this._engines.set("_vue",Bl()),this._engines.set("role",Vi(!1)),this._engines.set("text",this._createTextEngine(!0,!1)),this._engines.set("text:light",this._createTextEngine(!1,!1)),this._engines.set("id",this._createAttributeEngine("id",!0)),this._engines.set("id:light",this._createAttributeEngine("id",!1)),this._engines.set("data-testid",this._createAttributeEngine("data-testid",!0)),this._engines.set("data-testid:light",this._createAttributeEngine("data-testid",!1)),this._engines.set("data-test-id",this._createAttributeEngine("data-test-id",!0)),this._engines.set("data-test-id:light",this._createAttributeEngine("data-test-id",!1)),this._engines.set("data-test",this._createAttributeEngine("data-test",!0)),this._engines.set("data-test:light",this._createAttributeEngine("data-test",!1)),this._engines.set("css",this._createCSSEngine()),this._engines.set("nth",{queryAll:()=>[]}),this._engines.set("visible",this._createVisibleEngine()),this._engines.set("internal:control",this._createControlEngine()),this._engines.set("internal:has",this._createHasEngine()),this._engines.set("internal:has-not",this._createHasNotEngine()),this._engines.set("internal:and",{queryAll:()=>[]}),this._engines.set("internal:or",{queryAll:()=>[]}),this._engines.set("internal:chain",this._createInternalChainEngine()),this._engines.set("internal:label",this._createInternalLabelEngine()),this._engines.set("internal:text",this._createTextEngine(!0,!0)),this._engines.set("internal:has-text",this._createInternalHasTextEngine()),this._engines.set("internal:has-not-text",this._createInternalHasNotTextEngine()),this._engines.set("internal:attr",this._createNamedAttributeEngine()),this._engines.set("internal:testid",this._createNamedAttributeEngine()),this._engines.set("internal:role",Vi(!0)),this._engines.set("internal:describe",this._createDescribeEngine()),this._engines.set("aria-ref",this._createAriaRefEngine());for(let{name:n,source:r}of t.customEngines)this._engines.set(n,this.eval(r));this._stableRafCount=t.stableRafCount,this._browserName=t.browserName,So({browserNameForWorkarounds:t.browserName,inputFileRoleTextbox:t.inputFileRoleTextbox}),this._setupGlobalListenersRemovalDetection(),this._setupHitTargetInterceptors(),this.isUnderTest&&(this.window.__injectedScript=this)}eval(e){return this.window.eval(e)}testIdAttributeNameForStrictErrorAndConsoleCodegen(){return this._testIdAttributeNameForStrictErrorAndConsoleCodegen}parseSelector(e){let t=vs(e);return Wc(t,n=>{if(!this._engines.has(n.name))throw this.createStacklessError(`Unknown engine "${n.name}" while parsing selector ${e}`)}),t}generateSelector(e,t){return qr(this,e,t)}generateSelectorSimple(e,t){return qr(this,e,{...t,testIdAttributeName:this._testIdAttributeNameForStrictErrorAndConsoleCodegen}).selector}querySelector(e,t,n){let r=this.querySelectorAll(e,t);if(n&&r.length>1)throw this.strictModeViolationError(e,r);return r[0]}_queryNth(e,t){let n=[...e],r=+t.body;return r===-1&&(r=n.length-1),new Set(n.slice(r,r+1))}_queryLayoutSelector(e,t,n){let r=t.name,o=t.body,u=[],l=this.querySelectorAll(o.parsed,n);for(let h of e){let p=na(r,h,l,o.distance);p!==void 0&&u.push({element:h,score:p})}return u.sort((h,p)=>h.score-p.score),new Set(u.map(h=>h.element))}ariaSnapshot(e,t){if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Can only capture aria snapshot of Element nodes.");return this._lastAriaSnapshot=ws(e,t),Br(this._lastAriaSnapshot,t)}getAllByAria(e,t){return cl(e.documentElement,t)}querySelectorAll(e,t){if(e.capture!==void 0){if(e.parts.some(r=>r.name==="nth"))throw this.createStacklessError("Can't query n-th element in a request with the capture.");let n={parts:e.parts.slice(0,e.capture+1)};if(e.capture<e.parts.length-1){let r={parts:e.parts.slice(e.capture+1)},o={name:"internal:has",body:{parsed:r},source:je(r)};n.parts.push(o)}return this.querySelectorAll(n,t)}if(!t.querySelectorAll)throw this.createStacklessError("Node is not queryable.");if(e.capture!==void 0)throw this.createStacklessError("Internal error: there should not be a capture in the selector.");if(t.nodeType===11&&e.parts.length===1&&e.parts[0].name==="css"&&e.parts[0].source===":scope")return[t];this._evaluator.begin();try{let n=new Set([t]);for(let r of e.parts)if(r.name==="nth")n=this._queryNth(n,r);else if(r.name==="internal:and"){let o=this.querySelectorAll(r.body.parsed,t);n=new Set(o.filter(u=>n.has(u)))}else if(r.name==="internal:or"){let o=this.querySelectorAll(r.body.parsed,t);n=new Set(aa(new Set([...n,...o])))}else if(yl.includes(r.name))n=this._queryLayoutSelector(n,r,t);else{let o=new Set;for(let u of n){let l=this._queryEngineAll(r,u);for(let h of l)o.add(h)}n=o}return[...n]}finally{this._evaluator.end()}}_queryEngineAll(e,t){let n=this._engines.get(e.name).queryAll(t,e.body);for(let r of n)if(!("nodeName"in r))throw this.createStacklessError(`Expected a Node but got ${Object.prototype.toString.call(r)}`);return n}_createAttributeEngine(e,t){let n=r=>[{simples:[{selector:{css:`[${e}=${JSON.stringify(r)}]`,functions:[]},combinator:""}]}];return{queryAll:(r,o)=>this._evaluator.query({scope:r,pierceShadow:t},n(o))}}_createCSSEngine(){return{queryAll:(e,t)=>this._evaluator.query({scope:e,pierceShadow:!0},t)}}_createTextEngine(e,t){return{queryAll:(r,o)=>{let{matcher:u,kind:l}=qn(o,t),h=[],p=null,b=m=>{if(l==="lax"&&p&&p.contains(m))return!1;let y=an(this._evaluator._cacheText,m,u);y==="none"&&(p=m),(y==="self"||y==="selfAndChildren"&&l==="strict"&&!t)&&h.push(m)};r.nodeType===Node.ELEMENT_NODE&&b(r);let v=this._evaluator._queryCSS({scope:r,pierceShadow:e},"*");for(let m of v)b(m);return h}}}_createInternalHasTextEngine(){return{queryAll:(e,t)=>{if(e.nodeType!==1)return[];let n=e,r=Se(this._evaluator._cacheText,n),{matcher:o}=qn(t,!0);return o(r)?[n]:[]}}}_createInternalHasNotTextEngine(){return{queryAll:(e,t)=>{if(e.nodeType!==1)return[];let n=e,r=Se(this._evaluator._cacheText,n),{matcher:o}=qn(t,!0);return o(r)?[]:[n]}}}_createInternalLabelEngine(){return{queryAll:(e,t)=>{let{matcher:n}=qn(t,!0);return this._evaluator._queryCSS({scope:e,pierceShadow:!0},"*").filter(o=>bs(this._evaluator._cacheText,o).some(u=>n(u)))}}}_createNamedAttributeEngine(){return{queryAll:(t,n)=>{let r=tt(n,!0);if(r.name||r.attributes.length!==1)throw new Error("Malformed attribute selector: "+n);let{name:o,value:u,caseSensitive:l}=r.attributes[0],h=l?null:u.toLowerCase(),p;return u instanceof RegExp?p=v=>!!v.match(u):l?p=v=>v===u:p=v=>v.toLowerCase().includes(h),this._evaluator._queryCSS({scope:t,pierceShadow:!0},`[${o}]`).filter(v=>p(v.getAttribute(o)))}}}_createDescribeEngine(){return{queryAll:t=>t.nodeType!==1?[]:[t]}}_createControlEngine(){return{queryAll(e,t){if(t==="enter-frame")return[];if(t==="return-empty")return[];if(t==="component")return e.nodeType!==1?[]:[e.childElementCount===1?e.firstElementChild:e];throw new Error(`Internal error, unknown internal:control selector ${t}`)}}}_createHasEngine(){return{queryAll:(t,n)=>t.nodeType!==1?[]:!!this.querySelector(n.parsed,t,!1)?[t]:[]}}_createHasNotEngine(){return{queryAll:(t,n)=>t.nodeType!==1?[]:!!this.querySelector(n.parsed,t,!1)?[]:[t]}}_createVisibleEngine(){return{queryAll:(t,n)=>{if(t.nodeType!==1)return[];let r=n==="true";return Ge(t)===r?[t]:[]}}}_createInternalChainEngine(){return{queryAll:(t,n)=>this.querySelectorAll(n.parsed,t)}}extend(e,t){let n=this.window.eval(`
11
11
  (() => {
12
12
  const module = {};
13
13
  ${e}
14
14
  return module.exports.default();
15
- })()`);return new n(this,t)}async viewportRatio(e){return await new Promise(t=>{let n=new IntersectionObserver(r=>{t(r[0].intersectionRatio),n.disconnect()});n.observe(e),this.utils.builtins.requestAnimationFrame(()=>{})})}getElementBorderWidth(e){if(e.nodeType!==Node.ELEMENT_NODE||!e.ownerDocument||!e.ownerDocument.defaultView)return{left:0,top:0};let t=e.ownerDocument.defaultView.getComputedStyle(e);return{left:parseInt(t.borderLeftWidth||"",10),top:parseInt(t.borderTopWidth||"",10)}}describeIFrameStyle(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return"error:notconnected";let t=e.ownerDocument.defaultView;for(let r=e;r;r=me(r))if(t.getComputedStyle(r).transform!=="none")return"transformed";let n=t.getComputedStyle(e);return{left:parseInt(n.borderLeftWidth||"",10)+parseInt(n.paddingLeft||"",10),top:parseInt(n.borderTopWidth||"",10)+parseInt(n.paddingTop||"",10)}}retarget(e,t){let n=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;if(!n)return null;if(t==="none")return n;if(!n.matches("input, textarea, select")&&!n.isContentEditable&&(t==="button-link"?n=n.closest("button, [role=button], a, [role=link]")||n:n=n.closest("button, [role=button], [role=checkbox], [role=radio]")||n),t==="follow-label"&&!n.matches("a, input, textarea, button, select, [role=link], [role=button], [role=checkbox], [role=radio]")&&!n.isContentEditable){let r=n.closest("label");r&&r.control&&(n=r.control)}return n}async checkElementStates(e,t){if(t.includes("stable")){let n=await this._checkElementIsStable(e);if(n===!1)return{missingState:"stable"};if(n==="error:notconnected")return"error:notconnected"}for(let n of t)if(n!=="stable"){let r=this.elementState(e,n);if(r.received==="error:notconnected")return"error:notconnected";if(!r.matches)return{missingState:n}}}async _checkElementIsStable(e){let t=Symbol("continuePolling"),n,r=0,o=0,u=()=>{let v=this.retarget(e,"no-follow-label");if(!v)return"error:notconnected";let y=this.utils.builtins.performance.now();if(this._stableRafCount>1&&y-o<15)return t;o=y;let m=v.getBoundingClientRect(),w={x:m.top,y:m.left,width:m.width,height:m.height};if(n){if(!(w.x===n.x&&w.y===n.y&&w.width===n.width&&w.height===n.height))return!1;if(++r>=this._stableRafCount)return!0}return n=w,t},l,h,p=new Promise((v,y)=>{l=v,h=y}),b=()=>{try{let v=u();v!==t?l(v):this.utils.builtins.requestAnimationFrame(b)}catch(v){h(v)}};return this.utils.builtins.requestAnimationFrame(b),p}_createAriaRefEngine(){return{queryAll:(t,n)=>{var r,o;let u=(o=(r=this._lastAriaSnapshot)==null?void 0:r.elements)==null?void 0:o.get(n);return u&&u.isConnected?[u]:[]}}}elementState(e,t){let n=this.retarget(e,["visible","hidden"].includes(t)?"none":"follow-label");if(!n||!n.isConnected)return t==="hidden"?{matches:!0,received:"hidden"}:{matches:!1,received:"error:notconnected"};if(t==="visible"||t==="hidden"){let r=Ge(n);return{matches:t==="visible"?r:!r,received:r?"visible":"hidden"}}if(t==="disabled"||t==="enabled"){let r=tn(n);return{matches:t==="disabled"?r:!r,received:r?"disabled":"enabled"}}if(t==="editable"){let r=tn(n),o=Oo(n);if(o==="error")throw this.createStacklessError("Element is not an <input>, <textarea>, <select> or [contenteditable] and does not have a role allowing [aria-readonly]");return{matches:!r&&!o,received:r?"disabled":o?"readOnly":"editable"}}if(t==="checked"||t==="unchecked"){let r=t==="checked",o=Lo(n);if(o==="error")throw this.createStacklessError("Not a checkbox or radio button");return{matches:r===o,received:o?"checked":"unchecked"}}if(t==="indeterminate"){let r=Io(n);if(r==="error")throw this.createStacklessError("Not a checkbox or radio button");return{matches:r==="mixed",received:r===!0?"checked":r===!1?"unchecked":"mixed"}}throw this.createStacklessError(`Unexpected element state "${t}"`)}selectOptions(e,t){let n=this.retarget(e,"follow-label");if(!n)return"error:notconnected";if(n.nodeName.toLowerCase()!=="select")throw this.createStacklessError("Element is not a <select> element");let r=n,o=[...r.options],u=[],l=t.slice();for(let h=0;h<o.length;h++){let p=o[h],b=v=>{if(v instanceof Node)return p===v;let y=!0;return v.valueOrLabel!==void 0&&(y=y&&(v.valueOrLabel===p.value||v.valueOrLabel===p.label)),v.value!==void 0&&(y=y&&v.value===p.value),v.label!==void 0&&(y=y&&v.label===p.label),v.index!==void 0&&(y=y&&v.index===h),y};if(l.some(b))if(u.push(p),r.multiple)l=l.filter(v=>!b(v));else{l=[];break}}return l.length?"error:optionsnotfound":(r.value=void 0,u.forEach(h=>h.selected=!0),r.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),r.dispatchEvent(new Event("change",{bubbles:!0})),u.map(h=>h.value))}fill(e,t){let n=this.retarget(e,"follow-label");if(!n)return"error:notconnected";if(n.nodeName.toLowerCase()==="input"){let r=n,o=r.type.toLowerCase(),u=new Set(["color","date","time","datetime-local","month","range","week"]);if(!new Set(["","email","number","password","search","tel","text","url"]).has(o)&&!u.has(o))throw this.createStacklessError(`Input of type "${o}" cannot be filled`);if(o==="number"&&(t=t.trim(),isNaN(Number(t))))throw this.createStacklessError("Cannot type text into input[type=number]");if(u.has(o)){if(t=t.trim(),r.focus(),r.value=t,r.value!==t)throw this.createStacklessError("Malformed value");return n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),n.dispatchEvent(new Event("change",{bubbles:!0})),"done"}}else if(n.nodeName.toLowerCase()!=="textarea"){if(!n.isContentEditable)throw this.createStacklessError("Element is not an <input>, <textarea> or [contenteditable] element")}return this.selectText(n),"needsinput"}selectText(e){let t=this.retarget(e,"follow-label");if(!t)return"error:notconnected";if(t.nodeName.toLowerCase()==="input"){let o=t;return o.select(),o.focus(),"done"}if(t.nodeName.toLowerCase()==="textarea"){let o=t;return o.selectionStart=0,o.selectionEnd=o.value.length,o.focus(),"done"}let n=t.ownerDocument.createRange();n.selectNodeContents(t);let r=t.ownerDocument.defaultView.getSelection();return r&&(r.removeAllRanges(),r.addRange(n)),t.focus(),"done"}_activelyFocused(e){let t=e.getRootNode().activeElement,n=t===e&&!!e.ownerDocument&&e.ownerDocument.hasFocus();return{activeElement:t,isFocused:n}}focusNode(e,t){if(!e.isConnected)return"error:notconnected";if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");let{activeElement:n,isFocused:r}=this._activelyFocused(e);if(e.isContentEditable&&!r&&n&&n.blur&&n.blur(),e.focus(),e.focus(),t&&!r&&e.nodeName.toLowerCase()==="input")try{e.setSelectionRange(0,0)}catch{}return"done"}blurNode(e){if(!e.isConnected)return"error:notconnected";if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");return e.blur(),"done"}setInputFiles(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"Node is not of type HTMLElement";let n=e;if(n.nodeName!=="INPUT")return"Not an <input> element";let r=n;if((r.getAttribute("type")||"").toLowerCase()!=="file")return"Not an input[type=file] element";let u=t.map(h=>{let p=Uint8Array.from(atob(h.buffer),b=>b.charCodeAt(0));return new File([p],h.name,{type:h.mimeType,lastModified:h.lastModifiedMs})}),l=new DataTransfer;for(let h of u)l.items.add(h);r.files=l.files,r.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),r.dispatchEvent(new Event("change",{bubbles:!0}))}expectHitTarget(e,t){let n=[],r=t;for(;r;){let y=Yr(r);if(!y||(n.push(y),y.nodeType===9))break;r=y.host}let o;for(let y=n.length-1;y>=0;y--){let m=n[y],w=m.elementsFromPoint(e.x,e.y),A=m.elementFromPoint(e.x,e.y);if(A&&w[0]&&me(A)===w[0]){let P=this.window.getComputedStyle(A);P?.display==="contents"&&w.unshift(A)}w[0]&&w[0].shadowRoot===m&&w[1]===A&&w.shift();let I=w[0];if(!I||(o=I,y&&I!==n[y-1].host))break}let u=[],l=[];for(;o&&o!==t;)u.push(o),l.push(["sticky","fixed"].includes(this.window.getComputedStyle(o).position)),o=me(o);if(o===t)return"done";let h=this.previewNode(u[0]||this.document.documentElement),p=l.some(y=>y),b,v=t;for(;v;){let y=u.indexOf(v);if(y!==-1){y>1&&(b=this.previewNode(u[y-1])),p=l.slice(0,y).some(m=>m);break}v=me(v)}return b?{hitTargetDescription:`${h} from ${b} subtree`,hasPositionStickyOrFixed:p}:{hitTargetDescription:h,hasPositionStickyOrFixed:p}}setupHitTargetInterceptor(e,t,n,r){let o=this.retarget(e,"button-link");if(!o||!o.isConnected)return"error:notconnected";if(n){let b=this.expectHitTarget(n,o);if(b!=="done")return JSON.stringify(b)}if(t==="drag")return{stop:()=>"done"};let u={hover:this._hoverHitTargetInterceptorEvents,tap:this._tapHitTargetInterceptorEvents,mouse:this._mouseHitTargetInterceptorEvents}[t],l,h=b=>{if(!u.has(b.type)||!b.isTrusted)return;let v=this.window.TouchEvent&&b instanceof this.window.TouchEvent?b.touches[0]:b;l===void 0&&v&&(l=this.expectHitTarget({x:v.clientX,y:v.clientY},o)),(r||l!=="done"&&l!==void 0)&&(b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation())},p=()=>(this._hitTargetInterceptor===h&&(this._hitTargetInterceptor=void 0),l||"done");return this._hitTargetInterceptor=h,{stop:p}}dispatchEvent(e,t,n){var r,o,u;let l,h={bubbles:!0,cancelable:!0,composed:!0,...n};switch(this._eventTypes.get(t)){case"mouse":l=new MouseEvent(t,h);break;case"keyboard":l=new KeyboardEvent(t,h);break;case"touch":{if(this._browserName==="webkit"){let p=v=>{var y,m;if(v instanceof Touch)return v;let w=v.pageX;w===void 0&&v.clientX!==void 0&&(w=v.clientX+(((y=this.document.scrollingElement)==null?void 0:y.scrollLeft)||0));let A=v.pageY;return A===void 0&&v.clientY!==void 0&&(A=v.clientY+(((m=this.document.scrollingElement)==null?void 0:m.scrollTop)||0)),this.document.createTouch(this.window,v.target??e,v.identifier,w,A,v.screenX,v.screenY,v.radiusX,v.radiusY,v.rotationAngle,v.force)},b=v=>v instanceof TouchList||!v?v:this.document.createTouchList(...v.map(p));h.target??=e,h.touches=b(h.touches),h.targetTouches=b(h.targetTouches),h.changedTouches=b(h.changedTouches),l=new TouchEvent(t,h)}else h.target??=e,h.touches=(r=h.touches)==null?void 0:r.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),h.targetTouches=(o=h.targetTouches)==null?void 0:o.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),h.changedTouches=(u=h.changedTouches)==null?void 0:u.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),l=new TouchEvent(t,h);break}case"pointer":l=new PointerEvent(t,h);break;case"focus":l=new FocusEvent(t,h);break;case"drag":l=new DragEvent(t,h);break;case"wheel":l=new WheelEvent(t,h);break;case"deviceorientation":try{l=new DeviceOrientationEvent(t,h)}catch{let{bubbles:p,cancelable:b,alpha:v,beta:y,gamma:m,absolute:w}=h;l=this.document.createEvent("DeviceOrientationEvent"),l.initDeviceOrientationEvent(t,p,b,v,y,m,w)}break;case"devicemotion":try{l=new DeviceMotionEvent(t,h)}catch{let{bubbles:p,cancelable:b,acceleration:v,accelerationIncludingGravity:y,rotationRate:m,interval:w}=h;l=this.document.createEvent("DeviceMotionEvent"),l.initDeviceMotionEvent(t,p,b,v,y,m,w)}break;default:l=new Event(t,h);break}e.dispatchEvent(l)}previewNode(e){if(e.nodeType===Node.TEXT_NODE)return Rn(`#text=${e.nodeValue||""}`);if(e.nodeType!==Node.ELEMENT_NODE)return Rn(`<${e.nodeName.toLowerCase()} />`);let t=e,n=[];for(let h=0;h<t.attributes.length;h++){let{name:p,value:b}=t.attributes[h];p!=="style"&&(!b&&this._booleanAttributes.has(p)?n.push(` ${p}`):n.push(` ${p}="${b}"`))}n.sort((h,p)=>h.length-p.length);let r=Mr(n.join(""),500);if(this._autoClosingTags.has(t.nodeName))return Rn(`<${t.nodeName.toLowerCase()}${r}/>`);let o=t.childNodes,u=!1;if(o.length<=5){u=!0;for(let h=0;h<o.length;h++)u=u&&o[h].nodeType===Node.TEXT_NODE}let l=u?t.textContent||"":o.length?"\u2026":"";return Rn(`<${t.nodeName.toLowerCase()}${r}>${Mr(l,50)}</${t.nodeName.toLowerCase()}>`)}strictModeViolationError(e,t){let n=t.slice(0,10).map(o=>({preview:this.previewNode(o),selector:this.generateSelectorSimple(o)})),r=n.map((o,u)=>`
15
+ })()`);return new n(this,t)}async viewportRatio(e){return await new Promise(t=>{let n=new IntersectionObserver(r=>{t(r[0].intersectionRatio),n.disconnect()});n.observe(e),this.utils.builtins.requestAnimationFrame(()=>{})})}getElementBorderWidth(e){if(e.nodeType!==Node.ELEMENT_NODE||!e.ownerDocument||!e.ownerDocument.defaultView)return{left:0,top:0};let t=e.ownerDocument.defaultView.getComputedStyle(e);return{left:parseInt(t.borderLeftWidth||"",10),top:parseInt(t.borderTopWidth||"",10)}}describeIFrameStyle(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return"error:notconnected";let t=e.ownerDocument.defaultView;for(let r=e;r;r=me(r))if(t.getComputedStyle(r).transform!=="none")return"transformed";let n=t.getComputedStyle(e);return{left:parseInt(n.borderLeftWidth||"",10)+parseInt(n.paddingLeft||"",10),top:parseInt(n.borderTopWidth||"",10)+parseInt(n.paddingTop||"",10)}}retarget(e,t){let n=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;if(!n)return null;if(t==="none")return n;if(!n.matches("input, textarea, select")&&!n.isContentEditable&&(t==="button-link"?n=n.closest("button, [role=button], a, [role=link]")||n:n=n.closest("button, [role=button], [role=checkbox], [role=radio]")||n),t==="follow-label"&&!n.matches("a, input, textarea, button, select, [role=link], [role=button], [role=checkbox], [role=radio]")&&!n.isContentEditable){let r=n.closest("label");r&&r.control&&(n=r.control)}return n}async checkElementStates(e,t){if(t.includes("stable")){let n=await this._checkElementIsStable(e);if(n===!1)return{missingState:"stable"};if(n==="error:notconnected")return"error:notconnected"}for(let n of t)if(n!=="stable"){let r=this.elementState(e,n);if(r.received==="error:notconnected")return"error:notconnected";if(!r.matches)return{missingState:n}}}async _checkElementIsStable(e){let t=Symbol("continuePolling"),n,r=0,o=0,u=()=>{let v=this.retarget(e,"no-follow-label");if(!v)return"error:notconnected";let m=this.utils.builtins.performance.now();if(this._stableRafCount>1&&m-o<15)return t;o=m;let y=v.getBoundingClientRect(),w={x:y.top,y:y.left,width:y.width,height:y.height};if(n){if(!(w.x===n.x&&w.y===n.y&&w.width===n.width&&w.height===n.height))return!1;if(++r>=this._stableRafCount)return!0}return n=w,t},l,h,p=new Promise((v,m)=>{l=v,h=m}),b=()=>{try{let v=u();v!==t?l(v):this.utils.builtins.requestAnimationFrame(b)}catch(v){h(v)}};return this.utils.builtins.requestAnimationFrame(b),p}_createAriaRefEngine(){return{queryAll:(t,n)=>{var r,o;let u=(o=(r=this._lastAriaSnapshot)==null?void 0:r.elements)==null?void 0:o.get(n);return u&&u.isConnected?[u]:[]}}}elementState(e,t){let n=this.retarget(e,["visible","hidden"].includes(t)?"none":"follow-label");if(!n||!n.isConnected)return t==="hidden"?{matches:!0,received:"hidden"}:{matches:!1,received:"error:notconnected"};if(t==="visible"||t==="hidden"){let r=Ge(n);return{matches:t==="visible"?r:!r,received:r?"visible":"hidden"}}if(t==="disabled"||t==="enabled"){let r=tn(n);return{matches:t==="disabled"?r:!r,received:r?"disabled":"enabled"}}if(t==="editable"){let r=tn(n),o=Oo(n);if(o==="error")throw this.createStacklessError("Element is not an <input>, <textarea>, <select> or [contenteditable] and does not have a role allowing [aria-readonly]");return{matches:!r&&!o,received:r?"disabled":o?"readOnly":"editable"}}if(t==="checked"||t==="unchecked"){let r=t==="checked",o=Lo(n);if(o==="error")throw this.createStacklessError("Not a checkbox or radio button");return{matches:r===o,received:o?"checked":"unchecked"}}if(t==="indeterminate"){let r=Io(n);if(r==="error")throw this.createStacklessError("Not a checkbox or radio button");return{matches:r==="mixed",received:r===!0?"checked":r===!1?"unchecked":"mixed"}}throw this.createStacklessError(`Unexpected element state "${t}"`)}selectOptions(e,t){let n=this.retarget(e,"follow-label");if(!n)return"error:notconnected";if(n.nodeName.toLowerCase()!=="select")throw this.createStacklessError("Element is not a <select> element");let r=n,o=[...r.options],u=[],l=t.slice();for(let h=0;h<o.length;h++){let p=o[h],b=v=>{if(v instanceof Node)return p===v;let m=!0;return v.valueOrLabel!==void 0&&(m=m&&(v.valueOrLabel===p.value||v.valueOrLabel===p.label)),v.value!==void 0&&(m=m&&v.value===p.value),v.label!==void 0&&(m=m&&v.label===p.label),v.index!==void 0&&(m=m&&v.index===h),m};if(l.some(b))if(u.push(p),r.multiple)l=l.filter(v=>!b(v));else{l=[];break}}return l.length?"error:optionsnotfound":(r.value=void 0,u.forEach(h=>h.selected=!0),r.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),r.dispatchEvent(new Event("change",{bubbles:!0})),u.map(h=>h.value))}fill(e,t){let n=this.retarget(e,"follow-label");if(!n)return"error:notconnected";if(n.nodeName.toLowerCase()==="input"){let r=n,o=r.type.toLowerCase(),u=new Set(["color","date","time","datetime-local","month","range","week"]);if(!new Set(["","email","number","password","search","tel","text","url"]).has(o)&&!u.has(o))throw this.createStacklessError(`Input of type "${o}" cannot be filled`);if(o==="number"&&(t=t.trim(),isNaN(Number(t))))throw this.createStacklessError("Cannot type text into input[type=number]");if(u.has(o)){if(t=t.trim(),r.focus(),r.value=t,r.value!==t)throw this.createStacklessError("Malformed value");return n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),n.dispatchEvent(new Event("change",{bubbles:!0})),"done"}}else if(n.nodeName.toLowerCase()!=="textarea"){if(!n.isContentEditable)throw this.createStacklessError("Element is not an <input>, <textarea> or [contenteditable] element")}return this.selectText(n),"needsinput"}selectText(e){let t=this.retarget(e,"follow-label");if(!t)return"error:notconnected";if(t.nodeName.toLowerCase()==="input"){let o=t;return o.select(),o.focus(),"done"}if(t.nodeName.toLowerCase()==="textarea"){let o=t;return o.selectionStart=0,o.selectionEnd=o.value.length,o.focus(),"done"}let n=t.ownerDocument.createRange();n.selectNodeContents(t);let r=t.ownerDocument.defaultView.getSelection();return r&&(r.removeAllRanges(),r.addRange(n)),t.focus(),"done"}_activelyFocused(e){let t=e.getRootNode().activeElement,n=t===e&&!!e.ownerDocument&&e.ownerDocument.hasFocus();return{activeElement:t,isFocused:n}}focusNode(e,t){if(!e.isConnected)return"error:notconnected";if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");let{activeElement:n,isFocused:r}=this._activelyFocused(e);if(e.isContentEditable&&!r&&n&&n.blur&&n.blur(),e.focus(),e.focus(),t&&!r&&e.nodeName.toLowerCase()==="input")try{e.setSelectionRange(0,0)}catch{}return"done"}blurNode(e){if(!e.isConnected)return"error:notconnected";if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");return e.blur(),"done"}setInputFiles(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"Node is not of type HTMLElement";let n=e;if(n.nodeName!=="INPUT")return"Not an <input> element";let r=n;if((r.getAttribute("type")||"").toLowerCase()!=="file")return"Not an input[type=file] element";let u=t.map(h=>{let p=Uint8Array.from(atob(h.buffer),b=>b.charCodeAt(0));return new File([p],h.name,{type:h.mimeType,lastModified:h.lastModifiedMs})}),l=new DataTransfer;for(let h of u)l.items.add(h);r.files=l.files,r.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),r.dispatchEvent(new Event("change",{bubbles:!0}))}expectHitTarget(e,t){let n=[],r=t;for(;r;){let m=Yr(r);if(!m||(n.push(m),m.nodeType===9))break;r=m.host}let o;for(let m=n.length-1;m>=0;m--){let y=n[m],w=y.elementsFromPoint(e.x,e.y),A=y.elementFromPoint(e.x,e.y);if(A&&w[0]&&me(A)===w[0]){let P=this.window.getComputedStyle(A);P?.display==="contents"&&w.unshift(A)}w[0]&&w[0].shadowRoot===y&&w[1]===A&&w.shift();let I=w[0];if(!I||(o=I,m&&I!==n[m-1].host))break}let u=[],l=[];for(;o&&o!==t;)u.push(o),l.push(["sticky","fixed"].includes(this.window.getComputedStyle(o).position)),o=me(o);if(o===t)return"done";let h=this.previewNode(u[0]||this.document.documentElement),p=l.some(m=>m),b,v=t;for(;v;){let m=u.indexOf(v);if(m!==-1){m>1&&(b=this.previewNode(u[m-1])),p=l.slice(0,m).some(y=>y);break}v=me(v)}return b?{hitTargetDescription:`${h} from ${b} subtree`,hasPositionStickyOrFixed:p}:{hitTargetDescription:h,hasPositionStickyOrFixed:p}}setupHitTargetInterceptor(e,t,n,r){let o=this.retarget(e,"button-link");if(!o||!o.isConnected)return"error:notconnected";if(n){let b=this.expectHitTarget(n,o);if(b!=="done")return JSON.stringify(b)}if(t==="drag")return{stop:()=>"done"};let u={hover:this._hoverHitTargetInterceptorEvents,tap:this._tapHitTargetInterceptorEvents,mouse:this._mouseHitTargetInterceptorEvents}[t],l,h=b=>{if(!u.has(b.type)||!b.isTrusted)return;let v=this.window.TouchEvent&&b instanceof this.window.TouchEvent?b.touches[0]:b;l===void 0&&v&&(l=this.expectHitTarget({x:v.clientX,y:v.clientY},o)),(r||l!=="done"&&l!==void 0)&&(b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation())},p=()=>(this._hitTargetInterceptor===h&&(this._hitTargetInterceptor=void 0),l||"done");return this._hitTargetInterceptor=h,{stop:p}}dispatchEvent(e,t,n){var r,o,u;let l,h={bubbles:!0,cancelable:!0,composed:!0,...n};switch(this._eventTypes.get(t)){case"mouse":l=new MouseEvent(t,h);break;case"keyboard":l=new KeyboardEvent(t,h);break;case"touch":{if(this._browserName==="webkit"){let p=v=>{var m,y;if(v instanceof Touch)return v;let w=v.pageX;w===void 0&&v.clientX!==void 0&&(w=v.clientX+(((m=this.document.scrollingElement)==null?void 0:m.scrollLeft)||0));let A=v.pageY;return A===void 0&&v.clientY!==void 0&&(A=v.clientY+(((y=this.document.scrollingElement)==null?void 0:y.scrollTop)||0)),this.document.createTouch(this.window,v.target??e,v.identifier,w,A,v.screenX,v.screenY,v.radiusX,v.radiusY,v.rotationAngle,v.force)},b=v=>v instanceof TouchList||!v?v:this.document.createTouchList(...v.map(p));h.target??=e,h.touches=b(h.touches),h.targetTouches=b(h.targetTouches),h.changedTouches=b(h.changedTouches),l=new TouchEvent(t,h)}else h.target??=e,h.touches=(r=h.touches)==null?void 0:r.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),h.targetTouches=(o=h.targetTouches)==null?void 0:o.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),h.changedTouches=(u=h.changedTouches)==null?void 0:u.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),l=new TouchEvent(t,h);break}case"pointer":l=new PointerEvent(t,h);break;case"focus":l=new FocusEvent(t,h);break;case"drag":l=new DragEvent(t,h);break;case"wheel":l=new WheelEvent(t,h);break;case"deviceorientation":try{l=new DeviceOrientationEvent(t,h)}catch{let{bubbles:p,cancelable:b,alpha:v,beta:m,gamma:y,absolute:w}=h;l=this.document.createEvent("DeviceOrientationEvent"),l.initDeviceOrientationEvent(t,p,b,v,m,y,w)}break;case"devicemotion":try{l=new DeviceMotionEvent(t,h)}catch{let{bubbles:p,cancelable:b,acceleration:v,accelerationIncludingGravity:m,rotationRate:y,interval:w}=h;l=this.document.createEvent("DeviceMotionEvent"),l.initDeviceMotionEvent(t,p,b,v,m,y,w)}break;default:l=new Event(t,h);break}e.dispatchEvent(l)}previewNode(e){if(e.nodeType===Node.TEXT_NODE)return Rn(`#text=${e.nodeValue||""}`);if(e.nodeType!==Node.ELEMENT_NODE)return Rn(`<${e.nodeName.toLowerCase()} />`);let t=e,n=[];for(let h=0;h<t.attributes.length;h++){let{name:p,value:b}=t.attributes[h];p!=="style"&&(!b&&this._booleanAttributes.has(p)?n.push(` ${p}`):n.push(` ${p}="${b}"`))}n.sort((h,p)=>h.length-p.length);let r=Mr(n.join(""),500);if(this._autoClosingTags.has(t.nodeName))return Rn(`<${t.nodeName.toLowerCase()}${r}/>`);let o=t.childNodes,u=!1;if(o.length<=5){u=!0;for(let h=0;h<o.length;h++)u=u&&o[h].nodeType===Node.TEXT_NODE}let l=u?t.textContent||"":o.length?"\u2026":"";return Rn(`<${t.nodeName.toLowerCase()}${r}>${Mr(l,50)}</${t.nodeName.toLowerCase()}>`)}strictModeViolationError(e,t){let n=t.slice(0,10).map(o=>({preview:this.previewNode(o),selector:this.generateSelectorSimple(o)})),r=n.map((o,u)=>`
16
16
  ${u+1}) ${o.preview} aka ${Qt(this._sdkLanguage,o.selector)}`);return n.length<t.length&&r.push(`
17
17
  ...`),this.createStacklessError(`strict mode violation: ${Qt(this._sdkLanguage,je(e))} resolved to ${t.length} elements:${r.join("")}
18
- `)}createStacklessError(e){if(this._browserName==="firefox"){let n=new Error("Error: "+e);return n.stack="",n}let t=new Error(e);return delete t.stack,t}createHighlight(){return new Or(this)}maskSelectors(e,t){this._highlight&&this.hideHighlight(),this._highlight=new Or(this),this._highlight.install();let n=[];for(let r of e)n.push(this.querySelectorAll(r,this.document.documentElement));this._highlight.maskElements(n.flat(),t)}highlight(e){this._highlight||(this._highlight=new Or(this),this._highlight.install()),this._highlight.runHighlightOnRaf(e)}hideHighlight(){this._highlight&&(this._highlight.uninstall(),delete this._highlight)}markTargetElements(e,t){var n,r;((n=this._markedElements)==null?void 0:n.callId)!==t&&(this._markedElements=void 0);let o=((r=this._markedElements)==null?void 0:r.elements)||new Set,u=new CustomEvent("__playwright_unmark_target__",{bubbles:!0,cancelable:!0,detail:t,composed:!0});for(let h of o)e.has(h)||h.dispatchEvent(u);let l=new CustomEvent("__playwright_mark_target__",{bubbles:!0,cancelable:!0,detail:t,composed:!0});for(let h of e)o.has(h)||h.dispatchEvent(l);this._markedElements={callId:t,elements:e}}_setupGlobalListenersRemovalDetection(){let e="__playwright_global_listeners_check__",t=!1,n=()=>t=!0;this.window.addEventListener(e,n),new MutationObserver(r=>{if(r.some(u=>Array.from(u.addedNodes).includes(this.document.documentElement))&&(t=!1,this.window.dispatchEvent(new CustomEvent(e)),!t)){this.window.addEventListener(e,n);for(let u of this.onGlobalListenersRemoved)u()}}).observe(this.document,{childList:!0})}_setupHitTargetInterceptors(){let e=n=>{var r;return(r=this._hitTargetInterceptor)==null?void 0:r.call(this,n)},t=()=>{for(let n of this._allHitTargetInterceptorEvents)this.window.addEventListener(n,e,{capture:!0,passive:!1})};t(),this.onGlobalListenersRemoved.add(t)}async expect(e,t,n){return t.expression==="to.have.count"||t.expression.endsWith(".array")?this.expectArray(n,t):e?await this.expectSingleElement(e,t):!t.isNot&&t.expression==="to.be.hidden"?{matches:!0}:t.isNot&&t.expression==="to.be.visible"?{matches:!1}:!t.isNot&&t.expression==="to.be.detached"?{matches:!0}:t.isNot&&t.expression==="to.be.attached"?{matches:!1}:t.isNot&&t.expression==="to.be.in.viewport"?{matches:!1}:{matches:t.isNot,missingReceived:!0}}async expectSingleElement(e,t){var n;let r=t.expression;{let o;if(r==="to.have.attribute"){let u=e.hasAttribute(t.expressionArg);o={matches:u,received:u?"attribute present":"attribute not present"}}else if(r==="to.be.checked"){let{checked:u,indeterminate:l}=t.expectedValue;if(l){if(u!==void 0)throw this.createStacklessError("Can't assert indeterminate and checked at the same time");o=this.elementState(e,"indeterminate")}else o=this.elementState(e,u===!1?"unchecked":"checked")}else if(r==="to.be.disabled")o=this.elementState(e,"disabled");else if(r==="to.be.editable")o=this.elementState(e,"editable");else if(r==="to.be.readonly")o=this.elementState(e,"editable"),o.matches=!o.matches;else if(r==="to.be.empty")if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){let u=e.value;o={matches:!u,received:u?"notEmpty":"empty"}}else{let u=(n=e.textContent)==null?void 0:n.trim();o={matches:!u,received:u?"notEmpty":"empty"}}else if(r==="to.be.enabled")o=this.elementState(e,"enabled");else if(r==="to.be.focused"){let u=this._activelyFocused(e).isFocused;o={matches:u,received:u?"focused":"inactive"}}else r==="to.be.hidden"?o=this.elementState(e,"hidden"):r==="to.be.visible"?o=this.elementState(e,"visible"):r==="to.be.attached"?o={matches:!0,received:"attached"}:r==="to.be.detached"&&(o={matches:!1,received:"attached"});if(o){if(o.received==="error:notconnected")throw this.createStacklessError("Element is not connected");return o}}if(r==="to.have.property"){let o=e,u=t.expressionArg.split(".");for(let p=0;p<u.length-1;p++){if(typeof o!="object"||!(u[p]in o))return{received:void 0,matches:!1};o=o[u[p]]}let l=o[u[u.length-1]],h=Hr(l,t.expectedValue);return{received:l,matches:h}}if(r==="to.be.in.viewport"){let o=await this.viewportRatio(e);return{received:`viewport ratio ${o}`,matches:o>0&&o>(t.expectedNumber??0)-1e-9}}if(r==="to.have.values"){if(e=this.retarget(e,"follow-label"),e.nodeName!=="SELECT"||!e.multiple)throw this.createStacklessError("Not a select element with a multiple attribute");let o=[...e.selectedOptions].map(u=>u.value);return o.length!==t.expectedText.length?{received:o,matches:!1}:{received:o,matches:o.map((u,l)=>new Dn(t.expectedText[l]).matches(u)).every(Boolean)}}if(r==="to.match.aria"){let o=al(e,t.expectedValue);return{received:o.received,matches:!!o.matches.length}}{let o;if(r==="to.have.attribute.value"){let u=e.getAttribute(t.expressionArg);if(u===null)return{received:null,matches:!1};o=u}else if(["to.have.class","to.contain.class"].includes(r)){if(!t.expectedText)throw this.createStacklessError("Expected text is not provided for "+r);return{received:e.classList.toString(),matches:new Dn(t.expectedText[0]).matchesClassList(this,e.classList,r==="to.contain.class")}}else if(r==="to.have.css")o=this.window.getComputedStyle(e).getPropertyValue(t.expressionArg);else if(r==="to.have.id")o=e.id;else if(r==="to.have.text")o=t.useInnerText?e.innerText:Se(new Map,e).full;else if(r==="to.have.accessible.name")o=At(e,!1);else if(r==="to.have.accessible.description")o=Rr(e,!1);else if(r==="to.have.accessible.error.message")o=Co(e);else if(r==="to.have.role")o=he(e)||"";else if(r==="to.have.title")o=this.document.title;else if(r==="to.have.url")o=this.document.location.href;else if(r==="to.have.value"){if(e=this.retarget(e,"follow-label"),e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA"&&e.nodeName!=="SELECT")throw this.createStacklessError("Not an input element");o=e.value}if(o!==void 0&&t.expectedText){let u=new Dn(t.expectedText[0]);return{received:o,matches:u.matches(o)}}}throw this.createStacklessError("Unknown expect matcher: "+r)}expectArray(e,t){let n=t.expression;if(n==="to.have.count"){let h=e.length,p=h===t.expectedNumber;return{received:h,matches:p}}if(!t.expectedText)throw this.createStacklessError("Expected text is not provided for "+n);if(["to.have.class.array","to.contain.class.array"].includes(n)){let h=e.map(v=>v.classList),p=h.map(String);if(h.length!==t.expectedText.length)return{received:p,matches:!1};let b=this._matchSequentially(t.expectedText,h,(v,y)=>v.matchesClassList(this,y,n==="to.contain.class.array"));return{received:p,matches:b}}if(!["to.contain.text.array","to.have.text.array"].includes(n))throw this.createStacklessError("Unknown expect matcher: "+n);let r=e.map(h=>t.useInnerText?h.innerText:Se(new Map,h).full),o=n!=="to.contain.text.array";if(!(r.length===t.expectedText.length||!o))return{received:r,matches:!1};let l=this._matchSequentially(t.expectedText,r,(h,p)=>h.matches(p));return{received:r,matches:l}}_matchSequentially(e,t,n){let r=e.map(l=>new Dn(l)),o=0,u=0;for(;o<r.length&&u<t.length;)n(r[o],t[u])&&++o,++u;return o===r.length}};function Rn(e){return e.replace(/\n/g,"\u21B5").replace(/\t/g,"\u21C6")}function ou(e){if(e=e.substring(1,e.length-1),!e.includes("\\"))return e;let t=[],n=0;for(;n<e.length;)e[n]==="\\"&&n+1<e.length&&n++,t.push(e[n++]);return t.join("")}function qn(e,t){if(e[0]==="/"&&e.lastIndexOf("/")>0){let o=e.lastIndexOf("/"),u=new RegExp(e.substring(1,o),e.substring(o+1));return{matcher:l=>u.test(l.full),kind:"regex"}}let n=t?JSON.parse.bind(JSON):ou,r=!1;return e.length>1&&e[0]==='"'&&e[e.length-1]==='"'?(e=n(e),r=!0):t&&e.length>1&&e[0]==='"'&&e[e.length-2]==='"'&&e[e.length-1]==="i"?(e=n(e.substring(0,e.length-1)),r=!1):t&&e.length>1&&e[0]==='"'&&e[e.length-2]==='"'&&e[e.length-1]==="s"?(e=n(e.substring(0,e.length-1)),r=!0):e.length>1&&e[0]==="'"&&e[e.length-1]==="'"&&(e=n(e),r=!0),e=we(e),r?t?{kind:"strict",matcher:u=>u.normalized===e}:{matcher:u=>!e&&!u.immediate.length?!0:u.immediate.some(l=>we(l)===e),kind:"strict"}:(e=e.toLowerCase(),{kind:"lax",matcher:o=>o.normalized.toLowerCase().includes(e)})}var Dn=class{_string;_substring;_regex;_normalizeWhiteSpace;_ignoreCase;constructor(e){if(this._normalizeWhiteSpace=e.normalizeWhiteSpace,this._ignoreCase=e.ignoreCase,this._string=e.matchSubstring?void 0:this.normalize(e.string),this._substring=e.matchSubstring?this.normalize(e.string):void 0,e.regexSource){let t=new Set((e.regexFlags||"").split(""));e.ignoreCase===!1&&t.delete("i"),e.ignoreCase===!0&&t.add("i"),this._regex=new RegExp(e.regexSource,[...t].join(""))}}matches(e){return this._regex||(e=this.normalize(e)),this._string!==void 0?e===this._string:this._substring!==void 0?e.includes(this._substring):this._regex?!!this._regex.test(e):!1}matchesClassList(e,t,n){if(n){if(this._regex)throw e.createStacklessError("Partial matching does not support regular expressions. Please provide a string value.");return this._string.split(/\s+/g).filter(Boolean).every(r=>t.contains(r))}return this.matches(t.toString())}normalize(e){return e&&(this._normalizeWhiteSpace&&(e=we(e)),this._ignoreCase&&(e=e.toLocaleLowerCase()),e)}};function Hr(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!Hr(e[r],t[r]))return!1;return!0}if(e instanceof RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;++r)if(!t.hasOwnProperty(n[r]))return!1;for(let r of n)if(!Hr(e[r],t[r]))return!1;return!0}return typeof e=="number"&&typeof t=="number"?isNaN(e)&&isNaN(t):!1}var Me={selectorUtils:zi,roleUtils:to,domUtils:Eo,selectorGenerator:qo,stringUtils:Ji,InjectedScript:iu},pa=function(){if(!Me.InjectedScript)throw new Error("InjectedScript is not available yet.");let e=Me.InjectedScript,t=this.options||{sdkLanguage:"javascript",testIdAttributeName:"blinq-test-id",stableRafCount:0,browserName:"chromium",inputFileRoleTextbox:!1,customEngines:[],isUnderTest:!0};return new e(window,t)};var au=["slot","alt","name","placeholder","title","aria-label","aria-placeholder","role","data-testid","data-cy"];function cu(e){return`"${e.replace(/["\\]/g,t=>"\\"+t)}"`}function lu(e){return/^[a-zA-Z][a-zA-Z0-9\-\_]+$/.test(e)?"#"+e:`[id=${cu(e)}]`}function uu(e){let t="";for(let n=0;n<e.length;n++)t+=hu(e,n);return t}function hu(e,t){let n=e.charCodeAt(t);return n===0?"\uFFFD":n>=1&&n<=31||n>=48&&n<=57&&(t===0||t===1&&e.charCodeAt(0)===45)?"\\"+n.toString(16)+" ":t===0&&n===45&&e.length===1?"\\"+e.charAt(t):n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122?e.charAt(t):"\\"+e.charAt(t)}function fu(e){return e.unicode||e.unicodeSets?String(e):String(e).replace(/(^|[^\\])(\\\\)*(["'`])/g,"$1$2\\$3").replace(/>>/g,"\\>\\>")}var Ts=class{constructor(t,n={}){this.locatorStrategies={text:"basic",no_text:"no_text",custom:"custom",context:"context",digitIgnore:"ignore_digit",text_with_index:"text_with_index"},this.options=n,this.dom_Parent=new Ai,this.PW=Me,this.injectedScript=t,this.cache=new Map}generateUniqueCSSSelector(t,n){let r=n?.root||window.document,o=n?.separator||" > ",u=n?.isunique||(m=>this.getMatchingElements(m,n).length===1),l=n?.noCSSId||!1;if(!(t instanceof Element)||!r.contains(t))return"";let h="",p=t.getAttribute("id");if(p&&!/\d/.test(p)&&!l&&(h=lu(p),u(h))||t.tagName&&(h=t.tagName.toLowerCase()+h,u(h)))return h;let b=Array.from(t.classList).filter(m=>!/\d/.test(m));if(b.length&&(h+=b.map(m=>"."+uu(m)).join(""),u(h)))return h;for(let m of au)if(t.hasAttribute(m)){let w=t.getAttribute(m);if(w===""||/\d/.test(w))continue;w=w.replace(/[!"#$%&'()*+,./:;<=>?@[\]^`{|}~]/g,"\\$&"),h+=`[${m}=${this.PW.stringUtils.escapeForAttributeSelector(w)}]`}if(u(h)||t===r)return h;let v=t.parentElement;if(v){if(v!==r&&(t.assignedSlot&&(v=t.assignedSlot.parentElement??t.assignedSlot.parentNode.host),v&&v!==r&&(h=this.generateUniqueCSSSelector(v,n)+o+h,u(h))))return h}else if(t.parentNode instanceof ShadowRoot){let m=t.parentNode.host;if(m&&m!==r&&(h=this.generateUniqueCSSSelector(m,n)+" >>> "+h,u(h)))return h}let y=t.parentElement?.children;if(y){for(let m=0;m<y.length;m++)if(y[m]===t)return h+`:nth-child(${m+1})`}return""}getMatchingElements(t,n={}){let{root:r=window.document,prefix:o,visible:u=!0}=n;return u&&(t=`${t} >> visible=true`),o&&(t=`${o} >> ${t}`),this.injectedScript.querySelectorAll(this.injectedScript.parseSelector(t),r)}getLocatorStrategies(){return this.locatorStrategies}getTextLocators(t,n){let r=this.injectedScript,{textToIgnore:o=null}=n,u=this.PW.selectorGenerator.buildTextCandidates(r,t,n),l=[];for(let h of u){let p=0,b=[];for(let m of h){let{engine:w,selector:A}=m;o&&A.includes(o)||(w==="css"?b.push(A):b.push(`${w}=${A}`),p+=m.score)}let v=b.join(" >> "),y=p/h.length;l.push({css:v,score:y})}return l}getNoTextLocators(t,n){let r=this.injectedScript,o=this.PW.selectorGenerator.buildNoTextCandidates(r,t,n);for(let u of o)u.engine==="css"?u.css=u.selector:u.css=`${u.engine}=${u.selector}`,delete u.engine,delete u.selector;return o}getCustomLocators(t,n){let{customAttributes:r=[]}=this.options;if(!r||!Array.isArray(r))return console.error("Custom attributes must be an array"),[];let o=[],u=[];for(let l of r){if(!l||typeof l!="string"){console.error("Custom attribute must be a string");continue}let h=t.getAttribute(l);h!==null&&(u.push(l),o.push({css:`[${l}=${this.PW.stringUtils.escapeForAttributeSelector(h)}]`,score:1,priority:1}))}return o}toContextLocators(t,n,r={}){let o=this.dom_Parent.findLowestCommonAncestor([n,t]),u=this.dom_Parent.getClimbCountToParent(n,o),l=n.innerText.trim(),h=`internal:text="${l}" >> ${this.getXPathSelector(u)}`,p=this.getElementLocators(t,{root:o,strategies:{[this.locatorStrategies.custom]:!0,[this.locatorStrategies.text]:!0,[this.locatorStrategies.no_text]:!0},prefix:h,...r}),b=m=>{m.forEach(w=>{w.climb=u,w.text=l})},v=p.allStrategyLocators,y=p.locators;if(v){let m=[];for(let w in v){if(w==="strategy")continue;let A=v[w];A.length!==0&&(m.push(...A),v[w]=[])}return b(m),v[this.locatorStrategies.context]=m,v.strategy=this.locatorStrategies.context,p.locators=m,p}return y&&b(y),p}getContextLocators(t,n){if(!n||!Array.isArray(n))return console.error("Locators must be an array"),[];let r=[];try{let o=new Set;for(let u of n){let l=u.css;if(!l||typeof l!="string"){console.error("Locator must have a valid css selector");continue}let p=this.injectedScript.parseSelector(l).parts;if(!p||!Array.isArray(p)||p.length===0){console.error("Locator must have a valid css selector");continue}if(p.length<3)continue;let b=p[0];if(b.name!=="internal:text")continue;let v=b.body;if(!v||typeof v!="string"||v.length===0){console.error("Locator must have a valid text in the first part to be a context locator");continue}let y=p[1];if(y.name!=="xpath")continue;let m=y.body;if(!m||typeof m!="string"||m.length===0)continue;let w=y.body;if(!w||typeof w!="string"||w.length===0)continue;let A=/(\.\.)(\/\.\.)*/;try{if(A.test(w)){let P=w.split("..").length-1,B=l.indexOf(w),q=l.substring(B+w.length+3).trim();if(q.length===0)continue;let H=`internal:text=${v}`,ee=this.getMatchingElements(H,{});if(ee.length!==1){console.error("Context locator must have exactly one element matching the text part");continue}let te=ee[0],Z=this.injectedScript.utils.elementText(new Map,te).full.trim(),se=`${H} >> xpath=${m} >> ${q}`,le=this.getMatchingElements(se,{});if(le.length!==1){console.error("Context locator must have exactly one element matching the full selector");continue}if(le[0]!==t){console.error("Context locator must have the text element as the full element");continue}if(!o.has(Z)){o.add(Z);let re={css:q,climb:P,text:Z,priority:1};u.index!==void 0&&(re.index=u.index),r.push(re)}}}catch(I){console.error("Error parsing climb string:",I);continue}}}catch(o){console.error("Error generating context locators:",o)}return r.sort((o,u)=>o.text.length-u.text.length),r}getDigitIgnoreLocators(t,n){let r=[];try{if(!n||!Array.isArray(n))return console.error("Locators must be an array"),[];for(let o of n){let u=o.css;if(!u||typeof u!="string"){console.error("Locator must have a valid css selector");continue}let h=this.injectedScript.parseSelector(u).parts;if(!h||!Array.isArray(h)||h.length===0){console.error("Locator must have a valid css selector");continue}let p="",b=!1;for(let v of h){if(v.name!=="internal:text"){p+=`${v.name==="css"?"":v.name+"="}${v.source} >> `;continue}if(typeof v.body!="string"||v.body.length===0){p+=`${v.name==="css"?"":v.name+"="}${v.source} >> `;continue}let y=v.body,m=/\d+/g;b=m.test(y);let w=this.PW.stringUtils.escapeRegExp(y.substring(1,y.length-2)),A=new RegExp(w);p+=`internal:text=${fu(A).replace(m,"\\d+")} >> `}if(b&&(p.endsWith(" >> ")&&(p=p.slice(0,-4)),p)){let v=this.getMatchingElements(p,{});if(v.length!==1){console.error("Digit ignore locator must have exactly one element matching the final selector");continue}if(v[0]!==t){console.error("Digit ignore locator must match the original element");continue}r.push({css:p,priority:o.priority||1})}}}catch(o){console.error("Error generating digit ignore locators:",o)}return r}getTextwithIndexLocators(t){if(!t||!Array.isArray(t))return console.error("Locators must be an array"),[];let n=[];try{for(let r of t){if(!r||!r.css||typeof r.css!="string"){console.error("Locator must have a valid css selector");continue}let o=r.index;typeof o!="number"||o<0||n.push(r)}}catch(r){console.error("Error getting text with index locators:",r)}return n}getXPathSelector(t){if(typeof t!="number"||t<0)return console.error("Climb must be a non-negative integer"),"";if(t===0)return"";let n="xpath=..";if(t===1)return n;for(let r=1;r<t;r++)n+="/..";return n}categorizeLocators(t,n,r){let o=[],u=[],l=r?.visible??!0;try{for(let h of n){if(!h||!h.css||typeof h.css!="string"){console.error("Locator must have a valid css selector found: ",h);continue}l===!1&&(h.visible=!1);let p=this.getMatchingElements(h.css,r);if(p.length===0){console.warn(`No elements found for locator: ${h.css}`);continue}else if(p.length===1){if(t===p[0])h.priority=1,o.push(h);else if(t.contains(p[0])){h.priority=1;let b=this.dom_Parent.getClimbCountToParent(p[0],t),v=this.getXPathSelector(b),y=`${h.css} >> ${v}`;h.css=y,o.push(h)}}else h.priority=2,h.elements=p,u.push(h)}}catch(h){console.error("Error categorizing locators:",h)}return{unique:o,nonUnique:u}}getUniqueLocators(t,n=this.getNoTextLocators,r={}){return this.getUniqueLocators2(t,n,r)}getUniqueLocators1(t,n=this.getNoTextLocators,r={}){try{let{maxLocators:o=5,root:u=window.document.body,next:l="LCA",minLocators:h=3}=r;if(!t)return[];if(t===u)return t===window.document.documentElement?[{css:"html",score:1,priority:1},{css:":root",score:1,priority:1}]:[{css:":root",score:1,priority:1}];console.log("Generating locators for element:",t);let p=n(t,r);if(console.log("Generated locators:",p),!p||!Array.isArray(p))return console.error("Locator generator did not return an array of locators"),[];console.log("Categorizing locators for element:",t);let b=this.categorizeLocators(t,p,r);console.log("Categorized locators:",b);let{unique:v,nonUnique:y}=b,m=[];if(v.length>0&&m.push(...v),m.length>=o)return m.slice(0,o);let w=null;for(let A of y){let I=A.css??A.selector,P=A.elements||this.getMatchingElements(I,r);if(l==="parent"?w=this.dom_Parent.getActualParent(t):w=this.dom_Parent.findBranchingParent(P,t),w&&w!==t)if(u.contains(w)){let B=this.getUniqueLocators(w,n,{...r,root:u});for(let q of B){if(m.length>=o)return m.slice(0,o);let ee=`${q.css??q.selector} >> ${I}`,te=this.getMatchingElements(ee,r),Z=(q.score+A.score)/2+100;if(te.length===1&&te[0]===t)q.css=ee,q.score=Z,q.priority=1,m.push(q);else{let se=te.indexOf(t);se!==-1&&se<5&&(q.css=ee,q.index=se,q.priority=2,q.score=Z,m.push(q))}}}else{let B=P.indexOf(t);B!==-1&&B<5&&(A.index=B,A.priority=2,m.push(A))}else{let B=P.indexOf(t);B!==-1&&B<5&&(A.index=B,A.priority=2,m.push(A))}delete A.elements,delete A.strategy,delete A.engine,delete A.selector}if(m.length<h&&u&&u.contains(t)){let A=this.dom_Parent.getActualParent(t),I=this.getUniqueLocators(A,n,{...r,root:u});m.push(...I)}return m.sort((A,I)=>A.score-I.score),console.log("Final locators:",m,t),console.groupEnd(),m.slice(0,o)}catch(o){return console.error("Error in getUniqueLocators:",o),[]}}getUniqueLocators2(t,n=this.getNoTextLocators,r={}){try{let{maxLocators:o=5,root:u=window.document.body,prefix:l}=r;if(!t)return[];if(t===u)return t===window.document.documentElement?[{css:"html",score:1,priority:1},{css:":root",score:1,priority:1}]:[];console.log("Generating locators for element:",t);let h=n(t,r);if(console.log("Generated locators:",h),!h||!Array.isArray(h))return console.error("Locator generator did not return an array of locators"),[];console.log("Categorizing locators for element:",t);let p=this.categorizeLocators(t,h,r);console.log("Categorized locators:",p);let{unique:b,nonUnique:v}=p,y=[];if(b.length>0&&y.push(...b),y.length>=o)return y.slice(0,o);let m=new Map,w=l?[t]:this.dom_Parent.getFullAncestorChainToRoot(t,u);w.shift();let A=new Map,I=this.PW.selectorUtils.elementText(A,t).full.trim(),P=[],B=null;for(let q of w){let H=n(q,{...r,textToIgnore:I});if(!H||!Array.isArray(H)||H.length===0)continue;let ee=this.categorizeLocators(q,H,r);if(P.push({element:q,locators:ee}),m.set(q,ee),ee.unique.length>0){B={element:q,locators:ee};break}}for(let q of v){let H=q.css??q.selector;if((q.elements||this.getMatchingElements(H,r)).length===0){console.warn(`No elements found for locator: ${H}`);continue}if(!B){let te=this.getMatchingElements(H,r);if(te.length===1&&te[0]===t)y.push({css:H,score:q.score,priority:1});else{let Z=te.indexOf(t);Z!==-1&&y.push({css:H,index:Z,score:q.score+200,priority:2})}continue}for(let te of B.locators.unique){let Z=`${te.css} >> ${H}`,se=this.getMatchingElements(Z,r);if(se.length===1&&se[0]===t){let le=(te.score+q.score)/2+100,D={...te,css:Z,score:le,priority:1};y.push(D)}else{let le=se.indexOf(t);if(le!==-1&&le<5){let D=(te.score+q.score)/2,re={...te,css:Z,index:le,score:D+200,priority:2};y.push(re)}}}}return y.sort((q,H)=>q.score-H.score),console.log("Final locators:",y,t),console.groupEnd(),y.slice(0,o)}catch(o){return console.error("Error in getUniqueLocators:",o),[]}}isElementVisible(t){if(!(t instanceof Element))return!1;let n=window.getComputedStyle(t);if(n.display==="none"||n.visibility==="hidden"||n.opacity==="0")return!1;let r=t.getBoundingClientRect();return!(r.width===0||r.height===0)}getElementLocators(t,n={}){let r=this.isElementVisible(t);r===!1&&(console.warn("Element is not visible: ",t),n.visible=r);try{let{excludeText:o=!1,strategies:u={[this.locatorStrategies.custom]:!0,[this.locatorStrategies.context]:!0,[this.locatorStrategies.text]:!0,[this.locatorStrategies.text_with_index]:!0,[this.locatorStrategies.digitIgnore]:!0,[this.locatorStrategies.no_text]:!0}}=n,l={[this.locatorStrategies.custom]:[],[this.locatorStrategies.context]:[],[this.locatorStrategies.text]:[],[this.locatorStrategies.text_with_index]:[],[this.locatorStrategies.digitIgnore]:[],[this.locatorStrategies.no_text]:[]};if(u[this.locatorStrategies.custom]&&this.options?.customAttributes&&Array.isArray(this.options.customAttributes)&&this.options.customAttributes.length>0){console.groupCollapsed("Generating Custom locators for element:",t);let v=this.getUniqueLocators(t,this.getCustomLocators.bind(this),n);v.length>0&&(l[this.locatorStrategies.custom]=v)}if(console.groupEnd(),!o&&u[this.locatorStrategies.text]){console.groupCollapsed("Generating Text locators for element:",t);let v=this.getUniqueLocators(t,this.getTextLocators.bind(this),n);if(console.groupEnd(),v.length>0&&(l[this.locatorStrategies.text]=v),u[this.locatorStrategies.text_with_index]){let y=this.getTextwithIndexLocators(v);y.length>0&&(l[this.locatorStrategies.text_with_index]=y)}if(u[this.locatorStrategies.digitIgnore]){let y=this.getDigitIgnoreLocators(t,v);y.length>0&&(l[this.locatorStrategies.digitIgnore]=y)}if(u[this.locatorStrategies.context]){let y=this.getContextLocators(t,v);y.length>0&&(l[this.locatorStrategies.context]=y)}}if(u[this.locatorStrategies.no_text]){console.groupCollapsed("Generating No Text locators for element:",t);let v=this.getUniqueLocators(t,this.getNoTextLocators.bind(this),n);if(v.length>0)l[this.locatorStrategies.no_text]=v;else{let y=[];y.push({css:this.generateUniqueCSSSelector(t,n),score:500,priority:3}),y.length>0&&(l[this.locatorStrategies.no_text]=y)}console.groupEnd()}let h=this.getBestStrategy(l);if(!h)throw new Error("No locators found for element: "+t);l.strategy=h;let b={locators:l[l.strategy]??[],element_name:""};return Object.keys(l).length>1&&(b.allStrategyLocators=l),console.log("Generated locators:",b),b}catch(o){return console.error("Error in getElementLocators:",o),{locators:[],element_name:""}}}getBestStrategy(t){let n=[this.locatorStrategies.custom,this.locatorStrategies.context,this.locatorStrategies.text,this.locatorStrategies.text_with_index,this.locatorStrategies.digitIgnore,this.locatorStrategies.no_text];for(let r of n)if(t[r]&&t[r].length>0)return r;return null}},ga=Ts;var ks=class{constructor(t={}){let{inlineImages:n=!0,inlineStyles:r=!0,excludeSelectors:o=[]}=t;this.inlineImages=n,this.inlineStyles=r,this.excludeSelectors=o}imageToDataURL(t,n){try{let r=n.createElement("canvas");return r.width=t.naturalWidth||t.width,r.height=t.naturalHeight||t.height,r.getContext("2d").drawImage(t,0,0),r.toDataURL("image/png")}catch(r){return console.warn(`Failed to inline image: ${t.src}`,r),t.src}}processStyles(t){if(!this.inlineStyles)return;let n=Array.from(window.document.styleSheets);for(let r of n)try{let o=r.ownerNode.cloneNode(!0);if(!o.href)t.head.appendChild(o);else{let u=Array.from(r.cssRules).map(h=>h.cssText).join(`
18
+ `)}createStacklessError(e){if(this._browserName==="firefox"){let n=new Error("Error: "+e);return n.stack="",n}let t=new Error(e);return delete t.stack,t}createHighlight(){return new Or(this)}maskSelectors(e,t){this._highlight&&this.hideHighlight(),this._highlight=new Or(this),this._highlight.install();let n=[];for(let r of e)n.push(this.querySelectorAll(r,this.document.documentElement));this._highlight.maskElements(n.flat(),t)}highlight(e){this._highlight||(this._highlight=new Or(this),this._highlight.install()),this._highlight.runHighlightOnRaf(e)}hideHighlight(){this._highlight&&(this._highlight.uninstall(),delete this._highlight)}markTargetElements(e,t){var n,r;((n=this._markedElements)==null?void 0:n.callId)!==t&&(this._markedElements=void 0);let o=((r=this._markedElements)==null?void 0:r.elements)||new Set,u=new CustomEvent("__playwright_unmark_target__",{bubbles:!0,cancelable:!0,detail:t,composed:!0});for(let h of o)e.has(h)||h.dispatchEvent(u);let l=new CustomEvent("__playwright_mark_target__",{bubbles:!0,cancelable:!0,detail:t,composed:!0});for(let h of e)o.has(h)||h.dispatchEvent(l);this._markedElements={callId:t,elements:e}}_setupGlobalListenersRemovalDetection(){let e="__playwright_global_listeners_check__",t=!1,n=()=>t=!0;this.window.addEventListener(e,n),new MutationObserver(r=>{if(r.some(u=>Array.from(u.addedNodes).includes(this.document.documentElement))&&(t=!1,this.window.dispatchEvent(new CustomEvent(e)),!t)){this.window.addEventListener(e,n);for(let u of this.onGlobalListenersRemoved)u()}}).observe(this.document,{childList:!0})}_setupHitTargetInterceptors(){let e=n=>{var r;return(r=this._hitTargetInterceptor)==null?void 0:r.call(this,n)},t=()=>{for(let n of this._allHitTargetInterceptorEvents)this.window.addEventListener(n,e,{capture:!0,passive:!1})};t(),this.onGlobalListenersRemoved.add(t)}async expect(e,t,n){return t.expression==="to.have.count"||t.expression.endsWith(".array")?this.expectArray(n,t):e?await this.expectSingleElement(e,t):!t.isNot&&t.expression==="to.be.hidden"?{matches:!0}:t.isNot&&t.expression==="to.be.visible"?{matches:!1}:!t.isNot&&t.expression==="to.be.detached"?{matches:!0}:t.isNot&&t.expression==="to.be.attached"?{matches:!1}:t.isNot&&t.expression==="to.be.in.viewport"?{matches:!1}:{matches:t.isNot,missingReceived:!0}}async expectSingleElement(e,t){var n;let r=t.expression;{let o;if(r==="to.have.attribute"){let u=e.hasAttribute(t.expressionArg);o={matches:u,received:u?"attribute present":"attribute not present"}}else if(r==="to.be.checked"){let{checked:u,indeterminate:l}=t.expectedValue;if(l){if(u!==void 0)throw this.createStacklessError("Can't assert indeterminate and checked at the same time");o=this.elementState(e,"indeterminate")}else o=this.elementState(e,u===!1?"unchecked":"checked")}else if(r==="to.be.disabled")o=this.elementState(e,"disabled");else if(r==="to.be.editable")o=this.elementState(e,"editable");else if(r==="to.be.readonly")o=this.elementState(e,"editable"),o.matches=!o.matches;else if(r==="to.be.empty")if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){let u=e.value;o={matches:!u,received:u?"notEmpty":"empty"}}else{let u=(n=e.textContent)==null?void 0:n.trim();o={matches:!u,received:u?"notEmpty":"empty"}}else if(r==="to.be.enabled")o=this.elementState(e,"enabled");else if(r==="to.be.focused"){let u=this._activelyFocused(e).isFocused;o={matches:u,received:u?"focused":"inactive"}}else r==="to.be.hidden"?o=this.elementState(e,"hidden"):r==="to.be.visible"?o=this.elementState(e,"visible"):r==="to.be.attached"?o={matches:!0,received:"attached"}:r==="to.be.detached"&&(o={matches:!1,received:"attached"});if(o){if(o.received==="error:notconnected")throw this.createStacklessError("Element is not connected");return o}}if(r==="to.have.property"){let o=e,u=t.expressionArg.split(".");for(let p=0;p<u.length-1;p++){if(typeof o!="object"||!(u[p]in o))return{received:void 0,matches:!1};o=o[u[p]]}let l=o[u[u.length-1]],h=Hr(l,t.expectedValue);return{received:l,matches:h}}if(r==="to.be.in.viewport"){let o=await this.viewportRatio(e);return{received:`viewport ratio ${o}`,matches:o>0&&o>(t.expectedNumber??0)-1e-9}}if(r==="to.have.values"){if(e=this.retarget(e,"follow-label"),e.nodeName!=="SELECT"||!e.multiple)throw this.createStacklessError("Not a select element with a multiple attribute");let o=[...e.selectedOptions].map(u=>u.value);return o.length!==t.expectedText.length?{received:o,matches:!1}:{received:o,matches:o.map((u,l)=>new Dn(t.expectedText[l]).matches(u)).every(Boolean)}}if(r==="to.match.aria"){let o=al(e,t.expectedValue);return{received:o.received,matches:!!o.matches.length}}{let o;if(r==="to.have.attribute.value"){let u=e.getAttribute(t.expressionArg);if(u===null)return{received:null,matches:!1};o=u}else if(["to.have.class","to.contain.class"].includes(r)){if(!t.expectedText)throw this.createStacklessError("Expected text is not provided for "+r);return{received:e.classList.toString(),matches:new Dn(t.expectedText[0]).matchesClassList(this,e.classList,r==="to.contain.class")}}else if(r==="to.have.css")o=this.window.getComputedStyle(e).getPropertyValue(t.expressionArg);else if(r==="to.have.id")o=e.id;else if(r==="to.have.text")o=t.useInnerText?e.innerText:Se(new Map,e).full;else if(r==="to.have.accessible.name")o=At(e,!1);else if(r==="to.have.accessible.description")o=Rr(e,!1);else if(r==="to.have.accessible.error.message")o=Co(e);else if(r==="to.have.role")o=he(e)||"";else if(r==="to.have.title")o=this.document.title;else if(r==="to.have.url")o=this.document.location.href;else if(r==="to.have.value"){if(e=this.retarget(e,"follow-label"),e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA"&&e.nodeName!=="SELECT")throw this.createStacklessError("Not an input element");o=e.value}if(o!==void 0&&t.expectedText){let u=new Dn(t.expectedText[0]);return{received:o,matches:u.matches(o)}}}throw this.createStacklessError("Unknown expect matcher: "+r)}expectArray(e,t){let n=t.expression;if(n==="to.have.count"){let h=e.length,p=h===t.expectedNumber;return{received:h,matches:p}}if(!t.expectedText)throw this.createStacklessError("Expected text is not provided for "+n);if(["to.have.class.array","to.contain.class.array"].includes(n)){let h=e.map(v=>v.classList),p=h.map(String);if(h.length!==t.expectedText.length)return{received:p,matches:!1};let b=this._matchSequentially(t.expectedText,h,(v,m)=>v.matchesClassList(this,m,n==="to.contain.class.array"));return{received:p,matches:b}}if(!["to.contain.text.array","to.have.text.array"].includes(n))throw this.createStacklessError("Unknown expect matcher: "+n);let r=e.map(h=>t.useInnerText?h.innerText:Se(new Map,h).full),o=n!=="to.contain.text.array";if(!(r.length===t.expectedText.length||!o))return{received:r,matches:!1};let l=this._matchSequentially(t.expectedText,r,(h,p)=>h.matches(p));return{received:r,matches:l}}_matchSequentially(e,t,n){let r=e.map(l=>new Dn(l)),o=0,u=0;for(;o<r.length&&u<t.length;)n(r[o],t[u])&&++o,++u;return o===r.length}};function Rn(e){return e.replace(/\n/g,"\u21B5").replace(/\t/g,"\u21C6")}function ou(e){if(e=e.substring(1,e.length-1),!e.includes("\\"))return e;let t=[],n=0;for(;n<e.length;)e[n]==="\\"&&n+1<e.length&&n++,t.push(e[n++]);return t.join("")}function qn(e,t){if(e[0]==="/"&&e.lastIndexOf("/")>0){let o=e.lastIndexOf("/"),u=new RegExp(e.substring(1,o),e.substring(o+1));return{matcher:l=>u.test(l.full),kind:"regex"}}let n=t?JSON.parse.bind(JSON):ou,r=!1;return e.length>1&&e[0]==='"'&&e[e.length-1]==='"'?(e=n(e),r=!0):t&&e.length>1&&e[0]==='"'&&e[e.length-2]==='"'&&e[e.length-1]==="i"?(e=n(e.substring(0,e.length-1)),r=!1):t&&e.length>1&&e[0]==='"'&&e[e.length-2]==='"'&&e[e.length-1]==="s"?(e=n(e.substring(0,e.length-1)),r=!0):e.length>1&&e[0]==="'"&&e[e.length-1]==="'"&&(e=n(e),r=!0),e=we(e),r?t?{kind:"strict",matcher:u=>u.normalized===e}:{matcher:u=>!e&&!u.immediate.length?!0:u.immediate.some(l=>we(l)===e),kind:"strict"}:(e=e.toLowerCase(),{kind:"lax",matcher:o=>o.normalized.toLowerCase().includes(e)})}var Dn=class{_string;_substring;_regex;_normalizeWhiteSpace;_ignoreCase;constructor(e){if(this._normalizeWhiteSpace=e.normalizeWhiteSpace,this._ignoreCase=e.ignoreCase,this._string=e.matchSubstring?void 0:this.normalize(e.string),this._substring=e.matchSubstring?this.normalize(e.string):void 0,e.regexSource){let t=new Set((e.regexFlags||"").split(""));e.ignoreCase===!1&&t.delete("i"),e.ignoreCase===!0&&t.add("i"),this._regex=new RegExp(e.regexSource,[...t].join(""))}}matches(e){return this._regex||(e=this.normalize(e)),this._string!==void 0?e===this._string:this._substring!==void 0?e.includes(this._substring):this._regex?!!this._regex.test(e):!1}matchesClassList(e,t,n){if(n){if(this._regex)throw e.createStacklessError("Partial matching does not support regular expressions. Please provide a string value.");return this._string.split(/\s+/g).filter(Boolean).every(r=>t.contains(r))}return this.matches(t.toString())}normalize(e){return e&&(this._normalizeWhiteSpace&&(e=we(e)),this._ignoreCase&&(e=e.toLocaleLowerCase()),e)}};function Hr(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!Hr(e[r],t[r]))return!1;return!0}if(e instanceof RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;++r)if(!t.hasOwnProperty(n[r]))return!1;for(let r of n)if(!Hr(e[r],t[r]))return!1;return!0}return typeof e=="number"&&typeof t=="number"?isNaN(e)&&isNaN(t):!1}var Me={selectorUtils:zi,roleUtils:to,domUtils:Eo,selectorGenerator:qo,stringUtils:Ji,InjectedScript:iu},pa=function(){if(!Me.InjectedScript)throw new Error("InjectedScript is not available yet.");let e=Me.InjectedScript,t=this.options||{sdkLanguage:"javascript",testIdAttributeName:"blinq-test-id",stableRafCount:0,browserName:"chromium",inputFileRoleTextbox:!1,customEngines:[],isUnderTest:!0};return new e(window,t)};var au=["slot","alt","name","placeholder","title","aria-label","aria-placeholder","role","data-testid","data-cy"];function cu(e){return`"${e.replace(/["\\]/g,t=>"\\"+t)}"`}function lu(e){return/^[a-zA-Z][a-zA-Z0-9\-\_]+$/.test(e)?"#"+e:`[id=${cu(e)}]`}function uu(e){let t="";for(let n=0;n<e.length;n++)t+=hu(e,n);return t}function hu(e,t){let n=e.charCodeAt(t);return n===0?"\uFFFD":n>=1&&n<=31||n>=48&&n<=57&&(t===0||t===1&&e.charCodeAt(0)===45)?"\\"+n.toString(16)+" ":t===0&&n===45&&e.length===1?"\\"+e.charAt(t):n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122?e.charAt(t):"\\"+e.charAt(t)}function fu(e){return e.unicode||e.unicodeSets?String(e):String(e).replace(/(^|[^\\])(\\\\)*(["'`])/g,"$1$2\\$3").replace(/>>/g,"\\>\\>")}var Ts=class{constructor(t,n={}){this.locatorStrategies={text:"basic",no_text:"no_text",custom:"custom",context:"context",digitIgnore:"ignore_digit",text_with_index:"text_with_index"},this.options=n,this.dom_Parent=new Ai,this.PW=Me,this.injectedScript=t,this.cache=new Map}generateUniqueCSSSelector(t,n){let r=n?.root||window.document,o=n?.separator||" > ",u=n?.isunique||(y=>this.getMatchingElements(y,n).length===1),l=n?.noCSSId||!1;if(!(t instanceof Element)||!r.contains(t))return"";let h="",p=t.getAttribute("id");if(p&&!/\d/.test(p)&&!l&&(h=lu(p),u(h))||t.tagName&&(h=t.tagName.toLowerCase()+h,u(h)))return h;let b=Array.from(t.classList).filter(y=>!/\d/.test(y));if(b.length&&(h+=b.map(y=>"."+uu(y)).join(""),u(h)))return h;for(let y of au)if(t.hasAttribute(y)){let w=t.getAttribute(y);if(w===""||/\d/.test(w))continue;w=w.replace(/[!"#$%&'()*+,./:;<=>?@[\]^`{|}~]/g,"\\$&"),h+=`[${y}=${this.PW.stringUtils.escapeForAttributeSelector(w)}]`}if(u(h)||t===r)return h;let v=t.parentElement;if(v){if(v!==r&&(t.assignedSlot&&(v=t.assignedSlot.parentElement??t.assignedSlot.parentNode.host),v&&v!==r&&(h=this.generateUniqueCSSSelector(v,n)+o+h,u(h))))return h}else if(t.parentNode instanceof ShadowRoot){let y=t.parentNode.host;if(y&&y!==r&&(h=this.generateUniqueCSSSelector(y,n)+" >>> "+h,u(h)))return h}let m=t.parentElement?.children;if(m){for(let y=0;y<m.length;y++)if(m[y]===t)return h+`:nth-child(${y+1})`}return""}getMatchingElements(t,n={}){let{root:r=window.document,prefix:o,visible:u=!0}=n;return u&&(t=`${t} >> visible=true`),o&&(t=`${o} >> ${t}`),this.injectedScript.querySelectorAll(this.injectedScript.parseSelector(t),r)}getLocatorStrategies(){return this.locatorStrategies}getTextLocators(t,n){let r=this.injectedScript,{textToIgnore:o=null}=n,u=this.PW.selectorGenerator.buildTextCandidates(r,t,n),l=[];for(let h of u){let p=0,b=[];for(let y of h){let{engine:w,selector:A}=y;o&&A.includes(o)||(w==="css"?b.push(A):b.push(`${w}=${A}`),p+=y.score)}let v=b.join(" >> "),m=p/h.length;l.push({css:v,score:m})}return l}getNoTextLocators(t,n){let r=this.injectedScript,o=this.PW.selectorGenerator.buildNoTextCandidates(r,t,n);for(let u of o)u.engine==="css"?u.css=u.selector:u.css=`${u.engine}=${u.selector}`,delete u.engine,delete u.selector;return o}getCustomLocators(t,n){let{customAttributes:r=[]}=this.options;if(!r||!Array.isArray(r))return console.error("Custom attributes must be an array"),[];let o=[],u=[];for(let l of r){if(!l||typeof l!="string"){console.error("Custom attribute must be a string");continue}let h=t.getAttribute(l);h!==null&&(u.push(l),o.push({css:`[${l}=${this.PW.stringUtils.escapeForAttributeSelector(h)}]`,score:1,priority:1}))}return o}toContextLocators(t,n,r={}){let o=this.dom_Parent.findLowestCommonAncestor([n,t]),u=this.dom_Parent.getClimbCountToParent(n,o),l=n.innerText.trim(),h=`internal:text="${l}" >> ${this.getXPathSelector(u)}`,p=this.getElementLocators(t,{root:o,strategies:{[this.locatorStrategies.custom]:!0,[this.locatorStrategies.text]:!0,[this.locatorStrategies.no_text]:!0},prefix:h,...r}),b=y=>{y.forEach(w=>{w.climb=u,w.text=l})},v=p.allStrategyLocators,m=p.locators;if(v){let y=[];for(let w in v){if(w==="strategy")continue;let A=v[w];A.length!==0&&(y.push(...A),v[w]=[])}return b(y),v[this.locatorStrategies.context]=y,v.strategy=this.locatorStrategies.context,p.locators=y,p}return m&&b(m),p}getContextLocators(t,n){if(!n||!Array.isArray(n))return console.error("Locators must be an array"),[];let r=[];try{let o=new Set;for(let u of n){let l=u.css;if(!l||typeof l!="string"){console.error("Locator must have a valid css selector");continue}let p=this.injectedScript.parseSelector(l).parts;if(!p||!Array.isArray(p)||p.length===0){console.error("Locator must have a valid css selector");continue}if(p.length<3)continue;let b=p[0];if(b.name!=="internal:text")continue;let v=b.body;if(!v||typeof v!="string"||v.length===0){console.error("Locator must have a valid text in the first part to be a context locator");continue}let m=p[1];if(m.name!=="xpath")continue;let y=m.body;if(!y||typeof y!="string"||y.length===0)continue;let w=m.body;if(!w||typeof w!="string"||w.length===0)continue;let A=/(\.\.)(\/\.\.)*/;try{if(A.test(w)){let P=w.split("..").length-1,B=l.indexOf(w),q=l.substring(B+w.length+3).trim();if(q.length===0)continue;let H=`internal:text=${v}`,ee=this.getMatchingElements(H,{});if(ee.length!==1){console.error("Context locator must have exactly one element matching the text part");continue}let te=ee[0],Z=this.injectedScript.utils.elementText(new Map,te).full.trim(),se=`${H} >> xpath=${y} >> ${q}`,le=this.getMatchingElements(se,{});if(le.length!==1){console.error("Context locator must have exactly one element matching the full selector");continue}if(le[0]!==t){console.error("Context locator must have the text element as the full element");continue}if(!o.has(Z)){o.add(Z);let re={css:q,climb:P,text:Z,priority:1};u.index!==void 0&&(re.index=u.index),r.push(re)}}}catch(I){console.error("Error parsing climb string:",I);continue}}}catch(o){console.error("Error generating context locators:",o)}return r.sort((o,u)=>o.text.length-u.text.length),r}getDigitIgnoreLocators(t,n){let r=[];try{if(!n||!Array.isArray(n))return console.error("Locators must be an array"),[];for(let o of n){let u=o.css;if(!u||typeof u!="string"){console.error("Locator must have a valid css selector");continue}let h=this.injectedScript.parseSelector(u).parts;if(!h||!Array.isArray(h)||h.length===0){console.error("Locator must have a valid css selector");continue}let p="",b=!1;for(let v of h){if(v.name!=="internal:text"){p+=`${v.name==="css"?"":v.name+"="}${v.source} >> `;continue}if(typeof v.body!="string"||v.body.length===0){p+=`${v.name==="css"?"":v.name+"="}${v.source} >> `;continue}let m=v.body,y=/\d+/g;b=y.test(m);let w=this.PW.stringUtils.escapeRegExp(m.substring(1,m.length-2)),A=new RegExp(w);p+=`internal:text=${fu(A).replace(y,"\\d+")} >> `}if(b&&(p.endsWith(" >> ")&&(p=p.slice(0,-4)),p)){let v=this.getMatchingElements(p,{});if(v.length!==1){console.error("Digit ignore locator must have exactly one element matching the final selector");continue}if(v[0]!==t){console.error("Digit ignore locator must match the original element");continue}r.push({css:p,priority:o.priority||1})}}}catch(o){console.error("Error generating digit ignore locators:",o)}return r}getTextwithIndexLocators(t){if(!t||!Array.isArray(t))return console.error("Locators must be an array"),[];let n=[];try{for(let r of t){if(!r||!r.css||typeof r.css!="string"){console.error("Locator must have a valid css selector");continue}let o=r.index;typeof o!="number"||o<0||n.push(r)}}catch(r){console.error("Error getting text with index locators:",r)}return n}getXPathSelector(t){if(typeof t!="number"||t<0)return console.error("Climb must be a non-negative integer"),"";if(t===0)return"";let n="xpath=..";if(t===1)return n;for(let r=1;r<t;r++)n+="/..";return n}categorizeLocators(t,n,r){let o=[],u=[],l=r?.visible??!0;try{for(let h of n){if(!h||!h.css||typeof h.css!="string"){console.error("Locator must have a valid css selector found: ",h);continue}l===!1&&(h.visible=!1);let p=this.getMatchingElements(h.css,r);if(p.length===0){console.warn(`No elements found for locator: ${h.css}`);continue}else if(p.length===1){if(t===p[0])h.priority=1,o.push(h);else if(t.contains(p[0])){h.priority=1;let b=this.dom_Parent.getClimbCountToParent(p[0],t),v=this.getXPathSelector(b),m=`${h.css} >> ${v}`;h.css=m,o.push(h)}}else h.priority=2,h.elements=p,u.push(h)}}catch(h){console.error("Error categorizing locators:",h)}return{unique:o,nonUnique:u}}getUniqueLocators(t,n=this.getNoTextLocators,r={}){return this.getUniqueLocators2(t,n,r)}getUniqueLocators1(t,n=this.getNoTextLocators,r={}){try{let{maxLocators:o=5,root:u=window.document.body,next:l="LCA",minLocators:h=3}=r;if(!t)return[];if(t===u)return t===window.document.documentElement?[{css:"html",score:1,priority:1},{css:":root",score:1,priority:1}]:[{css:":root",score:1,priority:1}];console.log("Generating locators for element:",t);let p=n(t,r);if(console.log("Generated locators:",p),!p||!Array.isArray(p))return console.error("Locator generator did not return an array of locators"),[];console.log("Categorizing locators for element:",t);let b=this.categorizeLocators(t,p,r);console.log("Categorized locators:",b);let{unique:v,nonUnique:m}=b,y=[];if(v.length>0&&y.push(...v),y.length>=o)return y.slice(0,o);let w=null;for(let A of m){let I=A.css??A.selector,P=A.elements||this.getMatchingElements(I,r);if(l==="parent"?w=this.dom_Parent.getActualParent(t):w=this.dom_Parent.findBranchingParent(P,t),w&&w!==t)if(u.contains(w)){let B=this.getUniqueLocators(w,n,{...r,root:u});for(let q of B){if(y.length>=o)return y.slice(0,o);let ee=`${q.css??q.selector} >> ${I}`,te=this.getMatchingElements(ee,r),Z=(q.score+A.score)/2+100;if(te.length===1&&te[0]===t)q.css=ee,q.score=Z,q.priority=1,y.push(q);else{let se=te.indexOf(t);se!==-1&&se<5&&(q.css=ee,q.index=se,q.priority=2,q.score=Z,y.push(q))}}}else{let B=P.indexOf(t);B!==-1&&B<5&&(A.index=B,A.priority=2,y.push(A))}else{let B=P.indexOf(t);B!==-1&&B<5&&(A.index=B,A.priority=2,y.push(A))}delete A.elements,delete A.strategy,delete A.engine,delete A.selector}if(y.length<h&&u&&u.contains(t)){let A=this.dom_Parent.getActualParent(t),I=this.getUniqueLocators(A,n,{...r,root:u});y.push(...I)}return y.sort((A,I)=>A.score-I.score),console.log("Final locators:",y,t),console.groupEnd(),y.slice(0,o)}catch(o){return console.error("Error in getUniqueLocators:",o),[]}}getUniqueLocators2(t,n=this.getNoTextLocators,r={}){try{let{maxLocators:o=5,root:u=window.document.body,prefix:l}=r;if(!t)return[];if(t===u)return t===window.document.documentElement?[{css:"html",score:1,priority:1},{css:":root",score:1,priority:1}]:[];console.log("Generating locators for element:",t);let h=n(t,r);if(console.log("Generated locators:",h),!h||!Array.isArray(h))return console.error("Locator generator did not return an array of locators"),[];console.log("Categorizing locators for element:",t);let p=this.categorizeLocators(t,h,r);console.log("Categorized locators:",p);let{unique:b,nonUnique:v}=p,m=[];if(b.length>0&&m.push(...b),m.length>=o)return m.slice(0,o);let y=new Map,w=l?[t]:this.dom_Parent.getFullAncestorChainToRoot(t,u);w.shift();let A=new Map,I=this.PW.selectorUtils.elementText(A,t).full.trim(),P=[],B=null;for(let q of w){let H=n(q,{...r,textToIgnore:I});if(!H||!Array.isArray(H)||H.length===0)continue;let ee=this.categorizeLocators(q,H,r);if(P.push({element:q,locators:ee}),y.set(q,ee),ee.unique.length>0){B={element:q,locators:ee};break}}for(let q of v){let H=q.css??q.selector;if((q.elements||this.getMatchingElements(H,r)).length===0){console.warn(`No elements found for locator: ${H}`);continue}if(!B){let te=this.getMatchingElements(H,r);if(te.length===1&&te[0]===t)m.push({css:H,score:q.score,priority:1});else{let Z=te.indexOf(t);Z!==-1&&m.push({css:H,index:Z,score:q.score+200,priority:2})}continue}for(let te of B.locators.unique){let Z=`${te.css} >> ${H}`,se=this.getMatchingElements(Z,r);if(se.length===1&&se[0]===t){let le=(te.score+q.score)/2+100,D={...te,css:Z,score:le,priority:1};m.push(D)}else{let le=se.indexOf(t);if(le!==-1&&le<5){let D=(te.score+q.score)/2,re={...te,css:Z,index:le,score:D+200,priority:2};m.push(re)}}}}return m.sort((q,H)=>q.score-H.score),console.log("Final locators:",m,t),console.groupEnd(),m.slice(0,o)}catch(o){return console.error("Error in getUniqueLocators:",o),[]}}isElementVisible(t){if(!(t instanceof Element))return!1;let n=window.getComputedStyle(t);if(n.display==="none"||n.visibility==="hidden"||n.opacity==="0")return!1;let r=t.getBoundingClientRect();return!(r.width===0||r.height===0)}getElementLocators(t,n={}){let r=this.isElementVisible(t);r===!1&&(console.warn("Element is not visible: ",t),n.visible=r);try{let{excludeText:o=!1,strategies:u={[this.locatorStrategies.custom]:!0,[this.locatorStrategies.context]:!0,[this.locatorStrategies.text]:!0,[this.locatorStrategies.text_with_index]:!0,[this.locatorStrategies.digitIgnore]:!0,[this.locatorStrategies.no_text]:!0}}=n,l={[this.locatorStrategies.custom]:[],[this.locatorStrategies.context]:[],[this.locatorStrategies.text]:[],[this.locatorStrategies.text_with_index]:[],[this.locatorStrategies.digitIgnore]:[],[this.locatorStrategies.no_text]:[]};if(u[this.locatorStrategies.custom]&&this.options?.customAttributes&&Array.isArray(this.options.customAttributes)&&this.options.customAttributes.length>0){console.groupCollapsed("Generating Custom locators for element:",t);let v=this.getUniqueLocators(t,this.getCustomLocators.bind(this),n);v.length>0&&(l[this.locatorStrategies.custom]=v)}if(console.groupEnd(),!o&&u[this.locatorStrategies.text]){console.groupCollapsed("Generating Text locators for element:",t);let v=this.getUniqueLocators(t,this.getTextLocators.bind(this),n);if(console.groupEnd(),v.length>0&&(l[this.locatorStrategies.text]=v),u[this.locatorStrategies.text_with_index]){let m=this.getTextwithIndexLocators(v);m.length>0&&(l[this.locatorStrategies.text_with_index]=m)}if(u[this.locatorStrategies.digitIgnore]){let m=this.getDigitIgnoreLocators(t,v);m.length>0&&(l[this.locatorStrategies.digitIgnore]=m)}if(u[this.locatorStrategies.context]){let m=this.getContextLocators(t,v);m.length>0&&(l[this.locatorStrategies.context]=m)}}if(u[this.locatorStrategies.no_text]){console.groupCollapsed("Generating No Text locators for element:",t);let v=this.getUniqueLocators(t,this.getNoTextLocators.bind(this),n);if(v.length>0)l[this.locatorStrategies.no_text]=v;else{let m=[];m.push({css:this.generateUniqueCSSSelector(t,n),score:500,priority:3}),m.length>0&&(l[this.locatorStrategies.no_text]=m)}console.groupEnd()}let h=this.getBestStrategy(l);if(!h)throw new Error("No locators found for element: "+t);l.strategy=h;let b={locators:l[l.strategy]??[],element_name:""};return Object.keys(l).length>1&&(b.allStrategyLocators=l),console.log("Generated locators:",b),b}catch(o){return console.error("Error in getElementLocators:",o),{locators:[],element_name:""}}}getBestStrategy(t){let n=[this.locatorStrategies.custom,this.locatorStrategies.context,this.locatorStrategies.text,this.locatorStrategies.text_with_index,this.locatorStrategies.digitIgnore,this.locatorStrategies.no_text];for(let r of n)if(t[r]&&t[r].length>0)return r;return null}},ga=Ts;var ks=class{constructor(t={}){let{inlineImages:n=!0,inlineStyles:r=!0,excludeSelectors:o=[]}=t;this.inlineImages=n,this.inlineStyles=r,this.excludeSelectors=o}imageToDataURL(t,n){try{let r=n.createElement("canvas");return r.width=t.naturalWidth||t.width,r.height=t.naturalHeight||t.height,r.getContext("2d").drawImage(t,0,0),r.toDataURL("image/png")}catch(r){return console.warn(`Failed to inline image: ${t.src}`,r),t.src}}processStyles(t){if(!this.inlineStyles)return;let n=Array.from(window.document.styleSheets);for(let r of n)try{let o=r.ownerNode.cloneNode(!0);if(!o.href)t.head.appendChild(o);else{let u=Array.from(r.cssRules).map(h=>h.cssText).join(`
19
19
  `),l=t.createElement("style");l.textContent=u,t.head.appendChild(l)}}catch(o){console.warn(`Error processing stylesheet: ${r.href}`,o)}}processImages(t){if(!this.inlineImages)return;t.querySelectorAll("img").forEach(r=>{if(!(r.src.startsWith("data:")||r.src.endsWith(".svg"))&&!this.excludeSelectors.some(o=>r.matches(o))&&r.complete&&r.naturalWidth!==0)try{r.setAttribute("src",this.imageToDataURL(r,t))}catch(o){console.warn(`Failed to process image: ${r.src}`,o)}})}removeExcludedElements(t){this.excludeSelectors.forEach(n=>{t.querySelectorAll(n).forEach(o=>{o.parentNode?.removeChild(o)})})}processComputedStyles(t){t.querySelectorAll("*").forEach(r=>{if(this.excludeSelectors.some(h=>r.matches(h)))return;let o=window.getComputedStyle(r),u=["display","position","width","height","margin","padding","color","background-color","font-family","font-size","text-align","line-height","border","box-shadow","opacity"],l=[];if(u.forEach(h=>{let p=o.getPropertyValue(h);p&&l.push(`${h}: ${p}`)}),l.length>0){let h=r.getAttribute("style")||"";r.setAttribute("style",h+l.join("; ")+";")}})}createSnapshot(){let t=window.document.cloneNode(!0),n=window.document,r=t;this.processStyles(r),this.processImages(r),this.removeExcludedElements(r),this.processComputedStyles(r);let o=n.doctype?new XMLSerializer().serializeToString(n.doctype):"<!DOCTYPE html>",u=r.documentElement.outerHTML;return`${o}${u}`}},ma=ks;var _s=class{isLeafNode(t){return t.kind==="text"?!0:!t.children||t.children.length===0}deepClone(t){if(t.kind==="text")return t.text;{let n={kind:"role",role:t.role};return"checked"in t&&(n.checked=t.checked),"disabled"in t&&(n.disabled=t.disabled),"expanded"in t&&(n.expanded=t.expanded),"level"in t&&(n.level=t.level),"pressed"in t&&(n.pressed=t.pressed),"selected"in t&&(n.selected=t.selected),t.name!==void 0&&(n.name=t.name),t.props&&(n.props=Object.assign({},t.props)),t.containerMode&&(n.containerMode=t.containerMode),t.children&&(n.children=t.children.map(r=>this.deepClone(r))),n}}yamlEscapeKeyIfNeeded(t){return this.yamlStringNeedsQuotes(t)?"'"+t.replace(/'/g,"''")+"'":t}yamlEscapeValueIfNeeded(t){return this.yamlStringNeedsQuotes(t)?'"'+t.replace(/[\\"\x00-\x1f\x7f-\x9f]/g,n=>{switch(n){case"\\":return"\\\\";case'"':return'\\"';case"\b":return"\\b";case"\f":return"\\f";case`
20
- `:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return"\\x"+n.charCodeAt(0).toString(16).padStart(2,"0")}})+'"':t}yamlStringNeedsQuotes(t){return t?!!(t.length===0||/^\s|\s$/.test(t)||/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(t)||/^-/.test(t)||/[\n:](\s|$)/.test(t)||/\s#/.test(t)||/[\n\r]/.test(t)||/^[&*\],?!>|@"'#%]/.test(t)||/[{}`]/.test(t)||/^\[/.test(t)||!isNaN(Number(t))||["y","n","yes","no","true","false","on","off","null"].includes(t.toLowerCase())):!1}filterParentToChildren(t,n){let r=n.some(o=>JSON.stringify(o)===JSON.stringify(t));if(r||this.isLeafNode(t))return r?this.deepClone(t):null;if(t.kind==="role"&&t.children&&t.children.length>0){let o=t.children.map(u=>this.filterParentToChildren(u,n)).filter(u=>u!==null);if(o.length>0){let u=this.deepClone(t);return u.children=o,u}}return null}serializeAriaSnapshot(t,n=0){let r=[],o=(l,h,p)=>{if(typeof l=="string"){let m=this.yamlEscapeValueIfNeeded(l);m&&r.push(p+"- text: "+m);return}let b=l.role;if(l.name&&l.name.length<=900){let m=l.name;if(m){let w=m.startsWith("/")&&m.endsWith("/")?m:JSON.stringify(m);b+=" "+w}}l.checked==="mixed"&&(b+=" [checked=mixed]"),l.checked===!0&&(b+=" [checked]"),l.disabled&&(b+=" [disabled]"),l.expanded&&(b+=" [expanded]"),l.level&&(b+=` [level=${l.level}]`),l.pressed==="mixed"&&(b+=" [pressed=mixed]"),l.pressed===!0&&(b+=" [pressed]"),l.selected===!0&&(b+=" [selected]");let v=p+"- "+this.yamlEscapeKeyIfNeeded(b);l.props===void 0&&(l.props={}),l.children===void 0&&(l.children=[]);let y=!!Object.keys(l.props).length;if(!l.children.length&&!y)r.push(v);else if(l.children.length===1&&typeof l.children[0]=="string"&&!y){let m=l.children[0];m?r.push(v+": "+this.yamlEscapeValueIfNeeded(m)):r.push(v)}else{r.push(v+":");for(let[m,w]of Object.entries(l.props)||[])r.push(p+" - /"+m+": "+this.yamlEscapeValueIfNeeded(w));for(let m of l.children||[])o(m,l,p+" ")}},u=t;if(u.role==="fragment")for(let l of u.children||[])o(l,u,"");else o(u,null,"");return r.join(`
20
+ `:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return"\\x"+n.charCodeAt(0).toString(16).padStart(2,"0")}})+'"':t}yamlStringNeedsQuotes(t){return t?!!(t.length===0||/^\s|\s$/.test(t)||/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(t)||/^-/.test(t)||/[\n:](\s|$)/.test(t)||/\s#/.test(t)||/[\n\r]/.test(t)||/^[&*\],?!>|@"'#%]/.test(t)||/[{}`]/.test(t)||/^\[/.test(t)||!isNaN(Number(t))||["y","n","yes","no","true","false","on","off","null"].includes(t.toLowerCase())):!1}filterParentToChildren(t,n){let r=n.some(o=>JSON.stringify(o)===JSON.stringify(t));if(r||this.isLeafNode(t))return r?this.deepClone(t):null;if(t.kind==="role"&&t.children&&t.children.length>0){let o=t.children.map(u=>this.filterParentToChildren(u,n)).filter(u=>u!==null);if(o.length>0){let u=this.deepClone(t);return u.children=o,u}}return null}serializeAriaSnapshot(t,n=0){let r=[],o=(l,h,p)=>{if(typeof l=="string"){let y=this.yamlEscapeValueIfNeeded(l);y&&r.push(p+"- text: "+y);return}let b=l.role;if(l.name&&l.name.length<=900){let y=l.name;if(y){let w=y.startsWith("/")&&y.endsWith("/")?y:JSON.stringify(y);b+=" "+w}}l.checked==="mixed"&&(b+=" [checked=mixed]"),l.checked===!0&&(b+=" [checked]"),l.disabled&&(b+=" [disabled]"),l.expanded&&(b+=" [expanded]"),l.level&&(b+=` [level=${l.level}]`),l.pressed==="mixed"&&(b+=" [pressed=mixed]"),l.pressed===!0&&(b+=" [pressed]"),l.selected===!0&&(b+=" [selected]");let v=p+"- "+this.yamlEscapeKeyIfNeeded(b);l.props===void 0&&(l.props={}),l.children===void 0&&(l.children=[]);let m=!!Object.keys(l.props).length;if(!l.children.length&&!m)r.push(v);else if(l.children.length===1&&typeof l.children[0]=="string"&&!m){let y=l.children[0];y?r.push(v+": "+this.yamlEscapeValueIfNeeded(y)):r.push(v)}else{r.push(v+":");for(let[y,w]of Object.entries(l.props)||[])r.push(p+" - /"+y+": "+this.yamlEscapeValueIfNeeded(w));for(let y of l.children||[])o(y,l,p+" ")}},u=t;if(u.role==="fragment")for(let l of u.children||[])o(l,u,"");else o(u,null,"");return r.join(`
21
21
  `)}isSnapshotAvailable(t,n){if(n.has(t))return t}findMatchingElements(t,n){let r=new Map,o=t.trim().split(`
22
22
  `);return this.extractSubtrees(o).forEach(l=>{let h=l.map(p=>p.trim()).join(`
23
23
  `);for(let p of n){let b=h.trim();if(p.snapshot.split(`
24
- `).map(y=>y.trim()).join(`
25
- `)===b){r.set(h,p.element);break}}}),r}extractSubtrees(t){let n=[],r=this.getIndentSize(t);for(let o=0;o<t.length;o++){let u=t[o],l=this.getIndentLevel(u),h=[u];for(let p=o+1;p<t.length;p++){let b=t[p];if(this.getIndentLevel(b)>l)h.push(b);else break}n.push(h)}return n.sort((o,u)=>o.length-u.length),n}getIndentLevel(t){let n=t.match(/^(\s*)/);return n?n[1].length:0}getIndentSize(t){for(let n=1;n<t.length;n++){let r=this.getIndentLevel(t[n]);if(r>0)return r-this.getIndentLevel(t[n-1])}return 2}},ya=_s;var du=function(e){"use strict";let t=Symbol.for("yaml.alias"),n=Symbol.for("yaml.document"),r=Symbol.for("yaml.map"),o=Symbol.for("yaml.pair"),u=Symbol.for("yaml.scalar"),l=Symbol.for("yaml.seq"),h=Symbol.for("yaml.node.type"),p=a=>!!a&&typeof a=="object"&&a[h]===t,b=a=>!!a&&typeof a=="object"&&a[h]===n,v=a=>!!a&&typeof a=="object"&&a[h]===r,y=a=>!!a&&typeof a=="object"&&a[h]===o,m=a=>!!a&&typeof a=="object"&&a[h]===u,w=a=>!!a&&typeof a=="object"&&a[h]===l;function A(a){if(a&&typeof a=="object")switch(a[h]){case r:case l:return!0}return!1}function I(a){if(a&&typeof a=="object")switch(a[h]){case t:case r:case u:case l:return!0}return!1}let P=a=>(m(a)||A(a))&&!!a.anchor,B=Symbol("break visit"),q=Symbol("skip children"),H=Symbol("remove node");function ee(a,s){let i=le(s);b(a)?te(null,a.contents,i,Object.freeze([a]))===H&&(a.contents=null):te(null,a,i,Object.freeze([]))}function te(a,s,i,c){let f=D(a,s,i,c);if(I(f)||y(f))return re(a,c,f),te(a,f,i,c);if(typeof f!="symbol"){if(A(s)){c=Object.freeze(c.concat(s));for(let d=0;d<s.items.length;++d){let g=te(d,s.items[d],i,c);if(typeof g=="number")d=g-1;else{if(g===B)return B;g===H&&(s.items.splice(d,1),d-=1)}}}else if(y(s)){c=Object.freeze(c.concat(s));let d=te("key",s.key,i,c);if(d===B)return B;d===H&&(s.key=null);let g=te("value",s.value,i,c);if(g===B)return B;g===H&&(s.value=null)}}return f}async function Z(a,s){let i=le(s);b(a)?await se(null,a.contents,i,Object.freeze([a]))===H&&(a.contents=null):await se(null,a,i,Object.freeze([]))}async function se(a,s,i,c){let f=await D(a,s,i,c);if(I(f)||y(f))return re(a,c,f),se(a,f,i,c);if(typeof f!="symbol"){if(A(s)){c=Object.freeze(c.concat(s));for(let d=0;d<s.items.length;++d){let g=await se(d,s.items[d],i,c);if(typeof g=="number")d=g-1;else{if(g===B)return B;g===H&&(s.items.splice(d,1),d-=1)}}}else if(y(s)){c=Object.freeze(c.concat(s));let d=await se("key",s.key,i,c);if(d===B)return B;d===H&&(s.key=null);let g=await se("value",s.value,i,c);if(g===B)return B;g===H&&(s.value=null)}}return f}function le(a){return typeof a=="object"&&(a.Collection||a.Node||a.Value)?Object.assign({Alias:a.Node,Map:a.Node,Scalar:a.Node,Seq:a.Node},a.Value&&{Map:a.Value,Scalar:a.Value,Seq:a.Value},a.Collection&&{Map:a.Collection,Seq:a.Collection},a):a}function D(a,s,i,c){return typeof i=="function"?i(a,s,c):v(s)?i.Map?.(a,s,c):w(s)?i.Seq?.(a,s,c):y(s)?i.Pair?.(a,s,c):m(s)?i.Scalar?.(a,s,c):p(s)?i.Alias?.(a,s,c):void 0}function re(a,s,i){let c=s[s.length-1];if(A(c))c.items[a]=i;else if(y(c))a==="key"?c.key=i:c.value=i;else{if(!b(c)){let f=p(c)?"alias":"scalar";throw new Error(`Cannot replace node with ${f} parent`)}c.contents=i}}ee.BREAK=B,ee.SKIP=q,ee.REMOVE=H,Z.BREAK=B,Z.SKIP=q,Z.REMOVE=H;let Ee={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};class fe{constructor(s,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},fe.defaultYaml,s),this.tags=Object.assign({},fe.defaultTags,i)}clone(){let s=new fe(this.yaml,this.tags);return s.docStart=this.docStart,s}atDocument(){let s=new fe(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:fe.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},fe.defaultTags)}return s}add(s,i){this.atNextDocument&&(this.yaml={explicit:fe.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},fe.defaultTags),this.atNextDocument=!1);let c=s.trim().split(/[ \t]+/),f=c.shift();switch(f){case"%TAG":{if(c.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),c.length<2))return!1;let[d,g]=c;return this.tags[d]=g,!0}case"%YAML":{if(this.yaml.explicit=!0,c.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;let[d]=c;return d==="1.1"||d==="1.2"?(this.yaml.version=d,!0):(i(6,`Unsupported YAML version ${d}`,/^\d+\.\d+$/.test(d)),!1)}default:return i(0,`Unknown directive ${f}`,!0),!1}}tagName(s,i){if(s==="!")return"!";if(s[0]!=="!")return i(`Not a valid tag: ${s}`),null;if(s[1]==="<"){let g=s.slice(2,-1);return g==="!"||g==="!!"?(i(`Verbatim tags aren't resolved, so ${s} is invalid.`),null):(s[s.length-1]!==">"&&i("Verbatim tags must end with a >"),g)}let[,c,f]=s.match(/^(.*!)([^!]*)$/s);f||i(`The ${s} tag has no suffix`);let d=this.tags[c];if(d)try{return d+decodeURIComponent(f)}catch(g){return i(String(g)),null}return c==="!"?s:(i(`Could not resolve tag: ${s}`),null)}tagString(s){for(let[i,c]of Object.entries(this.tags))if(s.startsWith(c))return i+s.substring(c.length).replace(/[!,[\]{}]/g,f=>Ee[f]);return s[0]==="!"?s:`!<${s}>`}toString(s){let i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],c=Object.entries(this.tags),f;if(s&&c.length>0&&I(s.contents)){let d={};ee(s.contents,(g,S)=>{I(S)&&S.tag&&(d[S.tag]=!0)}),f=Object.keys(d)}else f=[];for(let[d,g]of c)d==="!!"&&g==="tag:yaml.org,2002:"||s&&!f.some(S=>S.startsWith(g))||i.push(`%TAG ${d} ${g}`);return i.join(`
26
- `)}}function rt(a){if(/[\x00-\x19\s,[\]{}]/.test(a)){let s=JSON.stringify(a);throw new Error(`Anchor must not contain whitespace or control characters: ${s}`)}return!0}function ze(a){let s=new Set;return ee(a,{Value(i,c){c.anchor&&s.add(c.anchor)}}),s}function ln(a,s){for(let i=1;;++i){let c=`${a}${i}`;if(!s.has(c))return c}}function He(a,s,i,c){if(c&&typeof c=="object")if(Array.isArray(c))for(let f=0,d=c.length;f<d;++f){let g=c[f],S=He(a,c,String(f),g);S===void 0?delete c[f]:S!==g&&(c[f]=S)}else if(c instanceof Map)for(let f of Array.from(c.keys())){let d=c.get(f),g=He(a,c,f,d);g===void 0?c.delete(f):g!==d&&c.set(f,g)}else if(c instanceof Set)for(let f of Array.from(c)){let d=He(a,c,f,f);d===void 0?c.delete(f):d!==f&&(c.delete(f),c.add(d))}else for(let[f,d]of Object.entries(c)){let g=He(a,c,f,d);g===void 0?delete c[f]:g!==d&&(c[f]=g)}return a.call(s,i,c)}function ye(a,s,i){if(Array.isArray(a))return a.map((c,f)=>ye(c,String(f),i));if(a&&typeof a.toJSON=="function"){if(!i||!P(a))return a.toJSON(s,i);let c={aliasCount:0,count:1,res:void 0};i.anchors.set(a,c),i.onCreate=d=>{c.res=d,delete i.onCreate};let f=a.toJSON(s,i);return i.onCreate&&i.onCreate(f),f}return typeof a!="bigint"||i?.keep?a:Number(a)}fe.defaultYaml={explicit:!1,version:"1.2"},fe.defaultTags={"!!":"tag:yaml.org,2002:"};class st{constructor(s){Object.defineProperty(this,h,{value:s})}clone(){let s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(s.range=this.range.slice()),s}toJS(s,{mapAsMap:i,maxAliasCount:c,onAnchor:f,reviver:d}={}){if(!b(s))throw new TypeError("A document argument is required");let g={anchors:new Map,doc:s,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof c=="number"?c:100},S=ye(this,"",g);if(typeof f=="function")for(let{count:k,res:x}of g.anchors.values())f(x,k);return typeof d=="function"?He(d,{"":S},"",S):S}}class U extends st{constructor(s){super(t),this.source=s,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(s,i){let c,f;i?.aliasResolveCache?c=i.aliasResolveCache:(c=[],ee(s,{Node:(d,g)=>{(p(g)||P(g))&&c.push(g)}}),i&&(i.aliasResolveCache=c));for(let d of c){if(d===this)break;d.anchor===this.source&&(f=d)}return f}toJSON(s,i){if(!i)return{source:this.source};let{anchors:c,doc:f,maxAliasCount:d}=i,g=this.resolve(f,i);if(!g){let k=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(k)}let S=c.get(g);if(S||(ye(g,null,i),S=c.get(g)),!S||S.res===void 0)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(d>=0&&(S.count+=1,S.aliasCount===0&&(S.aliasCount=z(f,g,c)),S.count*S.aliasCount>d))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return S.res}toString(s,i,c){let f=`*${this.source}`;if(s){if(rt(this.source),s.options.verifyAliasOrder&&!s.anchors.has(this.source)){let d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(d)}if(s.implicitKey)return`${f} `}return f}}function z(a,s,i){if(p(s)){let c=s.resolve(a),f=i&&c&&i.get(c);return f?f.count*f.aliasCount:0}if(A(s)){let c=0;for(let f of s.items){let d=z(a,f,i);d>c&&(c=d)}return c}if(y(s)){let c=z(a,s.key,i),f=z(a,s.value,i);return Math.max(c,f)}return 1}let be=a=>!a||typeof a!="function"&&typeof a!="object";class G extends st{constructor(s){super(u),this.value=s}toJSON(s,i){return i?.keep?this.value:ye(this.value,s,i)}toString(){return String(this.value)}}G.BLOCK_FOLDED="BLOCK_FOLDED",G.BLOCK_LITERAL="BLOCK_LITERAL",G.PLAIN="PLAIN",G.QUOTE_DOUBLE="QUOTE_DOUBLE",G.QUOTE_SINGLE="QUOTE_SINGLE";function Je(a,s,i){if(b(a)&&(a=a.contents),I(a))return a;if(y(a)){let _=i.schema[r].createNode?.(i.schema,null,i);return _.items.push(a),_}(a instanceof String||a instanceof Number||a instanceof Boolean||typeof BigInt<"u"&&a instanceof BigInt)&&(a=a.valueOf());let{aliasDuplicateObjects:c,onAnchor:f,onTagObj:d,schema:g,sourceObjects:S}=i,k;if(c&&a&&typeof a=="object"){if(k=S.get(a),k)return k.anchor||(k.anchor=f(a)),new U(k.anchor);k={anchor:null,node:null},S.set(a,k)}s?.startsWith("!!")&&(s="tag:yaml.org,2002:"+s.slice(2));let x=function(_,E,O){if(E){let $=O.filter(C=>C.tag===E),T=$.find(C=>!C.format)??$[0];if(!T)throw new Error(`Tag ${E} not found`);return T}return O.find($=>$.identify?.(_)&&!$.format)}(a,s,g.tags);if(!x){if(a&&typeof a.toJSON=="function"&&(a=a.toJSON()),!a||typeof a!="object"){let _=new G(a);return k&&(k.node=_),_}x=a instanceof Map?g[r]:Symbol.iterator in Object(a)?g[l]:g[r]}d&&(d(x),delete i.onTagObj);let N=x?.createNode?x.createNode(i.schema,a,i):typeof x?.nodeClass?.from=="function"?x.nodeClass.from(i.schema,a,i):new G(a);return s?N.tag=s:x.default||(N.tag=x.tag),k&&(k.node=N),N}function it(a,s,i){let c=i;for(let f=s.length-1;f>=0;--f){let d=s[f];if(typeof d=="number"&&Number.isInteger(d)&&d>=0){let g=[];g[d]=c,c=g}else c=new Map([[d,c]])}return Je(c,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:a,sourceObjects:new Map})}let $t=a=>a==null||typeof a=="object"&&!!a[Symbol.iterator]().next().done;class Os extends st{constructor(s,i){super(s),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(s){let i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return s&&(i.schema=s),i.items=i.items.map(c=>I(c)||y(c)?c.clone(s):c),this.range&&(i.range=this.range.slice()),i}addIn(s,i){if($t(s))this.add(i);else{let[c,...f]=s,d=this.get(c,!0);if(A(d))d.addIn(f,i);else{if(d!==void 0||!this.schema)throw new Error(`Expected YAML collection at ${c}. Remaining path: ${f}`);this.set(c,it(this.schema,f,i))}}}deleteIn(s){let[i,...c]=s;if(c.length===0)return this.delete(i);let f=this.get(i,!0);if(A(f))return f.deleteIn(c);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${c}`)}getIn(s,i){let[c,...f]=s,d=this.get(c,!0);return f.length===0?!i&&m(d)?d.value:d:A(d)?d.getIn(f,i):void 0}hasAllNullValues(s){return this.items.every(i=>{if(!y(i))return!1;let c=i.value;return c==null||s&&m(c)&&c.value==null&&!c.commentBefore&&!c.comment&&!c.tag})}hasIn(s){let[i,...c]=s;if(c.length===0)return this.has(i);let f=this.get(i,!0);return!!A(f)&&f.hasIn(c)}setIn(s,i){let[c,...f]=s;if(f.length===0)this.set(c,i);else{let d=this.get(c,!0);if(A(d))d.setIn(f,i);else{if(d!==void 0||!this.schema)throw new Error(`Expected YAML collection at ${c}. Remaining path: ${f}`);this.set(c,it(this.schema,f,i))}}}}let wa=a=>a.replace(/^(?!$)(?: $)?/gm,"#");function Re(a,s){return/^\n+$/.test(a)?a.substring(1):s?a.replace(/^(?! *$)/gm,s):a}let Ye=(a,s,i)=>a.endsWith(`
24
+ `).map(m=>m.trim()).join(`
25
+ `)===b){r.set(h,p.element);break}}}),r}extractSubtrees(t){let n=[],r=this.getIndentSize(t);for(let o=0;o<t.length;o++){let u=t[o],l=this.getIndentLevel(u),h=[u];for(let p=o+1;p<t.length;p++){let b=t[p];if(this.getIndentLevel(b)>l)h.push(b);else break}n.push(h)}return n.sort((o,u)=>o.length-u.length),n}getIndentLevel(t){let n=t.match(/^(\s*)/);return n?n[1].length:0}getIndentSize(t){for(let n=1;n<t.length;n++){let r=this.getIndentLevel(t[n]);if(r>0)return r-this.getIndentLevel(t[n-1])}return 2}},ya=_s;var du=function(e){"use strict";let t=Symbol.for("yaml.alias"),n=Symbol.for("yaml.document"),r=Symbol.for("yaml.map"),o=Symbol.for("yaml.pair"),u=Symbol.for("yaml.scalar"),l=Symbol.for("yaml.seq"),h=Symbol.for("yaml.node.type"),p=a=>!!a&&typeof a=="object"&&a[h]===t,b=a=>!!a&&typeof a=="object"&&a[h]===n,v=a=>!!a&&typeof a=="object"&&a[h]===r,m=a=>!!a&&typeof a=="object"&&a[h]===o,y=a=>!!a&&typeof a=="object"&&a[h]===u,w=a=>!!a&&typeof a=="object"&&a[h]===l;function A(a){if(a&&typeof a=="object")switch(a[h]){case r:case l:return!0}return!1}function I(a){if(a&&typeof a=="object")switch(a[h]){case t:case r:case u:case l:return!0}return!1}let P=a=>(y(a)||A(a))&&!!a.anchor,B=Symbol("break visit"),q=Symbol("skip children"),H=Symbol("remove node");function ee(a,s){let i=le(s);b(a)?te(null,a.contents,i,Object.freeze([a]))===H&&(a.contents=null):te(null,a,i,Object.freeze([]))}function te(a,s,i,c){let f=D(a,s,i,c);if(I(f)||m(f))return re(a,c,f),te(a,f,i,c);if(typeof f!="symbol"){if(A(s)){c=Object.freeze(c.concat(s));for(let d=0;d<s.items.length;++d){let g=te(d,s.items[d],i,c);if(typeof g=="number")d=g-1;else{if(g===B)return B;g===H&&(s.items.splice(d,1),d-=1)}}}else if(m(s)){c=Object.freeze(c.concat(s));let d=te("key",s.key,i,c);if(d===B)return B;d===H&&(s.key=null);let g=te("value",s.value,i,c);if(g===B)return B;g===H&&(s.value=null)}}return f}async function Z(a,s){let i=le(s);b(a)?await se(null,a.contents,i,Object.freeze([a]))===H&&(a.contents=null):await se(null,a,i,Object.freeze([]))}async function se(a,s,i,c){let f=await D(a,s,i,c);if(I(f)||m(f))return re(a,c,f),se(a,f,i,c);if(typeof f!="symbol"){if(A(s)){c=Object.freeze(c.concat(s));for(let d=0;d<s.items.length;++d){let g=await se(d,s.items[d],i,c);if(typeof g=="number")d=g-1;else{if(g===B)return B;g===H&&(s.items.splice(d,1),d-=1)}}}else if(m(s)){c=Object.freeze(c.concat(s));let d=await se("key",s.key,i,c);if(d===B)return B;d===H&&(s.key=null);let g=await se("value",s.value,i,c);if(g===B)return B;g===H&&(s.value=null)}}return f}function le(a){return typeof a=="object"&&(a.Collection||a.Node||a.Value)?Object.assign({Alias:a.Node,Map:a.Node,Scalar:a.Node,Seq:a.Node},a.Value&&{Map:a.Value,Scalar:a.Value,Seq:a.Value},a.Collection&&{Map:a.Collection,Seq:a.Collection},a):a}function D(a,s,i,c){return typeof i=="function"?i(a,s,c):v(s)?i.Map?.(a,s,c):w(s)?i.Seq?.(a,s,c):m(s)?i.Pair?.(a,s,c):y(s)?i.Scalar?.(a,s,c):p(s)?i.Alias?.(a,s,c):void 0}function re(a,s,i){let c=s[s.length-1];if(A(c))c.items[a]=i;else if(m(c))a==="key"?c.key=i:c.value=i;else{if(!b(c)){let f=p(c)?"alias":"scalar";throw new Error(`Cannot replace node with ${f} parent`)}c.contents=i}}ee.BREAK=B,ee.SKIP=q,ee.REMOVE=H,Z.BREAK=B,Z.SKIP=q,Z.REMOVE=H;let Ee={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};class fe{constructor(s,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},fe.defaultYaml,s),this.tags=Object.assign({},fe.defaultTags,i)}clone(){let s=new fe(this.yaml,this.tags);return s.docStart=this.docStart,s}atDocument(){let s=new fe(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:fe.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},fe.defaultTags)}return s}add(s,i){this.atNextDocument&&(this.yaml={explicit:fe.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},fe.defaultTags),this.atNextDocument=!1);let c=s.trim().split(/[ \t]+/),f=c.shift();switch(f){case"%TAG":{if(c.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),c.length<2))return!1;let[d,g]=c;return this.tags[d]=g,!0}case"%YAML":{if(this.yaml.explicit=!0,c.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;let[d]=c;return d==="1.1"||d==="1.2"?(this.yaml.version=d,!0):(i(6,`Unsupported YAML version ${d}`,/^\d+\.\d+$/.test(d)),!1)}default:return i(0,`Unknown directive ${f}`,!0),!1}}tagName(s,i){if(s==="!")return"!";if(s[0]!=="!")return i(`Not a valid tag: ${s}`),null;if(s[1]==="<"){let g=s.slice(2,-1);return g==="!"||g==="!!"?(i(`Verbatim tags aren't resolved, so ${s} is invalid.`),null):(s[s.length-1]!==">"&&i("Verbatim tags must end with a >"),g)}let[,c,f]=s.match(/^(.*!)([^!]*)$/s);f||i(`The ${s} tag has no suffix`);let d=this.tags[c];if(d)try{return d+decodeURIComponent(f)}catch(g){return i(String(g)),null}return c==="!"?s:(i(`Could not resolve tag: ${s}`),null)}tagString(s){for(let[i,c]of Object.entries(this.tags))if(s.startsWith(c))return i+s.substring(c.length).replace(/[!,[\]{}]/g,f=>Ee[f]);return s[0]==="!"?s:`!<${s}>`}toString(s){let i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],c=Object.entries(this.tags),f;if(s&&c.length>0&&I(s.contents)){let d={};ee(s.contents,(g,S)=>{I(S)&&S.tag&&(d[S.tag]=!0)}),f=Object.keys(d)}else f=[];for(let[d,g]of c)d==="!!"&&g==="tag:yaml.org,2002:"||s&&!f.some(S=>S.startsWith(g))||i.push(`%TAG ${d} ${g}`);return i.join(`
26
+ `)}}function rt(a){if(/[\x00-\x19\s,[\]{}]/.test(a)){let s=JSON.stringify(a);throw new Error(`Anchor must not contain whitespace or control characters: ${s}`)}return!0}function ze(a){let s=new Set;return ee(a,{Value(i,c){c.anchor&&s.add(c.anchor)}}),s}function ln(a,s){for(let i=1;;++i){let c=`${a}${i}`;if(!s.has(c))return c}}function He(a,s,i,c){if(c&&typeof c=="object")if(Array.isArray(c))for(let f=0,d=c.length;f<d;++f){let g=c[f],S=He(a,c,String(f),g);S===void 0?delete c[f]:S!==g&&(c[f]=S)}else if(c instanceof Map)for(let f of Array.from(c.keys())){let d=c.get(f),g=He(a,c,f,d);g===void 0?c.delete(f):g!==d&&c.set(f,g)}else if(c instanceof Set)for(let f of Array.from(c)){let d=He(a,c,f,f);d===void 0?c.delete(f):d!==f&&(c.delete(f),c.add(d))}else for(let[f,d]of Object.entries(c)){let g=He(a,c,f,d);g===void 0?delete c[f]:g!==d&&(c[f]=g)}return a.call(s,i,c)}function ye(a,s,i){if(Array.isArray(a))return a.map((c,f)=>ye(c,String(f),i));if(a&&typeof a.toJSON=="function"){if(!i||!P(a))return a.toJSON(s,i);let c={aliasCount:0,count:1,res:void 0};i.anchors.set(a,c),i.onCreate=d=>{c.res=d,delete i.onCreate};let f=a.toJSON(s,i);return i.onCreate&&i.onCreate(f),f}return typeof a!="bigint"||i?.keep?a:Number(a)}fe.defaultYaml={explicit:!1,version:"1.2"},fe.defaultTags={"!!":"tag:yaml.org,2002:"};class st{constructor(s){Object.defineProperty(this,h,{value:s})}clone(){let s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(s.range=this.range.slice()),s}toJS(s,{mapAsMap:i,maxAliasCount:c,onAnchor:f,reviver:d}={}){if(!b(s))throw new TypeError("A document argument is required");let g={anchors:new Map,doc:s,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof c=="number"?c:100},S=ye(this,"",g);if(typeof f=="function")for(let{count:k,res:x}of g.anchors.values())f(x,k);return typeof d=="function"?He(d,{"":S},"",S):S}}class U extends st{constructor(s){super(t),this.source=s,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(s,i){let c,f;i?.aliasResolveCache?c=i.aliasResolveCache:(c=[],ee(s,{Node:(d,g)=>{(p(g)||P(g))&&c.push(g)}}),i&&(i.aliasResolveCache=c));for(let d of c){if(d===this)break;d.anchor===this.source&&(f=d)}return f}toJSON(s,i){if(!i)return{source:this.source};let{anchors:c,doc:f,maxAliasCount:d}=i,g=this.resolve(f,i);if(!g){let k=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(k)}let S=c.get(g);if(S||(ye(g,null,i),S=c.get(g)),!S||S.res===void 0)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(d>=0&&(S.count+=1,S.aliasCount===0&&(S.aliasCount=z(f,g,c)),S.count*S.aliasCount>d))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return S.res}toString(s,i,c){let f=`*${this.source}`;if(s){if(rt(this.source),s.options.verifyAliasOrder&&!s.anchors.has(this.source)){let d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(d)}if(s.implicitKey)return`${f} `}return f}}function z(a,s,i){if(p(s)){let c=s.resolve(a),f=i&&c&&i.get(c);return f?f.count*f.aliasCount:0}if(A(s)){let c=0;for(let f of s.items){let d=z(a,f,i);d>c&&(c=d)}return c}if(m(s)){let c=z(a,s.key,i),f=z(a,s.value,i);return Math.max(c,f)}return 1}let be=a=>!a||typeof a!="function"&&typeof a!="object";class G extends st{constructor(s){super(u),this.value=s}toJSON(s,i){return i?.keep?this.value:ye(this.value,s,i)}toString(){return String(this.value)}}G.BLOCK_FOLDED="BLOCK_FOLDED",G.BLOCK_LITERAL="BLOCK_LITERAL",G.PLAIN="PLAIN",G.QUOTE_DOUBLE="QUOTE_DOUBLE",G.QUOTE_SINGLE="QUOTE_SINGLE";function Je(a,s,i){if(b(a)&&(a=a.contents),I(a))return a;if(m(a)){let _=i.schema[r].createNode?.(i.schema,null,i);return _.items.push(a),_}(a instanceof String||a instanceof Number||a instanceof Boolean||typeof BigInt<"u"&&a instanceof BigInt)&&(a=a.valueOf());let{aliasDuplicateObjects:c,onAnchor:f,onTagObj:d,schema:g,sourceObjects:S}=i,k;if(c&&a&&typeof a=="object"){if(k=S.get(a),k)return k.anchor||(k.anchor=f(a)),new U(k.anchor);k={anchor:null,node:null},S.set(a,k)}s?.startsWith("!!")&&(s="tag:yaml.org,2002:"+s.slice(2));let x=function(_,E,O){if(E){let $=O.filter(C=>C.tag===E),T=$.find(C=>!C.format)??$[0];if(!T)throw new Error(`Tag ${E} not found`);return T}return O.find($=>$.identify?.(_)&&!$.format)}(a,s,g.tags);if(!x){if(a&&typeof a.toJSON=="function"&&(a=a.toJSON()),!a||typeof a!="object"){let _=new G(a);return k&&(k.node=_),_}x=a instanceof Map?g[r]:Symbol.iterator in Object(a)?g[l]:g[r]}d&&(d(x),delete i.onTagObj);let N=x?.createNode?x.createNode(i.schema,a,i):typeof x?.nodeClass?.from=="function"?x.nodeClass.from(i.schema,a,i):new G(a);return s?N.tag=s:x.default||(N.tag=x.tag),k&&(k.node=N),N}function it(a,s,i){let c=i;for(let f=s.length-1;f>=0;--f){let d=s[f];if(typeof d=="number"&&Number.isInteger(d)&&d>=0){let g=[];g[d]=c,c=g}else c=new Map([[d,c]])}return Je(c,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:a,sourceObjects:new Map})}let $t=a=>a==null||typeof a=="object"&&!!a[Symbol.iterator]().next().done;class Os extends st{constructor(s,i){super(s),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(s){let i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return s&&(i.schema=s),i.items=i.items.map(c=>I(c)||m(c)?c.clone(s):c),this.range&&(i.range=this.range.slice()),i}addIn(s,i){if($t(s))this.add(i);else{let[c,...f]=s,d=this.get(c,!0);if(A(d))d.addIn(f,i);else{if(d!==void 0||!this.schema)throw new Error(`Expected YAML collection at ${c}. Remaining path: ${f}`);this.set(c,it(this.schema,f,i))}}}deleteIn(s){let[i,...c]=s;if(c.length===0)return this.delete(i);let f=this.get(i,!0);if(A(f))return f.deleteIn(c);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${c}`)}getIn(s,i){let[c,...f]=s,d=this.get(c,!0);return f.length===0?!i&&y(d)?d.value:d:A(d)?d.getIn(f,i):void 0}hasAllNullValues(s){return this.items.every(i=>{if(!m(i))return!1;let c=i.value;return c==null||s&&y(c)&&c.value==null&&!c.commentBefore&&!c.comment&&!c.tag})}hasIn(s){let[i,...c]=s;if(c.length===0)return this.has(i);let f=this.get(i,!0);return!!A(f)&&f.hasIn(c)}setIn(s,i){let[c,...f]=s;if(f.length===0)this.set(c,i);else{let d=this.get(c,!0);if(A(d))d.setIn(f,i);else{if(d!==void 0||!this.schema)throw new Error(`Expected YAML collection at ${c}. Remaining path: ${f}`);this.set(c,it(this.schema,f,i))}}}}let wa=a=>a.replace(/^(?!$)(?: $)?/gm,"#");function Re(a,s){return/^\n+$/.test(a)?a.substring(1):s?a.replace(/^(?! *$)/gm,s):a}let Ye=(a,s,i)=>a.endsWith(`
27
27
  `)?Re(i,s):i.includes(`
28
28
  `)?`
29
29
  `+Re(i,s):(a.endsWith(" ")?"":" ")+i,$s="flow",tr="block",un="quoted";function hn(a,s,i="flow",{indentAtStart:c,lineWidth:f=80,minContentWidth:d=20,onFold:g,onOverflow:S}={}){if(!f||f<0)return a;f<d&&(d=0);let k=Math.max(1+d,1+f-s.length);if(a.length<=k)return a;let x=[],N={},_,E,O=f-s.length;typeof c=="number"&&(c>f-Math.max(2,d)?x.push(0):O=f-c);let $=!1,T=-1,C=-1,L=-1;i===tr&&(T=Ms(a,T,s.length),T!==-1&&(O=T+k));for(let R;R=a[T+=1];){if(i===un&&R==="\\"){switch(C=T,a[T+1]){case"x":T+=3;break;case"u":T+=5;break;case"U":T+=9;break;default:T+=1}L=T}if(R===`
@@ -54,9 +54,9 @@ ${x}${M}${i=i.replace(/\n+/g,`$&${x}`)}${O}`}function Pt(a,s,i,c){let{implicitKe
54
54
  `)||K&&/[[\]{},]/.test(C))return ot(C,E);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(C))return M||K||!C.includes(`
55
55
  `)?ot(C,E):pn(_,E,O,$);if(!M&&!K&&T!==G.PLAIN&&C.includes(`
56
56
  `))return pn(_,E,O,$);if(dn(C)){if(R==="")return E.forceBlockIndent=!0,pn(_,E,O,$);if(M&&R===F)return ot(C,E)}let V=C.replace(/\n+/g,`$&
57
- ${R}`);if(L){let j=Y=>Y.default&&Y.tag!=="tag:yaml.org,2002:str"&&Y.test?.test(V),{compat:W,tags:J}=E.doc.schema;if(J.some(j)||W?.some(j))return ot(C,E)}return M?V:hn(V,R,$s,fn(E,!1))}(g,s,i,c);default:return null}},x=k(S);if(x===null){let{defaultKeyType:N,defaultStringType:_}=s.options,E=f&&N||_;if(x=k(E),x===null)throw new Error(`Unsupported default string type ${E}`)}return x}function Ps(a,s){let i=Object.assign({blockQuote:!0,commentString:wa,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},a.schema.toStringOptions,s),c;switch(i.collectionStyle){case"block":c=!1;break;case"flow":c=!0;break;default:c=null}return{anchors:new Set,doc:a,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):" ",inFlow:c,options:i}}function at(a,s,i,c){if(y(a))return a.toString(s,i,c);if(p(a)){if(s.doc.directives)return a.toString(s);if(s.resolvedAliases?.has(a))throw new TypeError("Cannot stringify circular structure without alias nodes");s.resolvedAliases?s.resolvedAliases.add(a):s.resolvedAliases=new Set([a]),a=a.resolve(s.doc)}let f,d=I(a)?a:s.doc.createNode(a,{onTagObj:k=>f=k});f||(f=function(k,x){if(x.tag){let E=k.filter(O=>O.tag===x.tag);if(E.length>0)return E.find(O=>O.format===x.format)??E[0]}let N,_;if(m(x)){_=x.value;let E=k.filter(O=>O.identify?.(_));if(E.length>1){let O=E.filter($=>$.test);O.length>0&&(E=O)}N=E.find(O=>O.format===x.format)??E.find(O=>!O.format)}else _=x,N=k.find(E=>E.nodeClass&&_ instanceof E.nodeClass);if(!N)throw new Error(`Tag not resolved for ${_?.constructor?.name??(_===null?"null":typeof _)} value`);return N}(s.doc.schema.tags,d));let g=function(k,x,{anchors:N,doc:_}){if(!_.directives)return"";let E=[],O=(m(k)||A(k))&&k.anchor;O&&rt(O)&&(N.add(O),E.push(`&${O}`));let $=k.tag?k.tag:x.default?null:x.tag;return $&&E.push(_.directives.tagString($)),E.join(" ")}(d,f,s);g.length>0&&(s.indentAtStart=(s.indentAtStart??0)+g.length+1);let S=typeof f.stringify=="function"?f.stringify(d,s,i,c):m(d)?Pt(d,s,i,c):d.toString(s,i,c);return g?m(d)||S[0]==="{"||S[0]==="["?`${g} ${S}`:`${g}
58
- ${s.indent}${S}`:S}function Rs(a,s){a!=="debug"&&a!=="warn"||console.warn(s)}let gn="<<",qe={identify:a=>a===gn||typeof a=="symbol"&&a.description===gn,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new G(Symbol(gn)),{addToJSMap:qs}),stringify:()=>gn};function qs(a,s,i){if(i=a&&p(i)?i.resolve(a.doc):i,w(i))for(let c of i.items)sr(a,s,c);else if(Array.isArray(i))for(let c of i)sr(a,s,c);else sr(a,s,i)}function sr(a,s,i){let c=a&&p(i)?i.resolve(a.doc):i;if(!v(c))throw new Error("Merge sources must be maps or map aliases");let f=c.toJSON(null,a,Map);for(let[d,g]of f)s instanceof Map?s.has(d)||s.set(d,g):s instanceof Set?s.add(d):Object.prototype.hasOwnProperty.call(s,d)||Object.defineProperty(s,d,{value:g,writable:!0,enumerable:!0,configurable:!0});return s}function Ds(a,s,{key:i,value:c}){if(I(i)&&i.addToJSMap)i.addToJSMap(a,s,c);else if(((f,d)=>(qe.identify(d)||m(d)&&(!d.type||d.type===G.PLAIN)&&qe.identify(d.value))&&f?.doc.schema.tags.some(g=>g.tag===qe.tag&&g.default))(a,i))qs(a,s,c);else{let f=ye(i,"",a);if(s instanceof Map)s.set(f,ye(c,f,a));else if(s instanceof Set)s.add(f);else{let d=function(S,k,x){if(k===null)return"";if(typeof k!="object")return String(k);if(I(S)&&x?.doc){let N=Ps(x.doc,{});N.anchors=new Set;for(let E of x.anchors.keys())N.anchors.add(E.anchor);N.inFlow=!0,N.inStringifyKey=!0;let _=S.toString(N);if(!x.mapKeyWarned){let E=JSON.stringify(_);E.length>40&&(E=E.substring(0,36)+'..."'),Rs(x.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${E}. Set mapAsMap: true to use object keys.`),x.mapKeyWarned=!0}return _}return JSON.stringify(k)}(i,f,a),g=ye(c,d,a);d in s?Object.defineProperty(s,d,{value:g,writable:!0,enumerable:!0,configurable:!0}):s[d]=g}}return s}function ir(a,s,i){let c=Je(a,void 0,i),f=Je(s,void 0,i);return new ve(c,f)}class ve{constructor(s,i=null){Object.defineProperty(this,h,{value:o}),this.key=s,this.value=i}clone(s){let{key:i,value:c}=this;return I(i)&&(i=i.clone(s)),I(c)&&(c=c.clone(s)),new ve(i,c)}toJSON(s,i){return Ds(i,i?.mapAsMap?new Map:{},this)}toString(s,i,c){return s?.doc?function({key:f,value:d},g,S,k){let{allNullValues:x,doc:N,indent:_,indentStep:E,options:{commentString:O,indentSeq:$,simpleKeys:T}}=g,C=I(f)&&f.comment||null;if(T){if(C)throw new Error("With simple keys, key nodes cannot have comments");if(A(f)||!I(f)&&typeof f=="object")throw new Error("With simple keys, collection cannot be used as a key value")}let L=!T&&(!f||C&&d==null&&!g.inFlow||A(f)||(m(f)?f.type===G.BLOCK_FOLDED||f.type===G.BLOCK_LITERAL:typeof f=="object"));g=Object.assign({},g,{allNullValues:!1,implicitKey:!L&&(T||!x),indent:_+E});let M,R,F,K=!1,V=!1,j=at(f,g,()=>K=!0,()=>V=!0);if(!L&&!g.inFlow&&j.length>1024){if(T)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");L=!0}if(g.inFlow){if(x||d==null)return K&&S&&S(),j===""?"?":L?`? ${j}`:j}else if(x&&!T||d==null&&L)return j=`? ${j}`,C&&!K?j+=Ye(j,g.indent,O(C)):V&&k&&k(),j;K&&(C=null),L?(C&&(j+=Ye(j,g.indent,O(C))),j=`? ${j}
59
- ${_}:`):(j=`${j}:`,C&&(j+=Ye(j,g.indent,O(C)))),I(d)?(M=!!d.spaceBefore,R=d.commentBefore,F=d.comment):(M=!1,R=null,F=null,d&&typeof d=="object"&&(d=N.createNode(d))),g.implicitKey=!1,L||C||!m(d)||(g.indentAtStart=j.length+1),V=!1,$||!(E.length>=2)||g.inFlow||L||!w(d)||d.flow||d.tag||d.anchor||(g.indent=g.indent.substring(2));let W=!1,J=at(d,g,()=>W=!0,()=>V=!0),Y=" ";if(C||M||R)Y=M?`
57
+ ${R}`);if(L){let j=Y=>Y.default&&Y.tag!=="tag:yaml.org,2002:str"&&Y.test?.test(V),{compat:W,tags:J}=E.doc.schema;if(J.some(j)||W?.some(j))return ot(C,E)}return M?V:hn(V,R,$s,fn(E,!1))}(g,s,i,c);default:return null}},x=k(S);if(x===null){let{defaultKeyType:N,defaultStringType:_}=s.options,E=f&&N||_;if(x=k(E),x===null)throw new Error(`Unsupported default string type ${E}`)}return x}function Ps(a,s){let i=Object.assign({blockQuote:!0,commentString:wa,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},a.schema.toStringOptions,s),c;switch(i.collectionStyle){case"block":c=!1;break;case"flow":c=!0;break;default:c=null}return{anchors:new Set,doc:a,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):" ",inFlow:c,options:i}}function at(a,s,i,c){if(m(a))return a.toString(s,i,c);if(p(a)){if(s.doc.directives)return a.toString(s);if(s.resolvedAliases?.has(a))throw new TypeError("Cannot stringify circular structure without alias nodes");s.resolvedAliases?s.resolvedAliases.add(a):s.resolvedAliases=new Set([a]),a=a.resolve(s.doc)}let f,d=I(a)?a:s.doc.createNode(a,{onTagObj:k=>f=k});f||(f=function(k,x){if(x.tag){let E=k.filter(O=>O.tag===x.tag);if(E.length>0)return E.find(O=>O.format===x.format)??E[0]}let N,_;if(y(x)){_=x.value;let E=k.filter(O=>O.identify?.(_));if(E.length>1){let O=E.filter($=>$.test);O.length>0&&(E=O)}N=E.find(O=>O.format===x.format)??E.find(O=>!O.format)}else _=x,N=k.find(E=>E.nodeClass&&_ instanceof E.nodeClass);if(!N)throw new Error(`Tag not resolved for ${_?.constructor?.name??(_===null?"null":typeof _)} value`);return N}(s.doc.schema.tags,d));let g=function(k,x,{anchors:N,doc:_}){if(!_.directives)return"";let E=[],O=(y(k)||A(k))&&k.anchor;O&&rt(O)&&(N.add(O),E.push(`&${O}`));let $=k.tag?k.tag:x.default?null:x.tag;return $&&E.push(_.directives.tagString($)),E.join(" ")}(d,f,s);g.length>0&&(s.indentAtStart=(s.indentAtStart??0)+g.length+1);let S=typeof f.stringify=="function"?f.stringify(d,s,i,c):y(d)?Pt(d,s,i,c):d.toString(s,i,c);return g?y(d)||S[0]==="{"||S[0]==="["?`${g} ${S}`:`${g}
58
+ ${s.indent}${S}`:S}function Rs(a,s){a!=="debug"&&a!=="warn"||console.warn(s)}let gn="<<",qe={identify:a=>a===gn||typeof a=="symbol"&&a.description===gn,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new G(Symbol(gn)),{addToJSMap:qs}),stringify:()=>gn};function qs(a,s,i){if(i=a&&p(i)?i.resolve(a.doc):i,w(i))for(let c of i.items)sr(a,s,c);else if(Array.isArray(i))for(let c of i)sr(a,s,c);else sr(a,s,i)}function sr(a,s,i){let c=a&&p(i)?i.resolve(a.doc):i;if(!v(c))throw new Error("Merge sources must be maps or map aliases");let f=c.toJSON(null,a,Map);for(let[d,g]of f)s instanceof Map?s.has(d)||s.set(d,g):s instanceof Set?s.add(d):Object.prototype.hasOwnProperty.call(s,d)||Object.defineProperty(s,d,{value:g,writable:!0,enumerable:!0,configurable:!0});return s}function Ds(a,s,{key:i,value:c}){if(I(i)&&i.addToJSMap)i.addToJSMap(a,s,c);else if(((f,d)=>(qe.identify(d)||y(d)&&(!d.type||d.type===G.PLAIN)&&qe.identify(d.value))&&f?.doc.schema.tags.some(g=>g.tag===qe.tag&&g.default))(a,i))qs(a,s,c);else{let f=ye(i,"",a);if(s instanceof Map)s.set(f,ye(c,f,a));else if(s instanceof Set)s.add(f);else{let d=function(S,k,x){if(k===null)return"";if(typeof k!="object")return String(k);if(I(S)&&x?.doc){let N=Ps(x.doc,{});N.anchors=new Set;for(let E of x.anchors.keys())N.anchors.add(E.anchor);N.inFlow=!0,N.inStringifyKey=!0;let _=S.toString(N);if(!x.mapKeyWarned){let E=JSON.stringify(_);E.length>40&&(E=E.substring(0,36)+'..."'),Rs(x.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${E}. Set mapAsMap: true to use object keys.`),x.mapKeyWarned=!0}return _}return JSON.stringify(k)}(i,f,a),g=ye(c,d,a);d in s?Object.defineProperty(s,d,{value:g,writable:!0,enumerable:!0,configurable:!0}):s[d]=g}}return s}function ir(a,s,i){let c=Je(a,void 0,i),f=Je(s,void 0,i);return new ve(c,f)}class ve{constructor(s,i=null){Object.defineProperty(this,h,{value:o}),this.key=s,this.value=i}clone(s){let{key:i,value:c}=this;return I(i)&&(i=i.clone(s)),I(c)&&(c=c.clone(s)),new ve(i,c)}toJSON(s,i){return Ds(i,i?.mapAsMap?new Map:{},this)}toString(s,i,c){return s?.doc?function({key:f,value:d},g,S,k){let{allNullValues:x,doc:N,indent:_,indentStep:E,options:{commentString:O,indentSeq:$,simpleKeys:T}}=g,C=I(f)&&f.comment||null;if(T){if(C)throw new Error("With simple keys, key nodes cannot have comments");if(A(f)||!I(f)&&typeof f=="object")throw new Error("With simple keys, collection cannot be used as a key value")}let L=!T&&(!f||C&&d==null&&!g.inFlow||A(f)||(y(f)?f.type===G.BLOCK_FOLDED||f.type===G.BLOCK_LITERAL:typeof f=="object"));g=Object.assign({},g,{allNullValues:!1,implicitKey:!L&&(T||!x),indent:_+E});let M,R,F,K=!1,V=!1,j=at(f,g,()=>K=!0,()=>V=!0);if(!L&&!g.inFlow&&j.length>1024){if(T)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");L=!0}if(g.inFlow){if(x||d==null)return K&&S&&S(),j===""?"?":L?`? ${j}`:j}else if(x&&!T||d==null&&L)return j=`? ${j}`,C&&!K?j+=Ye(j,g.indent,O(C)):V&&k&&k(),j;K&&(C=null),L?(C&&(j+=Ye(j,g.indent,O(C))),j=`? ${j}
59
+ ${_}:`):(j=`${j}:`,C&&(j+=Ye(j,g.indent,O(C)))),I(d)?(M=!!d.spaceBefore,R=d.commentBefore,F=d.comment):(M=!1,R=null,F=null,d&&typeof d=="object"&&(d=N.createNode(d))),g.implicitKey=!1,L||C||!y(d)||(g.indentAtStart=j.length+1),V=!1,$||!(E.length>=2)||g.inFlow||L||!w(d)||d.flow||d.tag||d.anchor||(g.indent=g.indent.substring(2));let W=!1,J=at(d,g,()=>W=!0,()=>V=!0),Y=" ";if(C||M||R)Y=M?`
60
60
  `:"",R&&(Y+=`
61
61
  ${Re(O(R),g.indent)}`),J!==""||g.inFlow?Y+=`
62
62
  ${g.indent}`:Y===`
@@ -65,17 +65,17 @@ ${g.indent}`:Y===`
65
65
  `);else if(!L&&A(d)){let ne=J[0],Q=J.indexOf(`
66
66
  `),X=Q!==-1,xe=g.inFlow??d.flow??d.items.length===0;if(X||!xe){let ie=!1;if(X&&(ne==="&"||ne==="!")){let oe=J.indexOf(" ");ne==="&"&&oe!==-1&&oe<Q&&J[oe+1]==="!"&&(oe=J.indexOf(" ",oe+1)),(oe===-1||Q<oe)&&(ie=!0)}ie||(Y=`
67
67
  ${g.indent}`)}}else J!==""&&J[0]!==`
68
- `||(Y="");return j+=Y+J,g.inFlow?W&&S&&S():F&&!W?j+=Ye(j,g.indent,O(F)):V&&k&&k(),j}(this,s,i,c):JSON.stringify(this)}}function Us(a,s,i){return(s.inFlow??a.flow?Sa:Ea)(a,s,i)}function Ea({comment:a,items:s},i,{blockItemPrefix:c,flowChars:f,itemIndent:d,onChompKeep:g,onComment:S}){let{indent:k,options:{commentString:x}}=i,N=Object.assign({},i,{indent:d,type:null}),_=!1,E=[];for(let $=0;$<s.length;++$){let T=s[$],C=null;if(I(T))!_&&T.spaceBefore&&E.push(""),mn(i,E,T.commentBefore,_),T.comment&&(C=T.comment);else if(y(T)){let M=I(T.key)?T.key:null;M&&(!_&&M.spaceBefore&&E.push(""),mn(i,E,M.commentBefore,_))}_=!1;let L=at(T,N,()=>C=null,()=>_=!0);C&&(L+=Ye(L,d,x(C))),_&&C&&(_=!1),E.push(c+L)}let O;if(E.length===0)O=f.start+f.end;else{O=E[0];for(let $=1;$<E.length;++$){let T=E[$];O+=T?`
68
+ `||(Y="");return j+=Y+J,g.inFlow?W&&S&&S():F&&!W?j+=Ye(j,g.indent,O(F)):V&&k&&k(),j}(this,s,i,c):JSON.stringify(this)}}function Us(a,s,i){return(s.inFlow??a.flow?Sa:Ea)(a,s,i)}function Ea({comment:a,items:s},i,{blockItemPrefix:c,flowChars:f,itemIndent:d,onChompKeep:g,onComment:S}){let{indent:k,options:{commentString:x}}=i,N=Object.assign({},i,{indent:d,type:null}),_=!1,E=[];for(let $=0;$<s.length;++$){let T=s[$],C=null;if(I(T))!_&&T.spaceBefore&&E.push(""),mn(i,E,T.commentBefore,_),T.comment&&(C=T.comment);else if(m(T)){let M=I(T.key)?T.key:null;M&&(!_&&M.spaceBefore&&E.push(""),mn(i,E,M.commentBefore,_))}_=!1;let L=at(T,N,()=>C=null,()=>_=!0);C&&(L+=Ye(L,d,x(C))),_&&C&&(_=!1),E.push(c+L)}let O;if(E.length===0)O=f.start+f.end;else{O=E[0];for(let $=1;$<E.length;++$){let T=E[$];O+=T?`
69
69
  ${k}${T}`:`
70
70
  `}}return a?(O+=`
71
- `+Re(x(a),k),S&&S()):_&&g&&g(),O}function Sa({items:a},s,{flowChars:i,itemIndent:c}){let{indent:f,indentStep:d,flowCollectionPadding:g,options:{commentString:S}}=s;c+=d;let k=Object.assign({},s,{indent:c,inFlow:!0,type:null}),x=!1,N=0,_=[];for(let $=0;$<a.length;++$){let T=a[$],C=null;if(I(T))T.spaceBefore&&_.push(""),mn(s,_,T.commentBefore,!1),T.comment&&(C=T.comment);else if(y(T)){let M=I(T.key)?T.key:null;M&&(M.spaceBefore&&_.push(""),mn(s,_,M.commentBefore,!1),M.comment&&(x=!0));let R=I(T.value)?T.value:null;R?(R.comment&&(C=R.comment),R.commentBefore&&(x=!0)):T.value==null&&M?.comment&&(C=M.comment)}C&&(x=!0);let L=at(T,k,()=>C=null);$<a.length-1&&(L+=","),C&&(L+=Ye(L,c,S(C))),!x&&(_.length>N||L.includes(`
71
+ `+Re(x(a),k),S&&S()):_&&g&&g(),O}function Sa({items:a},s,{flowChars:i,itemIndent:c}){let{indent:f,indentStep:d,flowCollectionPadding:g,options:{commentString:S}}=s;c+=d;let k=Object.assign({},s,{indent:c,inFlow:!0,type:null}),x=!1,N=0,_=[];for(let $=0;$<a.length;++$){let T=a[$],C=null;if(I(T))T.spaceBefore&&_.push(""),mn(s,_,T.commentBefore,!1),T.comment&&(C=T.comment);else if(m(T)){let M=I(T.key)?T.key:null;M&&(M.spaceBefore&&_.push(""),mn(s,_,M.commentBefore,!1),M.comment&&(x=!0));let R=I(T.value)?T.value:null;R?(R.comment&&(C=R.comment),R.commentBefore&&(x=!0)):T.value==null&&M?.comment&&(C=M.comment)}C&&(x=!0);let L=at(T,k,()=>C=null);$<a.length-1&&(L+=","),C&&(L+=Ye(L,c,S(C))),!x&&(_.length>N||L.includes(`
72
72
  `))&&(x=!0),_.push(L),N=_.length}let{start:E,end:O}=i;if(_.length===0)return E+O;if(!x){let $=_.reduce((T,C)=>T+C.length+2,2);x=s.options.lineWidth>0&&$>s.options.lineWidth}if(x){let $=E;for(let T of _)$+=T?`
73
73
  ${d}${f}${T}`:`
74
74
  `;return`${$}
75
- ${f}${O}`}return`${E}${g}${_.join(" ")}${g}${O}`}function mn({indent:a,options:{commentString:s}},i,c,f){if(c&&f&&(c=c.replace(/^\n+/,"")),c){let d=Re(s(c),a);i.push(d.trimStart())}}function Qe(a,s){let i=m(s)?s.value:s;for(let c of a)if(y(c)&&(c.key===s||c.key===i||m(c.key)&&c.key.value===i))return c}class _e extends Os{static get tagName(){return"tag:yaml.org,2002:map"}constructor(s){super(r,s),this.items=[]}static from(s,i,c){let{keepUndefined:f,replacer:d}=c,g=new this(s),S=(k,x)=>{if(typeof d=="function")x=d.call(i,k,x);else if(Array.isArray(d)&&!d.includes(k))return;(x!==void 0||f)&&g.items.push(ir(k,x,c))};if(i instanceof Map)for(let[k,x]of i)S(k,x);else if(i&&typeof i=="object")for(let k of Object.keys(i))S(k,i[k]);return typeof s.sortMapEntries=="function"&&g.items.sort(s.sortMapEntries),g}add(s,i){let c;c=y(s)?s:s&&typeof s=="object"&&"key"in s?new ve(s.key,s.value):new ve(s,s?.value);let f=Qe(this.items,c.key),d=this.schema?.sortMapEntries;if(f){if(!i)throw new Error(`Key ${c.key} already set`);m(f.value)&&be(c.value)?f.value.value=c.value:f.value=c.value}else if(d){let g=this.items.findIndex(S=>d(c,S)<0);g===-1?this.items.push(c):this.items.splice(g,0,c)}else this.items.push(c)}delete(s){let i=Qe(this.items,s);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(s,i){let c=Qe(this.items,s),f=c?.value;return(!i&&m(f)?f.value:f)??void 0}has(s){return!!Qe(this.items,s)}set(s,i){this.add(new ve(s,i),!0)}toJSON(s,i,c){let f=c?new c:i?.mapAsMap?new Map:{};i?.onCreate&&i.onCreate(f);for(let d of this.items)Ds(i,f,d);return f}toString(s,i,c){if(!s)return JSON.stringify(this);for(let f of this.items)if(!y(f))throw new Error(`Map items must all be pairs; found ${JSON.stringify(f)} instead`);return!s.allNullValues&&this.hasAllNullValues(!1)&&(s=Object.assign({},s,{allNullValues:!0})),Us(this,s,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:s.indent||"",onChompKeep:c,onComment:i})}}let ct={collection:"map",default:!0,nodeClass:_e,tag:"tag:yaml.org,2002:map",resolve:(a,s)=>(v(a)||s("Expected a mapping for this tag"),a),createNode:(a,s,i)=>_e.from(a,s,i)};class We extends Os{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(s){super(l,s),this.items=[]}add(s){this.items.push(s)}delete(s){let i=yn(s);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(s,i){let c=yn(s);if(typeof c!="number")return;let f=this.items[c];return!i&&m(f)?f.value:f}has(s){let i=yn(s);return typeof i=="number"&&i<this.items.length}set(s,i){let c=yn(s);if(typeof c!="number")throw new Error(`Expected a valid index, not ${s}.`);let f=this.items[c];m(f)&&be(i)?f.value=i:this.items[c]=i}toJSON(s,i){let c=[];i?.onCreate&&i.onCreate(c);let f=0;for(let d of this.items)c.push(ye(d,String(f++),i));return c}toString(s,i,c){return s?Us(this,s,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(s.indent||"")+" ",onChompKeep:c,onComment:i}):JSON.stringify(this)}static from(s,i,c){let{replacer:f}=c,d=new this(s);if(i&&Symbol.iterator in Object(i)){let g=0;for(let S of i){if(typeof f=="function"){let k=i instanceof Set?S:String(g++);S=f.call(i,k,S)}d.items.push(Je(S,void 0,c))}}return d}}function yn(a){let s=m(a)?a.value:a;return s&&typeof s=="string"&&(s=Number(s)),typeof s=="number"&&Number.isInteger(s)&&s>=0?s:null}let lt={collection:"seq",default:!0,nodeClass:We,tag:"tag:yaml.org,2002:seq",resolve:(a,s)=>(w(a)||s("Expected a sequence for this tag"),a),createNode:(a,s,i)=>We.from(a,s,i)},bn={identify:a=>typeof a=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:a=>a,stringify:(a,s,i,c)=>Pt(a,s=Object.assign({actualString:!0},s),i,c)},vn={identify:a=>a==null,createNode:()=>new G(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new G(null),stringify:({source:a},s)=>typeof a=="string"&&vn.test.test(a)?a:s.options.nullStr},or={identify:a=>typeof a=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:a=>new G(a[0]==="t"||a[0]==="T"),stringify({source:a,value:s},i){return a&&or.test.test(a)&&s===(a[0]==="t"||a[0]==="T")?a:s?i.options.trueStr:i.options.falseStr}};function Ie({format:a,minFractionDigits:s,tag:i,value:c}){if(typeof c=="bigint")return String(c);let f=typeof c=="number"?c:Number(c);if(!isFinite(f))return isNaN(f)?".nan":f<0?"-.inf":".inf";let d=JSON.stringify(c);if(!a&&s&&(!i||i==="tag:yaml.org,2002:float")&&/^\d/.test(d)){let g=d.indexOf(".");g<0&&(g=d.length,d+=".");let S=s-(d.length-g-1);for(;S-- >0;)d+="0"}return d}let Bs={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a=>a.slice(-3).toLowerCase()==="nan"?NaN:a[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ie},js={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:a=>parseFloat(a),stringify(a){let s=Number(a.value);return isFinite(s)?s.toExponential():Ie(a)}},Fs={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(a){let s=new G(parseFloat(a)),i=a.indexOf(".");return i!==-1&&a[a.length-1]==="0"&&(s.minFractionDigits=a.length-i-1),s},stringify:Ie},wn=a=>typeof a=="bigint"||Number.isInteger(a),ar=(a,s,i,{intAsBigInt:c})=>c?BigInt(a):parseInt(a.substring(s),i);function Hs(a,s,i){let{value:c}=a;return wn(c)&&c>=0?i+c.toString(s):Ie(a)}let Ws={identify:a=>wn(a)&&a>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(a,s,i)=>ar(a,2,8,i),stringify:a=>Hs(a,8,"0o")},Ks={identify:wn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(a,s,i)=>ar(a,0,10,i),stringify:Ie},Vs={identify:a=>wn(a)&&a>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(a,s,i)=>ar(a,2,16,i),stringify:a=>Hs(a,16,"0x")},xa=[ct,lt,bn,vn,or,Ws,Ks,Vs,Bs,js,Fs];function Gs(a){return typeof a=="bigint"||Number.isInteger(a)}let En=({value:a})=>JSON.stringify(a),Ta=[ct,lt].concat([{identify:a=>typeof a=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:a=>a,stringify:En},{identify:a=>a==null,createNode:()=>new G(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:En},{identify:a=>typeof a=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:a=>a==="true",stringify:En},{identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(a,s,{intAsBigInt:i})=>i?BigInt(a):parseInt(a,10),stringify:({value:a})=>Gs(a)?a.toString():JSON.stringify(a)},{identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:a=>parseFloat(a),stringify:En}],{default:!0,tag:"",test:/^/,resolve:(a,s)=>(s(`Unresolved plain scalar ${JSON.stringify(a)}`),a)}),cr={identify:a=>a instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(a,s){if(typeof atob=="function"){let i=atob(a.replace(/[\n\r]/g,"")),c=new Uint8Array(i.length);for(let f=0;f<i.length;++f)c[f]=i.charCodeAt(f);return c}return s("This environment does not support reading binary tags; either Buffer or atob is required"),a},stringify({comment:a,type:s,value:i},c,f,d){if(!i)return"";let g=i,S;if(typeof btoa!="function")throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let k="";for(let x=0;x<g.length;++x)k+=String.fromCharCode(g[x]);S=btoa(k)}if(s||(s=G.BLOCK_LITERAL),s!==G.QUOTE_DOUBLE){let k=Math.max(c.options.lineWidth-c.indent.length,c.options.minContentWidth),x=Math.ceil(S.length/k),N=new Array(x);for(let _=0,E=0;_<x;++_,E+=k)N[_]=S.substr(E,k);S=N.join(s===G.BLOCK_LITERAL?`
76
- `:" ")}return Pt({comment:a,type:s,value:S},c,f,d)}};function zs(a,s){if(w(a))for(let i=0;i<a.items.length;++i){let c=a.items[i];if(!y(c)){if(v(c)){c.items.length>1&&s("Each pair must have its own sequence indicator");let f=c.items[0]||new ve(new G(null));if(c.commentBefore&&(f.key.commentBefore=f.key.commentBefore?`${c.commentBefore}
75
+ ${f}${O}`}return`${E}${g}${_.join(" ")}${g}${O}`}function mn({indent:a,options:{commentString:s}},i,c,f){if(c&&f&&(c=c.replace(/^\n+/,"")),c){let d=Re(s(c),a);i.push(d.trimStart())}}function Qe(a,s){let i=y(s)?s.value:s;for(let c of a)if(m(c)&&(c.key===s||c.key===i||y(c.key)&&c.key.value===i))return c}class _e extends Os{static get tagName(){return"tag:yaml.org,2002:map"}constructor(s){super(r,s),this.items=[]}static from(s,i,c){let{keepUndefined:f,replacer:d}=c,g=new this(s),S=(k,x)=>{if(typeof d=="function")x=d.call(i,k,x);else if(Array.isArray(d)&&!d.includes(k))return;(x!==void 0||f)&&g.items.push(ir(k,x,c))};if(i instanceof Map)for(let[k,x]of i)S(k,x);else if(i&&typeof i=="object")for(let k of Object.keys(i))S(k,i[k]);return typeof s.sortMapEntries=="function"&&g.items.sort(s.sortMapEntries),g}add(s,i){let c;c=m(s)?s:s&&typeof s=="object"&&"key"in s?new ve(s.key,s.value):new ve(s,s?.value);let f=Qe(this.items,c.key),d=this.schema?.sortMapEntries;if(f){if(!i)throw new Error(`Key ${c.key} already set`);y(f.value)&&be(c.value)?f.value.value=c.value:f.value=c.value}else if(d){let g=this.items.findIndex(S=>d(c,S)<0);g===-1?this.items.push(c):this.items.splice(g,0,c)}else this.items.push(c)}delete(s){let i=Qe(this.items,s);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(s,i){let c=Qe(this.items,s),f=c?.value;return(!i&&y(f)?f.value:f)??void 0}has(s){return!!Qe(this.items,s)}set(s,i){this.add(new ve(s,i),!0)}toJSON(s,i,c){let f=c?new c:i?.mapAsMap?new Map:{};i?.onCreate&&i.onCreate(f);for(let d of this.items)Ds(i,f,d);return f}toString(s,i,c){if(!s)return JSON.stringify(this);for(let f of this.items)if(!m(f))throw new Error(`Map items must all be pairs; found ${JSON.stringify(f)} instead`);return!s.allNullValues&&this.hasAllNullValues(!1)&&(s=Object.assign({},s,{allNullValues:!0})),Us(this,s,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:s.indent||"",onChompKeep:c,onComment:i})}}let ct={collection:"map",default:!0,nodeClass:_e,tag:"tag:yaml.org,2002:map",resolve:(a,s)=>(v(a)||s("Expected a mapping for this tag"),a),createNode:(a,s,i)=>_e.from(a,s,i)};class We extends Os{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(s){super(l,s),this.items=[]}add(s){this.items.push(s)}delete(s){let i=yn(s);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(s,i){let c=yn(s);if(typeof c!="number")return;let f=this.items[c];return!i&&y(f)?f.value:f}has(s){let i=yn(s);return typeof i=="number"&&i<this.items.length}set(s,i){let c=yn(s);if(typeof c!="number")throw new Error(`Expected a valid index, not ${s}.`);let f=this.items[c];y(f)&&be(i)?f.value=i:this.items[c]=i}toJSON(s,i){let c=[];i?.onCreate&&i.onCreate(c);let f=0;for(let d of this.items)c.push(ye(d,String(f++),i));return c}toString(s,i,c){return s?Us(this,s,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(s.indent||"")+" ",onChompKeep:c,onComment:i}):JSON.stringify(this)}static from(s,i,c){let{replacer:f}=c,d=new this(s);if(i&&Symbol.iterator in Object(i)){let g=0;for(let S of i){if(typeof f=="function"){let k=i instanceof Set?S:String(g++);S=f.call(i,k,S)}d.items.push(Je(S,void 0,c))}}return d}}function yn(a){let s=y(a)?a.value:a;return s&&typeof s=="string"&&(s=Number(s)),typeof s=="number"&&Number.isInteger(s)&&s>=0?s:null}let lt={collection:"seq",default:!0,nodeClass:We,tag:"tag:yaml.org,2002:seq",resolve:(a,s)=>(w(a)||s("Expected a sequence for this tag"),a),createNode:(a,s,i)=>We.from(a,s,i)},bn={identify:a=>typeof a=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:a=>a,stringify:(a,s,i,c)=>Pt(a,s=Object.assign({actualString:!0},s),i,c)},vn={identify:a=>a==null,createNode:()=>new G(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new G(null),stringify:({source:a},s)=>typeof a=="string"&&vn.test.test(a)?a:s.options.nullStr},or={identify:a=>typeof a=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:a=>new G(a[0]==="t"||a[0]==="T"),stringify({source:a,value:s},i){return a&&or.test.test(a)&&s===(a[0]==="t"||a[0]==="T")?a:s?i.options.trueStr:i.options.falseStr}};function Ie({format:a,minFractionDigits:s,tag:i,value:c}){if(typeof c=="bigint")return String(c);let f=typeof c=="number"?c:Number(c);if(!isFinite(f))return isNaN(f)?".nan":f<0?"-.inf":".inf";let d=JSON.stringify(c);if(!a&&s&&(!i||i==="tag:yaml.org,2002:float")&&/^\d/.test(d)){let g=d.indexOf(".");g<0&&(g=d.length,d+=".");let S=s-(d.length-g-1);for(;S-- >0;)d+="0"}return d}let Bs={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a=>a.slice(-3).toLowerCase()==="nan"?NaN:a[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ie},js={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:a=>parseFloat(a),stringify(a){let s=Number(a.value);return isFinite(s)?s.toExponential():Ie(a)}},Fs={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(a){let s=new G(parseFloat(a)),i=a.indexOf(".");return i!==-1&&a[a.length-1]==="0"&&(s.minFractionDigits=a.length-i-1),s},stringify:Ie},wn=a=>typeof a=="bigint"||Number.isInteger(a),ar=(a,s,i,{intAsBigInt:c})=>c?BigInt(a):parseInt(a.substring(s),i);function Hs(a,s,i){let{value:c}=a;return wn(c)&&c>=0?i+c.toString(s):Ie(a)}let Ws={identify:a=>wn(a)&&a>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(a,s,i)=>ar(a,2,8,i),stringify:a=>Hs(a,8,"0o")},Ks={identify:wn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(a,s,i)=>ar(a,0,10,i),stringify:Ie},Vs={identify:a=>wn(a)&&a>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(a,s,i)=>ar(a,2,16,i),stringify:a=>Hs(a,16,"0x")},xa=[ct,lt,bn,vn,or,Ws,Ks,Vs,Bs,js,Fs];function Gs(a){return typeof a=="bigint"||Number.isInteger(a)}let En=({value:a})=>JSON.stringify(a),Ta=[ct,lt].concat([{identify:a=>typeof a=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:a=>a,stringify:En},{identify:a=>a==null,createNode:()=>new G(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:En},{identify:a=>typeof a=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:a=>a==="true",stringify:En},{identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(a,s,{intAsBigInt:i})=>i?BigInt(a):parseInt(a,10),stringify:({value:a})=>Gs(a)?a.toString():JSON.stringify(a)},{identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:a=>parseFloat(a),stringify:En}],{default:!0,tag:"",test:/^/,resolve:(a,s)=>(s(`Unresolved plain scalar ${JSON.stringify(a)}`),a)}),cr={identify:a=>a instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(a,s){if(typeof atob=="function"){let i=atob(a.replace(/[\n\r]/g,"")),c=new Uint8Array(i.length);for(let f=0;f<i.length;++f)c[f]=i.charCodeAt(f);return c}return s("This environment does not support reading binary tags; either Buffer or atob is required"),a},stringify({comment:a,type:s,value:i},c,f,d){if(!i)return"";let g=i,S;if(typeof btoa!="function")throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let k="";for(let x=0;x<g.length;++x)k+=String.fromCharCode(g[x]);S=btoa(k)}if(s||(s=G.BLOCK_LITERAL),s!==G.QUOTE_DOUBLE){let k=Math.max(c.options.lineWidth-c.indent.length,c.options.minContentWidth),x=Math.ceil(S.length/k),N=new Array(x);for(let _=0,E=0;_<x;++_,E+=k)N[_]=S.substr(E,k);S=N.join(s===G.BLOCK_LITERAL?`
76
+ `:" ")}return Pt({comment:a,type:s,value:S},c,f,d)}};function zs(a,s){if(w(a))for(let i=0;i<a.items.length;++i){let c=a.items[i];if(!m(c)){if(v(c)){c.items.length>1&&s("Each pair must have its own sequence indicator");let f=c.items[0]||new ve(new G(null));if(c.commentBefore&&(f.key.commentBefore=f.key.commentBefore?`${c.commentBefore}
77
77
  ${f.key.commentBefore}`:c.commentBefore),c.comment){let d=f.value??f.key;d.comment=d.comment?`${c.comment}
78
- ${d.comment}`:c.comment}c=f}a.items[i]=y(c)?c:new ve(c)}}else s("Expected a sequence for this tag");return a}function Js(a,s,i){let{replacer:c}=i,f=new We(a);f.tag="tag:yaml.org,2002:pairs";let d=0;if(s&&Symbol.iterator in Object(s))for(let g of s){let S,k;if(typeof c=="function"&&(g=c.call(s,String(d++),g)),Array.isArray(g)){if(g.length!==2)throw new TypeError(`Expected [key, value] tuple: ${g}`);S=g[0],k=g[1]}else if(g&&g instanceof Object){let x=Object.keys(g);if(x.length!==1)throw new TypeError(`Expected tuple with one key, not ${x.length} keys`);S=x[0],k=g[S]}else S=g;f.items.push(ir(S,k,i))}return f}let lr={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:zs,createNode:Js};class ut extends We{constructor(){super(),this.add=_e.prototype.add.bind(this),this.delete=_e.prototype.delete.bind(this),this.get=_e.prototype.get.bind(this),this.has=_e.prototype.has.bind(this),this.set=_e.prototype.set.bind(this),this.tag=ut.tag}toJSON(s,i){if(!i)return super.toJSON(s);let c=new Map;i?.onCreate&&i.onCreate(c);for(let f of this.items){let d,g;if(y(f)?(d=ye(f.key,"",i),g=ye(f.value,d,i)):d=ye(f,"",i),c.has(d))throw new Error("Ordered maps must not include duplicate keys");c.set(d,g)}return c}static from(s,i,c){let f=Js(s,i,c),d=new this;return d.items=f.items,d}}ut.tag="tag:yaml.org,2002:omap";let ur={collection:"seq",identify:a=>a instanceof Map,nodeClass:ut,default:!1,tag:"tag:yaml.org,2002:omap",resolve(a,s){let i=zs(a,s),c=[];for(let{key:f}of i.items)m(f)&&(c.includes(f.value)?s(`Ordered maps must not include duplicate keys: ${f.value}`):c.push(f.value));return Object.assign(new ut,i)},createNode:(a,s,i)=>ut.from(a,s,i)};function Ys({value:a,source:s},i){return s&&(a?Qs:Xs).test.test(s)?s:a?i.options.trueStr:i.options.falseStr}let Qs={identify:a=>a===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new G(!0),stringify:Ys},Xs={identify:a=>a===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new G(!1),stringify:Ys},ka={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a=>a.slice(-3).toLowerCase()==="nan"?NaN:a[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ie},_a={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:a=>parseFloat(a.replace(/_/g,"")),stringify(a){let s=Number(a.value);return isFinite(s)?s.toExponential():Ie(a)}},Aa={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(a){let s=new G(parseFloat(a.replace(/_/g,""))),i=a.indexOf(".");if(i!==-1){let c=a.substring(i+1).replace(/_/g,"");c[c.length-1]==="0"&&(s.minFractionDigits=c.length)}return s},stringify:Ie},Rt=a=>typeof a=="bigint"||Number.isInteger(a);function Sn(a,s,i,{intAsBigInt:c}){let f=a[0];if(f!=="-"&&f!=="+"||(s+=1),a=a.substring(s).replace(/_/g,""),c){switch(i){case 2:a=`0b${a}`;break;case 8:a=`0o${a}`;break;case 16:a=`0x${a}`}let g=BigInt(a);return f==="-"?BigInt(-1)*g:g}let d=parseInt(a,i);return f==="-"?-1*d:d}function hr(a,s,i){let{value:c}=a;if(Rt(c)){let f=c.toString(s);return c<0?"-"+i+f.substr(1):i+f}return Ie(a)}let Na={identify:Rt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(a,s,i)=>Sn(a,2,2,i),stringify:a=>hr(a,2,"0b")},Ca={identify:Rt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(a,s,i)=>Sn(a,1,8,i),stringify:a=>hr(a,8,"0")},Ia={identify:Rt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(a,s,i)=>Sn(a,0,10,i),stringify:Ie},La={identify:Rt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(a,s,i)=>Sn(a,2,16,i),stringify:a=>hr(a,16,"0x")};class ht extends _e{constructor(s){super(s),this.tag=ht.tag}add(s){let i;i=y(s)?s:s&&typeof s=="object"&&"key"in s&&"value"in s&&s.value===null?new ve(s.key,null):new ve(s,null),Qe(this.items,i.key)||this.items.push(i)}get(s,i){let c=Qe(this.items,s);return!i&&y(c)?m(c.key)?c.key.value:c.key:c}set(s,i){if(typeof i!="boolean")throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof i);let c=Qe(this.items,s);c&&!i?this.items.splice(this.items.indexOf(c),1):!c&&i&&this.items.push(new ve(s))}toJSON(s,i){return super.toJSON(s,i,Set)}toString(s,i,c){if(!s)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},s,{allNullValues:!0}),i,c);throw new Error("Set items must all have null values")}static from(s,i,c){let{replacer:f}=c,d=new this(s);if(i&&Symbol.iterator in Object(i))for(let g of i)typeof f=="function"&&(g=f.call(i,g,g)),d.items.push(ir(g,null,c));return d}}ht.tag="tag:yaml.org,2002:set";let fr={collection:"map",identify:a=>a instanceof Set,nodeClass:ht,default:!1,tag:"tag:yaml.org,2002:set",createNode:(a,s,i)=>ht.from(a,s,i),resolve(a,s){if(v(a)){if(a.hasAllNullValues(!0))return Object.assign(new ht,a);s("Set items must all have null values")}else s("Expected a mapping for this tag");return a}};function dr(a,s){let i=a[0],c=i==="-"||i==="+"?a.substring(1):a,f=g=>s?BigInt(g):Number(g),d=c.replace(/_/g,"").split(":").reduce((g,S)=>g*f(60)+f(S),f(0));return i==="-"?f(-1)*d:d}function Zs(a){let{value:s}=a,i=g=>g;if(typeof s=="bigint")i=g=>BigInt(g);else if(isNaN(s)||!isFinite(s))return Ie(a);let c="";s<0&&(c="-",s*=i(-1));let f=i(60),d=[s%f];return s<60?d.unshift(0):(s=(s-d[0])/f,d.unshift(s%f),s>=60&&(s=(s-d[0])/f,d.unshift(s))),c+d.map(g=>String(g).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}let ei={identify:a=>typeof a=="bigint"||Number.isInteger(a),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(a,s,{intAsBigInt:i})=>dr(a,i),stringify:Zs},ti={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:a=>dr(a,!1),stringify:Zs},xn={identify:a=>a instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(a){let s=a.match(xn.test);if(!s)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,i,c,f,d,g,S]=s.map(Number),k=s[7]?Number((s[7]+"00").substr(1,3)):0,x=Date.UTC(i,c-1,f,d||0,g||0,S||0,k),N=s[8];if(N&&N!=="Z"){let _=dr(N,!1);Math.abs(_)<30&&(_*=60),x-=6e4*_}return new Date(x)},stringify:({value:a})=>a?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},ni=[ct,lt,bn,vn,Qs,Xs,Na,Ca,Ia,La,ka,_a,Aa,cr,qe,ur,lr,fr,ei,ti,xn],ri=new Map([["core",xa],["failsafe",[ct,lt,bn]],["json",Ta],["yaml11",ni],["yaml-1.1",ni]]),si={binary:cr,bool:or,float:Fs,floatExp:js,floatNaN:Bs,floatTime:ti,int:Ks,intHex:Vs,intOct:Ws,intTime:ei,map:ct,merge:qe,null:vn,omap:ur,pairs:lr,seq:lt,set:fr,timestamp:xn},Oa={"tag:yaml.org,2002:binary":cr,"tag:yaml.org,2002:merge":qe,"tag:yaml.org,2002:omap":ur,"tag:yaml.org,2002:pairs":lr,"tag:yaml.org,2002:set":fr,"tag:yaml.org,2002:timestamp":xn};function pr(a,s,i){let c=ri.get(s);if(c&&!a)return i&&!c.includes(qe)?c.concat(qe):c.slice();let f=c;if(!f){if(!Array.isArray(a)){let d=Array.from(ri.keys()).filter(g=>g!=="yaml11").map(g=>JSON.stringify(g)).join(", ");throw new Error(`Unknown schema "${s}"; use one of ${d} or define customTags array`)}f=[]}if(Array.isArray(a))for(let d of a)f=f.concat(d);else typeof a=="function"&&(f=a(f.slice()));return i&&(f=f.concat(qe)),f.reduce((d,g)=>{let S=typeof g=="string"?si[g]:g;if(!S){let k=JSON.stringify(g),x=Object.keys(si).map(N=>JSON.stringify(N)).join(", ");throw new Error(`Unknown custom tag ${k}; use one of ${x}`)}return d.includes(S)||d.push(S),d},[])}let $a=(a,s)=>a.key<s.key?-1:a.key>s.key?1:0;class Tn{constructor({compat:s,customTags:i,merge:c,resolveKnownTags:f,schema:d,sortMapEntries:g,toStringDefaults:S}){this.compat=Array.isArray(s)?pr(s,"compat"):s?pr(null,s):null,this.name=typeof d=="string"&&d||"core",this.knownTags=f?Oa:{},this.tags=pr(i,this.name,c),this.toStringOptions=S??null,Object.defineProperty(this,r,{value:ct}),Object.defineProperty(this,u,{value:bn}),Object.defineProperty(this,l,{value:lt}),this.sortMapEntries=typeof g=="function"?g:g===!0?$a:null}clone(){let s=Object.create(Tn.prototype,Object.getOwnPropertyDescriptors(this));return s.tags=this.tags.slice(),s}}class ft{constructor(s,i,c){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,h,{value:n});let f=null;typeof i=="function"||Array.isArray(i)?f=i:c===void 0&&i&&(c=i,i=void 0);let d=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},c);this.options=d;let{version:g}=d;c?._directives?(this.directives=c._directives.atDocument(),this.directives.yaml.explicit&&(g=this.directives.yaml.version)):this.directives=new fe({version:g}),this.setSchema(g,c),this.contents=s===void 0?null:this.createNode(s,f,c)}clone(){let s=Object.create(ft.prototype,{[h]:{value:n}});return s.commentBefore=this.commentBefore,s.comment=this.comment,s.errors=this.errors.slice(),s.warnings=this.warnings.slice(),s.options=Object.assign({},this.options),this.directives&&(s.directives=this.directives.clone()),s.schema=this.schema.clone(),s.contents=I(this.contents)?this.contents.clone(s.schema):this.contents,this.range&&(s.range=this.range.slice()),s}add(s){dt(this.contents)&&this.contents.add(s)}addIn(s,i){dt(this.contents)&&this.contents.addIn(s,i)}createAlias(s,i){if(!s.anchor){let c=ze(this);s.anchor=!i||c.has(i)?ln(i||"a",c):i}return new U(s.anchor)}createNode(s,i,c){let f;if(typeof i=="function")s=i.call({"":s},"",s),f=i;else if(Array.isArray(i)){let T=L=>typeof L=="number"||L instanceof String||L instanceof Number,C=i.filter(T).map(String);C.length>0&&(i=i.concat(C)),f=i}else c===void 0&&i&&(c=i,i=void 0);let{aliasDuplicateObjects:d,anchorPrefix:g,flow:S,keepUndefined:k,onTagObj:x,tag:N}=c??{},{onAnchor:_,setAnchors:E,sourceObjects:O}=function(T,C){let L=[],M=new Map,R=null;return{onAnchor:F=>{L.push(F),R||(R=ze(T));let K=ln(C,R);return R.add(K),K},setAnchors:()=>{for(let F of L){let K=M.get(F);if(typeof K!="object"||!K.anchor||!m(K.node)&&!A(K.node)){let V=new Error("Failed to resolve repeated object (this should not happen)");throw V.source=F,V}K.node.anchor=K.anchor}},sourceObjects:M}}(this,g||"a"),$=Je(s,N,{aliasDuplicateObjects:d??!0,keepUndefined:k??!1,onAnchor:_,onTagObj:x,replacer:f,schema:this.schema,sourceObjects:O});return S&&A($)&&($.flow=!0),E(),$}createPair(s,i,c={}){let f=this.createNode(s,null,c),d=this.createNode(i,null,c);return new ve(f,d)}delete(s){return!!dt(this.contents)&&this.contents.delete(s)}deleteIn(s){return $t(s)?this.contents!=null&&(this.contents=null,!0):!!dt(this.contents)&&this.contents.deleteIn(s)}get(s,i){return A(this.contents)?this.contents.get(s,i):void 0}getIn(s,i){return $t(s)?!i&&m(this.contents)?this.contents.value:this.contents:A(this.contents)?this.contents.getIn(s,i):void 0}has(s){return!!A(this.contents)&&this.contents.has(s)}hasIn(s){return $t(s)?this.contents!==void 0:!!A(this.contents)&&this.contents.hasIn(s)}set(s,i){this.contents==null?this.contents=it(this.schema,[s],i):dt(this.contents)&&this.contents.set(s,i)}setIn(s,i){$t(s)?this.contents=i:this.contents==null?this.contents=it(this.schema,Array.from(s),i):dt(this.contents)&&this.contents.setIn(s,i)}setSchema(s,i={}){let c;switch(typeof s=="number"&&(s=String(s)),s){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new fe({version:"1.1"}),c={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=s:this.directives=new fe({version:s}),c={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,c=null;break;default:{let f=JSON.stringify(s);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${f}`)}}if(i.schema instanceof Object)this.schema=i.schema;else{if(!c)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new Tn(Object.assign(c,i))}}toJS({json:s,jsonArg:i,mapAsMap:c,maxAliasCount:f,onAnchor:d,reviver:g}={}){let S={anchors:new Map,doc:this,keep:!s,mapAsMap:c===!0,mapKeyWarned:!1,maxAliasCount:typeof f=="number"?f:100},k=ye(this.contents,i??"",S);if(typeof d=="function")for(let{count:x,res:N}of S.anchors.values())d(N,x);return typeof g=="function"?He(g,{"":k},"",k):k}toJSON(s,i){return this.toJS({json:!0,jsonArg:s,mapAsMap:!1,onAnchor:i})}toString(s={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in s&&(!Number.isInteger(s.indent)||Number(s.indent)<=0)){let i=JSON.stringify(s.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return function(i,c){let f=[],d=c.directives===!0;if(c.directives!==!1&&i.directives){let N=i.directives.toString(i);N?(f.push(N),d=!0):i.directives.docStart&&(d=!0)}d&&f.push("---");let g=Ps(i,c),{commentString:S}=g.options;if(i.commentBefore){f.length!==1&&f.unshift("");let N=S(i.commentBefore);f.unshift(Re(N,""))}let k=!1,x=null;if(i.contents){if(I(i.contents)){if(i.contents.spaceBefore&&d&&f.push(""),i.contents.commentBefore){let E=S(i.contents.commentBefore);f.push(Re(E,""))}g.forceBlockIndent=!!i.comment,x=i.contents.comment}let N=x?void 0:()=>k=!0,_=at(i.contents,g,()=>x=null,N);x&&(_+=Ye(_,"",S(x))),_[0]!=="|"&&_[0]!==">"||f[f.length-1]!=="---"?f.push(_):f[f.length-1]=`--- ${_}`}else f.push(at(i.contents,g));if(i.directives?.docEnd)if(i.comment){let N=S(i.comment);N.includes(`
78
+ ${d.comment}`:c.comment}c=f}a.items[i]=m(c)?c:new ve(c)}}else s("Expected a sequence for this tag");return a}function Js(a,s,i){let{replacer:c}=i,f=new We(a);f.tag="tag:yaml.org,2002:pairs";let d=0;if(s&&Symbol.iterator in Object(s))for(let g of s){let S,k;if(typeof c=="function"&&(g=c.call(s,String(d++),g)),Array.isArray(g)){if(g.length!==2)throw new TypeError(`Expected [key, value] tuple: ${g}`);S=g[0],k=g[1]}else if(g&&g instanceof Object){let x=Object.keys(g);if(x.length!==1)throw new TypeError(`Expected tuple with one key, not ${x.length} keys`);S=x[0],k=g[S]}else S=g;f.items.push(ir(S,k,i))}return f}let lr={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:zs,createNode:Js};class ut extends We{constructor(){super(),this.add=_e.prototype.add.bind(this),this.delete=_e.prototype.delete.bind(this),this.get=_e.prototype.get.bind(this),this.has=_e.prototype.has.bind(this),this.set=_e.prototype.set.bind(this),this.tag=ut.tag}toJSON(s,i){if(!i)return super.toJSON(s);let c=new Map;i?.onCreate&&i.onCreate(c);for(let f of this.items){let d,g;if(m(f)?(d=ye(f.key,"",i),g=ye(f.value,d,i)):d=ye(f,"",i),c.has(d))throw new Error("Ordered maps must not include duplicate keys");c.set(d,g)}return c}static from(s,i,c){let f=Js(s,i,c),d=new this;return d.items=f.items,d}}ut.tag="tag:yaml.org,2002:omap";let ur={collection:"seq",identify:a=>a instanceof Map,nodeClass:ut,default:!1,tag:"tag:yaml.org,2002:omap",resolve(a,s){let i=zs(a,s),c=[];for(let{key:f}of i.items)y(f)&&(c.includes(f.value)?s(`Ordered maps must not include duplicate keys: ${f.value}`):c.push(f.value));return Object.assign(new ut,i)},createNode:(a,s,i)=>ut.from(a,s,i)};function Ys({value:a,source:s},i){return s&&(a?Qs:Xs).test.test(s)?s:a?i.options.trueStr:i.options.falseStr}let Qs={identify:a=>a===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new G(!0),stringify:Ys},Xs={identify:a=>a===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new G(!1),stringify:Ys},ka={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a=>a.slice(-3).toLowerCase()==="nan"?NaN:a[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ie},_a={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:a=>parseFloat(a.replace(/_/g,"")),stringify(a){let s=Number(a.value);return isFinite(s)?s.toExponential():Ie(a)}},Aa={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(a){let s=new G(parseFloat(a.replace(/_/g,""))),i=a.indexOf(".");if(i!==-1){let c=a.substring(i+1).replace(/_/g,"");c[c.length-1]==="0"&&(s.minFractionDigits=c.length)}return s},stringify:Ie},Rt=a=>typeof a=="bigint"||Number.isInteger(a);function Sn(a,s,i,{intAsBigInt:c}){let f=a[0];if(f!=="-"&&f!=="+"||(s+=1),a=a.substring(s).replace(/_/g,""),c){switch(i){case 2:a=`0b${a}`;break;case 8:a=`0o${a}`;break;case 16:a=`0x${a}`}let g=BigInt(a);return f==="-"?BigInt(-1)*g:g}let d=parseInt(a,i);return f==="-"?-1*d:d}function hr(a,s,i){let{value:c}=a;if(Rt(c)){let f=c.toString(s);return c<0?"-"+i+f.substr(1):i+f}return Ie(a)}let Na={identify:Rt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(a,s,i)=>Sn(a,2,2,i),stringify:a=>hr(a,2,"0b")},Ca={identify:Rt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(a,s,i)=>Sn(a,1,8,i),stringify:a=>hr(a,8,"0")},Ia={identify:Rt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(a,s,i)=>Sn(a,0,10,i),stringify:Ie},La={identify:Rt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(a,s,i)=>Sn(a,2,16,i),stringify:a=>hr(a,16,"0x")};class ht extends _e{constructor(s){super(s),this.tag=ht.tag}add(s){let i;i=m(s)?s:s&&typeof s=="object"&&"key"in s&&"value"in s&&s.value===null?new ve(s.key,null):new ve(s,null),Qe(this.items,i.key)||this.items.push(i)}get(s,i){let c=Qe(this.items,s);return!i&&m(c)?y(c.key)?c.key.value:c.key:c}set(s,i){if(typeof i!="boolean")throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof i);let c=Qe(this.items,s);c&&!i?this.items.splice(this.items.indexOf(c),1):!c&&i&&this.items.push(new ve(s))}toJSON(s,i){return super.toJSON(s,i,Set)}toString(s,i,c){if(!s)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},s,{allNullValues:!0}),i,c);throw new Error("Set items must all have null values")}static from(s,i,c){let{replacer:f}=c,d=new this(s);if(i&&Symbol.iterator in Object(i))for(let g of i)typeof f=="function"&&(g=f.call(i,g,g)),d.items.push(ir(g,null,c));return d}}ht.tag="tag:yaml.org,2002:set";let fr={collection:"map",identify:a=>a instanceof Set,nodeClass:ht,default:!1,tag:"tag:yaml.org,2002:set",createNode:(a,s,i)=>ht.from(a,s,i),resolve(a,s){if(v(a)){if(a.hasAllNullValues(!0))return Object.assign(new ht,a);s("Set items must all have null values")}else s("Expected a mapping for this tag");return a}};function dr(a,s){let i=a[0],c=i==="-"||i==="+"?a.substring(1):a,f=g=>s?BigInt(g):Number(g),d=c.replace(/_/g,"").split(":").reduce((g,S)=>g*f(60)+f(S),f(0));return i==="-"?f(-1)*d:d}function Zs(a){let{value:s}=a,i=g=>g;if(typeof s=="bigint")i=g=>BigInt(g);else if(isNaN(s)||!isFinite(s))return Ie(a);let c="";s<0&&(c="-",s*=i(-1));let f=i(60),d=[s%f];return s<60?d.unshift(0):(s=(s-d[0])/f,d.unshift(s%f),s>=60&&(s=(s-d[0])/f,d.unshift(s))),c+d.map(g=>String(g).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}let ei={identify:a=>typeof a=="bigint"||Number.isInteger(a),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(a,s,{intAsBigInt:i})=>dr(a,i),stringify:Zs},ti={identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:a=>dr(a,!1),stringify:Zs},xn={identify:a=>a instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(a){let s=a.match(xn.test);if(!s)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,i,c,f,d,g,S]=s.map(Number),k=s[7]?Number((s[7]+"00").substr(1,3)):0,x=Date.UTC(i,c-1,f,d||0,g||0,S||0,k),N=s[8];if(N&&N!=="Z"){let _=dr(N,!1);Math.abs(_)<30&&(_*=60),x-=6e4*_}return new Date(x)},stringify:({value:a})=>a?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},ni=[ct,lt,bn,vn,Qs,Xs,Na,Ca,Ia,La,ka,_a,Aa,cr,qe,ur,lr,fr,ei,ti,xn],ri=new Map([["core",xa],["failsafe",[ct,lt,bn]],["json",Ta],["yaml11",ni],["yaml-1.1",ni]]),si={binary:cr,bool:or,float:Fs,floatExp:js,floatNaN:Bs,floatTime:ti,int:Ks,intHex:Vs,intOct:Ws,intTime:ei,map:ct,merge:qe,null:vn,omap:ur,pairs:lr,seq:lt,set:fr,timestamp:xn},Oa={"tag:yaml.org,2002:binary":cr,"tag:yaml.org,2002:merge":qe,"tag:yaml.org,2002:omap":ur,"tag:yaml.org,2002:pairs":lr,"tag:yaml.org,2002:set":fr,"tag:yaml.org,2002:timestamp":xn};function pr(a,s,i){let c=ri.get(s);if(c&&!a)return i&&!c.includes(qe)?c.concat(qe):c.slice();let f=c;if(!f){if(!Array.isArray(a)){let d=Array.from(ri.keys()).filter(g=>g!=="yaml11").map(g=>JSON.stringify(g)).join(", ");throw new Error(`Unknown schema "${s}"; use one of ${d} or define customTags array`)}f=[]}if(Array.isArray(a))for(let d of a)f=f.concat(d);else typeof a=="function"&&(f=a(f.slice()));return i&&(f=f.concat(qe)),f.reduce((d,g)=>{let S=typeof g=="string"?si[g]:g;if(!S){let k=JSON.stringify(g),x=Object.keys(si).map(N=>JSON.stringify(N)).join(", ");throw new Error(`Unknown custom tag ${k}; use one of ${x}`)}return d.includes(S)||d.push(S),d},[])}let $a=(a,s)=>a.key<s.key?-1:a.key>s.key?1:0;class Tn{constructor({compat:s,customTags:i,merge:c,resolveKnownTags:f,schema:d,sortMapEntries:g,toStringDefaults:S}){this.compat=Array.isArray(s)?pr(s,"compat"):s?pr(null,s):null,this.name=typeof d=="string"&&d||"core",this.knownTags=f?Oa:{},this.tags=pr(i,this.name,c),this.toStringOptions=S??null,Object.defineProperty(this,r,{value:ct}),Object.defineProperty(this,u,{value:bn}),Object.defineProperty(this,l,{value:lt}),this.sortMapEntries=typeof g=="function"?g:g===!0?$a:null}clone(){let s=Object.create(Tn.prototype,Object.getOwnPropertyDescriptors(this));return s.tags=this.tags.slice(),s}}class ft{constructor(s,i,c){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,h,{value:n});let f=null;typeof i=="function"||Array.isArray(i)?f=i:c===void 0&&i&&(c=i,i=void 0);let d=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},c);this.options=d;let{version:g}=d;c?._directives?(this.directives=c._directives.atDocument(),this.directives.yaml.explicit&&(g=this.directives.yaml.version)):this.directives=new fe({version:g}),this.setSchema(g,c),this.contents=s===void 0?null:this.createNode(s,f,c)}clone(){let s=Object.create(ft.prototype,{[h]:{value:n}});return s.commentBefore=this.commentBefore,s.comment=this.comment,s.errors=this.errors.slice(),s.warnings=this.warnings.slice(),s.options=Object.assign({},this.options),this.directives&&(s.directives=this.directives.clone()),s.schema=this.schema.clone(),s.contents=I(this.contents)?this.contents.clone(s.schema):this.contents,this.range&&(s.range=this.range.slice()),s}add(s){dt(this.contents)&&this.contents.add(s)}addIn(s,i){dt(this.contents)&&this.contents.addIn(s,i)}createAlias(s,i){if(!s.anchor){let c=ze(this);s.anchor=!i||c.has(i)?ln(i||"a",c):i}return new U(s.anchor)}createNode(s,i,c){let f;if(typeof i=="function")s=i.call({"":s},"",s),f=i;else if(Array.isArray(i)){let T=L=>typeof L=="number"||L instanceof String||L instanceof Number,C=i.filter(T).map(String);C.length>0&&(i=i.concat(C)),f=i}else c===void 0&&i&&(c=i,i=void 0);let{aliasDuplicateObjects:d,anchorPrefix:g,flow:S,keepUndefined:k,onTagObj:x,tag:N}=c??{},{onAnchor:_,setAnchors:E,sourceObjects:O}=function(T,C){let L=[],M=new Map,R=null;return{onAnchor:F=>{L.push(F),R||(R=ze(T));let K=ln(C,R);return R.add(K),K},setAnchors:()=>{for(let F of L){let K=M.get(F);if(typeof K!="object"||!K.anchor||!y(K.node)&&!A(K.node)){let V=new Error("Failed to resolve repeated object (this should not happen)");throw V.source=F,V}K.node.anchor=K.anchor}},sourceObjects:M}}(this,g||"a"),$=Je(s,N,{aliasDuplicateObjects:d??!0,keepUndefined:k??!1,onAnchor:_,onTagObj:x,replacer:f,schema:this.schema,sourceObjects:O});return S&&A($)&&($.flow=!0),E(),$}createPair(s,i,c={}){let f=this.createNode(s,null,c),d=this.createNode(i,null,c);return new ve(f,d)}delete(s){return!!dt(this.contents)&&this.contents.delete(s)}deleteIn(s){return $t(s)?this.contents!=null&&(this.contents=null,!0):!!dt(this.contents)&&this.contents.deleteIn(s)}get(s,i){return A(this.contents)?this.contents.get(s,i):void 0}getIn(s,i){return $t(s)?!i&&y(this.contents)?this.contents.value:this.contents:A(this.contents)?this.contents.getIn(s,i):void 0}has(s){return!!A(this.contents)&&this.contents.has(s)}hasIn(s){return $t(s)?this.contents!==void 0:!!A(this.contents)&&this.contents.hasIn(s)}set(s,i){this.contents==null?this.contents=it(this.schema,[s],i):dt(this.contents)&&this.contents.set(s,i)}setIn(s,i){$t(s)?this.contents=i:this.contents==null?this.contents=it(this.schema,Array.from(s),i):dt(this.contents)&&this.contents.setIn(s,i)}setSchema(s,i={}){let c;switch(typeof s=="number"&&(s=String(s)),s){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new fe({version:"1.1"}),c={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=s:this.directives=new fe({version:s}),c={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,c=null;break;default:{let f=JSON.stringify(s);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${f}`)}}if(i.schema instanceof Object)this.schema=i.schema;else{if(!c)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new Tn(Object.assign(c,i))}}toJS({json:s,jsonArg:i,mapAsMap:c,maxAliasCount:f,onAnchor:d,reviver:g}={}){let S={anchors:new Map,doc:this,keep:!s,mapAsMap:c===!0,mapKeyWarned:!1,maxAliasCount:typeof f=="number"?f:100},k=ye(this.contents,i??"",S);if(typeof d=="function")for(let{count:x,res:N}of S.anchors.values())d(N,x);return typeof g=="function"?He(g,{"":k},"",k):k}toJSON(s,i){return this.toJS({json:!0,jsonArg:s,mapAsMap:!1,onAnchor:i})}toString(s={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in s&&(!Number.isInteger(s.indent)||Number(s.indent)<=0)){let i=JSON.stringify(s.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return function(i,c){let f=[],d=c.directives===!0;if(c.directives!==!1&&i.directives){let N=i.directives.toString(i);N?(f.push(N),d=!0):i.directives.docStart&&(d=!0)}d&&f.push("---");let g=Ps(i,c),{commentString:S}=g.options;if(i.commentBefore){f.length!==1&&f.unshift("");let N=S(i.commentBefore);f.unshift(Re(N,""))}let k=!1,x=null;if(i.contents){if(I(i.contents)){if(i.contents.spaceBefore&&d&&f.push(""),i.contents.commentBefore){let E=S(i.contents.commentBefore);f.push(Re(E,""))}g.forceBlockIndent=!!i.comment,x=i.contents.comment}let N=x?void 0:()=>k=!0,_=at(i.contents,g,()=>x=null,N);x&&(_+=Ye(_,"",S(x))),_[0]!=="|"&&_[0]!==">"||f[f.length-1]!=="---"?f.push(_):f[f.length-1]=`--- ${_}`}else f.push(at(i.contents,g));if(i.directives?.docEnd)if(i.comment){let N=S(i.comment);N.includes(`
79
79
  `)?(f.push("..."),f.push(Re(N,""))):f.push(`... ${N}`)}else f.push("...");else{let N=i.comment;N&&k&&(N=N.replace(/^\n+/,"")),N&&(k&&!x||f[f.length-1]===""||f.push(""),f.push(Re(S(N),"")))}return f.join(`
80
80
  `)+`
81
81
  `}(this,s)}}function dt(a){if(A(a))return!0;throw new Error("Expected a YAML collection as document contents")}class gr extends Error{constructor(s,i,c,f){super(),this.name=s,this.code=c,this.message=f,this.pos=i}}class Xe extends gr{constructor(s,i,c){super("YAMLParseError",s,i,c)}}class ii extends gr{constructor(s,i,c){super("YAMLWarning",s,i,c)}}let kn=(a,s)=>i=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map(S=>s.linePos(S));let{line:c,col:f}=i.linePos[0];i.message+=` at line ${c}, column ${f}`;let d=f-1,g=a.substring(s.lineStarts[c-1],s.lineStarts[c]).replace(/[\n\r]+$/,"");if(d>=60&&g.length>80){let S=Math.min(d-39,g.length-79);g="\u2026"+g.substring(S),d-=S-1}if(g.length>80&&(g=g.substring(0,79)+"\u2026"),c>1&&/^ *$/.test(g.substring(0,d))){let S=a.substring(s.lineStarts[c-2],s.lineStarts[c-1]);S.length>80&&(S=S.substring(0,79)+`\u2026
@@ -84,10 +84,10 @@ ${d.comment}`:c.comment}c=f}a.items[i]=y(c)?c:new ve(c)}}else s("Expected a sequ
84
84
  ${g}
85
85
  ${x}
86
86
  `}};function pt(a,{flow:s,indicator:i,next:c,offset:f,onError:d,parentIndent:g,startOnNewline:S}){let k=!1,x=S,N=S,_="",E="",O=!1,$=!1,T=null,C=null,L=null,M=null,R=null,F=null,K=null;for(let W of a)switch($&&(W.type!=="space"&&W.type!=="newline"&&W.type!=="comma"&&d(W.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),$=!1),T&&(x&&W.type!=="comment"&&W.type!=="newline"&&d(T,"TAB_AS_INDENT","Tabs are not allowed as indentation"),T=null),W.type){case"space":s||i==="doc-start"&&c?.type==="flow-collection"||!W.source.includes(" ")||(T=W),N=!0;break;case"comment":{N||d(W,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let J=W.source.substring(1)||" ";_?_+=E+J:_=J,E="",x=!1;break}case"newline":x?_?_+=W.source:F&&i==="seq-item-ind"||(k=!0):E+=W.source,x=!0,O=!0,(C||L)&&(M=W),N=!0;break;case"anchor":C&&d(W,"MULTIPLE_ANCHORS","A node can have at most one anchor"),W.source.endsWith(":")&&d(W.offset+W.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),C=W,K===null&&(K=W.offset),x=!1,N=!1,$=!0;break;case"tag":L&&d(W,"MULTIPLE_TAGS","A node can have at most one tag"),L=W,K===null&&(K=W.offset),x=!1,N=!1,$=!0;break;case i:(C||L)&&d(W,"BAD_PROP_ORDER",`Anchors and tags must be after the ${W.source} indicator`),F&&d(W,"UNEXPECTED_TOKEN",`Unexpected ${W.source} in ${s??"collection"}`),F=W,x=i==="seq-item-ind"||i==="explicit-key-ind",N=!1;break;case"comma":if(s){R&&d(W,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`),R=W,x=!1,N=!1;break}default:d(W,"UNEXPECTED_TOKEN",`Unexpected ${W.type} token`),x=!1,N=!1}let V=a[a.length-1],j=V?V.offset+V.source.length:f;return $&&c&&c.type!=="space"&&c.type!=="newline"&&c.type!=="comma"&&(c.type!=="scalar"||c.source!=="")&&d(c.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),T&&(x&&T.indent<=g||c?.type==="block-map"||c?.type==="block-seq")&&d(T,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:R,found:F,spaceBefore:k,comment:_,hasNewline:O,anchor:C,tag:L,newlineAfterProp:M,end:j,start:K??j}}function qt(a){if(!a)return null;switch(a.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(a.source.includes(`
87
- `))return!0;if(a.end){for(let s of a.end)if(s.type==="newline")return!0}return!1;case"flow-collection":for(let s of a.items){for(let i of s.start)if(i.type==="newline")return!0;if(s.sep){for(let i of s.sep)if(i.type==="newline")return!0}if(qt(s.key)||qt(s.value))return!0}return!1;default:return!0}}function mr(a,s,i){if(s?.type==="flow-collection"){let c=s.end[0];c.indent===a&&(c.source==="]"||c.source==="}")&&qt(s)&&i(c,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function oi(a,s,i){let{uniqueKeys:c}=a.options;if(c===!1)return!1;let f=typeof c=="function"?c:(d,g)=>d===g||m(d)&&m(g)&&d.value===g.value;return s.some(d=>f(d.key,i))}let ai="All mapping items must start at the same column";function Dt(a,s,i,c){let f="";if(a){let d=!1,g="";for(let S of a){let{source:k,type:x}=S;switch(x){case"space":d=!0;break;case"comment":{i&&!d&&c(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=k.substring(1)||" ";f?f+=g+N:f=N,g="";break}case"newline":f&&(g+=k),d=!0;break;default:c(S,"UNEXPECTED_TOKEN",`Unexpected ${x} at node end`)}s+=k.length}}return{comment:f,offset:s}}let yr="Block collections are not allowed within flow collections",br=a=>a&&(a.type==="block-map"||a.type==="block-seq");function vr(a,s,i,c,f,d){let g=i.type==="block-map"?function({composeNode:k,composeEmptyNode:x},N,_,E,O){let $=new(O?.nodeClass??_e)(N.schema);N.atRoot&&(N.atRoot=!1);let T=_.offset,C=null;for(let L of _.items){let{start:M,key:R,sep:F,value:K}=L,V=pt(M,{indicator:"explicit-key-ind",next:R??F?.[0],offset:T,onError:E,parentIndent:_.indent,startOnNewline:!0}),j=!V.found;if(j){if(R&&(R.type==="block-seq"?E(T,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in R&&R.indent!==_.indent&&E(T,"BAD_INDENT",ai)),!V.anchor&&!V.tag&&!F){C=V.end,V.comment&&($.comment?$.comment+=`
87
+ `))return!0;if(a.end){for(let s of a.end)if(s.type==="newline")return!0}return!1;case"flow-collection":for(let s of a.items){for(let i of s.start)if(i.type==="newline")return!0;if(s.sep){for(let i of s.sep)if(i.type==="newline")return!0}if(qt(s.key)||qt(s.value))return!0}return!1;default:return!0}}function mr(a,s,i){if(s?.type==="flow-collection"){let c=s.end[0];c.indent===a&&(c.source==="]"||c.source==="}")&&qt(s)&&i(c,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function oi(a,s,i){let{uniqueKeys:c}=a.options;if(c===!1)return!1;let f=typeof c=="function"?c:(d,g)=>d===g||y(d)&&y(g)&&d.value===g.value;return s.some(d=>f(d.key,i))}let ai="All mapping items must start at the same column";function Dt(a,s,i,c){let f="";if(a){let d=!1,g="";for(let S of a){let{source:k,type:x}=S;switch(x){case"space":d=!0;break;case"comment":{i&&!d&&c(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=k.substring(1)||" ";f?f+=g+N:f=N,g="";break}case"newline":f&&(g+=k),d=!0;break;default:c(S,"UNEXPECTED_TOKEN",`Unexpected ${x} at node end`)}s+=k.length}}return{comment:f,offset:s}}let yr="Block collections are not allowed within flow collections",br=a=>a&&(a.type==="block-map"||a.type==="block-seq");function vr(a,s,i,c,f,d){let g=i.type==="block-map"?function({composeNode:k,composeEmptyNode:x},N,_,E,O){let $=new(O?.nodeClass??_e)(N.schema);N.atRoot&&(N.atRoot=!1);let T=_.offset,C=null;for(let L of _.items){let{start:M,key:R,sep:F,value:K}=L,V=pt(M,{indicator:"explicit-key-ind",next:R??F?.[0],offset:T,onError:E,parentIndent:_.indent,startOnNewline:!0}),j=!V.found;if(j){if(R&&(R.type==="block-seq"?E(T,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in R&&R.indent!==_.indent&&E(T,"BAD_INDENT",ai)),!V.anchor&&!V.tag&&!F){C=V.end,V.comment&&($.comment?$.comment+=`
88
88
  `+V.comment:$.comment=V.comment);continue}(V.newlineAfterProp||qt(R))&&E(R??M[M.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else V.found?.indent!==_.indent&&E(T,"BAD_INDENT",ai);N.atKey=!0;let W=V.end,J=R?k(N,R,V,E):x(N,W,M,null,V,E);N.schema.compat&&mr(_.indent,R,E),N.atKey=!1,oi(N,$.items,J)&&E(W,"DUPLICATE_KEY","Map keys must be unique");let Y=pt(F??[],{indicator:"map-value-ind",next:K,offset:J.range[2],onError:E,parentIndent:_.indent,startOnNewline:!R||R.type==="block-scalar"});if(T=Y.end,Y.found){j&&(K?.type!=="block-map"||Y.hasNewline||E(T,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),N.options.strict&&V.start<Y.found.offset-1024&&E(J.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let ne=K?k(N,K,Y,E):x(N,T,F,null,Y,E);N.schema.compat&&mr(_.indent,K,E),T=ne.range[2];let Q=new ve(J,ne);N.options.keepSourceTokens&&(Q.srcToken=L),$.items.push(Q)}else{j&&E(J.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),Y.comment&&(J.comment?J.comment+=`
89
89
  `+Y.comment:J.comment=Y.comment);let ne=new ve(J);N.options.keepSourceTokens&&(ne.srcToken=L),$.items.push(ne)}}return C&&C<T&&E(C,"IMPOSSIBLE","Map comment with trailing content"),$.range=[_.offset,T,C??T],$}(a,s,i,c,d):i.type==="block-seq"?function({composeNode:k,composeEmptyNode:x},N,_,E,O){let $=new(O?.nodeClass??We)(N.schema);N.atRoot&&(N.atRoot=!1),N.atKey&&(N.atKey=!1);let T=_.offset,C=null;for(let{start:L,value:M}of _.items){let R=pt(L,{indicator:"seq-item-ind",next:M,offset:T,onError:E,parentIndent:_.indent,startOnNewline:!0});if(!R.found){if(!(R.anchor||R.tag||M)){C=R.end,R.comment&&($.comment=R.comment);continue}M&&M.type==="block-seq"?E(R.end,"BAD_INDENT","All sequence items must start at the same column"):E(T,"MISSING_CHAR","Sequence item without - indicator")}let F=M?k(N,M,R,E):x(N,R.end,L,null,R,E);N.schema.compat&&mr(_.indent,M,E),T=F.range[2],$.items.push(F)}return $.range=[_.offset,T,C??T],$}(a,s,i,c,d):function({composeNode:k,composeEmptyNode:x},N,_,E,O){let $=_.start.source==="{",T=$?"flow map":"flow sequence",C=new(O?.nodeClass??($?_e:We))(N.schema);C.flow=!0;let L=N.atRoot;L&&(N.atRoot=!1),N.atKey&&(N.atKey=!1);let M=_.offset+_.start.source.length;for(let j=0;j<_.items.length;++j){let W=_.items[j],{start:J,key:Y,sep:ne,value:Q}=W,X=pt(J,{flow:T,indicator:"explicit-key-ind",next:Y??ne?.[0],offset:M,onError:E,parentIndent:_.indent,startOnNewline:!1});if(!X.found){if(!(X.anchor||X.tag||ne||Q)){j===0&&X.comma?E(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${T}`):j<_.items.length-1&&E(X.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${T}`),X.comment&&(C.comment?C.comment+=`
90
- `+X.comment:C.comment=X.comment),M=X.end;continue}!$&&N.options.strict&&qt(Y)&&E(Y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===0)X.comma&&E(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${T}`);else if(X.comma||E(X.start,"MISSING_CHAR",`Missing , between ${T} items`),X.comment){let xe="";e:for(let ie of J)switch(ie.type){case"comma":case"space":break;case"comment":xe=ie.source.substring(1);break e;default:break e}if(xe){let ie=C.items[C.items.length-1];y(ie)&&(ie=ie.value??ie.key),ie.comment?ie.comment+=`
90
+ `+X.comment:C.comment=X.comment),M=X.end;continue}!$&&N.options.strict&&qt(Y)&&E(Y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===0)X.comma&&E(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${T}`);else if(X.comma||E(X.start,"MISSING_CHAR",`Missing , between ${T} items`),X.comment){let xe="";e:for(let ie of J)switch(ie.type){case"comma":case"space":break;case"comment":xe=ie.source.substring(1);break e;default:break e}if(xe){let ie=C.items[C.items.length-1];m(ie)&&(ie=ie.value??ie.key),ie.comment?ie.comment+=`
91
91
  `+xe:ie.comment=xe,X.comment=X.comment.substring(xe.length+1)}}if($||ne||X.found){N.atKey=!0;let xe=X.end,ie=Y?k(N,Y,X,E):x(N,xe,J,null,X,E);br(Y)&&E(ie.range,"BLOCK_IN_FLOW",yr),N.atKey=!1;let oe=pt(ne??[],{flow:T,indicator:"map-value-ind",next:Q,offset:ie.range[2],onError:E,parentIndent:_.indent,startOnNewline:!1});if(oe.found){if(!$&&!X.found&&N.options.strict){if(ne)for(let Oe of ne){if(Oe===oe.found)break;if(Oe.type==="newline"){E(Oe,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}X.start<oe.found.offset-1024&&E(oe.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else Q&&("source"in Q&&Q.source&&Q.source[0]===":"?E(Q,"MISSING_CHAR",`Missing space after : in ${T}`):E(oe.start,"MISSING_CHAR",`Missing , or : between ${T} items`));let mt=Q?k(N,Q,oe,E):oe.found?x(N,oe.end,ne,null,oe,E):null;mt?br(Q)&&E(mt.range,"BLOCK_IN_FLOW",yr):oe.comment&&(ie.comment?ie.comment+=`
92
92
  `+oe.comment:ie.comment=oe.comment);let _r=new ve(ie,mt);if(N.options.keepSourceTokens&&(_r.srcToken=W),$){let Oe=C;oi(N,Oe.items,ie)&&E(xe,"DUPLICATE_KEY","Map keys must be unique"),Oe.items.push(_r)}else{let Oe=new _e(N.schema);Oe.flow=!0,Oe.items.push(_r);let _i=(mt??ie).range;Oe.range=[ie.range[0],_i[1],_i[2]],C.items.push(Oe)}M=mt?mt.range[2]:oe.end}else{let xe=Q?k(N,Q,X,E):x(N,X.end,ne,null,X,E);C.items.push(xe),M=xe.range[2],br(Q)&&E(xe.range,"BLOCK_IN_FLOW",yr)}}let R=$?"}":"]",[F,...K]=_.end,V=M;if(F&&F.source===R)V=F.offset+F.source.length;else{let j=T[0].toUpperCase()+T.substring(1);E(M,L?"MISSING_CHAR":"BAD_INDENT",L?`${j} must end with a ${R}`:`${j} in block collection must be sufficiently indented and end with a ${R}`),F&&F.source.length!==1&&K.unshift(F)}if(K.length>0){let j=Dt(K,V,N.options.strict,E);j.comment&&(C.comment?C.comment+=`
93
93
  `+j.comment:C.comment=j.comment),C.range=[_.offset,V,j.offset]}else C.range=[_.offset,V,V];return C}(a,s,i,c,d),S=g.constructor;return f==="!"||f===S.tagName?(g.tag=S.tagName,g):(f&&(g.tag=f),g)}function ci(a,s,i){let c=s.offset,f=function({offset:T,props:C},L,M){if(C[0].type!=="block-scalar-header")return M(C[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:R}=C[0],F=R[0],K=0,V="",j=-1;for(let ne=1;ne<R.length;++ne){let Q=R[ne];if(V||Q!=="-"&&Q!=="+"){let X=Number(Q);!K&&X?K=X:j===-1&&(j=T+ne)}else V=Q}j!==-1&&M(j,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${R}`);let W=!1,J="",Y=R.length;for(let ne=1;ne<C.length;++ne){let Q=C[ne];switch(Q.type){case"space":W=!0;case"newline":Y+=Q.source.length;break;case"comment":L&&!W&&M(Q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),Y+=Q.source.length,J=Q.source.substring(1);break;case"error":M(Q,"UNEXPECTED_TOKEN",Q.message),Y+=Q.source.length;break;default:{M(Q,"UNEXPECTED_TOKEN",`Unexpected token in block scalar header: ${Q.type}`);let X=Q.source;X&&typeof X=="string"&&(Y+=X.length)}}}return{mode:F,indent:K,chomp:V,comment:J,length:Y}}(s,a.options.strict,i);if(!f)return{value:"",type:null,comment:"",range:[c,c,c]};let d=f.mode===">"?G.BLOCK_FOLDED:G.BLOCK_LITERAL,g=s.source?function(T){let C=T.split(/\n( *)/),L=C[0],M=L.match(/^( *)/),R=[M?.[1]?[M[1],L.slice(M[1].length)]:["",L]];for(let F=1;F<C.length;F+=2)R.push([C[F],C[F+1]]);return R}(s.source):[],S=g.length;for(let T=g.length-1;T>=0;--T){let C=g[T][1];if(C!==""&&C!=="\r")break;S=T}if(S===0){let T=f.chomp==="+"&&g.length>0?`
@@ -120,11 +120,11 @@ ${x}
120
120
  `);)c===`
121
121
  `&&(i+=`
122
122
  `),c=a[(s+=1)+1];return i||(i=" "),{fold:i,offset:s}}let Pa={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
123
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Ra(a,s,i,c){let f=a.substr(s,i),d=f.length===i&&/^[0-9a-fA-F]+$/.test(f)?parseInt(f,16):NaN;if(isNaN(d)){let g=a.substr(s-2,i+2);return c(s-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${g}`),g}return String.fromCodePoint(d)}function hi(a,s,i,c){let{value:f,type:d,comment:g,range:S}=s.type==="block-scalar"?ci(a,s,c):li(s,a.options.strict,c),k=i?a.directives.tagName(i.source,_=>c(i,"TAG_RESOLVE_FAILED",_)):null,x,N;x=a.options.stringKeys&&a.atKey?a.schema[u]:k?function(_,E,O,$,T){if(O==="!")return _[u];let C=[];for(let M of _.tags)if(!M.collection&&M.tag===O){if(!M.default||!M.test)return M;C.push(M)}for(let M of C)if(M.test?.test(E))return M;let L=_.knownTags[O];return L&&!L.collection?(_.tags.push(Object.assign({},L,{default:!1,test:void 0})),L):(T($,"TAG_RESOLVE_FAILED",`Unresolved tag: ${O}`,O!=="tag:yaml.org,2002:str"),_[u])}(a.schema,f,k,i,c):s.type==="scalar"?function({atKey:_,directives:E,schema:O},$,T,C){let L=O.tags.find(M=>(M.default===!0||_&&M.default==="key")&&M.test?.test($))||O[u];if(O.compat){let M=O.compat.find(R=>R.default&&R.test?.test($))??O[u];L.tag!==M.tag&&C(T,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${E.tagString(L.tag)} or ${E.tagString(M.tag)}`,!0)}return L}(a,f,s,c):a.schema[u];try{let _=x.resolve(f,E=>c(i??s,"TAG_RESOLVE_FAILED",E),a.options);N=m(_)?_:new G(_)}catch(_){let E=_ instanceof Error?_.message:String(_);c(i??s,"TAG_RESOLVE_FAILED",E),N=new G(f)}return N.range=S,N.source=f,d&&(N.type=d),k&&(N.tag=k),x.format&&(N.format=x.format),g&&(N.comment=g),N}function qa(a,s,i){if(s){i===null&&(i=s.length);for(let c=i-1;c>=0;--c){let f=s[c];switch(f.type){case"space":case"comment":case"newline":a-=f.source.length;continue}for(f=s[++c];f?.type==="space";)a+=f.source.length,f=s[++c];break}}return a}let Da={composeNode:fi,composeEmptyNode:wr};function fi(a,s,i,c){let f=a.atKey,{spaceBefore:d,comment:g,anchor:S,tag:k}=i,x,N=!0;switch(s.type){case"alias":x=function({options:_},{offset:E,source:O,end:$},T){let C=new U(O.substring(1));C.source===""&&T(E,"BAD_ALIAS","Alias cannot be an empty string"),C.source.endsWith(":")&&T(E+O.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let L=E+O.length,M=Dt($,L,_.strict,T);return C.range=[E,L,M.offset],M.comment&&(C.comment=M.comment),C}(a,s,c),(S||k)&&c(s,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":x=hi(a,s,k,c),S&&(x.anchor=S.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":x=function(_,E,O,$,T){let C=$.tag,L=C?E.directives.tagName(C.source,j=>T(C,"TAG_RESOLVE_FAILED",j)):null;if(O.type==="block-seq"){let{anchor:j,newlineAfterProp:W}=$,J=j&&C?j.offset>C.offset?j:C:j??C;J&&(!W||W.offset<J.offset)&&T(J,"MISSING_CHAR","Missing newline after block sequence props")}let M=O.type==="block-map"?"map":O.type==="block-seq"?"seq":O.start.source==="{"?"map":"seq";if(!C||!L||L==="!"||L===_e.tagName&&M==="map"||L===We.tagName&&M==="seq")return vr(_,E,O,T,L);let R=E.schema.tags.find(j=>j.tag===L&&j.collection===M);if(!R){let j=E.schema.knownTags[L];if(!j||j.collection!==M)return j?T(C,"BAD_COLLECTION_TYPE",`${j.tag} used for ${M} collection, but expects ${j.collection??"scalar"}`,!0):T(C,"TAG_RESOLVE_FAILED",`Unresolved tag: ${L}`,!0),vr(_,E,O,T,L);E.schema.tags.push(Object.assign({},j,{default:!1})),R=j}let F=vr(_,E,O,T,L,R),K=R.resolve?.(F,j=>T(C,"TAG_RESOLVE_FAILED",j),E.options)??F,V=I(K)?K:new G(K);return V.range=F.range,V.tag=L,R?.format&&(V.format=R.format),V}(Da,a,s,i,c),S&&(x.anchor=S.source.substring(1));break;default:c(s,"UNEXPECTED_TOKEN",s.type==="error"?s.message:`Unsupported token (type: ${s.type})`),x=wr(a,s.offset,void 0,null,i,c),N=!1}return S&&x.anchor===""&&c(S,"BAD_ALIAS","Anchor cannot be an empty string"),f&&a.options.stringKeys&&(!m(x)||typeof x.value!="string"||x.tag&&x.tag!=="tag:yaml.org,2002:str")&&c(k??s,"NON_STRING_KEY","With stringKeys, all keys must be strings"),d&&(x.spaceBefore=!0),g&&(s.type==="scalar"&&s.source===""?x.comment=g:x.commentBefore=g),a.options.keepSourceTokens&&N&&(x.srcToken=s),x}function wr(a,s,i,c,{spaceBefore:f,comment:d,anchor:g,tag:S,end:k},x){let N=hi(a,{type:"scalar",offset:qa(s,i,c),indent:-1,source:""},S,x);return g&&(N.anchor=g.source.substring(1),N.anchor===""&&x(g,"BAD_ALIAS","Anchor cannot be an empty string")),f&&(N.spaceBefore=!0),d&&(N.comment=d,N.range[2]=k),N}function Ut(a){if(typeof a=="number")return[a,a+1];if(Array.isArray(a))return a.length===2?a:[a[0],a[1]];let{offset:s,source:i}=a;return[s,s+(typeof i=="string"?i.length:1)]}function di(a){let s="",i=!1,c=!1;for(let f=0;f<a.length;++f){let d=a[f];switch(d[0]){case"#":s+=(s===""?"":c?`
123
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Ra(a,s,i,c){let f=a.substr(s,i),d=f.length===i&&/^[0-9a-fA-F]+$/.test(f)?parseInt(f,16):NaN;if(isNaN(d)){let g=a.substr(s-2,i+2);return c(s-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${g}`),g}return String.fromCodePoint(d)}function hi(a,s,i,c){let{value:f,type:d,comment:g,range:S}=s.type==="block-scalar"?ci(a,s,c):li(s,a.options.strict,c),k=i?a.directives.tagName(i.source,_=>c(i,"TAG_RESOLVE_FAILED",_)):null,x,N;x=a.options.stringKeys&&a.atKey?a.schema[u]:k?function(_,E,O,$,T){if(O==="!")return _[u];let C=[];for(let M of _.tags)if(!M.collection&&M.tag===O){if(!M.default||!M.test)return M;C.push(M)}for(let M of C)if(M.test?.test(E))return M;let L=_.knownTags[O];return L&&!L.collection?(_.tags.push(Object.assign({},L,{default:!1,test:void 0})),L):(T($,"TAG_RESOLVE_FAILED",`Unresolved tag: ${O}`,O!=="tag:yaml.org,2002:str"),_[u])}(a.schema,f,k,i,c):s.type==="scalar"?function({atKey:_,directives:E,schema:O},$,T,C){let L=O.tags.find(M=>(M.default===!0||_&&M.default==="key")&&M.test?.test($))||O[u];if(O.compat){let M=O.compat.find(R=>R.default&&R.test?.test($))??O[u];L.tag!==M.tag&&C(T,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${E.tagString(L.tag)} or ${E.tagString(M.tag)}`,!0)}return L}(a,f,s,c):a.schema[u];try{let _=x.resolve(f,E=>c(i??s,"TAG_RESOLVE_FAILED",E),a.options);N=y(_)?_:new G(_)}catch(_){let E=_ instanceof Error?_.message:String(_);c(i??s,"TAG_RESOLVE_FAILED",E),N=new G(f)}return N.range=S,N.source=f,d&&(N.type=d),k&&(N.tag=k),x.format&&(N.format=x.format),g&&(N.comment=g),N}function qa(a,s,i){if(s){i===null&&(i=s.length);for(let c=i-1;c>=0;--c){let f=s[c];switch(f.type){case"space":case"comment":case"newline":a-=f.source.length;continue}for(f=s[++c];f?.type==="space";)a+=f.source.length,f=s[++c];break}}return a}let Da={composeNode:fi,composeEmptyNode:wr};function fi(a,s,i,c){let f=a.atKey,{spaceBefore:d,comment:g,anchor:S,tag:k}=i,x,N=!0;switch(s.type){case"alias":x=function({options:_},{offset:E,source:O,end:$},T){let C=new U(O.substring(1));C.source===""&&T(E,"BAD_ALIAS","Alias cannot be an empty string"),C.source.endsWith(":")&&T(E+O.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let L=E+O.length,M=Dt($,L,_.strict,T);return C.range=[E,L,M.offset],M.comment&&(C.comment=M.comment),C}(a,s,c),(S||k)&&c(s,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":x=hi(a,s,k,c),S&&(x.anchor=S.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":x=function(_,E,O,$,T){let C=$.tag,L=C?E.directives.tagName(C.source,j=>T(C,"TAG_RESOLVE_FAILED",j)):null;if(O.type==="block-seq"){let{anchor:j,newlineAfterProp:W}=$,J=j&&C?j.offset>C.offset?j:C:j??C;J&&(!W||W.offset<J.offset)&&T(J,"MISSING_CHAR","Missing newline after block sequence props")}let M=O.type==="block-map"?"map":O.type==="block-seq"?"seq":O.start.source==="{"?"map":"seq";if(!C||!L||L==="!"||L===_e.tagName&&M==="map"||L===We.tagName&&M==="seq")return vr(_,E,O,T,L);let R=E.schema.tags.find(j=>j.tag===L&&j.collection===M);if(!R){let j=E.schema.knownTags[L];if(!j||j.collection!==M)return j?T(C,"BAD_COLLECTION_TYPE",`${j.tag} used for ${M} collection, but expects ${j.collection??"scalar"}`,!0):T(C,"TAG_RESOLVE_FAILED",`Unresolved tag: ${L}`,!0),vr(_,E,O,T,L);E.schema.tags.push(Object.assign({},j,{default:!1})),R=j}let F=vr(_,E,O,T,L,R),K=R.resolve?.(F,j=>T(C,"TAG_RESOLVE_FAILED",j),E.options)??F,V=I(K)?K:new G(K);return V.range=F.range,V.tag=L,R?.format&&(V.format=R.format),V}(Da,a,s,i,c),S&&(x.anchor=S.source.substring(1));break;default:c(s,"UNEXPECTED_TOKEN",s.type==="error"?s.message:`Unsupported token (type: ${s.type})`),x=wr(a,s.offset,void 0,null,i,c),N=!1}return S&&x.anchor===""&&c(S,"BAD_ALIAS","Anchor cannot be an empty string"),f&&a.options.stringKeys&&(!y(x)||typeof x.value!="string"||x.tag&&x.tag!=="tag:yaml.org,2002:str")&&c(k??s,"NON_STRING_KEY","With stringKeys, all keys must be strings"),d&&(x.spaceBefore=!0),g&&(s.type==="scalar"&&s.source===""?x.comment=g:x.commentBefore=g),a.options.keepSourceTokens&&N&&(x.srcToken=s),x}function wr(a,s,i,c,{spaceBefore:f,comment:d,anchor:g,tag:S,end:k},x){let N=hi(a,{type:"scalar",offset:qa(s,i,c),indent:-1,source:""},S,x);return g&&(N.anchor=g.source.substring(1),N.anchor===""&&x(g,"BAD_ALIAS","Anchor cannot be an empty string")),f&&(N.spaceBefore=!0),d&&(N.comment=d,N.range[2]=k),N}function Ut(a){if(typeof a=="number")return[a,a+1];if(Array.isArray(a))return a.length===2?a:[a[0],a[1]];let{offset:s,source:i}=a;return[s,s+(typeof i=="string"?i.length:1)]}function di(a){let s="",i=!1,c=!1;for(let f=0;f<a.length;++f){let d=a[f];switch(d[0]){case"#":s+=(s===""?"":c?`
124
124
 
125
125
  `:`
126
126
  `)+(d.substring(1)||" "),i=!0,c=!1;break;case"%":a[f+1]?.[0]!=="#"&&(f+=1),i=!1;break;default:i||(c=!0),i=!1}}return{comment:s,afterEmptyLine:c}}class Er{constructor(s={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(i,c,f,d)=>{let g=Ut(i);d?this.warnings.push(new ii(g,c,f)):this.errors.push(new Xe(g,c,f))},this.directives=new fe({version:s.version||"1.2"}),this.options=s}decorate(s,i){let{comment:c,afterEmptyLine:f}=di(this.prelude);if(c){let d=s.contents;if(i)s.comment=s.comment?`${s.comment}
127
- ${c}`:c;else if(f||s.directives.docStart||!d)s.commentBefore=c;else if(A(d)&&!d.flow&&d.items.length>0){let g=d.items[0];y(g)&&(g=g.key);let S=g.commentBefore;g.commentBefore=S?`${c}
127
+ ${c}`:c;else if(f||s.directives.docStart||!d)s.commentBefore=c;else if(A(d)&&!d.flow&&d.items.length>0){let g=d.items[0];m(g)&&(g=g.key);let S=g.commentBefore;g.commentBefore=S?`${c}
128
128
  ${S}`:c}else{let g=d.commentBefore;d.commentBefore=g?`${c}
129
129
  ${g}`:c}}i?(Array.prototype.push.apply(s.errors,this.errors),Array.prototype.push.apply(s.warnings,this.warnings)):(s.errors=this.errors,s.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:di(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(s,i=!1,c=-1){for(let f of s)yield*this.next(f);yield*this.end(i,c)}*next(s){switch(s.type){case"directive":this.directives.add(s.source,(i,c,f)=>{let d=Ut(s);d[0]+=i,this.onError(d,"BAD_DIRECTIVE",c,f)}),this.prelude.push(s.source),this.atDirectives=!0;break;case"document":{let i=function(c,f,{offset:d,start:g,value:S,end:k},x){let N=Object.assign({_directives:f},c),_=new ft(void 0,N),E={atKey:!1,atRoot:!0,directives:_.directives,options:_.options,schema:_.schema},O=pt(g,{indicator:"doc-start",next:S??k?.[0],offset:d,onError:x,parentIndent:0,startOnNewline:!0});O.found&&(_.directives.docStart=!0,!S||S.type!=="block-map"&&S.type!=="block-seq"||O.hasNewline||x(O.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),_.contents=S?fi(E,S,O,x):wr(E,O.end,g,null,O,x);let $=_.contents.range[2],T=Dt(k,$,!1,x);return T.comment&&(_.comment=T.comment),_.range=[d,$,T.offset],_}(this.options,this.directives,s,this.onError);this.atDirectives&&!i.directives.docStart&&this.onError(s,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(i,!1),this.doc&&(yield this.doc),this.doc=i,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(s.source);break;case"error":{let i=s.source?`${s.message}: ${JSON.stringify(s.source)}`:s.message,c=new Xe(Ut(s),"UNEXPECTED_TOKEN",i);this.atDirectives||!this.doc?this.errors.push(c):this.doc.errors.push(c);break}case"doc-end":{if(!this.doc){let c="Unexpected doc-end without preceding document";this.errors.push(new Xe(Ut(s),"UNEXPECTED_TOKEN",c));break}this.doc.directives.docEnd=!0;let i=Dt(s.end,s.offset+s.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),i.comment){let c=this.doc.comment;this.doc.comment=c?`${c}
130
130
  ${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.push(new Xe(Ut(s),"UNEXPECTED_TOKEN",`Unsupported token ${s.type}`))}}*end(s=!1,i=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(s){let c=Object.assign({_directives:this.directives},this.options),f=new ft(void 0,c);this.atDirectives&&this.onError(i,"MISSING_CHAR","Missing directives-end indicator line"),f.range=[0,i,i],this.decorate(f,!1),yield f}}}function pi(a,s){if(s)for(let i of s)switch(i.type){case"space":case"comment":a.push(i);break;case"newline":return a.push(i),!0}return!1}function Sr(a,s,i){switch(a.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":a.type=i,a.source=s;break;case"block-scalar":{let c=a.props.slice(1),f=s.length;a.props[0].type==="block-scalar-header"&&(f-=a.props[0].source.length);for(let d of c)d.offset+=f;delete a.props,Object.assign(a,{type:i,source:s,end:c});break}case"block-map":case"block-seq":{let c={type:"newline",offset:a.offset+s.length,indent:a.indent,source:`
@@ -160,8 +160,8 @@ ${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.pus
160
160
  `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
161
161
  `,i)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(s){let i=s.items[s.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,i.value){let c="end"in i.value?i.value.end:void 0;(Array.isArray(c)?c[c.length-1]:void 0)?.type==="comment"?c?.push(this.sourceToken):s.items.push({start:[this.sourceToken]})}else i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)s.items.push({start:[this.sourceToken]});else if(i.sep)i.sep.push(this.sourceToken);else{if(this.atIndentedComment(i.start,s.indent)){let c=s.items[s.items.length-2],f=c?.value?.end;if(Array.isArray(f))return Array.prototype.push.apply(f,i.start),f.push(this.sourceToken),void s.items.pop()}i.start.push(this.sourceToken)}return}if(this.indent>=s.indent){let c=!this.onKeyLine&&this.indent===s.indent,f=c&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind",d=[];if(f&&i.sep&&!i.value){let g=[];for(let S=0;S<i.sep.length;++S){let k=i.sep[S];switch(k.type){case"newline":g.push(S);break;case"space":break;case"comment":k.indent>s.indent&&(g.length=0);break;default:g.length=0}}g.length>=2&&(d=i.sep.splice(g[1]))}switch(this.type){case"anchor":case"tag":return void(f||i.value?(d.push(this.sourceToken),s.items.push({start:d}),this.onKeyLine=!0):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken));case"explicit-key-ind":return i.sep||i.explicitKey?f||i.value?(d.push(this.sourceToken),s.items.push({start:d,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(i.start.push(this.sourceToken),i.explicitKey=!0),void(this.onKeyLine=!0);case"map-value-ind":if(i.explicitKey)if(i.sep)if(i.value)s.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ke(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]});else if(Si(i.key)&&!Ke(i.sep,"newline")){let g=gt(i.start),S=i.key,k=i.sep;k.push(this.sourceToken),delete i.key,delete i.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:g,key:S,sep:k}]})}else d.length>0?i.sep=i.sep.concat(d,this.sourceToken):i.sep.push(this.sourceToken);else if(Ke(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{let g=gt(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:g,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||f?s.items.push({start:d,key:null,sep:[this.sourceToken]}):Ke(i.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let g=this.flowScalar(this.type);return void(f||i.value?(s.items.push({start:d,key:g,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(g):(Object.assign(i,{key:g,sep:[]}),this.onKeyLine=!0))}default:{let g=this.startBlockValue(s);if(g){if(g.type==="block-seq"){if(!i.explicitKey&&i.sep&&!Ke(i.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else c&&s.items.push({start:d});return void this.stack.push(g)}}}}yield*this.pop(),yield*this.step()}*blockSequence(s){let i=s.items[s.items.length-1];switch(this.type){case"newline":if(i.value){let c="end"in i.value?i.value.end:void 0;(Array.isArray(c)?c[c.length-1]:void 0)?.type==="comment"?c?.push(this.sourceToken):s.items.push({start:[this.sourceToken]})}else i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)s.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,s.indent)){let c=s.items[s.items.length-2],f=c?.value?.end;if(Array.isArray(f))return Array.prototype.push.apply(f,i.start),f.push(this.sourceToken),void s.items.pop()}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=s.indent)break;return void i.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==s.indent)break;return void(i.value||Ke(i.start,"seq-item-ind")?s.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken))}if(this.indent>s.indent){let c=this.startBlockValue(s);if(c)return void this.stack.push(c)}yield*this.pop(),yield*this.step()}*flowCollection(s){let i=s.items[s.items.length-1];if(this.type==="flow-error-end"){let c;do yield*this.pop(),c=this.peek(1);while(c&&c.type==="flow-collection")}else if(s.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":return void(!i||i.sep?s.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken));case"map-value-ind":return void(!i||i.value?s.items.push({start:[],key:null,sep:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!i||i.value?s.items.push({start:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let f=this.flowScalar(this.type);return void(!i||i.value?s.items.push({start:[],key:f,sep:[]}):i.sep?this.stack.push(f):Object.assign(i,{key:f,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void s.end.push(this.sourceToken)}let c=this.startBlockValue(s);c?this.stack.push(c):(yield*this.pop(),yield*this.step())}else{let c=this.peek(2);if(c.type==="block-map"&&(this.type==="map-value-ind"&&c.indent===s.indent||this.type==="newline"&&!c.items[c.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&c.type!=="flow-collection"){let f=gt(On(c));xi(s);let d=s.end.splice(1,s.end.length);d.push(this.sourceToken);let g={type:"block-map",offset:s.offset,indent:s.indent,items:[{start:f,key:s,sep:d}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=g}else yield*this.lineEnd(s)}}flowScalar(s){if(this.onNewLine){let i=this.source.indexOf(`
162
162
  `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
163
- `,i)+1}return{type:s,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(s){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let i=gt(On(s));return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let i=gt(On(s));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(s,i){return this.type==="comment"&&!(this.indent<=i)&&s.every(c=>c.type==="newline"||c.type==="space")}*documentEnd(s){this.type!=="doc-mode"&&(s.end?s.end.push(this.sourceToken):s.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(s){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:s.end?s.end.push(this.sourceToken):s.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Ti(a){let s=a.prettyErrors!==!1;return{lineCounter:a.lineCounter||s&&new wi||null,prettyErrors:s}}function ki(a,s={}){let{lineCounter:i,prettyErrors:c}=Ti(s),f=new kr(i?.addNewLine),d=new Er(s),g=null;for(let S of d.compose(f.parse(a),!0,a.length))if(g){if(g.options.logLevel!=="silent"){g.errors.push(new Xe(S.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else g=S;return c&&i&&(g.errors.forEach(kn(a,i)),g.warnings.forEach(kn(a,i))),g}return e.Alias=U,e.CST=Ba,e.Composer=Er,e.Document=ft,e.Lexer=vi,e.LineCounter=wi,e.Pair=ve,e.Parser=kr,e.Scalar=G,e.Schema=Tn,e.YAMLError=gr,e.YAMLMap=_e,e.YAMLParseError=Xe,e.YAMLSeq=We,e.YAMLWarning=ii,e.isAlias=p,e.isCollection=A,e.isDocument=b,e.isMap=v,e.isNode=I,e.isPair=y,e.isScalar=m,e.isSeq=w,e.parse=function(a,s,i){let c;typeof s=="function"?c=s:i===void 0&&s&&typeof s=="object"&&(i=s);let f=ki(a,i);if(!f)return null;if(f.warnings.forEach(d=>Rs(f.options.logLevel,d)),f.errors.length>0){if(f.options.logLevel!=="silent")throw f.errors[0];f.errors=[]}return f.toJS(Object.assign({reviver:c},i))},e.parseAllDocuments=function(a,s={}){let{lineCounter:i,prettyErrors:c}=Ti(s),f=new kr(i?.addNewLine),d=new Er(s),g=Array.from(d.compose(f.parse(a)));if(c&&i)for(let S of g)S.errors.forEach(kn(a,i)),S.warnings.forEach(kn(a,i));return g.length>0?g:Object.assign([],{empty:!0},d.streamInfo())},e.parseDocument=ki,e.stringify=function(a,s,i){let c=null;if(typeof s=="function"||Array.isArray(s)?c=s:i===void 0&&s&&(i=s),typeof i=="string"&&(i=i.length),typeof i=="number"){let f=Math.round(i);i=f<1?void 0:f>8?{indent:8}:{indent:f}}if(a===void 0){let{keepUndefined:f}=i??s??{};if(!f)return}return b(a)&&!c?a.toString(i):new ft(a,c,i).toString(i)},e.visit=ee,e.visitAsync=Z,e}({}),As=du;var pu=Me.domUtils.closestCrossShadow,gu=Me.domUtils.isElementVisible,cn=class{deepEventTarget(t){return t.composedPath()[0]}deepActiveElement(t){let n=t.activeElement;for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}modifiersForEvent(t){return(t.altKey?1:0)|(t.ctrlKey?2:0)|(t.metaKey?4:0)|(t.shiftKey?8:0)}buttonForEvent(t){switch(t.which){case 1:return"left";case 2:return"middle";case 3:return"right"}return"left"}positionForEvent(t){if(t.target.nodeName==="CANVAS")return{x:t.offsetX,y:t.offsetY}}consumeEvent(t){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()}asCheckbox(t){if(!t||t.nodeName!=="INPUT")return null;let n=t;return["checkbox","radio"].includes(n.type)?n:null}isRangeInput(t){return!t||t.nodeName!=="INPUT"?!1:t.type.toLowerCase()==="range"}addEventListener(t,n,r,o){return t.addEventListener(n,r,o),()=>{t.removeEventListener(n,r,o)}}removeEventListeners(t){for(let n of t)n();t.splice(0,t.length)}getNearestInteractiveElement(t,n=window.document){try{if(!t.matches("input,textarea,select")&&!t.isContentEditable){let r=pu(t,"button,select,input,[role=button],[role=checkbox],[role=radio],a,[role=link]",n);if(r&&gu(r))return r}return t}catch(r){return console.error(r),t}}shouldGenerateKeyPressFor(t){if(t.key==="Enter"&&(this.deepEventTarget(t).nodeName==="TEXTAREA"||this.deepEventTarget(t).isContentEditable)||["Backspace","Delete","AltGraph"].includes(t.key)||t.key==="@"&&t.code==="KeyL")return!1;if(navigator.platform.includes("Mac")){if(t.key==="v"&&t.metaKey)return!1}else if(t.key==="v"&&t.ctrlKey||t.key==="Insert"&&t.shiftKey)return!1;if(["Shift","Control","Meta","Alt","Process"].includes(t.key))return!1;let n=t.ctrlKey||t.altKey||t.metaKey;return t.key.length===1&&!n?!!this.asCheckbox(this.deepEventTarget(t)):!0}};var mu=Math.random().toString(36).substring(7),ba=0,Ns=()=>(ba++,`bvt_input_${ba}_${mu}`),yu=e=>{if(e instanceof HTMLInputElement&&(e.type==="button"||e.type==="submit"))return e.value?.length>0;if(e.innerText?.length>0){if(e.childNodes.length===0)return!0;for(let n=0;n<e.childNodes.length;n++){let r=e.childNodes[n];if(r.nodeType===Node.TEXT_NODE&&r.nodeValue.trim().length>0)return!0}}},nt={recordCommand:e=>__bvt_recordCommand(e),setMode:e=>__bvt_setMode(e),revertMode:()=>__bvt_revertMode(),recordPageClose:()=>__bvt_recordPageClose(),getMode:()=>__bvt_getMode(),log:e=>__bvt_log(e),sendObject:e=>__bvt_getObject(e)},va=null,Pe=class{constructor(t,n){this.name=t,this.getAction=n.getAction,this.getInterestedElement=n.getInterestedElement,this.hoverOutlineStyle=n.hoverOutlineStyle,this.start=n.start}},Cs=class{#t=null;#e="noop";contextElement=null;debugListener=!1;debugMouseOut=!1;debugMouseOver=!1;debugFocusOut=!1;debugFocusIn=!1;#n=Symbol("outline");#r=!1;toolbar=null;activeElement=null;cleanup=null;rect=null;offsetX=null;offsetY=null;popupHandlers=[];disableHighlight=!1;improviseLocators=!0;snapshotCapturer=new ma({excludeSelectors:["script","x-bvt-toolbar"]});injectedScript=pa();locatorGenerator=new ga(this.injectedScript);PW=Me;snapshotUtils=new ya;eventUtils=new cn;constructor(t={}){let{disableHighlight:n=!1,improviseLocators:r=!0,popupHandlers:o=[],testAttributes:u=[]}=t;this.disableHighlight=n,this.improviseLocators=r,this.popupHandlers=o,this.locatorGenerator.options.customAttributes=u,this.init()}init({mode:t="noop"}={}){this.addRecorderStates(),this.mode=t,this.addOverrides(),this.addListeners(),this.addHighlightListeners(window),window.addEventListener("DOMContentLoaded",async()=>{this.addToolbar(),this.mode=await nt.getMode()})}collectElementsFromAriaSnapshot(t,n){if(!(t.element&&t.element.tagName==="X-BVT-TOOL")){t.element&&n.add({element:t.element,snapshot:this.injectedScript.ariaSnapshot(t.element)});for(let r of t.children)typeof r!="string"&&this.collectElementsFromAriaSnapshot(r,n)}}addRecorderStates(){let t=new Pe("noop",{getAction:y=>{this.eventUtils.consumeEvent(y)},getInterestedElement:()=>{},hoverOutlineStyle:""}),n=new Pe("idle",{start:()=>(this.toolbar?.hide(),()=>{this.toolbar?.show()}),getAction:()=>null,getInterestedElement:()=>{},hoverOutlineStyle:""}),r=new Pe("running",{start:()=>(this.toolbar?.hide(),()=>{this.toolbar?.show()}),getAction:()=>null,getInterestedElement:()=>{},hoverOutlineStyle:""}),o=new Pe("inspecting",{start:()=>(this.toolbar?.hide(),()=>{this.toolbar?.show(),this.resetHighlight(this.activeElement)}),getInterestedElement:y=>y,hoverOutlineStyle:"2px solid red",getAction(y){if(l.eventUtils.consumeEvent(y),y.type==="pointerdown"){let m=l.eventUtils.deepEventTarget(y);return{details:{name:"click"},element:m}}}}),u=new Pe("multiInspecting",{start:()=>{this.toolbar?.hide();let y=document.getElementsByTagName("body")[0];this.pageSnapshot=this.injectedScript.ariaSnapshot(y),this.lastSnapshot=this.injectedScript._lastAriaSnapshot,this.snapshotElements=new Set,this.interestedElements=new Map,this.collectElementsFromAriaSnapshot(this.lastSnapshot.root,this.snapshotElements),this.elementSet=new Set;for(let{element:m}of this.snapshotElements)this.elementSet.add(m);return()=>{this.toolbar?.show();for(let m of this.interestedElements.keys())m.style.background=m.__originalBackground,delete m.__originalBackground}},getInterestedElement:y=>this.snapshotUtils.isSnapshotAvailable(y,this.elementSet),hoverOutlineStyle:"2px solid red",getAction:y=>{if(this.eventUtils.consumeEvent(y),y.type==="pointerdown"){let m=this.eventUtils.deepEventTarget(y),w=this.injectedScript.ariaSnapshot(m);if(this.snapshotUtils.isSnapshotAvailable(m,this.elementSet)){if(this.interestedElements.has(m)?(this.interestedElements.delete(m),m.style.background=m.__originalBackground,delete m.__originalBackground):(m.__originalBackground=m.style.background,m.style.background="rgba(255, 204, 0, 0.3)",this.interestedElements.set(m,w)),Array.from(this.interestedElements.keys()).length===0)return{details:{name:"click",value:""},element:m};let I=this.injectedScript.utils.parseAriaSnapshot(As,this.pageSnapshot).fragment,B=Array.from(this.interestedElements.values()).map(H=>this.injectedScript.utils.parseAriaSnapshot(As,H).fragment),q=this.snapshotUtils.filterParentToChildren(I,B);return w=this.snapshotUtils.serializeAriaSnapshot(q),{details:{name:"click",value:w},element:m}}}}}),l=this,h=new Pe("recordingText",{start:()=>(this.toolbar?.hide(),()=>{this.toolbar?.show(),this.resetHighlight(this.activeElement)}),getInterestedElement:y=>{if(yu(y))return y},hoverOutlineStyle:"2px solid red",getAction(y){if(l.eventUtils.consumeEvent(y),y.type==="pointerdown"){let m=l.eventUtils.deepEventTarget(y);if(this.getInterestedElement(m))return{details:{name:"click"},element:m}}}}),p=new Pe("recordingHover",{start:()=>(this.toolbar&&(this.toolbar.hoverTool.selected=!0),()=>{this.resetHighlight(this.activeElement),this.toolbar&&(this.toolbar.hoverTool.selected=!1)}),getAction:y=>{if(this.eventUtils.consumeEvent(y),y.type==="click")return{details:{name:"click"},element:this.eventUtils.deepEventTarget(y)}},getInterestedElement:y=>y,hoverOutlineStyle:"2px solid blue"}),b=new Pe("recordingInput",{start:()=>()=>{this.resetHighlight(this.activeElement)},getAction:y=>{switch(y.type){case"pointerdown":{if(y.button===2)return;let m=this.eventUtils.getNearestInteractiveElement(this.eventUtils.deepEventTarget(y)),w=this.eventUtils.asCheckbox(m);return m.nodeName==="INPUT"&&m.type.toLowerCase()==="file"?void 0:w?{details:{name:w.checked?"uncheck":"check"},element:m}:{details:{name:"click",position:this.eventUtils.positionForEvent(y),button:this.eventUtils.buttonForEvent(y),modifiers:this.eventUtils.modifiersForEvent(y),clickCount:y.detail},element:m}}case"input":{let m=this.eventUtils.getNearestInteractiveElement(this.eventUtils.deepEventTarget(y));return m.nodeName==="INPUT"&&m.type.toLowerCase()==="file"?{details:{name:"setInputFiles",files:[...m.files||[]].map(w=>w.name)},element:m}:this.eventUtils.isRangeInput(m)?{details:{name:"fill",text:m.value},element:m}:["INPUT","TEXTAREA"].includes(m.nodeName)||m.isContentEditable?m.nodeName==="INPUT"&&["checkbox","radio"].includes(m.type.toLowerCase())?void 0:{details:{name:"fill",text:m.isContentEditable?m.innerText:m.value},element:m}:m.nodeName==="SELECT"?{details:{name:"select",options:[...m.selectedOptions].map(A=>A.value)},element:m}:void 0}case"keydown":{if(!this.eventUtils.shouldGenerateKeyPressFor(y))return;if(y.key===" "){let m=this.eventUtils.asCheckbox(this.eventUtils.deepEventTarget(y));if(m)return{details:{name:m.checked?"uncheck":"check"},element:m}}return{details:{name:"press",key:y.key,modifiers:this.eventUtils.modifiersForEvent(y)},element:this.eventUtils.deepEventTarget(y)}}}},getInterestedElement:y=>{let m=this.eventUtils.getNearestInteractiveElement(y);return m||y},hoverOutlineStyle:"2px solid red"}),v={noop:t,idle:n,running:r,recordingText:h,recordingContext:h,recordingInput:b,recordingHover:p,inspecting:o,multiInspecting:u};this.RecorderStateMap=v}addOverrides(){let t=window.close.bind(window);window.close=async function(){nt.recordPageClose(),t()};let n=this,r=Element.prototype.attachShadow;Element.prototype.attachShadow=function(o){let u=r.call(this,o);return n.addHighlightListeners(u),u}}set mode(t){let n=this.RecorderStateMap[t];n&&(this.cleanup&&this.cleanup(),this.#t=n,this.#t.start&&(this.cleanup=this.#t.start()),this.#e=t)}get mode(){return this.#e}getFrameDetails(){return{url:window.location.href,title:window.document.title,isTop:window.top===window,viewport:{width:window.innerWidth,height:window.innerHeight}}}setHighlight(t){if(t.closest("x-bvt-toolbar"))return;let n=this.#t.getInterestedElement(t);n&&(this.activeElement=n,n[this.#n]===void 0&&(n[this.#n]=n.style.outline,n.style.outline=this.#t.hoverOutlineStyle,n.styleUpdateFn&&n.styleUpdateFn(n)))}resetHighlight(t){if(!t)return;let n=this.#t.getInterestedElement(t);n&&n[this.#n]!==void 0&&(n.style.outline=n[this.#n],n[this.#n]=void 0,n.styleUpdateFn&&n.styleUpdateFn(n))}addHighlightListeners(t){t.addEventListener("mouseover",n=>{if(this.debugMouseOver)debugger;let r=this.eventUtils.deepEventTarget(n);this.setHighlight(r)}),t.addEventListener("mouseout",n=>{if(this.debugMouseOut)debugger;let r=this.eventUtils.deepEventTarget(n);this.resetHighlight(r)}),t.addEventListener("focusin",n=>{if(this.debugFocusIn)debugger;let r=this.eventUtils.deepEventTarget(n);this.setHighlight(r)}),t.addEventListener("focusout",n=>{if(this.debugFocusOut)debugger;let r=this.eventUtils.deepEventTarget(n);this.resetHighlight(r)})}addToolbar(){if(window.top!==window)return;let t=document.createElement("x-bvt-toolbar");t.id="bvt-toolbar",this.toolbar=t,document.body.appendChild(t)}handleStateTransition(t){if(this.#e==="recordingContext"){this.contextElement=t,nt.revertMode();return}this.#e==="recordingHover"&&nt.revertMode(),this.contextElement=null}getElementProperties(t){if(!t||!(t instanceof HTMLElement||t instanceof SVGElement))throw new Error("Please provide a valid HTML element");let n={properties:{},attributes:{},dataset:{}},r={},o={},u={};for(let h in t)try{let p=t[h];typeof p!="function"&&typeof p!="object"&&p!==null&&p!==void 0&&!h.includes("_")&&(r[h]=p)}catch{r[h]="[Error accessing property]"}if(t.attributes)for(let h of t.attributes)h.name!=="data-input-id"&&h.name!=="data-blinq-id"&&(o[h.name]=h.value);if(t.dataset)for(let[h,p]of Object.entries(t.dataset))h!=="inputId"&&h!=="blinqId"&&(u[h]=p);let l=h=>Object.fromEntries(Object.entries(h).sort(([p],[b])=>p.localeCompare(b)));return n.properties=l(r),n.attributes=l(o),n.dataset=l(u),n}getElementDetails(t,n){(va!==t.dataset.inputId||n!=="input")&&(t.dataset.inputId=Ns(),va=t.dataset.inputId);let r=this.PW.roleUtils.getAriaRole(t),o=this.PW.roleUtils.getElementAccessibleName(t,!1)||this.PW.roleUtils.getElementAccessibleName(t,!0)||"",u=this.getElementProperties(t),l=this.PW.selectorUtils.elementText(new Map,t);return{role:r,label:o,inputID:t.dataset.inputId,tagName:t.tagName,type:t.type,text:l.full.trim(),textNormalized:l.normalized.trim(),parent:`tagname: ${t.parentElement?.tagName}
164
- innerText: ${t.parentElement?.innerText}`,attrs:{placeholder:t.getAttribute("placeholder"),src:t.getAttribute("src"),href:t.getAttribute("href"),alt:t.getAttribute("alt"),value:t.value,tagName:t.tagName,text:t.textContent,type:t.type,disabled:t.disabled,readOnly:t.readOnly,required:t.required,checked:t.checked,innerText:t.innerText},attributes:u.attributes,properties:u.properties,dataset:u.dataset}}handleEvent(t){if(!this.toolbar)return!0;let n=this.eventUtils.deepEventTarget(t);switch(t.type){case"pointerdown":{let r=n.closest("x-bvt-tool");if(r?.name==="drag")return this.rect=this.toolbar.getBoundingClientRect(),this.offsetX=t.clientX-this.rect.left,this.offsetY=t.clientY-this.rect.top,this.#r=!0,!1;if(r)return!1;break}case"pointerup":{if(this.#r)return this.#r=!1,!1;break}case"mousemove":{if(this.#r){let r=t.clientX-this.offsetX,o=t.clientY-this.offsetY;return r<0||o<0||r+this.rect.width>window.innerWidth||o+this.rect.height>window.innerHeight?void 0:(this.toolbar.style.left=`${r}px`,!1)}break}case"click":{let r=n.closest("x-bvt-tool");if(r?.name==="hover")return r.selected?nt.revertMode():nt.setMode("recordingHover"),!1;break}}return!0}isPopupCloseEvent(t){let n=t.type,r=n==="pointerdown",o=n==="keydown"&&t.key==="Enter";if(!r&&!o)return!1;let u=this.eventUtils.deepEventTarget(t);return this.popupHandlers.some(l=>{let h=l.locator.css,p=l.close_dialog_locator.css,b=document.querySelector(h);if(!b)return!1;let v=window.getComputedStyle(b);return v.display==="none"||v.visibility==="hidden"?!1:u.matches(p)})}getLocatorsObject(t,n={}){if(this.contextElement)return this.locatorGenerator.toContextLocators(t,this.contextElement,n);let r=this.#e==="recordingText";return this.locatorGenerator.getElementLocators(t,{excludeText:r,...n})}addListeners(){["input","keydown","click","pointerdown","pointerup","mousemove"].forEach(n=>{window.addEventListener(n,async r=>{if(this.debugListener)debugger;if(performance.mark("command-received"),!this.handleEvent(r))return;let u=this.#t.getAction(r);if(!u)return;let l=u.element,h=document.querySelector("[data-blinq-id]");h&&h.removeAttribute("data-blinq-id"),l.setAttribute("data-blinq-id",Ns());let p=document.querySelector("[data-blinq-context-id]");p&&p.removeAttribute("data-blinq-context-id"),this.contextElement&&this.contextElement.setAttribute("data-blinq-context-id",Ns()),performance.mark("command-send");let b={mode:this.#e,action:u.details,element:this.getElementDetails(l,n),isPopupCloseClick:this.isPopupCloseEvent(r),frame:this.getFrameDetails(),statistics:{time:`${performance.measure("command-received","command-send").duration.toFixed(2)} ms`}},v={id:l.getAttribute("data-blinq-id"),contextId:this.contextElement?.getAttribute("data-blinq-context-id"),doc:this.snapshotCapturer.createSnapshot({excludeSelectors:["x-bvt-toolbar","script","style","link[rel=stylesheet]"]})};b.snapshotDetails=v,nt.recordCommand(b),this.handleStateTransition(u.element)},{capture:!0})})}setPopupHandlers(t){this.popupHandlers=t}setDisableHighlight(t){this.disableHighlight=t}setImproviseLocators(t){this.improviseLocators=t}deselectAriaElements(){for(let t of this.interestedElements.keys())t.style.background=t.__originalBackground,delete t.__originalBackground;this.interestedElements.clear()}processAriaSnapshot(t){let n=this.snapshotUtils.findMatchingElements(t,this.snapshotElements);for(let r of n.values()){let o=r;o&&(o.__originalOutline=o.style.outline,o.style.outline="2px solid blue",setTimeout(()=>{o.style.outline=o.__originalOutline,delete o.__originalOutline},2e3))}}setTestAttributes(t){this.locatorGenerator.options.customAttributes=t}};window.__bvt_Recorder=new Cs(window.__bvt_Recorder_config);var Is=class extends HTMLElement{#t=!1;tooltipText=null;#e=null;#n=!1;constructor(t,n){super()}connectedCallback(){this.#n||(this.init(),this.addEventListener("mouseenter",this.showTooltip),this.addEventListener("mouseleave",this.hideTooltip),this.#n=!0)}init(){this.setAttribute("role","button"),this.style.cssText=`
163
+ `,i)+1}return{type:s,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(s){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let i=gt(On(s));return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let i=gt(On(s));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(s,i){return this.type==="comment"&&!(this.indent<=i)&&s.every(c=>c.type==="newline"||c.type==="space")}*documentEnd(s){this.type!=="doc-mode"&&(s.end?s.end.push(this.sourceToken):s.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(s){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:s.end?s.end.push(this.sourceToken):s.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Ti(a){let s=a.prettyErrors!==!1;return{lineCounter:a.lineCounter||s&&new wi||null,prettyErrors:s}}function ki(a,s={}){let{lineCounter:i,prettyErrors:c}=Ti(s),f=new kr(i?.addNewLine),d=new Er(s),g=null;for(let S of d.compose(f.parse(a),!0,a.length))if(g){if(g.options.logLevel!=="silent"){g.errors.push(new Xe(S.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else g=S;return c&&i&&(g.errors.forEach(kn(a,i)),g.warnings.forEach(kn(a,i))),g}return e.Alias=U,e.CST=Ba,e.Composer=Er,e.Document=ft,e.Lexer=vi,e.LineCounter=wi,e.Pair=ve,e.Parser=kr,e.Scalar=G,e.Schema=Tn,e.YAMLError=gr,e.YAMLMap=_e,e.YAMLParseError=Xe,e.YAMLSeq=We,e.YAMLWarning=ii,e.isAlias=p,e.isCollection=A,e.isDocument=b,e.isMap=v,e.isNode=I,e.isPair=m,e.isScalar=y,e.isSeq=w,e.parse=function(a,s,i){let c;typeof s=="function"?c=s:i===void 0&&s&&typeof s=="object"&&(i=s);let f=ki(a,i);if(!f)return null;if(f.warnings.forEach(d=>Rs(f.options.logLevel,d)),f.errors.length>0){if(f.options.logLevel!=="silent")throw f.errors[0];f.errors=[]}return f.toJS(Object.assign({reviver:c},i))},e.parseAllDocuments=function(a,s={}){let{lineCounter:i,prettyErrors:c}=Ti(s),f=new kr(i?.addNewLine),d=new Er(s),g=Array.from(d.compose(f.parse(a)));if(c&&i)for(let S of g)S.errors.forEach(kn(a,i)),S.warnings.forEach(kn(a,i));return g.length>0?g:Object.assign([],{empty:!0},d.streamInfo())},e.parseDocument=ki,e.stringify=function(a,s,i){let c=null;if(typeof s=="function"||Array.isArray(s)?c=s:i===void 0&&s&&(i=s),typeof i=="string"&&(i=i.length),typeof i=="number"){let f=Math.round(i);i=f<1?void 0:f>8?{indent:8}:{indent:f}}if(a===void 0){let{keepUndefined:f}=i??s??{};if(!f)return}return b(a)&&!c?a.toString(i):new ft(a,c,i).toString(i)},e.visit=ee,e.visitAsync=Z,e}({}),As=du;var pu=Me.domUtils.closestCrossShadow,gu=Me.domUtils.isElementVisible,cn=class{deepEventTarget(t){return t.composedPath()[0]}deepActiveElement(t){let n=t.activeElement;for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}modifiersForEvent(t){return(t.altKey?1:0)|(t.ctrlKey?2:0)|(t.metaKey?4:0)|(t.shiftKey?8:0)}buttonForEvent(t){switch(t.which){case 1:return"left";case 2:return"middle";case 3:return"right"}return"left"}positionForEvent(t){if(t.target.nodeName==="CANVAS")return{x:t.offsetX,y:t.offsetY}}consumeEvent(t){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()}asCheckbox(t){if(!t||t.nodeName!=="INPUT")return null;let n=t;return["checkbox","radio"].includes(n.type)?n:null}isRangeInput(t){return!t||t.nodeName!=="INPUT"?!1:t.type.toLowerCase()==="range"}addEventListener(t,n,r,o){return t.addEventListener(n,r,o),()=>{t.removeEventListener(n,r,o)}}removeEventListeners(t){for(let n of t)n();t.splice(0,t.length)}getNearestInteractiveElement(t,n=window.document){try{if(!t.matches("input,textarea,select")&&!t.isContentEditable){let r=pu(t,"button,select,input,[role=button],[role=checkbox],[role=radio],a,[role=link]",n);if(r&&gu(r))return r}return t}catch(r){return console.error(r),t}}shouldGenerateKeyPressFor(t){if(t.key==="Enter"&&(this.deepEventTarget(t).nodeName==="TEXTAREA"||this.deepEventTarget(t).isContentEditable)||["Backspace","Delete","AltGraph"].includes(t.key)||t.key==="@"&&t.code==="KeyL")return!1;if(navigator.platform.includes("Mac")){if(t.key==="v"&&t.metaKey)return!1}else if(t.key==="v"&&t.ctrlKey||t.key==="Insert"&&t.shiftKey)return!1;if(["Shift","Control","Meta","Alt","Process"].includes(t.key))return!1;let n=t.ctrlKey||t.altKey||t.metaKey;return t.key.length===1&&!n?!!this.asCheckbox(this.deepEventTarget(t)):!0}};var mu=Math.random().toString(36).substring(7),ba=0,Ns=()=>(ba++,`bvt_input_${ba}_${mu}`),yu=e=>{if(e instanceof HTMLInputElement&&(e.type==="button"||e.type==="submit"))return e.value?.length>0;if(e.innerText?.length>0){if(e.childNodes.length===0)return!0;for(let n=0;n<e.childNodes.length;n++){let r=e.childNodes[n];if(r.nodeType===Node.TEXT_NODE&&r.nodeValue.trim().length>0)return!0}}},nt={recordCommand:e=>__bvt_recordCommand(e),setMode:e=>__bvt_setMode(e),revertMode:()=>__bvt_revertMode(),recordPageClose:()=>__bvt_recordPageClose(),getMode:()=>__bvt_getMode(),log:e=>__bvt_log(e),sendObject:e=>__bvt_getObject(e)},va=null,Pe=class{constructor(t,n){this.name=t,this.getAction=n.getAction,this.getInterestedElement=n.getInterestedElement,this.hoverOutlineStyle=n.hoverOutlineStyle,this.start=n.start}},Cs=class{#t=null;#e="noop";contextElement=null;debugListener=!1;debugMouseOut=!1;debugMouseOver=!1;debugFocusOut=!1;debugFocusIn=!1;#n=Symbol("outline");#r=!1;toolbar=null;activeElement=null;cleanup=null;rect=null;offsetX=null;offsetY=null;popupHandlers=[];disableHighlight=!1;improviseLocators=!0;snapshotCapturer=new ma({excludeSelectors:["script","x-bvt-toolbar"]});injectedScript=pa();locatorGenerator=new ga(this.injectedScript);PW=Me;snapshotUtils=new ya;eventUtils=new cn;constructor(t={}){let{disableHighlight:n=!1,improviseLocators:r=!0,popupHandlers:o=[],testAttributes:u=[]}=t;this.disableHighlight=n,this.improviseLocators=r,this.popupHandlers=o,this.locatorGenerator.options.customAttributes=u,this.init()}init({mode:t="noop"}={}){this.addRecorderStates(),this.mode=t,this.addOverrides(),this.addListeners(),this.addHighlightListeners(window),window.addEventListener("DOMContentLoaded",async()=>{this.addToolbar(),this.mode=await nt.getMode()})}collectElementsFromAriaSnapshot(t,n){if(!(t.element&&t.element.tagName==="X-BVT-TOOL")){t.element&&n.add({element:t.element,snapshot:this.injectedScript.ariaSnapshot(t.element)});for(let r of t.children)typeof r!="string"&&this.collectElementsFromAriaSnapshot(r,n)}}addRecorderStates(){let t=new Pe("noop",{getAction:m=>{this.eventUtils.consumeEvent(m)},getInterestedElement:()=>{},hoverOutlineStyle:""}),n=new Pe("idle",{start:()=>(this.toolbar?.hide(),()=>{this.toolbar?.show()}),getAction:()=>null,getInterestedElement:()=>{},hoverOutlineStyle:""}),r=new Pe("running",{start:()=>(this.toolbar?.hide(),()=>{this.toolbar?.show()}),getAction:()=>null,getInterestedElement:()=>{},hoverOutlineStyle:""}),o=new Pe("inspecting",{start:()=>(this.toolbar?.hide(),()=>{this.toolbar?.show(),this.resetHighlight(this.activeElement)}),getInterestedElement:m=>m,hoverOutlineStyle:"2px solid red",getAction(m){if(l.eventUtils.consumeEvent(m),m.type==="pointerdown"){let y=l.eventUtils.deepEventTarget(m);return{details:{name:"click"},element:y}}}}),u=new Pe("multiInspecting",{start:()=>{this.toolbar?.hide();let m=document.getElementsByTagName("body")[0];this.pageSnapshot=this.injectedScript.ariaSnapshot(m),this.lastSnapshot=this.injectedScript._lastAriaSnapshot,this.snapshotElements=new Set,this.interestedElements=new Map,this.collectElementsFromAriaSnapshot(this.lastSnapshot.root,this.snapshotElements),this.elementSet=new Set;for(let{element:y}of this.snapshotElements)this.elementSet.add(y);return()=>{this.toolbar?.show();for(let y of this.interestedElements.keys())y.style.background=y.__originalBackground,delete y.__originalBackground}},getInterestedElement:m=>this.snapshotUtils.isSnapshotAvailable(m,this.elementSet),hoverOutlineStyle:"2px solid red",getAction:m=>{if(this.eventUtils.consumeEvent(m),m.type==="pointerdown"){let y=this.eventUtils.deepEventTarget(m),w=this.injectedScript.ariaSnapshot(y);if(this.snapshotUtils.isSnapshotAvailable(y,this.elementSet)){if(this.interestedElements.has(y)?(this.interestedElements.delete(y),y.style.background=y.__originalBackground,delete y.__originalBackground):(y.__originalBackground=y.style.background,y.style.background="rgba(255, 204, 0, 0.3)",this.interestedElements.set(y,w)),Array.from(this.interestedElements.keys()).length===0)return{details:{name:"click",value:""},element:y};let I=this.injectedScript.utils.parseAriaSnapshot(As,this.pageSnapshot).fragment,B=Array.from(this.interestedElements.values()).map(H=>this.injectedScript.utils.parseAriaSnapshot(As,H).fragment),q=this.snapshotUtils.filterParentToChildren(I,B);return w=this.snapshotUtils.serializeAriaSnapshot(q),{details:{name:"click",value:w},element:y}}}}}),l=this,h=new Pe("recordingText",{start:()=>(this.toolbar?.hide(),()=>{this.toolbar?.show(),this.resetHighlight(this.activeElement)}),getInterestedElement:m=>{if(yu(m))return m},hoverOutlineStyle:"2px solid red",getAction(m){if(l.eventUtils.consumeEvent(m),m.type==="pointerdown"){let y=l.eventUtils.deepEventTarget(m);if(this.getInterestedElement(y))return{details:{name:"click"},element:y}}}}),p=new Pe("recordingHover",{start:()=>(this.toolbar&&(this.toolbar.hoverTool.selected=!0),()=>{this.resetHighlight(this.activeElement),this.toolbar&&(this.toolbar.hoverTool.selected=!1)}),getAction:m=>{if(this.eventUtils.consumeEvent(m),m.type==="click")return{details:{name:"click"},element:this.eventUtils.deepEventTarget(m)}},getInterestedElement:m=>m,hoverOutlineStyle:"2px solid blue"}),b=new Pe("recordingInput",{start:()=>()=>{this.resetHighlight(this.activeElement)},getAction:m=>{switch(m.type){case"pointerdown":{if(m.button===2)return;let y=this.eventUtils.getNearestInteractiveElement(this.eventUtils.deepEventTarget(m)),w=this.eventUtils.asCheckbox(y);return y.nodeName==="INPUT"&&y.type.toLowerCase()==="file"?void 0:w?{details:{name:w.checked?"uncheck":"check"},element:y}:{details:{name:"click",position:this.eventUtils.positionForEvent(m),button:this.eventUtils.buttonForEvent(m),modifiers:this.eventUtils.modifiersForEvent(m),clickCount:m.detail},element:y}}case"input":{let y=this.eventUtils.getNearestInteractiveElement(this.eventUtils.deepEventTarget(m));return y.nodeName==="INPUT"&&y.type.toLowerCase()==="file"?{details:{name:"setInputFiles",files:[...y.files||[]].map(w=>w.name)},element:y}:this.eventUtils.isRangeInput(y)?{details:{name:"fill",text:y.value},element:y}:["INPUT","TEXTAREA"].includes(y.nodeName)||y.isContentEditable?y.nodeName==="INPUT"&&["checkbox","radio"].includes(y.type.toLowerCase())?void 0:{details:{name:"fill",text:y.isContentEditable?y.innerText:y.value},element:y}:y.nodeName==="SELECT"?{details:{name:"select",options:[...y.selectedOptions].map(A=>A.value)},element:y}:void 0}case"keydown":{let y=m.preventDefault.bind(m);if(m.preventDefault=()=>{if(m.key.length>=1&&!m.ctrlKey&&!m.metaKey&&!m.altKey){let w=this.eventUtils.getNearestInteractiveElement(this.eventUtils.deepEventTarget(m));setTimeout(()=>{if(m.__bvt_recorded!==void 0)return;let I=w.value;this.recordEvent({details:{name:"fill",text:I},element:w},w,"input",m),m.__bvt_recorded=!0},20)}y()},!this.eventUtils.shouldGenerateKeyPressFor(m))return;if(m.key===" "){let w=this.eventUtils.asCheckbox(this.eventUtils.deepEventTarget(m));if(w)return{details:{name:w.checked?"uncheck":"check"},element:w}}return{details:{name:"press",key:m.key,modifiers:this.eventUtils.modifiersForEvent(m)},element:this.eventUtils.deepEventTarget(m)}}}},getInterestedElement:m=>{let y=this.eventUtils.getNearestInteractiveElement(m);return y||m},hoverOutlineStyle:"2px solid red"}),v={noop:t,idle:n,running:r,recordingText:h,recordingContext:h,recordingInput:b,recordingHover:p,inspecting:o,multiInspecting:u};this.RecorderStateMap=v}addOverrides(){let t=window.close.bind(window);window.close=async function(){nt.recordPageClose(),t()};let n=this,r=Element.prototype.attachShadow;Element.prototype.attachShadow=function(o){let u=r.call(this,o);return n.addHighlightListeners(u),u}}set mode(t){let n=this.RecorderStateMap[t];n&&(this.cleanup&&this.cleanup(),this.#t=n,this.#t.start&&(this.cleanup=this.#t.start()),this.#e=t)}get mode(){return this.#e}getFrameDetails(){return{url:window.location.href,title:window.document.title,isTop:window.top===window,viewport:{width:window.innerWidth,height:window.innerHeight}}}setHighlight(t){if(t.closest("x-bvt-toolbar"))return;let n=this.#t.getInterestedElement(t);n&&(this.activeElement=n,n[this.#n]===void 0&&(n[this.#n]=n.style.outline,n.style.outline=this.#t.hoverOutlineStyle,n.styleUpdateFn&&n.styleUpdateFn(n)))}resetHighlight(t){if(!t)return;let n=this.#t.getInterestedElement(t);n&&n[this.#n]!==void 0&&(n.style.outline=n[this.#n],n[this.#n]=void 0,n.styleUpdateFn&&n.styleUpdateFn(n))}addHighlightListeners(t){t.addEventListener("mouseover",n=>{if(this.debugMouseOver)debugger;let r=this.eventUtils.deepEventTarget(n);this.setHighlight(r)}),t.addEventListener("mouseout",n=>{if(this.debugMouseOut)debugger;let r=this.eventUtils.deepEventTarget(n);this.resetHighlight(r)}),t.addEventListener("focusin",n=>{if(this.debugFocusIn)debugger;let r=this.eventUtils.deepEventTarget(n);this.setHighlight(r)}),t.addEventListener("focusout",n=>{if(this.debugFocusOut)debugger;let r=this.eventUtils.deepEventTarget(n);this.resetHighlight(r)})}addToolbar(){if(window.top!==window)return;let t=document.createElement("x-bvt-toolbar");t.id="bvt-toolbar",this.toolbar=t,document.body.appendChild(t)}handleStateTransition(t){if(this.#e==="recordingContext"){this.contextElement=t,nt.revertMode();return}this.#e==="recordingHover"&&nt.revertMode(),this.contextElement=null}getElementProperties(t){if(!t||!(t instanceof HTMLElement||t instanceof SVGElement))throw new Error("Please provide a valid HTML element");let n={properties:{},attributes:{},dataset:{}},r={},o={},u={};for(let h in t)try{let p=t[h];typeof p!="function"&&typeof p!="object"&&p!==null&&p!==void 0&&!h.includes("_")&&(r[h]=p)}catch{r[h]="[Error accessing property]"}if(t.attributes)for(let h of t.attributes)h.name!=="data-input-id"&&h.name!=="data-blinq-id"&&(o[h.name]=h.value);if(t.dataset)for(let[h,p]of Object.entries(t.dataset))h!=="inputId"&&h!=="blinqId"&&(u[h]=p);let l=h=>Object.fromEntries(Object.entries(h).sort(([p],[b])=>p.localeCompare(b)));return n.properties=l(r),n.attributes=l(o),n.dataset=l(u),n}getElementDetails(t,n){(va!==t.dataset.inputId||n!=="input")&&(t.dataset.inputId=Ns(),va=t.dataset.inputId);let r=this.PW.roleUtils.getAriaRole(t),o=this.PW.roleUtils.getElementAccessibleName(t,!1)||this.PW.roleUtils.getElementAccessibleName(t,!0)||"",u=this.getElementProperties(t),l=this.PW.selectorUtils.elementText(new Map,t);return{role:r,label:o,inputID:t.dataset.inputId,tagName:t.tagName,type:t.type,text:l.full.trim(),textNormalized:l.normalized.trim(),parent:`tagname: ${t.parentElement?.tagName}
164
+ innerText: ${t.parentElement?.innerText}`,attrs:{placeholder:t.getAttribute("placeholder"),src:t.getAttribute("src"),href:t.getAttribute("href"),alt:t.getAttribute("alt"),value:t.value,tagName:t.tagName,text:t.textContent,type:t.type,disabled:t.disabled,readOnly:t.readOnly,required:t.required,checked:t.checked,innerText:t.innerText},attributes:u.attributes,properties:u.properties,dataset:u.dataset}}handleEvent(t){if(!this.toolbar)return!0;let n=this.eventUtils.deepEventTarget(t);switch(t.type){case"pointerdown":{let r=n.closest("x-bvt-tool");if(r?.name==="drag")return this.rect=this.toolbar.getBoundingClientRect(),this.offsetX=t.clientX-this.rect.left,this.offsetY=t.clientY-this.rect.top,this.#r=!0,!1;if(r)return!1;break}case"pointerup":{if(this.#r)return this.#r=!1,!1;break}case"mousemove":{if(this.#r){let r=t.clientX-this.offsetX,o=t.clientY-this.offsetY;return r<0||o<0||r+this.rect.width>window.innerWidth||o+this.rect.height>window.innerHeight?void 0:(this.toolbar.style.left=`${r}px`,!1)}break}case"click":{let r=n.closest("x-bvt-tool");if(r?.name==="hover")return r.selected?nt.revertMode():nt.setMode("recordingHover"),!1;break}}return!0}isPopupCloseEvent(t){let n=t.type,r=n==="pointerdown",o=n==="keydown"&&t.key==="Enter";if(!r&&!o)return!1;let u=this.eventUtils.deepEventTarget(t);return this.popupHandlers.some(l=>{let h=l.locator.css,p=l.close_dialog_locator.css,b=document.querySelector(h);if(!b)return!1;let v=window.getComputedStyle(b);return v.display==="none"||v.visibility==="hidden"?!1:u.matches(p)})}getLocatorsObject(t,n={}){if(this.contextElement)return this.locatorGenerator.toContextLocators(t,this.contextElement,n);let r=this.#e==="recordingText";return this.locatorGenerator.getElementLocators(t,{excludeText:r,...n})}addListeners(){["input","keydown","click","pointerdown","pointerup","mousemove"].forEach(n=>{window.addEventListener(n,async r=>{if(this.debugListener)debugger;if(performance.mark("command-received"),!this.handleEvent(r))return;let u=this.#t.getAction(r);if(!u)return;let l=u.element,h=document.querySelector("[data-blinq-id]");h&&h.removeAttribute("data-blinq-id"),l.setAttribute("data-blinq-id",Ns());let p=document.querySelector("[data-blinq-context-id]");p&&p.removeAttribute("data-blinq-context-id"),this.contextElement&&this.contextElement.setAttribute("data-blinq-context-id",Ns()),performance.mark("command-send"),this.recordEvent(u,l,n,r),this.handleStateTransition(u.element)},{capture:!0})})}recordEvent(t,n,r,o){let u={mode:this.#e,action:t.details,element:this.getElementDetails(n,r),isPopupCloseClick:this.isPopupCloseEvent(o),frame:this.getFrameDetails(),statistics:{time:`${performance.measure("command-received","command-send").duration.toFixed(2)} ms`}},l={id:n.getAttribute("data-blinq-id"),contextId:this.contextElement?.getAttribute("data-blinq-context-id"),doc:this.snapshotCapturer.createSnapshot({excludeSelectors:["x-bvt-toolbar","script","style","link[rel=stylesheet]"]})};u.snapshotDetails=l,nt.recordCommand(u)}setPopupHandlers(t){this.popupHandlers=t}setDisableHighlight(t){this.disableHighlight=t}setImproviseLocators(t){this.improviseLocators=t}deselectAriaElements(){for(let t of this.interestedElements.keys())t.style.background=t.__originalBackground,delete t.__originalBackground;this.interestedElements.clear()}processAriaSnapshot(t){let n=this.snapshotUtils.findMatchingElements(t,this.snapshotElements);for(let r of n.values()){let o=r;o&&(o.__originalOutline=o.style.outline,o.style.outline="2px solid blue",setTimeout(()=>{o.style.outline=o.__originalOutline,delete o.__originalOutline},2e3))}}setTestAttributes(t){this.locatorGenerator.options.customAttributes=t}};window.__bvt_Recorder=new Cs(window.__bvt_Recorder_config);var Is=class extends HTMLElement{#t=!1;tooltipText=null;#e=null;#n=!1;constructor(t,n){super()}connectedCallback(){this.#n||(this.init(),this.addEventListener("mouseenter",this.showTooltip),this.addEventListener("mouseleave",this.hideTooltip),this.#n=!0)}init(){this.setAttribute("role","button"),this.style.cssText=`
165
165
  display: inline-flex;
166
166
  align-items: center;
167
167
  justify-content: center;