playwright-core 1.54.1-beta-1753117034000 → 1.54.1-beta-1753912139000
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/generated/pollingRecorderSource.js +1 -1
- package/lib/vite/recorder/assets/{codeMirrorModule-ISMgoUzq.js → codeMirrorModule-e5r_evYO.js} +1 -1
- package/lib/vite/recorder/assets/{index-Ds0aE8ml.js → index-DGRGeke2.js} +32 -32
- package/lib/vite/recorder/index.html +1 -1
- package/lib/vite/traceViewer/assets/{codeMirrorModule-3kZ8GVgK.js → codeMirrorModule-rKSJ91kC.js} +1 -1
- package/lib/vite/traceViewer/assets/{defaultSettingsView-Ds-bson8.js → defaultSettingsView-CUd-tHFm.js} +3 -3
- package/lib/vite/traceViewer/{index.CG3BNeDq.js → index.Cu8n3rOi.js} +1 -1
- package/lib/vite/traceViewer/index.html +2 -2
- package/lib/vite/traceViewer/{uiMode.BijnIl3L.js → uiMode.BCbdHUa5.js} +1 -1
- package/lib/vite/traceViewer/uiMode.html +2 -2
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
21
21
|
<link rel="icon" href="/playwright-logo.svg" type="image/svg+xml">
|
|
22
22
|
<title>Playwright Inspector</title>
|
|
23
|
-
<script type="module" crossorigin src="/assets/index-
|
|
23
|
+
<script type="module" crossorigin src="/assets/index-DGRGeke2.js"></script>
|
|
24
24
|
<link rel="stylesheet" crossorigin href="/assets/index-eHBmevrY.css">
|
|
25
25
|
</head>
|
|
26
26
|
<body>
|
package/lib/vite/traceViewer/assets/{codeMirrorModule-3kZ8GVgK.js → codeMirrorModule-rKSJ91kC.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as Wu}from"./defaultSettingsView-Ds-bson8.js";var vi={exports:{}},_u=vi.exports,ha;function It(){return ha||(ha=1,function(Et,zt){(function(C,De){Et.exports=De()})(_u,function(){var C=navigator.userAgent,De=navigator.platform,I=/gecko\/\d/i.test(C),K=/MSIE \d/.test(C),$=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(C),V=/Edge\/(\d+)/.exec(C),b=K||$||V,N=b&&(K?document.documentMode||6:+(V||$)[1]),_=!V&&/WebKit\//.test(C),ie=_&&/Qt\/\d+\.\d+/.test(C),O=!V&&/Chrome\/(\d+)/.exec(C),q=O&&+O[1],z=/Opera\//.test(C),X=/Apple Computer/.test(navigator.vendor),ke=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(C),we=/PhantomJS/.test(C),te=X&&(/Mobile\/\w+/.test(C)||navigator.maxTouchPoints>2),re=/Android/.test(C),ne=te||re||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(C),se=te||/Mac/.test(De),Ae=/\bCrOS\b/.test(C),ye=/win/i.test(De),de=z&&C.match(/Version\/(\d*\.\d*)/);de&&(de=Number(de[1])),de&&de>=15&&(z=!1,_=!0);var ze=se&&(ie||z&&(de==null||de<12.11)),fe=I||b&&N>=9;function H(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Ee=function(e,t){var n=e.className,r=H(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function D(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function J(e,t){return D(e).appendChild(t)}function d(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function S(e,t,n,r){var i=d(e,t,n,r);return i.setAttribute("role","presentation"),i}var w;document.createRange?w=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:w=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function m(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function y(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function P(e,t){var n=e.className;H(t).test(n)||(e.className+=(n?" ":"")+t)}function le(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!H(n[r]).test(t)&&(t+=" "+n[r]);return t}var p=function(e){e.select()};te?p=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:b&&(p=function(e){try{e.select()}catch{}});function c(e){return e.display.wrapper.ownerDocument}function Y(e){return xe(e.display.wrapper)}function xe(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function j(e){return c(e).defaultView}function ue(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Te(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Le(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,l=i||0;;){var a=e.indexOf(" ",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var be=function(){this.id=null,this.f=null,this.time=0,this.handler=ue(this.onTimeout,this)};be.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},be.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function oe(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Ne=50,qe={toString:function(){return"CodeMirror.Pass"}},Ve={scroll:!1},ct={origin:"*mouse"},Oe={origin:"+move"};function Re(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Ue=[""];function et(e){for(;Ue.length<=e;)Ue.push(ge(Ue)+" ");return Ue[e]}function ge(e){return e[e.length-1]}function Pe(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function T(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function B(){}function F(e,t){var n;return Object.create?n=Object.create(e):(B.prototype=e,n=new B),t&&Te(t,n),n}var Ie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ae(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Ie.test(e))}function Se(e,t){return t?t.source.indexOf("\\w")>-1&&ae(e)?!0:t.test(e):ae(e)}function he(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Be=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Me(e){return e.charCodeAt(0)>=768&&Be.test(e)}function Lt(e,t,n){for(;(n<0?t>0:t<e.length)&&Me(e.charAt(t));)t+=n;return t}function Nt(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function or(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var br=null;function lr(e,t,n){var r;br=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:br=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:br=i)}return r??br}var mi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,h,v){this.level=u,this.from=h,this.to=v}return function(u,h){var v=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var k=u.length,x=[],M=0;M<k;++M)x.push(n(u.charCodeAt(M)));for(var E=0,R=v;E<k;++E){var U=x[E];U=="m"?x[E]=R:R=U}for(var Q=0,G=v;Q<k;++Q){var ee=x[Q];ee=="1"&&G=="r"?x[Q]="n":o.test(ee)&&(G=ee,ee=="r"&&(x[Q]="R"))}for(var me=1,pe=x[0];me<k-1;++me){var Fe=x[me];Fe=="+"&&pe=="1"&&x[me+1]=="1"?x[me]="1":Fe==","&&pe==x[me+1]&&(pe=="1"||pe=="n")&&(x[me]=pe),pe=Fe}for(var Ke=0;Ke<k;++Ke){var st=x[Ke];if(st==",")x[Ke]="N";else if(st=="%"){var Xe=void 0;for(Xe=Ke+1;Xe<k&&x[Xe]=="%";++Xe);for(var Mt=Ke&&x[Ke-1]=="!"||Xe<k&&x[Xe]=="1"?"1":"N",wt=Ke;wt<Xe;++wt)x[wt]=Mt;Ke=Xe-1}}for(var tt=0,St=v;tt<k;++tt){var ft=x[tt];St=="L"&&ft=="1"?x[tt]="L":o.test(ft)&&(St=ft)}for(var nt=0;nt<k;++nt)if(i.test(x[nt])){var rt=void 0;for(rt=nt+1;rt<k&&i.test(x[rt]);++rt);for(var Qe=(nt?x[nt-1]:v)=="L",Tt=(rt<k?x[rt]:v)=="L",nn=Qe==Tt?Qe?"L":"R":v,xr=nt;xr<rt;++xr)x[xr]=nn;nt=rt-1}for(var gt=[],Jt,ut=0;ut<k;)if(l.test(x[ut])){var co=ut;for(++ut;ut<k&&l.test(x[ut]);++ut);gt.push(new s(0,co,ut))}else{var ir=ut,Ar=gt.length,Er=h=="rtl"?1:0;for(++ut;ut<k&&x[ut]!="L";++ut);for(var mt=ir;mt<ut;)if(a.test(x[mt])){ir<mt&&(gt.splice(Ar,0,new s(1,ir,mt)),Ar+=Er);var on=mt;for(++mt;mt<ut&&a.test(x[mt]);++mt);gt.splice(Ar,0,new s(2,on,mt)),Ar+=Er,ir=mt}else++mt;ir<ut&>.splice(Ar,0,new s(1,ir,ut))}return h=="ltr"&&(gt[0].level==1&&(Jt=u.match(/^\s+/))&&(gt[0].from=Jt[0].length,gt.unshift(new s(0,0,Jt[0].length))),ge(gt).level==1&&(Jt=u.match(/\s+$/))&&(ge(gt).to-=Jt[0].length,gt.push(new s(0,k-Jt[0].length,k)))),h=="rtl"?gt.reverse():gt}}();function We(e,t){var n=e.order;return n==null&&(n=e.order=mi(e.text,t)),n}var Bn=[],ve=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Bn).concat(n)}};function Qt(e,t){return e._handlers&&e._handlers[t]||Bn}function dt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=oe(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ye(e,t){var n=Qt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Ze(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ye(e,n||t.type,e,t),yt(t)||t.codemirrorIgnore}function Ot(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)oe(n,t[r])==-1&&n.push(t[r])}function Ct(e,t){return Qt(e,t).length>0}function Bt(e){e.prototype.on=function(t,n){ve(this,t,n)},e.prototype.off=function(t,n){dt(this,t,n)}}function ht(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Nr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function yt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ar(e){ht(e),Nr(e)}function ln(e){return e.target||e.srcElement}function Wt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),se&&e.ctrlKey&&t==1&&(t=3),t}var yi=function(){if(b&&N<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),Or;function Wn(e){if(Or==null){var t=d("span","");J(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Or=t.offsetWidth<=1&&t.offsetHeight>2&&!(b&&N<8))}var n=Or?d("span",""):d("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var an;function sr(e){if(an!=null)return an;var t=J(e,document.createTextNode("AخA")),n=w(t,0,1).getBoundingClientRect(),r=w(t,1,2).getBoundingClientRect();return D(e),!n||n.left==n.right?!1:an=r.right-n.right<3}var Pt=`
|
|
1
|
+
import{n as Wu}from"./defaultSettingsView-CUd-tHFm.js";var vi={exports:{}},_u=vi.exports,ha;function It(){return ha||(ha=1,function(Et,zt){(function(C,De){Et.exports=De()})(_u,function(){var C=navigator.userAgent,De=navigator.platform,I=/gecko\/\d/i.test(C),K=/MSIE \d/.test(C),$=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(C),V=/Edge\/(\d+)/.exec(C),b=K||$||V,N=b&&(K?document.documentMode||6:+(V||$)[1]),_=!V&&/WebKit\//.test(C),ie=_&&/Qt\/\d+\.\d+/.test(C),O=!V&&/Chrome\/(\d+)/.exec(C),q=O&&+O[1],z=/Opera\//.test(C),X=/Apple Computer/.test(navigator.vendor),ke=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(C),we=/PhantomJS/.test(C),te=X&&(/Mobile\/\w+/.test(C)||navigator.maxTouchPoints>2),re=/Android/.test(C),ne=te||re||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(C),se=te||/Mac/.test(De),Ae=/\bCrOS\b/.test(C),ye=/win/i.test(De),de=z&&C.match(/Version\/(\d*\.\d*)/);de&&(de=Number(de[1])),de&&de>=15&&(z=!1,_=!0);var ze=se&&(ie||z&&(de==null||de<12.11)),fe=I||b&&N>=9;function H(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Ee=function(e,t){var n=e.className,r=H(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function D(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function J(e,t){return D(e).appendChild(t)}function d(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function S(e,t,n,r){var i=d(e,t,n,r);return i.setAttribute("role","presentation"),i}var w;document.createRange?w=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:w=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function m(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function y(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function P(e,t){var n=e.className;H(t).test(n)||(e.className+=(n?" ":"")+t)}function le(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!H(n[r]).test(t)&&(t+=" "+n[r]);return t}var p=function(e){e.select()};te?p=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:b&&(p=function(e){try{e.select()}catch{}});function c(e){return e.display.wrapper.ownerDocument}function Y(e){return xe(e.display.wrapper)}function xe(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function j(e){return c(e).defaultView}function ue(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Te(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Le(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,l=i||0;;){var a=e.indexOf(" ",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var be=function(){this.id=null,this.f=null,this.time=0,this.handler=ue(this.onTimeout,this)};be.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},be.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function oe(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Ne=50,qe={toString:function(){return"CodeMirror.Pass"}},Ve={scroll:!1},ct={origin:"*mouse"},Oe={origin:"+move"};function Re(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Ue=[""];function et(e){for(;Ue.length<=e;)Ue.push(ge(Ue)+" ");return Ue[e]}function ge(e){return e[e.length-1]}function Pe(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function T(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function B(){}function F(e,t){var n;return Object.create?n=Object.create(e):(B.prototype=e,n=new B),t&&Te(t,n),n}var Ie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ae(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Ie.test(e))}function Se(e,t){return t?t.source.indexOf("\\w")>-1&&ae(e)?!0:t.test(e):ae(e)}function he(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Be=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Me(e){return e.charCodeAt(0)>=768&&Be.test(e)}function Lt(e,t,n){for(;(n<0?t>0:t<e.length)&&Me(e.charAt(t));)t+=n;return t}function Nt(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function or(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var br=null;function lr(e,t,n){var r;br=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:br=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:br=i)}return r??br}var mi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,h,v){this.level=u,this.from=h,this.to=v}return function(u,h){var v=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var k=u.length,x=[],M=0;M<k;++M)x.push(n(u.charCodeAt(M)));for(var E=0,R=v;E<k;++E){var U=x[E];U=="m"?x[E]=R:R=U}for(var Q=0,G=v;Q<k;++Q){var ee=x[Q];ee=="1"&&G=="r"?x[Q]="n":o.test(ee)&&(G=ee,ee=="r"&&(x[Q]="R"))}for(var me=1,pe=x[0];me<k-1;++me){var Fe=x[me];Fe=="+"&&pe=="1"&&x[me+1]=="1"?x[me]="1":Fe==","&&pe==x[me+1]&&(pe=="1"||pe=="n")&&(x[me]=pe),pe=Fe}for(var Ke=0;Ke<k;++Ke){var st=x[Ke];if(st==",")x[Ke]="N";else if(st=="%"){var Xe=void 0;for(Xe=Ke+1;Xe<k&&x[Xe]=="%";++Xe);for(var Mt=Ke&&x[Ke-1]=="!"||Xe<k&&x[Xe]=="1"?"1":"N",wt=Ke;wt<Xe;++wt)x[wt]=Mt;Ke=Xe-1}}for(var tt=0,St=v;tt<k;++tt){var ft=x[tt];St=="L"&&ft=="1"?x[tt]="L":o.test(ft)&&(St=ft)}for(var nt=0;nt<k;++nt)if(i.test(x[nt])){var rt=void 0;for(rt=nt+1;rt<k&&i.test(x[rt]);++rt);for(var Qe=(nt?x[nt-1]:v)=="L",Tt=(rt<k?x[rt]:v)=="L",nn=Qe==Tt?Qe?"L":"R":v,xr=nt;xr<rt;++xr)x[xr]=nn;nt=rt-1}for(var gt=[],Jt,ut=0;ut<k;)if(l.test(x[ut])){var co=ut;for(++ut;ut<k&&l.test(x[ut]);++ut);gt.push(new s(0,co,ut))}else{var ir=ut,Ar=gt.length,Er=h=="rtl"?1:0;for(++ut;ut<k&&x[ut]!="L";++ut);for(var mt=ir;mt<ut;)if(a.test(x[mt])){ir<mt&&(gt.splice(Ar,0,new s(1,ir,mt)),Ar+=Er);var on=mt;for(++mt;mt<ut&&a.test(x[mt]);++mt);gt.splice(Ar,0,new s(2,on,mt)),Ar+=Er,ir=mt}else++mt;ir<ut&>.splice(Ar,0,new s(1,ir,ut))}return h=="ltr"&&(gt[0].level==1&&(Jt=u.match(/^\s+/))&&(gt[0].from=Jt[0].length,gt.unshift(new s(0,0,Jt[0].length))),ge(gt).level==1&&(Jt=u.match(/\s+$/))&&(ge(gt).to-=Jt[0].length,gt.push(new s(0,k-Jt[0].length,k)))),h=="rtl"?gt.reverse():gt}}();function We(e,t){var n=e.order;return n==null&&(n=e.order=mi(e.text,t)),n}var Bn=[],ve=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Bn).concat(n)}};function Qt(e,t){return e._handlers&&e._handlers[t]||Bn}function dt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=oe(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ye(e,t){var n=Qt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Ze(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ye(e,n||t.type,e,t),yt(t)||t.codemirrorIgnore}function Ot(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)oe(n,t[r])==-1&&n.push(t[r])}function Ct(e,t){return Qt(e,t).length>0}function Bt(e){e.prototype.on=function(t,n){ve(this,t,n)},e.prototype.off=function(t,n){dt(this,t,n)}}function ht(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Nr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function yt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ar(e){ht(e),Nr(e)}function ln(e){return e.target||e.srcElement}function Wt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),se&&e.ctrlKey&&t==1&&(t=3),t}var yi=function(){if(b&&N<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),Or;function Wn(e){if(Or==null){var t=d("span","");J(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Or=t.offsetWidth<=1&&t.offsetHeight>2&&!(b&&N<8))}var n=Or?d("span",""):d("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var an;function sr(e){if(an!=null)return an;var t=J(e,document.createTextNode("AخA")),n=w(t,0,1).getBoundingClientRect(),r=w(t,1,2).getBoundingClientRect();return D(e),!n||n.left==n.right?!1:an=r.right-n.right<3}var Pt=`
|
|
2
2
|
|
|
3
3
|
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
|
|
4
4
|
`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=o.indexOf("\r");l!=-1?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ur=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},_n=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),_t=null;function xi(e){if(_t!=null)return _t;var t=J(e,d("span","x")),n=t.getBoundingClientRect(),r=w(t,0,1).getBoundingClientRect();return _t=Math.abs(n.left-r.left)>1}var Pr={},Ht={};function Rt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pr[e]=t}function kr(e,t){Ht[e]=t}function Ir(e){if(typeof e=="string"&&Ht.hasOwnProperty(e))e=Ht[e];else if(e&&typeof e.name=="string"&&Ht.hasOwnProperty(e.name)){var t=Ht[e.name];typeof t=="string"&&(t={name:t}),e=F(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ir("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ir("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function zr(e,t){t=Ir(t);var n=Pr[t.name];if(!n)return zr(e,"text/plain");var r=n(e,t);if(fr.hasOwnProperty(t.name)){var i=fr[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var fr={};function Br(e,t){var n=fr.hasOwnProperty(e)?fr[e]:fr[e]={};Te(t,n)}function Gt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function sn(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Wr(e,t,n){return e.startState?e.startState(t,n):!0}var Je=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Je.prototype.eol=function(){return this.pos>=this.string.length},Je.prototype.sol=function(){return this.pos==this.lineStart},Je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Je.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Je.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Je.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Je.prototype.skipToEnd=function(){this.pos=this.string.length},Je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Je.prototype.backUp=function(e){this.pos-=e},Je.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Le(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Le(this.string,this.lineStart,this.tabSize):0)},Je.prototype.indentation=function(){return Le(this.string,null,this.tabSize)-(this.lineStart?Le(this.string,this.lineStart,this.tabSize):0)},Je.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(l){return n?l.toLowerCase():l},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Je.prototype.current=function(){return this.string.slice(this.start,this.pos)},Je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ce(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Vt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(o){var l=o.text;i==n.line&&(l=l.slice(0,n.ch)),i==t.line&&(l=l.slice(t.ch)),r.push(l),++i}),r}function un(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Ft(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function f(e){if(e.parent==null)return null;for(var t=e.parent,n=oe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function g(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l],s=a.height;if(t<s)break;t-=s}return n+l}function A(e,t){return t>=e.first&&t<e.first+e.size}function W(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function L(e,t,n){if(n===void 0&&(n=null),!(this instanceof L))return new L(e,t,n);this.line=e,this.ch=t,this.sticky=n}function Z(e,t){return e.line-t.line||e.ch-t.ch}function _e(e,t){return e.sticky==t.sticky&&Z(e,t)==0}function it(e){return L(e.line,e.ch)}function xt(e,t){return Z(e,t)<0?t:e}function _r(e,t){return Z(e,t)<0?e:t}function po(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ce(e,t){if(t.line<e.first)return L(e.first,0);var n=e.first+e.size-1;return t.line>n?L(n,ce(e,n).text.length):_a(t,ce(e,t.line).text.length)}function _a(e,t){var n=e.ch;return n==null||n>t?L(e.line,t):n<0?L(e.line,0):e}function go(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Ce(e,t[r]);return n}var Hn=function(e,t){this.state=e,this.lookAhead=t},Xt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Xt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Xt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Xt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Xt.fromSaved=function(e,t,n){return t instanceof Hn?new Xt(e,Gt(e.mode,t.state),n,t.lookAhead):new Xt(e,Gt(e.mode,t),n)},Xt.prototype.save=function(e){var t=e!==!1?Gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Hn(t,this.maxLookAhead):t};function vo(e,t,n,r){var i=[e.state.modeGen],o={};wo(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var l=n.state,a=function(u){n.baseTokens=i;var h=e.state.overlays[u],v=1,k=0;n.state=!0,wo(e,t.text,h.mode,n,function(x,M){for(var E=v;k<x;){var R=i[v];R>x&&i.splice(v,1,x,i[v+1],R),v+=2,k=Math.min(x,R)}if(M)if(h.opaque)i.splice(E,v-E,x,"overlay "+M),v=E+2;else for(;E<v;E+=2){var U=i[E+1];i[E+1]=(U?U+" ":"")+"overlay "+M}},o),n.state=l,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function mo(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=fn(e,f(t)),i=t.text.length>e.options.maxHighlightLength&&Gt(e.doc.mode,r.state),o=vo(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function fn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Xt(r,!0,t);var o=Ha(e,t,n),l=o>r.first&&ce(r,o-1).stateAfter,a=l?Xt.fromSaved(r,l,o):new Xt(r,Wr(r.mode),o);return r.iter(o,t,function(s){bi(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?a.save():null,a.nextLine()}),n&&(r.modeFrontier=a.line),a}function bi(e,t,n,r){var i=e.doc.mode,o=new Je(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&yo(i,n.state);!o.eol();)ki(i,o,n.state),o.start=o.pos}function yo(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=sn(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function ki(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=sn(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var xo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function bo(e,t,n,r){var i=e.doc,o=i.mode,l;t=Ce(i,t);var a=ce(i,t.line),s=fn(e,t.line,n),u=new Je(a.text,e.options.tabSize,s),h;for(r&&(h=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,l=ki(o,u,s.state),r&&h.push(new xo(u,l,Gt(i.mode,s.state)));return r?h:new xo(u,l,s.state)}function ko(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function wo(e,t,n,r,i,o,l){var a=n.flattenSpans;a==null&&(a=e.options.flattenSpans);var s=0,u=null,h=new Je(t,e.options.tabSize,r),v,k=e.options.addModeClass&&[null];for(t==""&&ko(yo(n,r.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(a=!1,l&&bi(e,t,r,h.pos),h.pos=t.length,v=null):v=ko(ki(n,h,r.state,k),o),k){var x=k[0].name;x&&(v="m-"+(v?x+" "+v:x))}if(!a||u!=v){for(;s<h.start;)s=Math.min(h.start,s+5e3),i(s,u);u=v}h.start=h.pos}for(;s<h.pos;){var M=Math.min(h.pos,s+5e3);i(M,u),s=M}}function Ha(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=ce(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof Hn?u.lookAhead:0)<=o.modeFrontier))return a;var h=Le(s.text,null,e.options.tabSize);(i==null||r>h)&&(i=a-1,r=h)}return i}function Ra(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=ce(e,r).stateAfter;if(i&&(!(i instanceof Hn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var So=!1,$t=!1;function qa(){So=!0}function ja(){$t=!0}function Rn(e,t,n){this.marker=e,this.from=t,this.to=n}function cn(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Ka(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Ua(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function Ga(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&l.type=="bookmark"&&(!n||!o.marker.insertLeft)){var s=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Rn(l,o.from,s?null:o.to))}}return r}function Xa(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&l.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Rn(l,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function wi(e,t){if(t.full)return null;var n=A(e,t.from.line)&&ce(e,t.from.line).markedSpans,r=A(e,t.to.line)&&ce(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,l=Z(t.from,t.to)==0,a=Ga(n,i,l),s=Xa(r,o,l),u=t.text.length==1,h=ge(t.text).length+(u?i:0);if(a)for(var v=0;v<a.length;++v){var k=a[v];if(k.to==null){var x=cn(s,k.marker);x?u&&(k.to=x.to==null?null:x.to+h):k.to=i}}if(s)for(var M=0;M<s.length;++M){var E=s[M];if(E.to!=null&&(E.to+=h),E.from==null){var R=cn(a,E.marker);R||(E.from=h,u&&(a||(a=[])).push(E))}else E.from+=h,u&&(a||(a=[])).push(E)}a&&(a=To(a)),s&&s!=a&&(s=To(s));var U=[a];if(!u){var Q=t.text.length-2,G;if(Q>0&&a)for(var ee=0;ee<a.length;++ee)a[ee].to==null&&(G||(G=[])).push(new Rn(a[ee].marker,null,null));for(var me=0;me<Q;++me)U.push(G);U.push(s)}return U}function To(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ya(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(x){if(x.markedSpans)for(var M=0;M<x.markedSpans.length;++M){var E=x.markedSpans[M].marker;E.readOnly&&(!r||oe(r,E)==-1)&&(r||(r=[])).push(E)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var l=r[o],a=l.find(0),s=0;s<i.length;++s){var u=i[s];if(!(Z(u.to,a.from)<0||Z(u.from,a.to)>0)){var h=[s,1],v=Z(u.from,a.from),k=Z(u.to,a.to);(v<0||!l.inclusiveLeft&&!v)&&h.push({from:u.from,to:a.from}),(k>0||!l.inclusiveRight&&!k)&&h.push({from:a.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function Lo(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Co(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function qn(e){return e.inclusiveLeft?-1:0}function jn(e){return e.inclusiveRight?1:0}function Si(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=Z(r.from,i.from)||qn(e)-qn(t);if(o)return-o;var l=Z(r.to,i.to)||jn(e)-jn(t);return l||t.id-e.id}function Do(e,t){var n=$t&&e.markedSpans,r;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||Si(r,i.marker)<0)&&(r=i.marker);return r}function Mo(e){return Do(e,!0)}function Kn(e){return Do(e,!1)}function Za(e,t){var n=$t&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||Si(r,o.marker)<0)&&(r=o.marker)}return r}function Fo(e,t,n,r,i){var o=ce(e,t),l=$t&&o.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(s.marker.collapsed){var u=s.marker.find(0),h=Z(u.from,n)||qn(s.marker)-qn(i),v=Z(u.to,r)||jn(s.marker)-jn(i);if(!(h>=0&&v<=0||h<=0&&v>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?Z(u.to,n)>=0:Z(u.to,n)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?Z(u.from,r)<=0:Z(u.from,r)<0)))return!0}}}function qt(e){for(var t;t=Mo(e);)e=t.find(-1,!0).line;return e}function Ja(e){for(var t;t=Kn(e);)e=t.find(1,!0).line;return e}function Qa(e){for(var t,n;t=Kn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Ti(e,t){var n=ce(e,t),r=qt(n);return n==r?t:f(r)}function Ao(e,t){if(t>e.lastLine())return t;var n=ce(e,t),r;if(!cr(e,n))return t;for(;r=Kn(n);)n=r.find(1,!0).line;return f(n)+1}function cr(e,t){var n=$t&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&Li(e,t,r))return!0}}}function Li(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Li(e,r.line,cn(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Li(e,t,i))return!0}function er(e){e=qt(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==n)break;t+=a.height}return t}function Un(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=Mo(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Kn(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function Ci(e){var t=e.display,n=e.doc;t.maxLine=ce(n,n.first),t.maxLineLength=Un(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=Un(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Hr=function(e,t,n){this.text=e,Co(this,t),this.height=n?n(this):1};Hr.prototype.lineNo=function(){return f(this)},Bt(Hr);function Va(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Lo(e),Co(e,n);var i=r?r(e):1;i!=e.height&&Ft(e,i)}function $a(e){e.parent=null,Lo(e)}var es={},ts={};function Eo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ts:es;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function No(e,t){var n=S("span",null,null,_?"padding-right: .1px":null),r={pre:S("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=ns,sr(e.display.measure)&&(l=We(o,e.doc.direction))&&(r.addToken=os(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&f(o);ls(o,r,mo(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=le(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=le(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Wn(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(_){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ye(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=le(r.pre.className,r.textClass||"")),r}function rs(e){var t=d("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ns(e,t,n,r,i,o,l){if(t){var a=e.splitSpaces?is(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,h;if(!s.test(t))e.col+=t.length,h=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,h),b&&N<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var v=0;;){s.lastIndex=v;var k=s.exec(t),x=k?k.index-v:t.length-v;if(x){var M=document.createTextNode(a.slice(v,v+x));b&&N<9?h.appendChild(d("span",[M])):h.appendChild(M),e.map.push(e.pos,e.pos+x,M),e.col+=x,e.pos+=x}if(!k)break;v+=x+1;var E=void 0;if(k[0]==" "){var R=e.cm.options.tabSize,U=R-e.col%R;E=h.appendChild(d("span",et(U),"cm-tab")),E.setAttribute("role","presentation"),E.setAttribute("cm-text"," "),e.col+=U}else k[0]=="\r"||k[0]==`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeMirrorModule-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeMirrorModule-rKSJ91kC.js","../codeMirrorModule.C3UTv-Ge.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var p0=Object.defineProperty;var m0=(t,e,n)=>e in t?p0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ee=(t,e,n)=>m0(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function g0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var au={exports:{}},bi={},cu={exports:{}},me={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -46,7 +46,7 @@ Error generating stack: `+m.message+`
|
|
|
46
46
|
rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
|
|
47
47
|
rgb(0 0 0 / 10%) 0px -2px 4px,
|
|
48
48
|
rgb(0 0 0 / 15%) 0px -6.1px 12px,
|
|
49
|
-
rgb(0 0 0 / 25%) 0px 6px 12px`},P1=({diff:t,noTargetBlank:e,hideDetails:n})=>{const[r,o]=$.useState(t.diff?"diff":"actual"),[l,c]=$.useState(!1),[u,d]=$.useState(null),[p,g]=$.useState("Expected"),[y,v]=$.useState(null),[S,k]=$.useState(null),[_,E]=Ar();$.useEffect(()=>{(async()=>{var M,G,K,O;d(await pu((M=t.expected)==null?void 0:M.attachment.path)),g(((G=t.expected)==null?void 0:G.title)||"Expected"),v(await pu((K=t.actual)==null?void 0:K.attachment.path)),k(await pu((O=t.diff)==null?void 0:O.attachment.path))})()},[t]);const C=u&&y&&S,A=C?Math.max(u.naturalWidth,y.naturalWidth,200):500,B=C?Math.max(u.naturalHeight,y.naturalHeight,200):500,R=Math.min(1,(_.width-30)/A),D=Math.min(1,(_.width-50)/A/2),z=A*R,H=B*R,F={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return w.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:E,children:C&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[t.diff&&w.jsx("div",{style:{...F,fontWeight:r==="diff"?600:"initial"},onClick:()=>o("diff"),children:"Diff"}),w.jsx("div",{style:{...F,fontWeight:r==="actual"?600:"initial"},onClick:()=>o("actual"),children:"Actual"}),w.jsx("div",{style:{...F,fontWeight:r==="expected"?600:"initial"},onClick:()=>o("expected"),children:p}),w.jsx("div",{style:{...F,fontWeight:r==="sxs"?600:"initial"},onClick:()=>o("sxs"),children:"Side by side"}),w.jsx("div",{style:{...F,fontWeight:r==="slider"?600:"initial"},onClick:()=>o("slider"),children:"Slider"})]}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:H+60},children:[t.diff&&r==="diff"&&w.jsx(En,{image:S,alt:"Diff",hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),t.diff&&r==="actual"&&w.jsx(En,{image:y,alt:"Actual",hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),t.diff&&r==="expected"&&w.jsx(En,{image:u,alt:p,hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),t.diff&&r==="slider"&&w.jsx(O1,{expectedImage:u,actualImage:y,hideSize:n,canvasWidth:z,canvasHeight:H,scale:R,expectedTitle:p}),t.diff&&r==="sxs"&&w.jsxs("div",{style:{display:"flex"},children:[w.jsx(En,{image:u,title:p,hideSize:n,canvasWidth:D*A,canvasHeight:D*B,scale:D}),w.jsx(En,{image:l?S:y,title:l?"Diff":"Actual",onClick:()=>c(!l),hideSize:n,canvasWidth:D*A,canvasHeight:D*B,scale:D})]}),!t.diff&&r==="actual"&&w.jsx(En,{image:y,title:"Actual",hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),!t.diff&&r==="expected"&&w.jsx(En,{image:u,title:p,hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),!t.diff&&r==="sxs"&&w.jsxs("div",{style:{display:"flex"},children:[w.jsx(En,{image:u,title:p,canvasWidth:D*A,canvasHeight:D*B,scale:D}),w.jsx(En,{image:y,title:"Actual",canvasWidth:D*A,canvasHeight:D*B,scale:D})]})]}),!n&&w.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[w.jsx("div",{children:t.diff&&w.jsx("a",{target:"_blank",href:t.diff.attachment.path,rel:"noreferrer",children:t.diff.attachment.name})}),w.jsx("div",{children:w.jsx("a",{target:e?"":"_blank",href:t.actual.attachment.path,rel:"noreferrer",children:t.actual.attachment.name})}),w.jsx("div",{children:w.jsx("a",{target:e?"":"_blank",href:t.expected.attachment.path,rel:"noreferrer",children:t.expected.attachment.name})})]})]})})},O1=({expectedImage:t,actualImage:e,canvasWidth:n,canvasHeight:r,scale:o,expectedTitle:l,hideSize:c})=>{const u={position:"absolute",top:0,left:0},[d,p]=$.useState(n/2),g=t.naturalWidth===e.naturalWidth&&t.naturalHeight===e.naturalHeight;return w.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!c&&w.jsxs("div",{style:{margin:5},children:[!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),w.jsx("span",{children:t.naturalWidth}),w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),w.jsx("span",{children:t.naturalHeight}),!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!g&&w.jsx("span",{children:e.naturalWidth}),!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!g&&w.jsx("span",{children:e.naturalHeight})]}),w.jsxs("div",{style:{position:"relative",width:n,height:r,margin:15,...Pu},children:[w.jsx(fg,{orientation:"horizontal",offsets:[d],setOffsets:y=>p(y[0]),resizerColor:"#57606a80",resizerWidth:6}),w.jsx("img",{alt:l,style:{width:t.naturalWidth*o,height:t.naturalHeight*o},draggable:"false",src:t.src}),w.jsx("div",{style:{...u,bottom:0,overflow:"hidden",width:d,...Pu},children:w.jsx("img",{alt:"Actual",style:{width:e.naturalWidth*o,height:e.naturalHeight*o},draggable:"false",src:e.src})})]})]})},En=({image:t,title:e,alt:n,hideSize:r,canvasWidth:o,canvasHeight:l,scale:c,onClick:u})=>w.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!r&&w.jsxs("div",{style:{margin:5},children:[e&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:e}),w.jsx("span",{children:t.naturalWidth}),w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),w.jsx("span",{children:t.naturalHeight})]}),w.jsx("div",{style:{display:"flex",flex:"none",width:o,height:l,margin:15,...Pu},children:w.jsx("img",{width:t.naturalWidth*c,height:t.naturalHeight*c,alt:e||n,style:{cursor:u?"pointer":"initial"},draggable:"false",src:t.src,onClick:u})})]}),$1="modulepreload",R1=function(t,e){return new URL(t,e).href},Qp={},D1=function(e,n,r){let o=Promise.resolve();if(n&&n.length>0){let c=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const u=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=c(n.map(g=>{if(g=R1(g,r),g in Qp)return;Qp[g]=!0;const y=g.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(!!r)for(let _=u.length-1;_>=0;_--){const E=u[_];if(E.href===g&&(!y||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${v}`))return;const k=document.createElement("link");if(k.rel=y?"stylesheet":$1,y||(k.as="script"),k.crossOrigin="",k.href=g,p&&k.setAttribute("nonce",p),document.head.appendChild(k),y)return new Promise((_,E)=>{k.addEventListener("load",_),k.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${g}`)))})}))}function l(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return o.then(c=>{for(const u of c||[])u.status==="rejected"&&l(u.reason);return e().catch(l)})},F1=20,Cs=({text:t,language:e,mimeType:n,linkify:r,readOnly:o,highlight:l,revealLine:c,lineNumbers:u,isFocused:d,focusOnChange:p,wrapLines:g,onChange:y,dataTestId:v,placeholder:S})=>{const[k,_]=Ar(),[E]=$.useState(D1(()=>import("./codeMirrorModule-3kZ8GVgK.js"),__vite__mapDeps([0,1]),import.meta.url).then(R=>R.default)),C=$.useRef(null),[A,B]=$.useState();return $.useEffect(()=>{(async()=>{var F,M;const R=await E;z1(R);const D=_.current;if(!D)return;const z=U1(e)||H1(n)||(r?"text/linkified":"");if(C.current&&z===C.current.cm.getOption("mode")&&!!o===C.current.cm.getOption("readOnly")&&u===C.current.cm.getOption("lineNumbers")&&g===C.current.cm.getOption("lineWrapping")&&S===C.current.cm.getOption("placeholder"))return;(M=(F=C.current)==null?void 0:F.cm)==null||M.getWrapperElement().remove();const H=R(D,{value:"",mode:z,readOnly:!!o,lineNumbers:u,lineWrapping:g,placeholder:S});return C.current={cm:H},d&&H.focus(),B(H),H})()},[E,A,_,e,n,r,u,g,o,d,S]),$.useEffect(()=>{C.current&&C.current.cm.setSize(k.width,k.height)},[k]),$.useLayoutEffect(()=>{var z;if(!A)return;let R=!1;if(A.getValue()!==t&&(A.setValue(t),R=!0,p&&(A.execCommand("selectAll"),A.focus())),R||JSON.stringify(l)!==JSON.stringify(C.current.highlight)){for(const M of C.current.highlight||[])A.removeLineClass(M.line-1,"wrap");for(const M of l||[])A.addLineClass(M.line-1,"wrap",`source-line-${M.type}`);for(const M of C.current.widgets||[])A.removeLineWidget(M);for(const M of C.current.markers||[])M.clear();const H=[],F=[];for(const M of l||[]){if(M.type!=="subtle-error"&&M.type!=="error")continue;const G=(z=C.current)==null?void 0:z.cm.getLine(M.line-1);if(G){const K={};K.title=M.message||"",F.push(A.markText({line:M.line-1,ch:0},{line:M.line-1,ch:M.column||G.length},{className:"source-line-error-underline",attributes:K}))}if(M.type==="error"){const K=document.createElement("div");K.innerHTML=qi(M.message||""),K.className="source-line-error-widget",H.push(A.addLineWidget(M.line,K,{above:!0,coverGutter:!1}))}}C.current.highlight=l,C.current.widgets=H,C.current.markers=F}typeof c=="number"&&C.current.cm.lineCount()>=c&&A.scrollIntoView({line:Math.max(0,c-1),ch:0},50);let D;return y&&(D=()=>y(A.getValue()),A.on("change",D)),()=>{D&&A.off("change",D)}},[A,t,l,c,p,y]),w.jsx("div",{"data-testid":v,className:"cm-wrapper",ref:_,onClick:B1})};function B1(t){var n;if(!(t.target instanceof HTMLElement))return;let e;t.target.classList.contains("cm-linkified")?e=t.target.textContent:t.target.classList.contains("cm-link")&&((n=t.target.nextElementSibling)!=null&&n.classList.contains("cm-url"))&&(e=t.target.nextElementSibling.textContent.slice(1,-1)),e&&(t.preventDefault(),t.stopPropagation(),window.open(e,"_blank"))}let Jp=!1;function z1(t){Jp||(Jp=!0,t.defineSimpleMode("text/linkified",{start:[{regex:Om,token:"linkified"}]}))}function H1(t){if(t){if(t.includes("javascript")||t.includes("json"))return"javascript";if(t.includes("python"))return"python";if(t.includes("csharp"))return"text/x-csharp";if(t.includes("java"))return"text/x-java";if(t.includes("markdown"))return"markdown";if(t.includes("html")||t.includes("svg"))return"htmlmixed";if(t.includes("css"))return"css"}}function U1(t){if(t)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[t]}function q1(t){return!!t.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const V1=({title:t,children:e,setExpanded:n,expanded:r,expandOnTitleClick:o})=>{const l=$.useId();return w.jsxs("div",{className:Be("expandable",r&&"expanded"),children:[w.jsxs("div",{role:"button","aria-expanded":r,"aria-controls":l,className:"expandable-title",onClick:()=>o&&n(!r),children:[w.jsx("div",{className:Be("codicon",r?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!o&&n(!r)}),t]}),r&&w.jsx("div",{id:l,role:"region",style:{marginLeft:25},children:e})]})};function dg(t){const e=[];let n=0,r;for(;(r=Om.exec(t))!==null;){const l=t.substring(n,r.index);l&&e.push(l);const c=r[0];e.push(W1(c)),n=r.index+c.length}const o=t.substring(n);return o&&e.push(o),e}function W1(t){let e=t;return e.startsWith("www.")&&(e="https://"+e),w.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:t})}const K1=({attachment:t,reveal:e})=>{const[n,r]=$.useState(!1),[o,l]=$.useState(null),[c,u]=$.useState(null),[d,p]=_0(),g=$.useRef(null),y=q1(t.contentType),v=!!t.sha1||!!t.path;$.useEffect(()=>{var _;if(e)return(_=g.current)==null||_.scrollIntoView({behavior:"smooth"}),p()},[e,p]),$.useEffect(()=>{n&&o===null&&c===null&&(u("Loading ..."),fetch(ra(t)).then(_=>_.text()).then(_=>{l(_),u(null)}).catch(_=>{u("Failed to load: "+_.message)}))},[n,o,c,t]);const S=$.useMemo(()=>{const _=o?o.split(`
|
|
49
|
+
rgb(0 0 0 / 25%) 0px 6px 12px`},P1=({diff:t,noTargetBlank:e,hideDetails:n})=>{const[r,o]=$.useState(t.diff?"diff":"actual"),[l,c]=$.useState(!1),[u,d]=$.useState(null),[p,g]=$.useState("Expected"),[y,v]=$.useState(null),[S,k]=$.useState(null),[_,E]=Ar();$.useEffect(()=>{(async()=>{var M,G,K,O;d(await pu((M=t.expected)==null?void 0:M.attachment.path)),g(((G=t.expected)==null?void 0:G.title)||"Expected"),v(await pu((K=t.actual)==null?void 0:K.attachment.path)),k(await pu((O=t.diff)==null?void 0:O.attachment.path))})()},[t]);const C=u&&y&&S,A=C?Math.max(u.naturalWidth,y.naturalWidth,200):500,B=C?Math.max(u.naturalHeight,y.naturalHeight,200):500,R=Math.min(1,(_.width-30)/A),D=Math.min(1,(_.width-50)/A/2),z=A*R,H=B*R,F={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return w.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:E,children:C&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[t.diff&&w.jsx("div",{style:{...F,fontWeight:r==="diff"?600:"initial"},onClick:()=>o("diff"),children:"Diff"}),w.jsx("div",{style:{...F,fontWeight:r==="actual"?600:"initial"},onClick:()=>o("actual"),children:"Actual"}),w.jsx("div",{style:{...F,fontWeight:r==="expected"?600:"initial"},onClick:()=>o("expected"),children:p}),w.jsx("div",{style:{...F,fontWeight:r==="sxs"?600:"initial"},onClick:()=>o("sxs"),children:"Side by side"}),w.jsx("div",{style:{...F,fontWeight:r==="slider"?600:"initial"},onClick:()=>o("slider"),children:"Slider"})]}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:H+60},children:[t.diff&&r==="diff"&&w.jsx(En,{image:S,alt:"Diff",hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),t.diff&&r==="actual"&&w.jsx(En,{image:y,alt:"Actual",hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),t.diff&&r==="expected"&&w.jsx(En,{image:u,alt:p,hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),t.diff&&r==="slider"&&w.jsx(O1,{expectedImage:u,actualImage:y,hideSize:n,canvasWidth:z,canvasHeight:H,scale:R,expectedTitle:p}),t.diff&&r==="sxs"&&w.jsxs("div",{style:{display:"flex"},children:[w.jsx(En,{image:u,title:p,hideSize:n,canvasWidth:D*A,canvasHeight:D*B,scale:D}),w.jsx(En,{image:l?S:y,title:l?"Diff":"Actual",onClick:()=>c(!l),hideSize:n,canvasWidth:D*A,canvasHeight:D*B,scale:D})]}),!t.diff&&r==="actual"&&w.jsx(En,{image:y,title:"Actual",hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),!t.diff&&r==="expected"&&w.jsx(En,{image:u,title:p,hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),!t.diff&&r==="sxs"&&w.jsxs("div",{style:{display:"flex"},children:[w.jsx(En,{image:u,title:p,canvasWidth:D*A,canvasHeight:D*B,scale:D}),w.jsx(En,{image:y,title:"Actual",canvasWidth:D*A,canvasHeight:D*B,scale:D})]})]}),!n&&w.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[w.jsx("div",{children:t.diff&&w.jsx("a",{target:"_blank",href:t.diff.attachment.path,rel:"noreferrer",children:t.diff.attachment.name})}),w.jsx("div",{children:w.jsx("a",{target:e?"":"_blank",href:t.actual.attachment.path,rel:"noreferrer",children:t.actual.attachment.name})}),w.jsx("div",{children:w.jsx("a",{target:e?"":"_blank",href:t.expected.attachment.path,rel:"noreferrer",children:t.expected.attachment.name})})]})]})})},O1=({expectedImage:t,actualImage:e,canvasWidth:n,canvasHeight:r,scale:o,expectedTitle:l,hideSize:c})=>{const u={position:"absolute",top:0,left:0},[d,p]=$.useState(n/2),g=t.naturalWidth===e.naturalWidth&&t.naturalHeight===e.naturalHeight;return w.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!c&&w.jsxs("div",{style:{margin:5},children:[!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),w.jsx("span",{children:t.naturalWidth}),w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),w.jsx("span",{children:t.naturalHeight}),!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!g&&w.jsx("span",{children:e.naturalWidth}),!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!g&&w.jsx("span",{children:e.naturalHeight})]}),w.jsxs("div",{style:{position:"relative",width:n,height:r,margin:15,...Pu},children:[w.jsx(fg,{orientation:"horizontal",offsets:[d],setOffsets:y=>p(y[0]),resizerColor:"#57606a80",resizerWidth:6}),w.jsx("img",{alt:l,style:{width:t.naturalWidth*o,height:t.naturalHeight*o},draggable:"false",src:t.src}),w.jsx("div",{style:{...u,bottom:0,overflow:"hidden",width:d,...Pu},children:w.jsx("img",{alt:"Actual",style:{width:e.naturalWidth*o,height:e.naturalHeight*o},draggable:"false",src:e.src})})]})]})},En=({image:t,title:e,alt:n,hideSize:r,canvasWidth:o,canvasHeight:l,scale:c,onClick:u})=>w.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!r&&w.jsxs("div",{style:{margin:5},children:[e&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:e}),w.jsx("span",{children:t.naturalWidth}),w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),w.jsx("span",{children:t.naturalHeight})]}),w.jsx("div",{style:{display:"flex",flex:"none",width:o,height:l,margin:15,...Pu},children:w.jsx("img",{width:t.naturalWidth*c,height:t.naturalHeight*c,alt:e||n,style:{cursor:u?"pointer":"initial"},draggable:"false",src:t.src,onClick:u})})]}),$1="modulepreload",R1=function(t,e){return new URL(t,e).href},Qp={},D1=function(e,n,r){let o=Promise.resolve();if(n&&n.length>0){let c=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const u=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=c(n.map(g=>{if(g=R1(g,r),g in Qp)return;Qp[g]=!0;const y=g.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(!!r)for(let _=u.length-1;_>=0;_--){const E=u[_];if(E.href===g&&(!y||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${v}`))return;const k=document.createElement("link");if(k.rel=y?"stylesheet":$1,y||(k.as="script"),k.crossOrigin="",k.href=g,p&&k.setAttribute("nonce",p),document.head.appendChild(k),y)return new Promise((_,E)=>{k.addEventListener("load",_),k.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${g}`)))})}))}function l(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return o.then(c=>{for(const u of c||[])u.status==="rejected"&&l(u.reason);return e().catch(l)})},F1=20,Cs=({text:t,language:e,mimeType:n,linkify:r,readOnly:o,highlight:l,revealLine:c,lineNumbers:u,isFocused:d,focusOnChange:p,wrapLines:g,onChange:y,dataTestId:v,placeholder:S})=>{const[k,_]=Ar(),[E]=$.useState(D1(()=>import("./codeMirrorModule-rKSJ91kC.js"),__vite__mapDeps([0,1]),import.meta.url).then(R=>R.default)),C=$.useRef(null),[A,B]=$.useState();return $.useEffect(()=>{(async()=>{var F,M;const R=await E;z1(R);const D=_.current;if(!D)return;const z=U1(e)||H1(n)||(r?"text/linkified":"");if(C.current&&z===C.current.cm.getOption("mode")&&!!o===C.current.cm.getOption("readOnly")&&u===C.current.cm.getOption("lineNumbers")&&g===C.current.cm.getOption("lineWrapping")&&S===C.current.cm.getOption("placeholder"))return;(M=(F=C.current)==null?void 0:F.cm)==null||M.getWrapperElement().remove();const H=R(D,{value:"",mode:z,readOnly:!!o,lineNumbers:u,lineWrapping:g,placeholder:S});return C.current={cm:H},d&&H.focus(),B(H),H})()},[E,A,_,e,n,r,u,g,o,d,S]),$.useEffect(()=>{C.current&&C.current.cm.setSize(k.width,k.height)},[k]),$.useLayoutEffect(()=>{var z;if(!A)return;let R=!1;if(A.getValue()!==t&&(A.setValue(t),R=!0,p&&(A.execCommand("selectAll"),A.focus())),R||JSON.stringify(l)!==JSON.stringify(C.current.highlight)){for(const M of C.current.highlight||[])A.removeLineClass(M.line-1,"wrap");for(const M of l||[])A.addLineClass(M.line-1,"wrap",`source-line-${M.type}`);for(const M of C.current.widgets||[])A.removeLineWidget(M);for(const M of C.current.markers||[])M.clear();const H=[],F=[];for(const M of l||[]){if(M.type!=="subtle-error"&&M.type!=="error")continue;const G=(z=C.current)==null?void 0:z.cm.getLine(M.line-1);if(G){const K={};K.title=M.message||"",F.push(A.markText({line:M.line-1,ch:0},{line:M.line-1,ch:M.column||G.length},{className:"source-line-error-underline",attributes:K}))}if(M.type==="error"){const K=document.createElement("div");K.innerHTML=qi(M.message||""),K.className="source-line-error-widget",H.push(A.addLineWidget(M.line,K,{above:!0,coverGutter:!1}))}}C.current.highlight=l,C.current.widgets=H,C.current.markers=F}typeof c=="number"&&C.current.cm.lineCount()>=c&&A.scrollIntoView({line:Math.max(0,c-1),ch:0},50);let D;return y&&(D=()=>y(A.getValue()),A.on("change",D)),()=>{D&&A.off("change",D)}},[A,t,l,c,p,y]),w.jsx("div",{"data-testid":v,className:"cm-wrapper",ref:_,onClick:B1})};function B1(t){var n;if(!(t.target instanceof HTMLElement))return;let e;t.target.classList.contains("cm-linkified")?e=t.target.textContent:t.target.classList.contains("cm-link")&&((n=t.target.nextElementSibling)!=null&&n.classList.contains("cm-url"))&&(e=t.target.nextElementSibling.textContent.slice(1,-1)),e&&(t.preventDefault(),t.stopPropagation(),window.open(e,"_blank"))}let Jp=!1;function z1(t){Jp||(Jp=!0,t.defineSimpleMode("text/linkified",{start:[{regex:Om,token:"linkified"}]}))}function H1(t){if(t){if(t.includes("javascript")||t.includes("json"))return"javascript";if(t.includes("python"))return"python";if(t.includes("csharp"))return"text/x-csharp";if(t.includes("java"))return"text/x-java";if(t.includes("markdown"))return"markdown";if(t.includes("html")||t.includes("svg"))return"htmlmixed";if(t.includes("css"))return"css"}}function U1(t){if(t)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[t]}function q1(t){return!!t.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const V1=({title:t,children:e,setExpanded:n,expanded:r,expandOnTitleClick:o})=>{const l=$.useId();return w.jsxs("div",{className:Be("expandable",r&&"expanded"),children:[w.jsxs("div",{role:"button","aria-expanded":r,"aria-controls":l,className:"expandable-title",onClick:()=>o&&n(!r),children:[w.jsx("div",{className:Be("codicon",r?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!o&&n(!r)}),t]}),r&&w.jsx("div",{id:l,role:"region",style:{marginLeft:25},children:e})]})};function dg(t){const e=[];let n=0,r;for(;(r=Om.exec(t))!==null;){const l=t.substring(n,r.index);l&&e.push(l);const c=r[0];e.push(W1(c)),n=r.index+c.length}const o=t.substring(n);return o&&e.push(o),e}function W1(t){let e=t;return e.startsWith("www.")&&(e="https://"+e),w.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:t})}const K1=({attachment:t,reveal:e})=>{const[n,r]=$.useState(!1),[o,l]=$.useState(null),[c,u]=$.useState(null),[d,p]=_0(),g=$.useRef(null),y=q1(t.contentType),v=!!t.sha1||!!t.path;$.useEffect(()=>{var _;if(e)return(_=g.current)==null||_.scrollIntoView({behavior:"smooth"}),p()},[e,p]),$.useEffect(()=>{n&&o===null&&c===null&&(u("Loading ..."),fetch(ra(t)).then(_=>_.text()).then(_=>{l(_),u(null)}).catch(_=>{u("Failed to load: "+_.message)}))},[n,o,c,t]);const S=$.useMemo(()=>{const _=o?o.split(`
|
|
50
50
|
`).length:0;return Math.min(Math.max(5,_),20)*F1},[o]),k=w.jsxs("span",{style:{marginLeft:5},ref:g,"aria-label":t.name,children:[w.jsx("span",{children:dg(t.name)}),v&&w.jsx("a",{style:{marginLeft:5},href:Al(t),children:"download"})]});return!y||!v?w.jsx("div",{style:{marginLeft:20},children:k}):w.jsxs("div",{className:Be(d&&"yellow-flash"),children:[w.jsx(V1,{title:k,expanded:n,setExpanded:r,expandOnTitleClick:!0,children:c&&w.jsx("i",{children:c})}),n&&o!==null&&w.jsx("div",{className:"vbox",style:{height:S},children:w.jsx(Cs,{text:o,readOnly:!0,mimeType:t.contentType,linkify:!0,lineNumbers:!0,wrapLines:!1})})]})},G1=({model:t,revealedAttachment:e})=>{const{diffMap:n,screenshots:r,attachments:o}=$.useMemo(()=>{const l=new Set((t==null?void 0:t.visibleAttachments)??[]),c=new Set,u=new Map;for(const d of l){if(!d.path&&!d.sha1)continue;const p=d.name.match(/^(.*)-(expected|actual|diff)\.png$/);if(p){const g=p[1],y=p[2],v=u.get(g)||{expected:void 0,actual:void 0,diff:void 0};v[y]=d,u.set(g,v),l.delete(d)}else d.contentType.startsWith("image/")&&(c.add(d),l.delete(d))}return{diffMap:u,attachments:l,screenshots:c}},[t]);return!n.size&&!r.size&&!o.size?w.jsx(Ir,{text:"No attachments"}):w.jsxs("div",{className:"attachments-tab",children:[[...n.values()].map(({expected:l,actual:c,diff:u})=>w.jsxs(w.Fragment,{children:[l&&c&&w.jsx("div",{className:"attachments-section",children:"Image diff"}),l&&c&&w.jsx(P1,{noTargetBlank:!0,diff:{name:"Image diff",expected:{attachment:{...l,path:Al(l)},title:"Expected"},actual:{attachment:{...c,path:Al(c)}},diff:u?{attachment:{...u,path:Al(u)}}:void 0}})]})),r.size?w.jsx("div",{className:"attachments-section",children:"Screenshots"}):void 0,[...r.values()].map((l,c)=>{const u=ra(l);return w.jsxs("div",{className:"attachment-item",children:[w.jsx("div",{children:w.jsx("img",{draggable:"false",src:u})}),w.jsx("div",{children:w.jsx("a",{target:"_blank",href:u,rel:"noreferrer",children:l.name})})]},`screenshot-${c}`)}),o.size?w.jsx("div",{className:"attachments-section",children:"Attachments"}):void 0,[...o.values()].map((l,c)=>w.jsx("div",{className:"attachment-item",children:w.jsx(K1,{attachment:l,reveal:e&&Q1(l,e[0])?e:void 0})},J1(l,c)))]})};function Q1(t,e){return t.name===e.name&&t.path===e.path&&t.sha1===e.sha1}function ra(t,e={}){const n=new URLSearchParams(e);return t.sha1?(n.set("trace",t.traceUrl),"sha1/"+t.sha1+"?"+n.toString()):(n.set("path",t.path),"file?"+n.toString())}function Al(t){const e={dn:t.name};return t.contentType&&(e.dct=t.contentType),ra(t,e)}function J1(t,e){return e+"-"+(t.sha1?"sha1-"+t.sha1:"path-"+t.path)}const X1=`
|
|
51
51
|
# Instructions
|
|
52
52
|
|
|
@@ -111,7 +111,7 @@ ${t.stack}`,{e:{n:t.name,m:t.message,s:c}}}if(M_(t))return{d:t.toJSON()};if(j_(t
|
|
|
111
111
|
})()`);return new r(this,n)}async viewportRatio(e){return await new Promise(n=>{const r=new IntersectionObserver(o=>{n(o[0].intersectionRatio),r.disconnect()});r.observe(e),this.utils.builtins.requestAnimationFrame(()=>{})})}getElementBorderWidth(e){if(e.nodeType!==Node.ELEMENT_NODE||!e.ownerDocument||!e.ownerDocument.defaultView)return{left:0,top:0};const n=e.ownerDocument.defaultView.getComputedStyle(e);return{left:parseInt(n.borderLeftWidth||"",10),top:parseInt(n.borderTopWidth||"",10)}}describeIFrameStyle(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return"error:notconnected";const n=e.ownerDocument.defaultView;for(let o=e;o;o=lt(o))if(n.getComputedStyle(o).transform!=="none")return"transformed";const r=n.getComputedStyle(e);return{left:parseInt(r.borderLeftWidth||"",10)+parseInt(r.paddingLeft||"",10),top:parseInt(r.borderTopWidth||"",10)+parseInt(r.paddingTop||"",10)}}retarget(e,n){let r=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;if(!r)return null;if(n==="none")return r;if(!r.matches("input, textarea, select")&&!r.isContentEditable&&(n==="button-link"?r=r.closest("button, [role=button], a, [role=link]")||r:r=r.closest("button, [role=button], [role=checkbox], [role=radio]")||r),n==="follow-label"&&!r.matches("a, input, textarea, button, select, [role=link], [role=button], [role=checkbox], [role=radio]")&&!r.isContentEditable){const o=r.closest("label");o&&o.control&&(r=o.control)}return r}async checkElementStates(e,n){if(n.includes("stable")){const r=await this._checkElementIsStable(e);if(r===!1)return{missingState:"stable"};if(r==="error:notconnected")return"error:notconnected"}for(const r of n)if(r!=="stable"){const o=this.elementState(e,r);if(o.received==="error:notconnected")return"error:notconnected";if(!o.matches)return{missingState:r}}}async _checkElementIsStable(e){const n=Symbol("continuePolling");let r,o=0,l=0;const c=()=>{const y=this.retarget(e,"no-follow-label");if(!y)return"error:notconnected";const v=this.utils.builtins.performance.now();if(this._stableRafCount>1&&v-l<15)return n;l=v;const S=y.getBoundingClientRect(),k={x:S.top,y:S.left,width:S.width,height:S.height};if(r){if(!(k.x===r.x&&k.y===r.y&&k.width===r.width&&k.height===r.height))return!1;if(++o>=this._stableRafCount)return!0}return r=k,n};let u,d;const p=new Promise((y,v)=>{u=y,d=v}),g=()=>{try{const y=c();y!==n?u(y):this.utils.builtins.requestAnimationFrame(g)}catch(y){d(y)}};return this.utils.builtins.requestAnimationFrame(g),p}_createAriaRefEngine(){return{queryAll:(n,r)=>{var l,c;const o=(c=(l=this._lastAriaSnapshot)==null?void 0:l.elements)==null?void 0:c.get(r);return o&&o.isConnected?[o]:[]}}}elementState(e,n){const r=this.retarget(e,["visible","hidden"].includes(n)?"none":"follow-label");if(!r||!r.isConnected)return n==="hidden"?{matches:!0,received:"hidden"}:{matches:!1,received:"error:notconnected"};if(n==="visible"||n==="hidden"){const o=Cr(r);return{matches:n==="visible"?o:!o,received:o?"visible":"hidden"}}if(n==="disabled"||n==="enabled"){const o=Wl(r);return{matches:n==="disabled"?o:!o,received:o?"disabled":"enabled"}}if(n==="editable"){const o=Wl(r),l=fx(r);if(l==="error")throw this.createStacklessError("Element is not an <input>, <textarea>, <select> or [contenteditable] and does not have a role allowing [aria-readonly]");return{matches:!o&&!l,received:o?"disabled":l?"readOnly":"editable"}}if(n==="checked"||n==="unchecked"){const o=n==="checked",l=cx(r);if(l==="error")throw this.createStacklessError("Not a checkbox or radio button");return{matches:o===l,received:l?"checked":"unchecked"}}if(n==="indeterminate"){const o=ax(r);if(o==="error")throw this.createStacklessError("Not a checkbox or radio button");return{matches:o==="mixed",received:o===!0?"checked":o===!1?"unchecked":"mixed"}}throw this.createStacklessError(`Unexpected element state "${n}"`)}selectOptions(e,n){const r=this.retarget(e,"follow-label");if(!r)return"error:notconnected";if(r.nodeName.toLowerCase()!=="select")throw this.createStacklessError("Element is not a <select> element");const o=r,l=[...o.options],c=[];let u=n.slice();for(let d=0;d<l.length;d++){const p=l[d],g=y=>{if(y instanceof Node)return p===y;let v=!0;return y.valueOrLabel!==void 0&&(v=v&&(y.valueOrLabel===p.value||y.valueOrLabel===p.label)),y.value!==void 0&&(v=v&&y.value===p.value),y.label!==void 0&&(v=v&&y.label===p.label),y.index!==void 0&&(v=v&&y.index===d),v};if(u.some(g)){if(!this.elementState(p,"enabled").matches)return"error:optionnotenabled";if(c.push(p),o.multiple)u=u.filter(y=>!g(y));else{u=[];break}}}return u.length?"error:optionsnotfound":(o.value=void 0,c.forEach(d=>d.selected=!0),o.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),o.dispatchEvent(new Event("change",{bubbles:!0})),c.map(d=>d.value))}fill(e,n){const r=this.retarget(e,"follow-label");if(!r)return"error:notconnected";if(r.nodeName.toLowerCase()==="input"){const o=r,l=o.type.toLowerCase(),c=new Set(["color","date","time","datetime-local","month","range","week"]);if(!new Set(["","email","number","password","search","tel","text","url"]).has(l)&&!c.has(l))throw this.createStacklessError(`Input of type "${l}" cannot be filled`);if(l==="number"&&(n=n.trim(),isNaN(Number(n))))throw this.createStacklessError("Cannot type text into input[type=number]");if(c.has(l)){if(n=n.trim(),o.focus(),o.value=n,o.value!==n)throw this.createStacklessError("Malformed value");return r.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),r.dispatchEvent(new Event("change",{bubbles:!0})),"done"}}else if(r.nodeName.toLowerCase()!=="textarea"){if(!r.isContentEditable)throw this.createStacklessError("Element is not an <input>, <textarea> or [contenteditable] element")}return this.selectText(r),"needsinput"}selectText(e){const n=this.retarget(e,"follow-label");if(!n)return"error:notconnected";if(n.nodeName.toLowerCase()==="input"){const l=n;return l.select(),l.focus(),"done"}if(n.nodeName.toLowerCase()==="textarea"){const l=n;return l.selectionStart=0,l.selectionEnd=l.value.length,l.focus(),"done"}const r=n.ownerDocument.createRange();r.selectNodeContents(n);const o=n.ownerDocument.defaultView.getSelection();return o&&(o.removeAllRanges(),o.addRange(r)),n.focus(),"done"}_activelyFocused(e){const n=e.getRootNode().activeElement,r=n===e&&!!e.ownerDocument&&e.ownerDocument.hasFocus();return{activeElement:n,isFocused:r}}focusNode(e,n){if(!e.isConnected)return"error:notconnected";if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");const{activeElement:r,isFocused:o}=this._activelyFocused(e);if(e.isContentEditable&&!o&&r&&r.blur&&r.blur(),e.focus(),e.focus(),n&&!o&&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,n){if(e.nodeType!==Node.ELEMENT_NODE)return"Node is not of type HTMLElement";const r=e;if(r.nodeName!=="INPUT")return"Not an <input> element";const o=r;if((o.getAttribute("type")||"").toLowerCase()!=="file")return"Not an input[type=file] element";const c=n.map(d=>{const p=Uint8Array.from(atob(d.buffer),g=>g.charCodeAt(0));return new File([p],d.name,{type:d.mimeType,lastModified:d.lastModifiedMs})}),u=new DataTransfer;for(const d of c)u.items.add(d);o.files=u.files,o.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),o.dispatchEvent(new Event("change",{bubbles:!0}))}expectHitTarget(e,n){const r=[];let o=n;for(;o;){const g=xg(o);if(!g||(r.push(g),g.nodeType===9))break;o=g.host}let l;for(let g=r.length-1;g>=0;g--){const y=r[g],v=y.elementsFromPoint(e.x,e.y),S=y.elementFromPoint(e.x,e.y);if(S&&v[0]&<(S)===v[0]){const _=this.window.getComputedStyle(S);(_==null?void 0:_.display)==="contents"&&v.unshift(S)}v[0]&&v[0].shadowRoot===y&&v[1]===S&&v.shift();const k=v[0];if(!k||(l=k,g&&k!==r[g-1].host))break}const c=[];for(;l&&l!==n;)c.push(l),l=lt(l);if(l===n)return"done";const u=this.previewNode(c[0]||this.document.documentElement);let d,p=n;for(;p;){const g=c.indexOf(p);if(g!==-1){g>1&&(d=this.previewNode(c[g-1]));break}p=lt(p)}return d?{hitTargetDescription:`${u} from ${d} subtree`}:{hitTargetDescription:u}}setupHitTargetInterceptor(e,n,r,o){const l=this.retarget(e,"button-link");if(!l||!l.isConnected)return"error:notconnected";if(r){const g=this.expectHitTarget(r,l);if(g!=="done")return g.hitTargetDescription}if(n==="drag")return{stop:()=>"done"};const c={hover:this._hoverHitTargetInterceptorEvents,tap:this._tapHitTargetInterceptorEvents,mouse:this._mouseHitTargetInterceptorEvents}[n];let u;const d=g=>{if(!c.has(g.type)||!g.isTrusted)return;const y=this.window.TouchEvent&&g instanceof this.window.TouchEvent?g.touches[0]:g;u===void 0&&y&&(u=this.expectHitTarget({x:y.clientX,y:y.clientY},l)),(o||u!=="done"&&u!==void 0)&&(g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation())},p=()=>(this._hitTargetInterceptor===d&&(this._hitTargetInterceptor=void 0),u||"done");return this._hitTargetInterceptor=d,{stop:p}}dispatchEvent(e,n,r){var c,u,d;let o;const l={bubbles:!0,cancelable:!0,composed:!0,...r};switch(this._eventTypes.get(n)){case"mouse":o=new MouseEvent(n,l);break;case"keyboard":o=new KeyboardEvent(n,l);break;case"touch":{if(this._browserName==="webkit"){const p=y=>{var k,_;if(y instanceof Touch)return y;let v=y.pageX;v===void 0&&y.clientX!==void 0&&(v=y.clientX+(((k=this.document.scrollingElement)==null?void 0:k.scrollLeft)||0));let S=y.pageY;return S===void 0&&y.clientY!==void 0&&(S=y.clientY+(((_=this.document.scrollingElement)==null?void 0:_.scrollTop)||0)),this.document.createTouch(this.window,y.target??e,y.identifier,v,S,y.screenX,y.screenY,y.radiusX,y.radiusY,y.rotationAngle,y.force)},g=y=>y instanceof TouchList||!y?y:this.document.createTouchList(...y.map(p));l.target??(l.target=e),l.touches=g(l.touches),l.targetTouches=g(l.targetTouches),l.changedTouches=g(l.changedTouches),o=new TouchEvent(n,l)}else l.target??(l.target=e),l.touches=(c=l.touches)==null?void 0:c.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),l.targetTouches=(u=l.targetTouches)==null?void 0:u.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),l.changedTouches=(d=l.changedTouches)==null?void 0:d.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),o=new TouchEvent(n,l);break}case"pointer":o=new PointerEvent(n,l);break;case"focus":o=new FocusEvent(n,l);break;case"drag":o=new DragEvent(n,l);break;case"wheel":o=new WheelEvent(n,l);break;case"deviceorientation":try{o=new DeviceOrientationEvent(n,l)}catch{const{bubbles:p,cancelable:g,alpha:y,beta:v,gamma:S,absolute:k}=l;o=this.document.createEvent("DeviceOrientationEvent"),o.initDeviceOrientationEvent(n,p,g,y,v,S,k)}break;case"devicemotion":try{o=new DeviceMotionEvent(n,l)}catch{const{bubbles:p,cancelable:g,acceleration:y,accelerationIncludingGravity:v,rotationRate:S,interval:k}=l;o=this.document.createEvent("DeviceMotionEvent"),o.initDeviceMotionEvent(n,p,g,y,v,S,k)}break;default:o=new Event(n,l);break}e.dispatchEvent(o)}previewNode(e){if(e.nodeType===Node.TEXT_NODE)return yl(`#text=${e.nodeValue||""}`);if(e.nodeType!==Node.ELEMENT_NODE)return yl(`<${e.nodeName.toLowerCase()} />`);const n=e,r=[];for(let d=0;d<n.attributes.length;d++){const{name:p,value:g}=n.attributes[d];p!=="style"&&(!g&&this._booleanAttributes.has(p)?r.push(` ${p}`):r.push(` ${p}="${g}"`))}r.sort((d,p)=>d.length-p.length);const o=Bp(r.join(""),500);if(this._autoClosingTags.has(n.nodeName))return yl(`<${n.nodeName.toLowerCase()}${o}/>`);const l=n.childNodes;let c=!1;if(l.length<=5){c=!0;for(let d=0;d<l.length;d++)c=c&&l[d].nodeType===Node.TEXT_NODE}const u=c?n.textContent||"":l.length?"…":"";return yl(`<${n.nodeName.toLowerCase()}${o}>${Bp(u,50)}</${n.nodeName.toLowerCase()}>`)}strictModeViolationError(e,n){const r=n.slice(0,10).map(l=>({preview:this.previewNode(l),selector:this.generateSelectorSimple(l)})),o=r.map((l,c)=>`
|
|
112
112
|
${c+1}) ${l.preview} aka ${Tr(this._sdkLanguage,l.selector)}`);return r.length<n.length&&o.push(`
|
|
113
113
|
...`),this.createStacklessError(`strict mode violation: ${Tr(this._sdkLanguage,Tn(e))} resolved to ${n.length} elements:${o.join("")}
|
|
114
|
-
`)}createStacklessError(e){if(this._browserName==="firefox"){const r=new Error("Error: "+e);return r.stack="",r}const n=new Error(e);return delete n.stack,n}createHighlight(){return new vu(this)}maskSelectors(e,n){this._highlight&&this.hideHighlight(),this._highlight=new vu(this),this._highlight.install();const r=[];for(const o of e)r.push(this.querySelectorAll(o,this.document.documentElement));this._highlight.maskElements(r.flat(),n)}highlight(e){this._highlight||(this._highlight=new vu(this),this._highlight.install()),this._highlight.runHighlightOnRaf(e)}hideHighlight(){this._highlight&&(this._highlight.uninstall(),delete this._highlight)}markTargetElements(e,n){var c,u;((c=this._markedElements)==null?void 0:c.callId)!==n&&(this._markedElements=void 0);const r=((u=this._markedElements)==null?void 0:u.elements)||new Set,o=new CustomEvent("__playwright_unmark_target__",{bubbles:!0,cancelable:!0,detail:n,composed:!0});for(const d of r)e.has(d)||d.dispatchEvent(o);const l=new CustomEvent("__playwright_mark_target__",{bubbles:!0,cancelable:!0,detail:n,composed:!0});for(const d of e)r.has(d)||d.dispatchEvent(l);this._markedElements={callId:n,elements:e}}_setupGlobalListenersRemovalDetection(){const e="__playwright_global_listeners_check__";let n=!1;const r=()=>n=!0;this.window.addEventListener(e,r),new MutationObserver(o=>{if(o.some(c=>Array.from(c.addedNodes).includes(this.document.documentElement))&&(n=!1,this.window.dispatchEvent(new CustomEvent(e)),!n)){this.window.addEventListener(e,r);for(const c of this.onGlobalListenersRemoved)c()}}).observe(this.document,{childList:!0})}_setupHitTargetInterceptors(){const e=r=>{var o;return(o=this._hitTargetInterceptor)==null?void 0:o.call(this,r)},n=()=>{for(const r of this._allHitTargetInterceptorEvents)this.window.addEventListener(r,e,{capture:!0,passive:!1})};n(),this.onGlobalListenersRemoved.add(n)}async expect(e,n,r){var l,c;if(n.expression==="to.have.count"||n.expression.endsWith(".array"))return this.expectArray(r,n);if(!e){if(!n.isNot&&n.expression==="to.be.hidden")return{matches:!0};if(n.isNot&&n.expression==="to.be.visible")return{matches:!1};if(!n.isNot&&n.expression==="to.be.detached")return{matches:!0};if(n.isNot&&n.expression==="to.be.attached")return{matches:!1};if(n.isNot&&n.expression==="to.be.in.viewport")return{matches:!1};if(n.expression==="to.have.title"&&((l=n==null?void 0:n.expectedText)!=null&&l[0])){const u=new fs(n.expectedText[0]),d=this.document.title;return{received:d,matches:u.matches(d)}}if(n.expression==="to.have.url"&&((c=n==null?void 0:n.expectedText)!=null&&c[0])){const u=new fs(n.expectedText[0]),d=this.document.location.href;return{received:d,matches:u.matches(d)}}return{matches:n.isNot,missingReceived:!0}}return await this.expectSingleElement(e,n)}async expectSingleElement(e,n){var o;const r=n.expression;{let l;if(r==="to.have.attribute"){const c=e.hasAttribute(n.expressionArg);l={matches:c,received:c?"attribute present":"attribute not present"}}else if(r==="to.be.checked"){const{checked:c,indeterminate:u}=n.expectedValue;if(u){if(c!==void 0)throw this.createStacklessError("Can't assert indeterminate and checked at the same time");l=this.elementState(e,"indeterminate")}else l=this.elementState(e,c===!1?"unchecked":"checked")}else if(r==="to.be.disabled")l=this.elementState(e,"disabled");else if(r==="to.be.editable")l=this.elementState(e,"editable");else if(r==="to.be.readonly")l=this.elementState(e,"editable"),l.matches=!l.matches;else if(r==="to.be.empty")if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){const c=e.value;l={matches:!c,received:c?"notEmpty":"empty"}}else{const c=(o=e.textContent)==null?void 0:o.trim();l={matches:!c,received:c?"notEmpty":"empty"}}else if(r==="to.be.enabled")l=this.elementState(e,"enabled");else if(r==="to.be.focused"){const c=this._activelyFocused(e).isFocused;l={matches:c,received:c?"focused":"inactive"}}else r==="to.be.hidden"?l=this.elementState(e,"hidden"):r==="to.be.visible"?l=this.elementState(e,"visible"):r==="to.be.attached"?l={matches:!0,received:"attached"}:r==="to.be.detached"&&(l={matches:!1,received:"attached"});if(l){if(l.received==="error:notconnected")throw this.createStacklessError("Element is not connected");return l}}if(r==="to.have.property"){let l=e;const c=n.expressionArg.split(".");for(let p=0;p<c.length-1;p++){if(typeof l!="object"||!(c[p]in l))return{received:void 0,matches:!1};l=l[c[p]]}const u=l[c[c.length-1]],d=Bu(u,n.expectedValue);return{received:u,matches:d}}if(r==="to.be.in.viewport"){const l=await this.viewportRatio(e);return{received:`viewport ratio ${l}`,matches:l>0&&l>(n.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");const l=[...e.selectedOptions].map(c=>c.value);return l.length!==n.expectedText.length?{received:l,matches:!1}:{received:l,matches:l.map((c,u)=>new fs(n.expectedText[u]).matches(c)).every(Boolean)}}if(r==="to.match.aria"){const l=Ex(e,n.expectedValue);return{received:l.received,matches:!!l.matches.length}}{let l;if(r==="to.have.attribute.value"){const c=e.getAttribute(n.expressionArg);if(c===null)return{received:null,matches:!1};l=c}else if(["to.have.class","to.contain.class"].includes(r)){if(!n.expectedText)throw this.createStacklessError("Expected text is not provided for "+r);return{received:e.classList.toString(),matches:new fs(n.expectedText[0]).matchesClassList(this,e.classList,r==="to.contain.class")}}else if(r==="to.have.css")l=this.window.getComputedStyle(e).getPropertyValue(n.expressionArg);else if(r==="to.have.id")l=e.id;else if(r==="to.have.text")l=n.useInnerText?e.innerText:Tt(new Map,e).full;else if(r==="to.have.accessible.name")l=Vi(e,!1);else if(r==="to.have.accessible.description")l=rm(e,!1);else if(r==="to.have.accessible.error.message")l=ox(e);else if(r==="to.have.role")l=nt(e)||"";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");l=e.value}if(l!==void 0&&n.expectedText){const c=new fs(n.expectedText[0]);return{received:l,matches:c.matches(l)}}}throw this.createStacklessError("Unknown expect matcher: "+r)}expectArray(e,n){const r=n.expression;if(r==="to.have.count"){const d=e.length,p=d===n.expectedNumber;return{received:d,matches:p}}if(!n.expectedText)throw this.createStacklessError("Expected text is not provided for "+r);if(["to.have.class.array","to.contain.class.array"].includes(r)){const d=e.map(y=>y.classList),p=d.map(String);if(d.length!==n.expectedText.length)return{received:p,matches:!1};const g=this._matchSequentially(n.expectedText,d,(y,v)=>y.matchesClassList(this,v,r==="to.contain.class.array"));return{received:p,matches:g}}if(!["to.contain.text.array","to.have.text.array"].includes(r))throw this.createStacklessError("Unknown expect matcher: "+r);const o=e.map(d=>n.useInnerText?d.innerText:Tt(new Map,d).full),l=r!=="to.contain.text.array";if(!(o.length===n.expectedText.length||!l))return{received:o,matches:!1};const u=this._matchSequentially(n.expectedText,o,(d,p)=>d.matches(p));return{received:o,matches:u}}_matchSequentially(e,n,r){const o=e.map(u=>new fs(u));let l=0,c=0;for(;l<o.length&&c<n.length;)r(o[l],n[c])&&++l,++c;return l===o.length}}function yl(t){return t.replace(/\n/g,"↵").replace(/\t/g,"⇆")}function B_(t){if(t=t.substring(1,t.length-1),!t.includes("\\"))return t;const e=[];let n=0;for(;n<t.length;)t[n]==="\\"&&n+1<t.length&&n++,e.push(t[n++]);return e.join("")}function vl(t,e){if(t[0]==="/"&&t.lastIndexOf("/")>0){const o=t.lastIndexOf("/"),l=new RegExp(t.substring(1,o),t.substring(o+1));return{matcher:c=>l.test(c.full),kind:"regex"}}const n=e?JSON.parse.bind(JSON):B_;let r=!1;return t.length>1&&t[0]==='"'&&t[t.length-1]==='"'?(t=n(t),r=!0):e&&t.length>1&&t[0]==='"'&&t[t.length-2]==='"'&&t[t.length-1]==="i"?(t=n(t.substring(0,t.length-1)),r=!1):e&&t.length>1&&t[0]==='"'&&t[t.length-2]==='"'&&t[t.length-1]==="s"?(t=n(t.substring(0,t.length-1)),r=!0):t.length>1&&t[0]==="'"&&t[t.length-1]==="'"&&(t=n(t),r=!0),t=mt(t),r?e?{kind:"strict",matcher:l=>l.normalized===t}:{matcher:l=>!t&&!l.immediate.length?!0:l.immediate.some(c=>mt(c)===t),kind:"strict"}:(t=t.toLowerCase(),{kind:"lax",matcher:o=>o.normalized.toLowerCase().includes(t)})}class fs{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){const n=new Set((e.regexFlags||"").split(""));e.ignoreCase===!1&&n.delete("i"),e.ignoreCase===!0&&n.add("i"),this._regex=new RegExp(e.regexSource,[...n].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,n,r){if(r){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(o=>n.contains(o))}return this.matches(n.toString())}normalize(e){return e&&(this._normalizeWhiteSpace&&(e=mt(e)),this._ignoreCase&&(e=e.toLocaleLowerCase()),e)}}function Bu(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!Bu(t[r],e[r]))return!1;return!0}if(t instanceof RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let r=0;r<n.length;++r)if(!e.hasOwnProperty(n[r]))return!1;for(const r of n)if(!Bu(t[r],e[r]))return!1;return!0}return typeof t=="number"&&typeof e=="number"?isNaN(t)&&isNaN(e):!1}const z_={tagName:"svg",children:[{tagName:"defs",children:[{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-gripper"},children:[{tagName:"path",attrs:{d:"M5 3h2v2H5zm0 4h2v2H5zm0 4h2v2H5zm4-8h2v2H9zm0 4h2v2H9zm0 4h2v2H9z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-circle-large-filled"},children:[{tagName:"path",attrs:{d:"M8 1a6.8 6.8 0 0 1 1.86.253 6.899 6.899 0 0 1 3.083 1.805 6.903 6.903 0 0 1 1.804 3.083C14.916 6.738 15 7.357 15 8s-.084 1.262-.253 1.86a6.9 6.9 0 0 1-.704 1.674 7.157 7.157 0 0 1-2.516 2.509 6.966 6.966 0 0 1-1.668.71A6.984 6.984 0 0 1 8 15a6.984 6.984 0 0 1-1.86-.246 7.098 7.098 0 0 1-1.674-.711 7.3 7.3 0 0 1-1.415-1.094 7.295 7.295 0 0 1-1.094-1.415 7.098 7.098 0 0 1-.71-1.675A6.985 6.985 0 0 1 1 8c0-.643.082-1.262.246-1.86a6.968 6.968 0 0 1 .711-1.667 7.156 7.156 0 0 1 2.509-2.516 6.895 6.895 0 0 1 1.675-.704A6.808 6.808 0 0 1 8 1z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-inspect"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1 3l1-1h12l1 1v6h-1V3H2v8h5v1H2l-1-1V3zm14.707 9.707L9 6v9.414l2.707-2.707h4zM10 13V8.414l3.293 3.293h-2L10 13z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-whole-word"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 11H1V13H15V11H16V14H15H1H0V11Z"}},{tagName:"path",attrs:{d:"M6.84048 11H5.95963V10.1406H5.93814C5.555 10.7995 4.99104 11.1289 4.24625 11.1289C3.69839 11.1289 3.26871 10.9839 2.95718 10.6938C2.64924 10.4038 2.49527 10.0189 2.49527 9.53906C2.49527 8.51139 3.10041 7.91341 4.3107 7.74512L5.95963 7.51416C5.95963 6.57959 5.58186 6.1123 4.82632 6.1123C4.16389 6.1123 3.56591 6.33789 3.03238 6.78906V5.88672C3.57307 5.54297 4.19612 5.37109 4.90152 5.37109C6.19416 5.37109 6.84048 6.05501 6.84048 7.42285V11ZM5.95963 8.21777L4.63297 8.40039C4.22476 8.45768 3.91682 8.55973 3.70914 8.70654C3.50145 8.84977 3.39761 9.10579 3.39761 9.47461C3.39761 9.74316 3.4925 9.96338 3.68228 10.1353C3.87564 10.3035 4.13166 10.3877 4.45035 10.3877C4.8872 10.3877 5.24706 10.2355 5.52994 9.93115C5.8164 9.62321 5.95963 9.2347 5.95963 8.76562V8.21777Z"}},{tagName:"path",attrs:{d:"M9.3475 10.2051H9.32601V11H8.44515V2.85742H9.32601V6.4668H9.3475C9.78076 5.73633 10.4146 5.37109 11.2489 5.37109C11.9543 5.37109 12.5057 5.61816 12.9032 6.1123C13.3042 6.60286 13.5047 7.26172 13.5047 8.08887C13.5047 9.00911 13.2809 9.74674 12.8333 10.3018C12.3857 10.8532 11.7734 11.1289 10.9964 11.1289C10.2695 11.1289 9.71989 10.821 9.3475 10.2051ZM9.32601 7.98682V8.75488C9.32601 9.20964 9.47282 9.59635 9.76644 9.91504C10.0636 10.2301 10.4396 10.3877 10.8944 10.3877C11.4279 10.3877 11.8451 10.1836 12.1458 9.77539C12.4502 9.36719 12.6024 8.79964 12.6024 8.07275C12.6024 7.46045 12.4609 6.98063 12.1781 6.6333C11.8952 6.28597 11.512 6.1123 11.0286 6.1123C10.5166 6.1123 10.1048 6.29134 9.7933 6.64941C9.48177 7.00391 9.32601 7.44971 9.32601 7.98682Z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-eye"},children:[{tagName:"path",attrs:{d:"M7.99993 6.00316C9.47266 6.00316 10.6666 7.19708 10.6666 8.66981C10.6666 10.1426 9.47266 11.3365 7.99993 11.3365C6.52715 11.3365 5.33324 10.1426 5.33324 8.66981C5.33324 7.19708 6.52715 6.00316 7.99993 6.00316ZM7.99993 7.00315C7.07946 7.00315 6.33324 7.74935 6.33324 8.66981C6.33324 9.59028 7.07946 10.3365 7.99993 10.3365C8.9204 10.3365 9.6666 9.59028 9.6666 8.66981C9.6666 7.74935 8.9204 7.00315 7.99993 7.00315ZM7.99993 3.66675C11.0756 3.66675 13.7307 5.76675 14.4673 8.70968C14.5344 8.97755 14.3716 9.24908 14.1037 9.31615C13.8358 9.38315 13.5643 9.22041 13.4973 8.95248C12.8713 6.45205 10.6141 4.66675 7.99993 4.66675C5.38454 4.66675 3.12664 6.45359 2.50182 8.95555C2.43491 9.22341 2.16348 9.38635 1.89557 9.31948C1.62766 9.25255 1.46471 8.98115 1.53162 8.71321C2.26701 5.76856 4.9229 3.66675 7.99993 3.66675Z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-symbol-constant"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 6h8v1H4V6zm8 3H4v1h8V9z"}},{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1 4l1-1h12l1 1v8l-1 1H2l-1-1V4zm1 0v8h12V4H2z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-check"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.431 3.323l-8.47 10-.79-.036-3.35-4.77.818-.574 2.978 4.24 8.051-9.506.764.646z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-close"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-pass"},children:[{tagName:"path",attrs:{d:"M6.27 10.87h.71l4.56-4.56-.71-.71-4.2 4.21-1.92-1.92L4 8.6l2.27 2.27z"}},{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-gist"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.57 1.14l3.28 3.3.15.36v9.7l-.5.5h-11l-.5-.5v-13l.5-.5h7.72l.35.14zM10 5h3l-3-3v3zM3 2v12h10V6H9.5L9 5.5V2H3zm2.062 7.533l1.817-1.828L6.17 7 4 9.179v.707l2.171 2.174.707-.707-1.816-1.82zM8.8 7.714l.7-.709 2.189 2.175v.709L9.5 12.062l-.705-.709 1.831-1.82L8.8 7.714z"}}]}]}]},Ht={multiple:"#f6b26b7f",single:"#6fa8dc7f",assert:"#8acae480",action:"#dc6f6f7f"};class gm{cursor(){return"default"}}class _u{constructor(e,n){this._hoveredModel=null,this._hoveredElement=null,this._recorder=e,this._assertVisibility=n}cursor(){return"pointer"}uninstall(){this._hoveredModel=null,this._hoveredElement=null}onClick(e){var n;Ue(e),e.button===0&&(n=this._hoveredModel)!=null&&n.selector&&this._commit(this._hoveredModel.selector,this._hoveredModel)}onPointerDown(e){Ue(e)}onPointerUp(e){Ue(e)}onMouseDown(e){Ue(e)}onMouseUp(e){Ue(e)}onMouseMove(e){var o;Ue(e);let n=this._recorder.deepEventTarget(e);if(n.isConnected||(n=null),this._hoveredElement===n)return;this._hoveredElement=n;let r=null;if(this._hoveredElement){const l=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName,multiple:!1});r={selector:l.selector,elements:l.elements,tooltipText:this._recorder.injectedScript.utils.asLocator(this._recorder.state.language,l.selector),color:this._assertVisibility?Ht.assert:Ht.single}}((o=this._hoveredModel)==null?void 0:o.selector)!==(r==null?void 0:r.selector)&&(this._hoveredModel=r,this._recorder.updateHighlight(r,!0))}onMouseEnter(e){Ue(e)}onMouseLeave(e){Ue(e);const n=this._recorder.injectedScript.window;n.top!==n&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&this._reset(!0)}onKeyDown(e){Ue(e),e.key==="Escape"&&this._assertVisibility&&this._recorder.setMode("recording")}onKeyUp(e){Ue(e)}onScroll(e){this._reset(!1)}_commit(e,n){var r;this._assertVisibility?(this._recorder.recordAction({name:"assertVisible",selector:e,signals:[]}),this._recorder.setMode("recording"),(r=this._recorder.overlay)==null||r.flashToolSucceeded("assertingVisibility")):this._recorder.elementPicked(e,n)}_reset(e){this._hoveredElement=null,this._hoveredModel=null,this._recorder.updateHighlight(null,e)}}class H_{constructor(e){this._hoveredModel=null,this._hoveredElement=null,this._activeModel=null,this._expectProgrammaticKeyUp=!1,this._observer=null,this._recorder=e,this._performingActions=new Set}cursor(){return"pointer"}_installObserverIfNeeded(){var e;this._observer||(e=this._recorder.injectedScript.document)!=null&&e.body&&(this._observer=new MutationObserver(n=>{if(this._hoveredElement)for(const r of n)for(const o of r.removedNodes)(o===this._hoveredElement||o.contains(this._hoveredElement))&&this._resetHoveredModel()}),this._observer.observe(this._recorder.injectedScript.document.body,{childList:!0,subtree:!0}))}uninstall(){var e;(e=this._observer)==null||e.disconnect(),this._observer=null,this._hoveredModel=null,this._hoveredElement=null,this._activeModel=null,this._expectProgrammaticKeyUp=!1}onClick(e){if(Es(this._hoveredElement)||e.button===2&&e.type==="auxclick"||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel))return;const n=Hi(this._recorder.deepEventTarget(e));if(n&&e.detail===1){this._performAction({name:n.checked?"check":"uncheck",selector:this._hoveredModel.selector,signals:[]});return}this._cancelPendingClickAction(),e.detail===1&&(this._pendingClickAction={action:{name:"click",selector:this._hoveredModel.selector,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail},timeout:this._recorder.injectedScript.utils.builtins.setTimeout(()=>this._commitPendingClickAction(),200)})}onDblClick(e){Es(this._hoveredElement)||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||(this._cancelPendingClickAction(),this._performAction({name:"click",selector:this._hoveredModel.selector,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail}))}_commitPendingClickAction(){this._pendingClickAction&&this._performAction(this._pendingClickAction.action),this._cancelPendingClickAction()}_cancelPendingClickAction(){this._pendingClickAction&&this._recorder.injectedScript.utils.builtins.clearTimeout(this._pendingClickAction.timeout),this._pendingClickAction=void 0}onContextMenu(e){this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||this._performAction({name:"click",selector:this._hoveredModel.selector,position:zi(e),signals:[],button:"right",modifiers:0,clickCount:0})}onPointerDown(e){this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onPointerUp(e){this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseDown(e){this._shouldIgnoreMouseEvent(e)||(this._consumeWhenAboutToPerform(e),this._activeModel=this._hoveredModel)}onMouseUp(e){this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseMove(e){const n=this._recorder.deepEventTarget(e);this._hoveredElement!==n&&(this._hoveredElement=n,this._updateModelForHoveredElement())}onMouseLeave(e){const n=this._recorder.injectedScript.window;n.top!==n&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&(this._hoveredElement=null,this._updateModelForHoveredElement())}onFocus(e){this._onFocus(!0)}onInput(e){const n=this._recorder.deepEventTarget(e);if(n.nodeName==="INPUT"&&n.type.toLowerCase()==="file"){this._recorder.recordAction({name:"setInputFiles",selector:this._activeModel.selector,signals:[],files:[...n.files||[]].map(r=>r.name)});return}if(Es(n)){this._recorder.recordAction({name:"fill",selector:this._hoveredModel.selector,signals:[],text:n.value});return}if(["INPUT","TEXTAREA"].includes(n.nodeName)||n.isContentEditable){if(n.nodeName==="INPUT"&&["checkbox","radio"].includes(n.type.toLowerCase())||this._consumedDueWrongTarget(e))return;this._recorder.recordAction({name:"fill",selector:this._activeModel.selector,signals:[],text:n.isContentEditable?n.innerText:n.value})}if(n.nodeName==="SELECT"){const r=n;if(this._actionInProgress(e))return;this._performAction({name:"select",selector:this._activeModel.selector,options:[...r.selectedOptions].map(o=>o.value),signals:[]})}}onKeyDown(e){if(this._shouldGenerateKeyPressFor(e)){if(this._actionInProgress(e)){this._expectProgrammaticKeyUp=!0;return}if(!this._consumedDueWrongTarget(e)){if(e.key===" "){const n=Hi(this._recorder.deepEventTarget(e));if(n&&e.detail===0){this._performAction({name:n.checked?"uncheck":"check",selector:this._activeModel.selector,signals:[]});return}}this._performAction({name:"press",selector:this._activeModel.selector,signals:[],key:e.key,modifiers:_s(e)})}}}onKeyUp(e){if(this._shouldGenerateKeyPressFor(e)){if(!this._expectProgrammaticKeyUp){Ue(e);return}this._expectProgrammaticKeyUp=!1}}onScroll(e){this._resetHoveredModel()}_resetHoveredModel(){this._hoveredModel=null,this._hoveredElement=null,this._updateHighlight(!1)}_onFocus(e){const n=K_(this._recorder.document);if(e&&n===this._recorder.document.body)return;const r=n?this._recorder.injectedScript.generateSelector(n,{testIdAttributeName:this._recorder.state.testIdAttributeName}):null;this._activeModel=r&&r.selector?{...r,color:Ht.action}:null,e&&(this._hoveredElement=n,this._updateModelForHoveredElement())}_shouldIgnoreMouseEvent(e){const n=this._recorder.deepEventTarget(e),r=n.nodeName;return!!(r==="SELECT"||r==="OPTION"||r==="INPUT"&&["date","range"].includes(n.type))}_actionInProgress(e){const n=e instanceof KeyboardEvent,r=e instanceof MouseEvent||e instanceof PointerEvent;for(const o of this._performingActions)if(n&&o.name==="press"&&e.key===o.key||r&&(o.name==="click"||o.name==="check"||o.name==="uncheck"))return!0;return Ue(e),!1}_consumedDueToNoModel(e,n){return n?!1:(Ue(e),!0)}_consumedDueWrongTarget(e){return this._activeModel&&this._activeModel.elements[0]===this._recorder.deepEventTarget(e)?!1:(Ue(e),!0)}_consumeWhenAboutToPerform(e){this._performingActions.size||Ue(e)}_performAction(e){this._recorder.updateHighlight(null,!1),this._performingActions.add(e);const n=this._recorder.performAction(e).then(()=>{this._performingActions.delete(e),this._onFocus(!1)});this._recorder.injectedScript.isUnderTest&&n.then(()=>{console.error("Action performed for test: "+JSON.stringify({hovered:this._hoveredModel?this._hoveredModel.selector:null,active:this._activeModel?this._activeModel.selector:null}))})}_shouldGenerateKeyPressFor(e){if(typeof e.key!="string"||e.key==="Enter"&&(this._recorder.deepEventTarget(e).nodeName==="TEXTAREA"||this._recorder.deepEventTarget(e).isContentEditable)||["Backspace","Delete","AltGraph"].includes(e.key)||e.key==="@"&&e.code==="KeyL")return!1;if(navigator.platform.includes("Mac")){if(e.key==="v"&&e.metaKey)return!1}else if(e.key==="v"&&e.ctrlKey||e.key==="Insert"&&e.shiftKey)return!1;if(["Shift","Control","Meta","Alt","Process"].includes(e.key))return!1;const n=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!n?!!Hi(this._recorder.deepEventTarget(e)):!0}_updateModelForHoveredElement(){if(this._installObserverIfNeeded(),this._performingActions.size)return;if(!this._hoveredElement||!this._hoveredElement.isConnected){this._hoveredModel=null,this._hoveredElement=null,this._updateHighlight(!0);return}const{selector:e,elements:n}=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoveredModel&&this._hoveredModel.selector===e||(this._hoveredModel=e?{selector:e,elements:n,color:Ht.action}:null,this._updateHighlight(!0))}_updateHighlight(e){this._recorder.updateHighlight(this._hoveredModel,e)}}class U_{constructor(e){this._recorder=e}cursor(){return"pointer"}onClick(e){const n=this._recorder.deepEventTarget(e);if(Es(n)||e.button===2&&e.type==="auxclick"||this._shouldIgnoreMouseEvent(e))return;const r=Hi(n),{ariaSnapshot:o,selector:l}=this._ariaSnapshot(n);if(r&&e.detail===1){this._recorder.recordAction({name:r.checked?"check":"uncheck",selector:l,signals:[],ariaSnapshot:o});return}this._recorder.recordAction({name:"click",selector:l,ariaSnapshot:o,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail})}onDblClick(e){const n=this._recorder.deepEventTarget(e);if(Es(n)||this._shouldIgnoreMouseEvent(e))return;const{ariaSnapshot:r,selector:o}=this._ariaSnapshot(n);this._recorder.recordAction({name:"click",selector:o,ariaSnapshot:r,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail})}onInput(e){const n=this._recorder.deepEventTarget(e),{ariaSnapshot:r,selector:o}=this._ariaSnapshot(n);if(Es(n)){this._recorder.recordAction({name:"fill",selector:o,ariaSnapshot:r,signals:[],text:n.value});return}if(["INPUT","TEXTAREA"].includes(n.nodeName)||n.isContentEditable){if(n.nodeName==="INPUT"&&["checkbox","radio"].includes(n.type.toLowerCase()))return;this._recorder.recordAction({name:"fill",selector:o,ariaSnapshot:r,signals:[],text:n.isContentEditable?n.innerText:n.value});return}if(n.nodeName==="SELECT"){const l=n;this._recorder.recordAction({name:"select",selector:o,ariaSnapshot:r,options:[...l.selectedOptions].map(c=>c.value),signals:[]});return}}onKeyDown(e){if(!this._shouldGenerateKeyPressFor(e))return;const n=this._recorder.deepEventTarget(e),{ariaSnapshot:r,selector:o}=this._ariaSnapshot(n);if(e.key===" "){const l=Hi(n);if(l&&e.detail===0){this._recorder.recordAction({name:l.checked?"uncheck":"check",selector:o,ariaSnapshot:r,signals:[]});return}}this._recorder.recordAction({name:"press",selector:o,ariaSnapshot:r,signals:[],key:e.key,modifiers:_s(e)})}_shouldIgnoreMouseEvent(e){const n=this._recorder.deepEventTarget(e),r=n.nodeName;return!!(r==="SELECT"||r==="OPTION"||r==="INPUT"&&["date","range"].includes(n.type))}_shouldGenerateKeyPressFor(e){if(typeof e.key!="string"||e.key==="Enter"&&(this._recorder.deepEventTarget(e).nodeName==="TEXTAREA"||this._recorder.deepEventTarget(e).isContentEditable)||["Backspace","Delete","AltGraph"].includes(e.key)||e.key==="@"&&e.code==="KeyL")return!1;if(navigator.platform.includes("Mac")){if(e.key==="v"&&e.metaKey)return!1}else if(e.key==="v"&&e.ctrlKey||e.key==="Insert"&&e.shiftKey)return!1;if(["Shift","Control","Meta","Alt","Process"].includes(e.key))return!1;const n=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!n?!this._isEditable(this._recorder.deepEventTarget(e)):!0}_isEditable(e){return!!(e.nodeName==="TEXTAREA"||e.nodeName==="INPUT"||e.isContentEditable)}_ariaSnapshot(e){const{ariaSnapshot:n,refs:r}=this._recorder.injectedScript.ariaSnapshotForRecorder(),o=e?r.get(e):void 0,l=o?`aria-ref=${o}`:void 0;return{ariaSnapshot:n,selector:l}}}class Eu{constructor(e,n){this._hoverHighlight=null,this._action=null,this._recorder=e,this._textCache=new Map,this._kind=n,this._dialog=new W_(e)}cursor(){return"pointer"}uninstall(){this._dialog.close(),this._hoverHighlight=null}onClick(e){Ue(e),this._kind==="value"?this._commitAssertValue():this._dialog.isShowing()||this._showDialog()}onMouseDown(e){const n=this._recorder.deepEventTarget(e);this._elementHasValue(n)&&e.preventDefault()}onPointerUp(e){var r;const n=(r=this._hoverHighlight)==null?void 0:r.elements[0];this._kind==="value"&&n&&(n.nodeName==="INPUT"||n.nodeName==="SELECT")&&n.disabled&&this._commitAssertValue()}onMouseMove(e){var r;if(this._dialog.isShowing())return;const n=this._recorder.deepEventTarget(e);if(((r=this._hoverHighlight)==null?void 0:r.elements[0])!==n){if(this._kind==="text"||this._kind==="snapshot")this._hoverHighlight=this._recorder.injectedScript.utils.elementText(this._textCache,n).full?{elements:[n],selector:"",color:Ht.assert}:null;else if(this._elementHasValue(n)){const o=this._recorder.injectedScript.generateSelector(n,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoverHighlight={selector:o.selector,elements:o.elements,color:Ht.assert}}else this._hoverHighlight=null;this._recorder.updateHighlight(this._hoverHighlight,!0)}}onKeyDown(e){e.key==="Escape"&&this._recorder.setMode("recording"),Ue(e)}onScroll(e){this._recorder.updateHighlight(this._hoverHighlight,!1)}_elementHasValue(e){return e.nodeName==="TEXTAREA"||e.nodeName==="SELECT"||e.nodeName==="INPUT"&&!["button","image","reset","submit"].includes(e.type)}_generateAction(){var n;this._textCache.clear();const e=(n=this._hoverHighlight)==null?void 0:n.elements[0];if(!e)return null;if(this._kind==="value"){if(!this._elementHasValue(e))return null;const{selector:r}=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName});return e.nodeName==="INPUT"&&["checkbox","radio"].includes(e.type.toLowerCase())?{name:"assertChecked",selector:r,signals:[],checked:!e.checked}:{name:"assertValue",selector:r,signals:[],value:e.value}}else if(this._kind==="snapshot"){const r=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:r.selector,elements:r.elements,color:Ht.assert},this._recorder.updateHighlight(this._hoverHighlight,!0),{name:"assertSnapshot",selector:this._hoverHighlight.selector,signals:[],ariaSnapshot:this._recorder.injectedScript.ariaSnapshot(e,{mode:"regex"})}}else{const r=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:r.selector,elements:r.elements,color:Ht.assert},this._recorder.updateHighlight(this._hoverHighlight,!0),{name:"assertText",selector:this._hoverHighlight.selector,signals:[],text:this._recorder.injectedScript.utils.elementText(this._textCache,e).normalized,substring:!0}}}_renderValue(e){return(e==null?void 0:e.name)==="assertText"?this._recorder.injectedScript.utils.normalizeWhiteSpace(e.text):(e==null?void 0:e.name)==="assertChecked"?String(e.checked):(e==null?void 0:e.name)==="assertValue"?e.value:(e==null?void 0:e.name)==="assertSnapshot"?e.ariaSnapshot:""}_commit(){!this._action||!this._dialog.isShowing()||(this._dialog.close(),this._recorder.recordAction(this._action),this._recorder.setMode("recording"))}_showDialog(){var e,n,r,o;(e=this._hoverHighlight)!=null&&e.elements[0]&&(this._action=this._generateAction(),((n=this._action)==null?void 0:n.name)==="assertText"?this._showTextDialog(this._action):((r=this._action)==null?void 0:r.name)==="assertSnapshot"&&(this._recorder.recordAction(this._action),this._recorder.setMode("recording"),(o=this._recorder.overlay)==null||o.flashToolSucceeded("assertingSnapshot")))}_showTextDialog(e){const n=this._recorder.document.createElement("textarea");n.setAttribute("spellcheck","false"),n.value=this._renderValue(e),n.classList.add("text-editor");const r=()=>{var y;const u=this._recorder.injectedScript.utils.normalizeWhiteSpace(n.value),d=(y=this._hoverHighlight)==null?void 0:y.elements[0];if(!d)return;e.text=u;const p=this._recorder.injectedScript.utils.elementText(this._textCache,d).normalized,g=u&&p.includes(u);n.classList.toggle("does-not-match",!g)};n.addEventListener("input",r);const l=this._dialog.show({label:"Assert that element contains text",body:n,onCommit:()=>this._commit()}),c=this._recorder.highlight.tooltipPosition(this._recorder.highlight.firstBox(),l);this._dialog.moveTo(c.anchorTop,c.anchorLeft),n.focus()}_commitAssertValue(){var n;if(this._kind!=="value")return;const e=this._generateAction();e&&(this._recorder.recordAction(e),this._recorder.setMode("recording"),(n=this._recorder.overlay)==null||n.flashToolSucceeded("assertingValue"))}}class q_{constructor(e){this._listeners=[],this._offsetX=0,this._measure={width:0,height:0},this._recorder=e;const n=this._recorder.document;this._overlayElement=n.createElement("x-pw-overlay");const r=n.createElement("x-pw-tools-list");this._overlayElement.appendChild(r),this._dragHandle=n.createElement("x-pw-tool-gripper"),this._dragHandle.appendChild(n.createElement("x-div")),r.appendChild(this._dragHandle),this._recordToggle=this._recorder.document.createElement("x-pw-tool-item"),this._recordToggle.title="Record",this._recordToggle.classList.add("record"),this._recordToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._recordToggle),this._pickLocatorToggle=this._recorder.document.createElement("x-pw-tool-item"),this._pickLocatorToggle.title="Pick locator",this._pickLocatorToggle.classList.add("pick-locator"),this._pickLocatorToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._pickLocatorToggle),this._assertVisibilityToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertVisibilityToggle.title="Assert visibility",this._assertVisibilityToggle.classList.add("visibility"),this._assertVisibilityToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._assertVisibilityToggle),this._assertTextToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertTextToggle.title="Assert text",this._assertTextToggle.classList.add("text"),this._assertTextToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._assertTextToggle),this._assertValuesToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertValuesToggle.title="Assert value",this._assertValuesToggle.classList.add("value"),this._assertValuesToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._assertValuesToggle),this._assertSnapshotToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertSnapshotToggle.title="Assert snapshot",this._assertSnapshotToggle.classList.add("snapshot"),this._assertSnapshotToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._assertSnapshotToggle),this._updateVisualPosition(),this._refreshListeners()}_refreshListeners(){gy(this._listeners),this._listeners=[Le(this._dragHandle,"mousedown",e=>{this._dragState={offsetX:this._offsetX,dragStart:{x:e.clientX,y:0}}}),Le(this._recordToggle,"click",()=>{this._recordToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="none"||this._recorder.state.mode==="standby"||this._recorder.state.mode==="inspecting"?"recording":"standby")}),Le(this._pickLocatorToggle,"click",()=>{if(this._pickLocatorToggle.classList.contains("disabled"))return;const e={inspecting:"standby",none:"inspecting",standby:"inspecting",recording:"recording-inspecting","recording-inspecting":"recording",assertingText:"recording-inspecting",assertingVisibility:"recording-inspecting",assertingValue:"recording-inspecting",assertingSnapshot:"recording-inspecting"};this._recorder.setMode(e[this._recorder.state.mode])}),Le(this._assertVisibilityToggle,"click",()=>{this._assertVisibilityToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingVisibility"?"recording":"assertingVisibility")}),Le(this._assertTextToggle,"click",()=>{this._assertTextToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingText"?"recording":"assertingText")}),Le(this._assertValuesToggle,"click",()=>{this._assertValuesToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingValue"?"recording":"assertingValue")}),Le(this._assertSnapshotToggle,"click",()=>{this._assertSnapshotToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingSnapshot"?"recording":"assertingSnapshot")})]}install(){this._recorder.highlight.appendChild(this._overlayElement),this._refreshListeners(),this._updateVisualPosition()}contains(e){return this._recorder.injectedScript.utils.isInsideScope(this._overlayElement,e)}setUIState(e){this._recordToggle.classList.toggle("toggled",e.mode==="recording"||e.mode==="assertingText"||e.mode==="assertingVisibility"||e.mode==="assertingValue"||e.mode==="assertingSnapshot"||e.mode==="recording-inspecting"),this._pickLocatorToggle.classList.toggle("toggled",e.mode==="inspecting"||e.mode==="recording-inspecting"),this._assertVisibilityToggle.classList.toggle("toggled",e.mode==="assertingVisibility"),this._assertVisibilityToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertTextToggle.classList.toggle("toggled",e.mode==="assertingText"),this._assertTextToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertValuesToggle.classList.toggle("toggled",e.mode==="assertingValue"),this._assertValuesToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertSnapshotToggle.classList.toggle("toggled",e.mode==="assertingSnapshot"),this._assertSnapshotToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._offsetX!==e.overlay.offsetX&&(this._offsetX=e.overlay.offsetX,this._updateVisualPosition()),e.mode==="none"?this._hideOverlay():this._showOverlay()}flashToolSucceeded(e){let n;e==="assertingVisibility"?n=this._assertVisibilityToggle:e==="assertingSnapshot"?n=this._assertSnapshotToggle:n=this._assertValuesToggle,n.classList.add("succeeded"),this._recorder.injectedScript.utils.builtins.setTimeout(()=>n.classList.remove("succeeded"),2e3)}_hideOverlay(){this._overlayElement.setAttribute("hidden","true")}_showOverlay(){this._overlayElement.hasAttribute("hidden")&&(this._overlayElement.removeAttribute("hidden"),this._updateVisualPosition())}_updateVisualPosition(){this._measure=this._overlayElement.getBoundingClientRect(),this._overlayElement.style.left=(this._recorder.injectedScript.window.innerWidth-this._measure.width)/2+this._offsetX+"px"}onMouseMove(e){if(!e.buttons)return this._dragState=void 0,!1;if(this._dragState){this._offsetX=this._dragState.offsetX+e.clientX-this._dragState.dragStart.x;const n=(this._recorder.injectedScript.window.innerWidth-this._measure.width)/2-10;return this._offsetX=Math.max(-n,Math.min(n,this._offsetX)),this._updateVisualPosition(),this._recorder.setOverlayState({offsetX:this._offsetX}),Ue(e),!0}return!1}onMouseUp(e){return this._dragState?(Ue(e),!0):!1}onClick(e){return this._dragState?(this._dragState=void 0,Ue(e),!0):!1}onDblClick(e){return!1}}class V_{constructor(e,n){var r,o;this._listeners=[],this._lastHighlightedSelector=void 0,this._lastHighlightedAriaTemplateJSON="undefined",this.state={mode:"none",testIdAttributeName:"data-testid",language:"javascript",overlay:{offsetX:0}},this._delegate={},this.document=e.document,this.injectedScript=e,this.highlight=e.createHighlight(),this._tools={none:new gm,standby:new gm,inspecting:new _u(this,!1),recording:(n==null?void 0:n.recorderMode)==="api"?new U_(this):new H_(this),"recording-inspecting":new _u(this,!1),assertingText:new Eu(this,"text"),assertingVisibility:new _u(this,!0),assertingValue:new Eu(this,"value"),assertingSnapshot:new Eu(this,"snapshot")},this._currentTool=this._tools.none,(o=(r=this._currentTool).install)==null||o.call(r),e.window.top===e.window&&(this.overlay=new q_(this),this.overlay.setUIState(this.state)),this._stylesheet=new e.window.CSSStyleSheet,this._stylesheet.replaceSync(`
|
|
114
|
+
`)}createStacklessError(e){if(this._browserName==="firefox"){const r=new Error("Error: "+e);return r.stack="",r}const n=new Error(e);return delete n.stack,n}createHighlight(){return new vu(this)}maskSelectors(e,n){this._highlight&&this.hideHighlight(),this._highlight=new vu(this),this._highlight.install();const r=[];for(const o of e)r.push(this.querySelectorAll(o,this.document.documentElement));this._highlight.maskElements(r.flat(),n)}highlight(e){this._highlight||(this._highlight=new vu(this),this._highlight.install()),this._highlight.runHighlightOnRaf(e)}hideHighlight(){this._highlight&&(this._highlight.uninstall(),delete this._highlight)}markTargetElements(e,n){var c,u;((c=this._markedElements)==null?void 0:c.callId)!==n&&(this._markedElements=void 0);const r=((u=this._markedElements)==null?void 0:u.elements)||new Set,o=new CustomEvent("__playwright_unmark_target__",{bubbles:!0,cancelable:!0,detail:n,composed:!0});for(const d of r)e.has(d)||d.dispatchEvent(o);const l=new CustomEvent("__playwright_mark_target__",{bubbles:!0,cancelable:!0,detail:n,composed:!0});for(const d of e)r.has(d)||d.dispatchEvent(l);this._markedElements={callId:n,elements:e}}_setupGlobalListenersRemovalDetection(){const e="__playwright_global_listeners_check__";let n=!1;const r=()=>n=!0;this.window.addEventListener(e,r),new MutationObserver(o=>{if(o.some(c=>Array.from(c.addedNodes).includes(this.document.documentElement))&&(n=!1,this.window.dispatchEvent(new CustomEvent(e)),!n)){this.window.addEventListener(e,r);for(const c of this.onGlobalListenersRemoved)c()}}).observe(this.document,{childList:!0})}_setupHitTargetInterceptors(){const e=r=>{var o;return(o=this._hitTargetInterceptor)==null?void 0:o.call(this,r)},n=()=>{for(const r of this._allHitTargetInterceptorEvents)this.window.addEventListener(r,e,{capture:!0,passive:!1})};n(),this.onGlobalListenersRemoved.add(n)}async expect(e,n,r){var l,c;if(n.expression==="to.have.count"||n.expression.endsWith(".array"))return this.expectArray(r,n);if(!e){if(!n.isNot&&n.expression==="to.be.hidden")return{matches:!0};if(n.isNot&&n.expression==="to.be.visible")return{matches:!1};if(!n.isNot&&n.expression==="to.be.detached")return{matches:!0};if(n.isNot&&n.expression==="to.be.attached")return{matches:!1};if(n.isNot&&n.expression==="to.be.in.viewport")return{matches:!1};if(n.expression==="to.have.title"&&((l=n==null?void 0:n.expectedText)!=null&&l[0])){const u=new fs(n.expectedText[0]),d=this.document.title;return{received:d,matches:u.matches(d)}}if(n.expression==="to.have.url"&&((c=n==null?void 0:n.expectedText)!=null&&c[0])){const u=new fs(n.expectedText[0]),d=this.document.location.href;return{received:d,matches:u.matches(d)}}return{matches:n.isNot,missingReceived:!0}}return await this.expectSingleElement(e,n)}async expectSingleElement(e,n){var o;const r=n.expression;{let l;if(r==="to.have.attribute"){const c=e.hasAttribute(n.expressionArg);l={matches:c,received:c?"attribute present":"attribute not present"}}else if(r==="to.be.checked"){const{checked:c,indeterminate:u}=n.expectedValue;if(u){if(c!==void 0)throw this.createStacklessError("Can't assert indeterminate and checked at the same time");l=this.elementState(e,"indeterminate")}else l=this.elementState(e,c===!1?"unchecked":"checked")}else if(r==="to.be.disabled")l=this.elementState(e,"disabled");else if(r==="to.be.editable")l=this.elementState(e,"editable");else if(r==="to.be.readonly")l=this.elementState(e,"editable"),l.matches=!l.matches;else if(r==="to.be.empty")if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){const c=e.value;l={matches:!c,received:c?"notEmpty":"empty"}}else{const c=(o=e.textContent)==null?void 0:o.trim();l={matches:!c,received:c?"notEmpty":"empty"}}else if(r==="to.be.enabled")l=this.elementState(e,"enabled");else if(r==="to.be.focused"){const c=this._activelyFocused(e).isFocused;l={matches:c,received:c?"focused":"inactive"}}else r==="to.be.hidden"?l=this.elementState(e,"hidden"):r==="to.be.visible"?l=this.elementState(e,"visible"):r==="to.be.attached"?l={matches:!0,received:"attached"}:r==="to.be.detached"&&(l={matches:!1,received:"attached"});if(l){if(l.received==="error:notconnected")throw this.createStacklessError("Element is not connected");return l}}if(r==="to.have.property"){let l=e;const c=n.expressionArg.split(".");for(let p=0;p<c.length-1;p++){if(typeof l!="object"||!(c[p]in l))return{received:void 0,matches:!1};l=l[c[p]]}const u=l[c[c.length-1]],d=Bu(u,n.expectedValue);return{received:u,matches:d}}if(r==="to.be.in.viewport"){const l=await this.viewportRatio(e);return{received:`viewport ratio ${l}`,matches:l>0&&l>(n.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");const l=[...e.selectedOptions].map(c=>c.value);return l.length!==n.expectedText.length?{received:l,matches:!1}:{received:l,matches:l.map((c,u)=>new fs(n.expectedText[u]).matches(c)).every(Boolean)}}if(r==="to.match.aria"){const l=Ex(e,n.expectedValue);return{received:l.received,matches:!!l.matches.length}}{let l;if(r==="to.have.attribute.value"){const c=e.getAttribute(n.expressionArg);if(c===null)return{received:null,matches:!1};l=c}else if(["to.have.class","to.contain.class"].includes(r)){if(!n.expectedText)throw this.createStacklessError("Expected text is not provided for "+r);return{received:e.classList.toString(),matches:new fs(n.expectedText[0]).matchesClassList(this,e.classList,r==="to.contain.class")}}else if(r==="to.have.css")l=this.window.getComputedStyle(e).getPropertyValue(n.expressionArg);else if(r==="to.have.id")l=e.id;else if(r==="to.have.text")l=n.useInnerText?e.innerText:Tt(new Map,e).full;else if(r==="to.have.accessible.name")l=Vi(e,!1);else if(r==="to.have.accessible.description")l=rm(e,!1);else if(r==="to.have.accessible.error.message")l=ox(e);else if(r==="to.have.role")l=nt(e)||"";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");l=e.value}if(l!==void 0&&n.expectedText){const c=new fs(n.expectedText[0]);return{received:l,matches:c.matches(l)}}}throw this.createStacklessError("Unknown expect matcher: "+r)}expectArray(e,n){const r=n.expression;if(r==="to.have.count"){const d=e.length,p=d===n.expectedNumber;return{received:d,matches:p}}if(!n.expectedText)throw this.createStacklessError("Expected text is not provided for "+r);if(["to.have.class.array","to.contain.class.array"].includes(r)){const d=e.map(y=>y.classList),p=d.map(String);if(d.length!==n.expectedText.length)return{received:p,matches:!1};const g=this._matchSequentially(n.expectedText,d,(y,v)=>y.matchesClassList(this,v,r==="to.contain.class.array"));return{received:p,matches:g}}if(!["to.contain.text.array","to.have.text.array"].includes(r))throw this.createStacklessError("Unknown expect matcher: "+r);const o=e.map(d=>n.useInnerText?d.innerText:Tt(new Map,d).full),l=r!=="to.contain.text.array";if(!(o.length===n.expectedText.length||!l))return{received:o,matches:!1};const u=this._matchSequentially(n.expectedText,o,(d,p)=>d.matches(p));return{received:o,matches:u}}_matchSequentially(e,n,r){const o=e.map(u=>new fs(u));let l=0,c=0;for(;l<o.length&&c<n.length;)r(o[l],n[c])&&++l,++c;return l===o.length}}function yl(t){return t.replace(/\n/g,"↵").replace(/\t/g,"⇆")}function B_(t){if(t=t.substring(1,t.length-1),!t.includes("\\"))return t;const e=[];let n=0;for(;n<t.length;)t[n]==="\\"&&n+1<t.length&&n++,e.push(t[n++]);return e.join("")}function vl(t,e){if(t[0]==="/"&&t.lastIndexOf("/")>0){const o=t.lastIndexOf("/"),l=new RegExp(t.substring(1,o),t.substring(o+1));return{matcher:c=>l.test(c.full),kind:"regex"}}const n=e?JSON.parse.bind(JSON):B_;let r=!1;return t.length>1&&t[0]==='"'&&t[t.length-1]==='"'?(t=n(t),r=!0):e&&t.length>1&&t[0]==='"'&&t[t.length-2]==='"'&&t[t.length-1]==="i"?(t=n(t.substring(0,t.length-1)),r=!1):e&&t.length>1&&t[0]==='"'&&t[t.length-2]==='"'&&t[t.length-1]==="s"?(t=n(t.substring(0,t.length-1)),r=!0):t.length>1&&t[0]==="'"&&t[t.length-1]==="'"&&(t=n(t),r=!0),t=mt(t),r?e?{kind:"strict",matcher:l=>l.normalized===t}:{matcher:l=>!t&&!l.immediate.length?!0:l.immediate.some(c=>mt(c)===t),kind:"strict"}:(t=t.toLowerCase(),{kind:"lax",matcher:o=>o.normalized.toLowerCase().includes(t)})}class fs{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){const n=new Set((e.regexFlags||"").split(""));e.ignoreCase===!1&&n.delete("i"),e.ignoreCase===!0&&n.add("i"),this._regex=new RegExp(e.regexSource,[...n].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,n,r){if(r){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(o=>n.contains(o))}return this.matches(n.toString())}normalize(e){return e&&(this._normalizeWhiteSpace&&(e=mt(e)),this._ignoreCase&&(e=e.toLocaleLowerCase()),e)}}function Bu(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!Bu(t[r],e[r]))return!1;return!0}if(t instanceof RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let r=0;r<n.length;++r)if(!e.hasOwnProperty(n[r]))return!1;for(const r of n)if(!Bu(t[r],e[r]))return!1;return!0}return typeof t=="number"&&typeof e=="number"?isNaN(t)&&isNaN(e):!1}const z_={tagName:"svg",children:[{tagName:"defs",children:[{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-gripper"},children:[{tagName:"path",attrs:{d:"M5 3h2v2H5zm0 4h2v2H5zm0 4h2v2H5zm4-8h2v2H9zm0 4h2v2H9zm0 4h2v2H9z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-circle-large-filled"},children:[{tagName:"path",attrs:{d:"M8 1a6.8 6.8 0 0 1 1.86.253 6.899 6.899 0 0 1 3.083 1.805 6.903 6.903 0 0 1 1.804 3.083C14.916 6.738 15 7.357 15 8s-.084 1.262-.253 1.86a6.9 6.9 0 0 1-.704 1.674 7.157 7.157 0 0 1-2.516 2.509 6.966 6.966 0 0 1-1.668.71A6.984 6.984 0 0 1 8 15a6.984 6.984 0 0 1-1.86-.246 7.098 7.098 0 0 1-1.674-.711 7.3 7.3 0 0 1-1.415-1.094 7.295 7.295 0 0 1-1.094-1.415 7.098 7.098 0 0 1-.71-1.675A6.985 6.985 0 0 1 1 8c0-.643.082-1.262.246-1.86a6.968 6.968 0 0 1 .711-1.667 7.156 7.156 0 0 1 2.509-2.516 6.895 6.895 0 0 1 1.675-.704A6.808 6.808 0 0 1 8 1z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-inspect"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1 3l1-1h12l1 1v6h-1V3H2v8h5v1H2l-1-1V3zm14.707 9.707L9 6v9.414l2.707-2.707h4zM10 13V8.414l3.293 3.293h-2L10 13z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-whole-word"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 11H1V13H15V11H16V14H15H1H0V11Z"}},{tagName:"path",attrs:{d:"M6.84048 11H5.95963V10.1406H5.93814C5.555 10.7995 4.99104 11.1289 4.24625 11.1289C3.69839 11.1289 3.26871 10.9839 2.95718 10.6938C2.64924 10.4038 2.49527 10.0189 2.49527 9.53906C2.49527 8.51139 3.10041 7.91341 4.3107 7.74512L5.95963 7.51416C5.95963 6.57959 5.58186 6.1123 4.82632 6.1123C4.16389 6.1123 3.56591 6.33789 3.03238 6.78906V5.88672C3.57307 5.54297 4.19612 5.37109 4.90152 5.37109C6.19416 5.37109 6.84048 6.05501 6.84048 7.42285V11ZM5.95963 8.21777L4.63297 8.40039C4.22476 8.45768 3.91682 8.55973 3.70914 8.70654C3.50145 8.84977 3.39761 9.10579 3.39761 9.47461C3.39761 9.74316 3.4925 9.96338 3.68228 10.1353C3.87564 10.3035 4.13166 10.3877 4.45035 10.3877C4.8872 10.3877 5.24706 10.2355 5.52994 9.93115C5.8164 9.62321 5.95963 9.2347 5.95963 8.76562V8.21777Z"}},{tagName:"path",attrs:{d:"M9.3475 10.2051H9.32601V11H8.44515V2.85742H9.32601V6.4668H9.3475C9.78076 5.73633 10.4146 5.37109 11.2489 5.37109C11.9543 5.37109 12.5057 5.61816 12.9032 6.1123C13.3042 6.60286 13.5047 7.26172 13.5047 8.08887C13.5047 9.00911 13.2809 9.74674 12.8333 10.3018C12.3857 10.8532 11.7734 11.1289 10.9964 11.1289C10.2695 11.1289 9.71989 10.821 9.3475 10.2051ZM9.32601 7.98682V8.75488C9.32601 9.20964 9.47282 9.59635 9.76644 9.91504C10.0636 10.2301 10.4396 10.3877 10.8944 10.3877C11.4279 10.3877 11.8451 10.1836 12.1458 9.77539C12.4502 9.36719 12.6024 8.79964 12.6024 8.07275C12.6024 7.46045 12.4609 6.98063 12.1781 6.6333C11.8952 6.28597 11.512 6.1123 11.0286 6.1123C10.5166 6.1123 10.1048 6.29134 9.7933 6.64941C9.48177 7.00391 9.32601 7.44971 9.32601 7.98682Z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-eye"},children:[{tagName:"path",attrs:{d:"M7.99993 6.00316C9.47266 6.00316 10.6666 7.19708 10.6666 8.66981C10.6666 10.1426 9.47266 11.3365 7.99993 11.3365C6.52715 11.3365 5.33324 10.1426 5.33324 8.66981C5.33324 7.19708 6.52715 6.00316 7.99993 6.00316ZM7.99993 7.00315C7.07946 7.00315 6.33324 7.74935 6.33324 8.66981C6.33324 9.59028 7.07946 10.3365 7.99993 10.3365C8.9204 10.3365 9.6666 9.59028 9.6666 8.66981C9.6666 7.74935 8.9204 7.00315 7.99993 7.00315ZM7.99993 3.66675C11.0756 3.66675 13.7307 5.76675 14.4673 8.70968C14.5344 8.97755 14.3716 9.24908 14.1037 9.31615C13.8358 9.38315 13.5643 9.22041 13.4973 8.95248C12.8713 6.45205 10.6141 4.66675 7.99993 4.66675C5.38454 4.66675 3.12664 6.45359 2.50182 8.95555C2.43491 9.22341 2.16348 9.38635 1.89557 9.31948C1.62766 9.25255 1.46471 8.98115 1.53162 8.71321C2.26701 5.76856 4.9229 3.66675 7.99993 3.66675Z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-symbol-constant"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 6h8v1H4V6zm8 3H4v1h8V9z"}},{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1 4l1-1h12l1 1v8l-1 1H2l-1-1V4zm1 0v8h12V4H2z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-check"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.431 3.323l-8.47 10-.79-.036-3.35-4.77.818-.574 2.978 4.24 8.051-9.506.764.646z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-close"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-pass"},children:[{tagName:"path",attrs:{d:"M6.27 10.87h.71l4.56-4.56-.71-.71-4.2 4.21-1.92-1.92L4 8.6l2.27 2.27z"}},{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-gist"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.57 1.14l3.28 3.3.15.36v9.7l-.5.5h-11l-.5-.5v-13l.5-.5h7.72l.35.14zM10 5h3l-3-3v3zM3 2v12h10V6H9.5L9 5.5V2H3zm2.062 7.533l1.817-1.828L6.17 7 4 9.179v.707l2.171 2.174.707-.707-1.816-1.82zM8.8 7.714l.7-.709 2.189 2.175v.709L9.5 12.062l-.705-.709 1.831-1.82L8.8 7.714z"}}]}]}]},Ht={multiple:"#f6b26b7f",single:"#6fa8dc7f",assert:"#8acae480",action:"#dc6f6f7f"};class gm{cursor(){return"default"}}class _u{constructor(e,n){this._hoveredModel=null,this._hoveredElement=null,this._recorder=e,this._assertVisibility=n}cursor(){return"pointer"}uninstall(){this._hoveredModel=null,this._hoveredElement=null}onClick(e){var n;Ue(e),e.button===0&&(n=this._hoveredModel)!=null&&n.selector&&this._commit(this._hoveredModel.selector,this._hoveredModel)}onPointerDown(e){Ue(e)}onPointerUp(e){Ue(e)}onMouseDown(e){Ue(e)}onMouseUp(e){Ue(e)}onMouseMove(e){var o;Ue(e);let n=this._recorder.deepEventTarget(e);if(n.isConnected||(n=null),this._hoveredElement===n)return;this._hoveredElement=n;let r=null;if(this._hoveredElement){const l=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName,multiple:!1});r={selector:l.selector,elements:l.elements,tooltipText:this._recorder.injectedScript.utils.asLocator(this._recorder.state.language,l.selector),color:this._assertVisibility?Ht.assert:Ht.single}}((o=this._hoveredModel)==null?void 0:o.selector)!==(r==null?void 0:r.selector)&&(this._hoveredModel=r,this._recorder.updateHighlight(r,!0))}onMouseEnter(e){Ue(e)}onMouseLeave(e){Ue(e);const n=this._recorder.injectedScript.window;n.top!==n&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&this._reset(!0)}onKeyDown(e){Ue(e),e.key==="Escape"&&this._assertVisibility&&this._recorder.setMode("recording")}onKeyUp(e){Ue(e)}onScroll(e){this._reset(!1)}_commit(e,n){var r;this._assertVisibility?(this._recorder.recordAction({name:"assertVisible",selector:e,signals:[]}),this._recorder.setMode("recording"),(r=this._recorder.overlay)==null||r.flashToolSucceeded("assertingVisibility")):this._recorder.elementPicked(e,n)}_reset(e){this._hoveredElement=null,this._hoveredModel=null,this._recorder.updateHighlight(null,e)}}class H_{constructor(e){this._hoveredModel=null,this._hoveredElement=null,this._activeModel=null,this._expectProgrammaticKeyUp=!1,this._observer=null,this._recorder=e,this._performingActions=new Set}cursor(){return"pointer"}_installObserverIfNeeded(){var e;this._observer||(e=this._recorder.injectedScript.document)!=null&&e.body&&(this._observer=new MutationObserver(n=>{if(this._hoveredElement)for(const r of n)for(const o of r.removedNodes)(o===this._hoveredElement||o.contains(this._hoveredElement))&&this._resetHoveredModel()}),this._observer.observe(this._recorder.injectedScript.document.body,{childList:!0,subtree:!0}))}uninstall(){var e;(e=this._observer)==null||e.disconnect(),this._observer=null,this._hoveredModel=null,this._hoveredElement=null,this._activeModel=null,this._expectProgrammaticKeyUp=!1}onClick(e){if(Es(this._hoveredElement)||e.button===2&&e.type==="auxclick"||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel))return;const n=Hi(this._recorder.deepEventTarget(e));if(n&&e.detail===1){this._performAction({name:n.checked?"check":"uncheck",selector:this._hoveredModel.selector,signals:[]});return}this._cancelPendingClickAction(),e.detail===1&&(this._pendingClickAction={action:{name:"click",selector:this._hoveredModel.selector,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail},timeout:this._recorder.injectedScript.utils.builtins.setTimeout(()=>this._commitPendingClickAction(),200)})}onDblClick(e){Es(this._hoveredElement)||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||(this._cancelPendingClickAction(),this._performAction({name:"click",selector:this._hoveredModel.selector,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail}))}_commitPendingClickAction(){this._pendingClickAction&&this._performAction(this._pendingClickAction.action),this._cancelPendingClickAction()}_cancelPendingClickAction(){this._pendingClickAction&&this._recorder.injectedScript.utils.builtins.clearTimeout(this._pendingClickAction.timeout),this._pendingClickAction=void 0}onContextMenu(e){this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||this._performAction({name:"click",selector:this._hoveredModel.selector,position:zi(e),signals:[],button:"right",modifiers:0,clickCount:0})}onPointerDown(e){this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onPointerUp(e){this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseDown(e){this._shouldIgnoreMouseEvent(e)||(this._consumeWhenAboutToPerform(e),this._activeModel=this._hoveredModel)}onMouseUp(e){this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseMove(e){const n=this._recorder.deepEventTarget(e);this._hoveredElement!==n&&(this._hoveredElement=n,this._updateModelForHoveredElement())}onMouseLeave(e){const n=this._recorder.injectedScript.window;n.top!==n&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&(this._hoveredElement=null,this._updateModelForHoveredElement())}onFocus(e){this._onFocus(!0)}onInput(e){const n=this._recorder.deepEventTarget(e);if(n.nodeName==="INPUT"&&n.type.toLowerCase()==="file"){this._recorder.recordAction({name:"setInputFiles",selector:this._activeModel.selector,signals:[],files:[...n.files||[]].map(r=>r.name)});return}if(Es(n)){this._recorder.recordAction({name:"fill",selector:this._hoveredModel.selector,signals:[],text:n.value});return}if(["INPUT","TEXTAREA"].includes(n.nodeName)||n.isContentEditable){if(n.nodeName==="INPUT"&&["checkbox","radio"].includes(n.type.toLowerCase())||this._consumedDueWrongTarget(e))return;this._recorder.recordAction({name:"fill",selector:this._activeModel.selector,signals:[],text:n.isContentEditable?n.innerText:n.value})}if(n.nodeName==="SELECT"){const r=n;this._recorder.recordAction({name:"select",selector:this._activeModel.selector,options:[...r.selectedOptions].map(o=>o.value),signals:[]})}}onKeyDown(e){if(this._shouldGenerateKeyPressFor(e)){if(this._actionInProgress(e)){this._expectProgrammaticKeyUp=!0;return}if(!this._consumedDueWrongTarget(e)){if(e.key===" "){const n=Hi(this._recorder.deepEventTarget(e));if(n&&e.detail===0){this._performAction({name:n.checked?"uncheck":"check",selector:this._activeModel.selector,signals:[]});return}}this._performAction({name:"press",selector:this._activeModel.selector,signals:[],key:e.key,modifiers:_s(e)})}}}onKeyUp(e){if(this._shouldGenerateKeyPressFor(e)){if(!this._expectProgrammaticKeyUp){Ue(e);return}this._expectProgrammaticKeyUp=!1}}onScroll(e){this._resetHoveredModel()}_resetHoveredModel(){this._hoveredModel=null,this._hoveredElement=null,this._updateHighlight(!1)}_onFocus(e){const n=K_(this._recorder.document);if(e&&n===this._recorder.document.body)return;const r=n?this._recorder.injectedScript.generateSelector(n,{testIdAttributeName:this._recorder.state.testIdAttributeName}):null;this._activeModel=r&&r.selector?{...r,color:Ht.action}:null,e&&(this._hoveredElement=n,this._updateModelForHoveredElement())}_shouldIgnoreMouseEvent(e){const n=this._recorder.deepEventTarget(e),r=n.nodeName;return!!(r==="SELECT"||r==="OPTION"||r==="INPUT"&&["date","range"].includes(n.type))}_actionInProgress(e){const n=e instanceof KeyboardEvent,r=e instanceof MouseEvent||e instanceof PointerEvent;for(const o of this._performingActions)if(n&&o.name==="press"&&e.key===o.key||r&&(o.name==="click"||o.name==="check"||o.name==="uncheck"))return!0;return Ue(e),!1}_consumedDueToNoModel(e,n){return n?!1:(Ue(e),!0)}_consumedDueWrongTarget(e){return this._activeModel&&this._activeModel.elements[0]===this._recorder.deepEventTarget(e)?!1:(Ue(e),!0)}_consumeWhenAboutToPerform(e){this._performingActions.size||Ue(e)}_performAction(e){this._recorder.updateHighlight(null,!1),this._performingActions.add(e);const n=this._recorder.performAction(e).then(()=>{this._performingActions.delete(e),this._onFocus(!1)});this._recorder.injectedScript.isUnderTest&&n.then(()=>{console.error("Action performed for test: "+JSON.stringify({hovered:this._hoveredModel?this._hoveredModel.selector:null,active:this._activeModel?this._activeModel.selector:null}))})}_shouldGenerateKeyPressFor(e){if(typeof e.key!="string"||e.key==="Enter"&&(this._recorder.deepEventTarget(e).nodeName==="TEXTAREA"||this._recorder.deepEventTarget(e).isContentEditable)||["Backspace","Delete","AltGraph"].includes(e.key)||e.key==="@"&&e.code==="KeyL")return!1;if(navigator.platform.includes("Mac")){if(e.key==="v"&&e.metaKey)return!1}else if(e.key==="v"&&e.ctrlKey||e.key==="Insert"&&e.shiftKey)return!1;if(["Shift","Control","Meta","Alt","Process"].includes(e.key))return!1;const n=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!n?!!Hi(this._recorder.deepEventTarget(e)):!0}_updateModelForHoveredElement(){if(this._installObserverIfNeeded(),this._performingActions.size)return;if(!this._hoveredElement||!this._hoveredElement.isConnected){this._hoveredModel=null,this._hoveredElement=null,this._updateHighlight(!0);return}const{selector:e,elements:n}=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoveredModel&&this._hoveredModel.selector===e||(this._hoveredModel=e?{selector:e,elements:n,color:Ht.action}:null,this._updateHighlight(!0))}_updateHighlight(e){this._recorder.updateHighlight(this._hoveredModel,e)}}class U_{constructor(e){this._recorder=e}cursor(){return"pointer"}onClick(e){const n=this._recorder.deepEventTarget(e);if(Es(n)||e.button===2&&e.type==="auxclick"||this._shouldIgnoreMouseEvent(e))return;const r=Hi(n),{ariaSnapshot:o,selector:l}=this._ariaSnapshot(n);if(r&&e.detail===1){this._recorder.recordAction({name:r.checked?"check":"uncheck",selector:l,signals:[],ariaSnapshot:o});return}this._recorder.recordAction({name:"click",selector:l,ariaSnapshot:o,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail})}onDblClick(e){const n=this._recorder.deepEventTarget(e);if(Es(n)||this._shouldIgnoreMouseEvent(e))return;const{ariaSnapshot:r,selector:o}=this._ariaSnapshot(n);this._recorder.recordAction({name:"click",selector:o,ariaSnapshot:r,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail})}onInput(e){const n=this._recorder.deepEventTarget(e),{ariaSnapshot:r,selector:o}=this._ariaSnapshot(n);if(Es(n)){this._recorder.recordAction({name:"fill",selector:o,ariaSnapshot:r,signals:[],text:n.value});return}if(["INPUT","TEXTAREA"].includes(n.nodeName)||n.isContentEditable){if(n.nodeName==="INPUT"&&["checkbox","radio"].includes(n.type.toLowerCase()))return;this._recorder.recordAction({name:"fill",selector:o,ariaSnapshot:r,signals:[],text:n.isContentEditable?n.innerText:n.value});return}if(n.nodeName==="SELECT"){const l=n;this._recorder.recordAction({name:"select",selector:o,ariaSnapshot:r,options:[...l.selectedOptions].map(c=>c.value),signals:[]});return}}onKeyDown(e){if(!this._shouldGenerateKeyPressFor(e))return;const n=this._recorder.deepEventTarget(e),{ariaSnapshot:r,selector:o}=this._ariaSnapshot(n);if(e.key===" "){const l=Hi(n);if(l&&e.detail===0){this._recorder.recordAction({name:l.checked?"uncheck":"check",selector:o,ariaSnapshot:r,signals:[]});return}}this._recorder.recordAction({name:"press",selector:o,ariaSnapshot:r,signals:[],key:e.key,modifiers:_s(e)})}_shouldIgnoreMouseEvent(e){const n=this._recorder.deepEventTarget(e),r=n.nodeName;return!!(r==="SELECT"||r==="OPTION"||r==="INPUT"&&["date","range"].includes(n.type))}_shouldGenerateKeyPressFor(e){if(typeof e.key!="string"||e.key==="Enter"&&(this._recorder.deepEventTarget(e).nodeName==="TEXTAREA"||this._recorder.deepEventTarget(e).isContentEditable)||["Backspace","Delete","AltGraph"].includes(e.key)||e.key==="@"&&e.code==="KeyL")return!1;if(navigator.platform.includes("Mac")){if(e.key==="v"&&e.metaKey)return!1}else if(e.key==="v"&&e.ctrlKey||e.key==="Insert"&&e.shiftKey)return!1;if(["Shift","Control","Meta","Alt","Process"].includes(e.key))return!1;const n=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!n?!this._isEditable(this._recorder.deepEventTarget(e)):!0}_isEditable(e){return!!(e.nodeName==="TEXTAREA"||e.nodeName==="INPUT"||e.isContentEditable)}_ariaSnapshot(e){const{ariaSnapshot:n,refs:r}=this._recorder.injectedScript.ariaSnapshotForRecorder(),o=e?r.get(e):void 0,l=o?`aria-ref=${o}`:void 0;return{ariaSnapshot:n,selector:l}}}class Eu{constructor(e,n){this._hoverHighlight=null,this._action=null,this._recorder=e,this._textCache=new Map,this._kind=n,this._dialog=new W_(e)}cursor(){return"pointer"}uninstall(){this._dialog.close(),this._hoverHighlight=null}onClick(e){Ue(e),this._kind==="value"?this._commitAssertValue():this._dialog.isShowing()||this._showDialog()}onMouseDown(e){const n=this._recorder.deepEventTarget(e);this._elementHasValue(n)&&e.preventDefault()}onPointerUp(e){var r;const n=(r=this._hoverHighlight)==null?void 0:r.elements[0];this._kind==="value"&&n&&(n.nodeName==="INPUT"||n.nodeName==="SELECT")&&n.disabled&&this._commitAssertValue()}onMouseMove(e){var r;if(this._dialog.isShowing())return;const n=this._recorder.deepEventTarget(e);if(((r=this._hoverHighlight)==null?void 0:r.elements[0])!==n){if(this._kind==="text"||this._kind==="snapshot")this._hoverHighlight=this._recorder.injectedScript.utils.elementText(this._textCache,n).full?{elements:[n],selector:"",color:Ht.assert}:null;else if(this._elementHasValue(n)){const o=this._recorder.injectedScript.generateSelector(n,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoverHighlight={selector:o.selector,elements:o.elements,color:Ht.assert}}else this._hoverHighlight=null;this._recorder.updateHighlight(this._hoverHighlight,!0)}}onKeyDown(e){e.key==="Escape"&&this._recorder.setMode("recording"),Ue(e)}onScroll(e){this._recorder.updateHighlight(this._hoverHighlight,!1)}_elementHasValue(e){return e.nodeName==="TEXTAREA"||e.nodeName==="SELECT"||e.nodeName==="INPUT"&&!["button","image","reset","submit"].includes(e.type)}_generateAction(){var n;this._textCache.clear();const e=(n=this._hoverHighlight)==null?void 0:n.elements[0];if(!e)return null;if(this._kind==="value"){if(!this._elementHasValue(e))return null;const{selector:r}=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName});return e.nodeName==="INPUT"&&["checkbox","radio"].includes(e.type.toLowerCase())?{name:"assertChecked",selector:r,signals:[],checked:!e.checked}:{name:"assertValue",selector:r,signals:[],value:e.value}}else if(this._kind==="snapshot"){const r=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:r.selector,elements:r.elements,color:Ht.assert},this._recorder.updateHighlight(this._hoverHighlight,!0),{name:"assertSnapshot",selector:this._hoverHighlight.selector,signals:[],ariaSnapshot:this._recorder.injectedScript.ariaSnapshot(e,{mode:"regex"})}}else{const r=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:r.selector,elements:r.elements,color:Ht.assert},this._recorder.updateHighlight(this._hoverHighlight,!0),{name:"assertText",selector:this._hoverHighlight.selector,signals:[],text:this._recorder.injectedScript.utils.elementText(this._textCache,e).normalized,substring:!0}}}_renderValue(e){return(e==null?void 0:e.name)==="assertText"?this._recorder.injectedScript.utils.normalizeWhiteSpace(e.text):(e==null?void 0:e.name)==="assertChecked"?String(e.checked):(e==null?void 0:e.name)==="assertValue"?e.value:(e==null?void 0:e.name)==="assertSnapshot"?e.ariaSnapshot:""}_commit(){!this._action||!this._dialog.isShowing()||(this._dialog.close(),this._recorder.recordAction(this._action),this._recorder.setMode("recording"))}_showDialog(){var e,n,r,o;(e=this._hoverHighlight)!=null&&e.elements[0]&&(this._action=this._generateAction(),((n=this._action)==null?void 0:n.name)==="assertText"?this._showTextDialog(this._action):((r=this._action)==null?void 0:r.name)==="assertSnapshot"&&(this._recorder.recordAction(this._action),this._recorder.setMode("recording"),(o=this._recorder.overlay)==null||o.flashToolSucceeded("assertingSnapshot")))}_showTextDialog(e){const n=this._recorder.document.createElement("textarea");n.setAttribute("spellcheck","false"),n.value=this._renderValue(e),n.classList.add("text-editor");const r=()=>{var y;const u=this._recorder.injectedScript.utils.normalizeWhiteSpace(n.value),d=(y=this._hoverHighlight)==null?void 0:y.elements[0];if(!d)return;e.text=u;const p=this._recorder.injectedScript.utils.elementText(this._textCache,d).normalized,g=u&&p.includes(u);n.classList.toggle("does-not-match",!g)};n.addEventListener("input",r);const l=this._dialog.show({label:"Assert that element contains text",body:n,onCommit:()=>this._commit()}),c=this._recorder.highlight.tooltipPosition(this._recorder.highlight.firstBox(),l);this._dialog.moveTo(c.anchorTop,c.anchorLeft),n.focus()}_commitAssertValue(){var n;if(this._kind!=="value")return;const e=this._generateAction();e&&(this._recorder.recordAction(e),this._recorder.setMode("recording"),(n=this._recorder.overlay)==null||n.flashToolSucceeded("assertingValue"))}}class q_{constructor(e){this._listeners=[],this._offsetX=0,this._measure={width:0,height:0},this._recorder=e;const n=this._recorder.document;this._overlayElement=n.createElement("x-pw-overlay");const r=n.createElement("x-pw-tools-list");this._overlayElement.appendChild(r),this._dragHandle=n.createElement("x-pw-tool-gripper"),this._dragHandle.appendChild(n.createElement("x-div")),r.appendChild(this._dragHandle),this._recordToggle=this._recorder.document.createElement("x-pw-tool-item"),this._recordToggle.title="Record",this._recordToggle.classList.add("record"),this._recordToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._recordToggle),this._pickLocatorToggle=this._recorder.document.createElement("x-pw-tool-item"),this._pickLocatorToggle.title="Pick locator",this._pickLocatorToggle.classList.add("pick-locator"),this._pickLocatorToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._pickLocatorToggle),this._assertVisibilityToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertVisibilityToggle.title="Assert visibility",this._assertVisibilityToggle.classList.add("visibility"),this._assertVisibilityToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._assertVisibilityToggle),this._assertTextToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertTextToggle.title="Assert text",this._assertTextToggle.classList.add("text"),this._assertTextToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._assertTextToggle),this._assertValuesToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertValuesToggle.title="Assert value",this._assertValuesToggle.classList.add("value"),this._assertValuesToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._assertValuesToggle),this._assertSnapshotToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertSnapshotToggle.title="Assert snapshot",this._assertSnapshotToggle.classList.add("snapshot"),this._assertSnapshotToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._assertSnapshotToggle),this._updateVisualPosition(),this._refreshListeners()}_refreshListeners(){gy(this._listeners),this._listeners=[Le(this._dragHandle,"mousedown",e=>{this._dragState={offsetX:this._offsetX,dragStart:{x:e.clientX,y:0}}}),Le(this._recordToggle,"click",()=>{this._recordToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="none"||this._recorder.state.mode==="standby"||this._recorder.state.mode==="inspecting"?"recording":"standby")}),Le(this._pickLocatorToggle,"click",()=>{if(this._pickLocatorToggle.classList.contains("disabled"))return;const e={inspecting:"standby",none:"inspecting",standby:"inspecting",recording:"recording-inspecting","recording-inspecting":"recording",assertingText:"recording-inspecting",assertingVisibility:"recording-inspecting",assertingValue:"recording-inspecting",assertingSnapshot:"recording-inspecting"};this._recorder.setMode(e[this._recorder.state.mode])}),Le(this._assertVisibilityToggle,"click",()=>{this._assertVisibilityToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingVisibility"?"recording":"assertingVisibility")}),Le(this._assertTextToggle,"click",()=>{this._assertTextToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingText"?"recording":"assertingText")}),Le(this._assertValuesToggle,"click",()=>{this._assertValuesToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingValue"?"recording":"assertingValue")}),Le(this._assertSnapshotToggle,"click",()=>{this._assertSnapshotToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingSnapshot"?"recording":"assertingSnapshot")})]}install(){this._recorder.highlight.appendChild(this._overlayElement),this._refreshListeners(),this._updateVisualPosition()}contains(e){return this._recorder.injectedScript.utils.isInsideScope(this._overlayElement,e)}setUIState(e){this._recordToggle.classList.toggle("toggled",e.mode==="recording"||e.mode==="assertingText"||e.mode==="assertingVisibility"||e.mode==="assertingValue"||e.mode==="assertingSnapshot"||e.mode==="recording-inspecting"),this._pickLocatorToggle.classList.toggle("toggled",e.mode==="inspecting"||e.mode==="recording-inspecting"),this._assertVisibilityToggle.classList.toggle("toggled",e.mode==="assertingVisibility"),this._assertVisibilityToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertTextToggle.classList.toggle("toggled",e.mode==="assertingText"),this._assertTextToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertValuesToggle.classList.toggle("toggled",e.mode==="assertingValue"),this._assertValuesToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertSnapshotToggle.classList.toggle("toggled",e.mode==="assertingSnapshot"),this._assertSnapshotToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._offsetX!==e.overlay.offsetX&&(this._offsetX=e.overlay.offsetX,this._updateVisualPosition()),e.mode==="none"?this._hideOverlay():this._showOverlay()}flashToolSucceeded(e){let n;e==="assertingVisibility"?n=this._assertVisibilityToggle:e==="assertingSnapshot"?n=this._assertSnapshotToggle:n=this._assertValuesToggle,n.classList.add("succeeded"),this._recorder.injectedScript.utils.builtins.setTimeout(()=>n.classList.remove("succeeded"),2e3)}_hideOverlay(){this._overlayElement.setAttribute("hidden","true")}_showOverlay(){this._overlayElement.hasAttribute("hidden")&&(this._overlayElement.removeAttribute("hidden"),this._updateVisualPosition())}_updateVisualPosition(){this._measure=this._overlayElement.getBoundingClientRect(),this._overlayElement.style.left=(this._recorder.injectedScript.window.innerWidth-this._measure.width)/2+this._offsetX+"px"}onMouseMove(e){if(!e.buttons)return this._dragState=void 0,!1;if(this._dragState){this._offsetX=this._dragState.offsetX+e.clientX-this._dragState.dragStart.x;const n=(this._recorder.injectedScript.window.innerWidth-this._measure.width)/2-10;return this._offsetX=Math.max(-n,Math.min(n,this._offsetX)),this._updateVisualPosition(),this._recorder.setOverlayState({offsetX:this._offsetX}),Ue(e),!0}return!1}onMouseUp(e){return this._dragState?(Ue(e),!0):!1}onClick(e){return this._dragState?(this._dragState=void 0,Ue(e),!0):!1}onDblClick(e){return!1}}class V_{constructor(e,n){var r,o;this._listeners=[],this._lastHighlightedSelector=void 0,this._lastHighlightedAriaTemplateJSON="undefined",this.state={mode:"none",testIdAttributeName:"data-testid",language:"javascript",overlay:{offsetX:0}},this._delegate={},this.document=e.document,this.injectedScript=e,this.highlight=e.createHighlight(),this._tools={none:new gm,standby:new gm,inspecting:new _u(this,!1),recording:(n==null?void 0:n.recorderMode)==="api"?new U_(this):new H_(this),"recording-inspecting":new _u(this,!1),assertingText:new Eu(this,"text"),assertingVisibility:new _u(this,!0),assertingValue:new Eu(this,"value"),assertingSnapshot:new Eu(this,"snapshot")},this._currentTool=this._tools.none,(o=(r=this._currentTool).install)==null||o.call(r),e.window.top===e.window&&(this.overlay=new q_(this),this.overlay.setUIState(this.state)),this._stylesheet=new e.window.CSSStyleSheet,this._stylesheet.replaceSync(`
|
|
115
115
|
body[data-pw-cursor=pointer] *, body[data-pw-cursor=pointer] *::after { cursor: pointer !important; }
|
|
116
116
|
body[data-pw-cursor=text] *, body[data-pw-cursor=text] *::after { cursor: text !important; }
|
|
117
117
|
`),this.installListeners(),e.utils.cacheNormalizedWhitespaces(),e.isUnderTest&&console.error("Recorder script ready for test"),e.consoleApi.install()}installListeners(){var r,o,l;gy(this._listeners),this._listeners=[Le(this.document,"click",c=>this._onClick(c),!0),Le(this.document,"auxclick",c=>this._onClick(c),!0),Le(this.document,"dblclick",c=>this._onDblClick(c),!0),Le(this.document,"contextmenu",c=>this._onContextMenu(c),!0),Le(this.document,"dragstart",c=>this._onDragStart(c),!0),Le(this.document,"input",c=>this._onInput(c),!0),Le(this.document,"keydown",c=>this._onKeyDown(c),!0),Le(this.document,"keyup",c=>this._onKeyUp(c),!0),Le(this.document,"pointerdown",c=>this._onPointerDown(c),!0),Le(this.document,"pointerup",c=>this._onPointerUp(c),!0),Le(this.document,"mousedown",c=>this._onMouseDown(c),!0),Le(this.document,"mouseup",c=>this._onMouseUp(c),!0),Le(this.document,"mousemove",c=>this._onMouseMove(c),!0),Le(this.document,"mouseleave",c=>this._onMouseLeave(c),!0),Le(this.document,"mouseenter",c=>this._onMouseEnter(c),!0),Le(this.document,"focus",c=>this._onFocus(c),!0),Le(this.document,"scroll",c=>this._onScroll(c),!0)],this.highlight.install();let e;const n=()=>{this.highlight.install(),e=this.injectedScript.utils.builtins.setTimeout(n,500)};e=this.injectedScript.utils.builtins.setTimeout(n,500),this._listeners.push(()=>this.injectedScript.utils.builtins.clearTimeout(e)),this.highlight.appendChild(yy(this.document,z_)),(r=this.overlay)==null||r.install(),(l=(o=this._currentTool)==null?void 0:o.install)==null||l.call(o),this.document.adoptedStyleSheets.push(this._stylesheet)}_switchCurrentTool(){var n,r,o,l,c;const e=this._tools[this.state.mode];e!==this._currentTool&&((r=(n=this._currentTool).uninstall)==null||r.call(n),this.clearHighlight(),this._currentTool=e,(l=(o=this._currentTool).install)==null||l.call(o),(c=this.injectedScript.document.body)==null||c.setAttribute("data-pw-cursor",e.cursor()))}setUIState(e,n){var l;this._delegate=n,e.actionPoint&&this.state.actionPoint&&e.actionPoint.x===this.state.actionPoint.x&&e.actionPoint.y===this.state.actionPoint.y||!e.actionPoint&&!this.state.actionPoint||(e.actionPoint?this.highlight.showActionPoint(e.actionPoint.x,e.actionPoint.y):this.highlight.hideActionPoint()),this.state=e,this.highlight.setLanguage(e.language),this._switchCurrentTool(),(l=this.overlay)==null||l.setUIState(e);let r="noop";if(e.actionSelector!==this._lastHighlightedSelector){const c=e.actionSelector?G_(this.injectedScript,e.language,e.actionSelector,this.document):null;r=c!=null&&c.length?c:"clear",this._lastHighlightedSelector=c!=null&&c.length?e.actionSelector:void 0}const o=JSON.stringify(e.ariaTemplate);if(this._lastHighlightedAriaTemplateJSON!==o){const c=e.ariaTemplate?this.injectedScript.getAllByAria(this.document,e.ariaTemplate):[];if(c.length){const u=c.length>1?Ht.multiple:Ht.single;r=c.map(d=>({element:d,color:u})),this._lastHighlightedAriaTemplateJSON=o}else this._lastHighlightedSelector||(r="clear"),this._lastHighlightedAriaTemplateJSON="undefined"}r==="clear"?this.highlight.clearHighlight():r!=="noop"&&this.highlight.updateHighlight(r)}clearHighlight(){this.updateHighlight(null,!1)}_onClick(e){var n,r,o;e.isTrusted&&((n=this.overlay)!=null&&n.onClick(e)||this._ignoreOverlayEvent(e)||(o=(r=this._currentTool).onClick)==null||o.call(r,e))}_onDblClick(e){var n,r,o;e.isTrusted&&((n=this.overlay)!=null&&n.onDblClick(e)||this._ignoreOverlayEvent(e)||(o=(r=this._currentTool).onDblClick)==null||o.call(r,e))}_onContextMenu(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onContextMenu)==null||r.call(n,e))}_onDragStart(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onDragStart)==null||r.call(n,e))}_onPointerDown(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onPointerDown)==null||r.call(n,e))}_onPointerUp(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onPointerUp)==null||r.call(n,e))}_onMouseDown(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onMouseDown)==null||r.call(n,e))}_onMouseUp(e){var n,r,o;e.isTrusted&&((n=this.overlay)!=null&&n.onMouseUp(e)||this._ignoreOverlayEvent(e)||(o=(r=this._currentTool).onMouseUp)==null||o.call(r,e))}_onMouseMove(e){var n,r,o;e.isTrusted&&((n=this.overlay)!=null&&n.onMouseMove(e)||this._ignoreOverlayEvent(e)||(o=(r=this._currentTool).onMouseMove)==null||o.call(r,e))}_onMouseEnter(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onMouseEnter)==null||r.call(n,e))}_onMouseLeave(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onMouseLeave)==null||r.call(n,e))}_onFocus(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onFocus)==null||r.call(n,e))}_onScroll(e){var n,r;e.isTrusted&&(this._lastHighlightedSelector=void 0,this._lastHighlightedAriaTemplateJSON="undefined",this.highlight.hideActionPoint(),(r=(n=this._currentTool).onScroll)==null||r.call(n,e))}_onInput(e){var n,r;this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onInput)==null||r.call(n,e)}_onKeyDown(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onKeyDown)==null||r.call(n,e))}_onKeyUp(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onKeyUp)==null||r.call(n,e))}updateHighlight(e,n){this._lastHighlightedSelector=void 0,this._lastHighlightedAriaTemplateJSON="undefined",this._updateHighlight(e,n)}_updateHighlight(e,n){var o,l;let r=e==null?void 0:e.tooltipText;r===void 0&&(e!=null&&e.selector)&&(r=this.injectedScript.utils.asLocator(this.state.language,e.selector)),e?this.highlight.updateHighlight(e.elements.map(c=>({element:c,color:e.color,tooltipText:r}))):this.highlight.clearHighlight(),n&&((l=(o=this._delegate).highlightUpdated)==null||l.call(o))}_ignoreOverlayEvent(e){return e.composedPath().some(n=>(n.nodeName||"").toLowerCase()==="x-pw-glass")}deepEventTarget(e){var n;for(const r of e.composedPath())if(!((n=this.overlay)!=null&&n.contains(r)))return r;return e.composedPath()[0]}setMode(e){var n,r;(r=(n=this._delegate).setMode)==null||r.call(n,e)}async performAction(e){var n,r;await((r=(n=this._delegate).performAction)==null?void 0:r.call(n,e).catch(()=>{}))}recordAction(e){var n,r;(r=(n=this._delegate).recordAction)==null||r.call(n,e)}setOverlayState(e){var n,r;(r=(n=this._delegate).setOverlayState)==null||r.call(n,e)}elementPicked(e,n){var o,l;const r=this.injectedScript.ariaSnapshot(n.elements[0]);(l=(o=this._delegate).elementPicked)==null||l.call(o,{selector:e,ariaSnapshot:r})}}class W_{constructor(e){this._dialogElement=null,this._recorder=e}isShowing(){return!!this._dialogElement}show(e){const n=this._recorder.document.createElement("x-pw-tool-item");n.title="Accept",n.classList.add("accept"),n.appendChild(this._recorder.document.createElement("x-div")),n.addEventListener("click",()=>e.onCommit());const r=this._recorder.document.createElement("x-pw-tool-item");r.title="Close",r.classList.add("cancel"),r.appendChild(this._recorder.document.createElement("x-div")),r.addEventListener("click",()=>{var u;this.close(),(u=e.onCancel)==null||u.call(e)}),this._dialogElement=this._recorder.document.createElement("x-pw-dialog"),this._keyboardListener=u=>{var d;if(u.key==="Escape"){this.close(),(d=e.onCancel)==null||d.call(e);return}if(u.key==="Enter"&&(u.ctrlKey||u.metaKey)){this._dialogElement&&e.onCommit();return}},this._recorder.document.addEventListener("keydown",this._keyboardListener,!0);const o=this._recorder.document.createElement("x-pw-tools-list"),l=this._recorder.document.createElement("label");l.textContent=e.label,o.appendChild(l),o.appendChild(this._recorder.document.createElement("x-spacer")),o.appendChild(n),o.appendChild(r),this._dialogElement.appendChild(o);const c=this._recorder.document.createElement("x-pw-dialog-body");return c.appendChild(e.body),this._dialogElement.appendChild(c),this._recorder.highlight.appendChild(this._dialogElement),this._dialogElement}moveTo(e,n){this._dialogElement&&(this._dialogElement.style.top=e+"px",this._dialogElement.style.left=n+"px")}close(){this._dialogElement&&(this._dialogElement.remove(),this._recorder.document.removeEventListener("keydown",this._keyboardListener),this._dialogElement=null)}}function K_(t){let e=t.activeElement;for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function _s(t){return(t.altKey?1:0)|(t.ctrlKey?2:0)|(t.metaKey?4:0)|(t.shiftKey?8:0)}function Ql(t){switch(t.which){case 1:return"left";case 2:return"middle";case 3:return"right"}return"left"}function zi(t){if(t.target.nodeName==="CANVAS")return{x:t.offsetX,y:t.offsetY}}function Ue(t){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()}function Hi(t){if(!t||t.nodeName!=="INPUT")return null;const e=t;return["checkbox","radio"].includes(e.type)?e:null}function Es(t){return!t||t.nodeName!=="INPUT"?!1:t.type.toLowerCase()==="range"}function Le(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function gy(t){for(const e of t)e();t.splice(0,t.length)}function G_(t,e,n,r){try{const o=t.parseSelector(n),l=t.querySelectorAll(o,r),c=l.length>1?Ht.multiple:Ht.single,u=t.utils.asLocator(e,n);return l.map((d,p)=>{const g=l.length>1?` [${p+1} of ${l.length}]`:"";return{element:d,color:c,tooltipText:u+g}})}catch{return[]}}function yy(t,{tagName:e,attrs:n,children:r}){const o=t.createElementNS("http://www.w3.org/2000/svg",e);if(n)for(const[l,c]of Object.entries(n))o.setAttribute(l,c);if(r)for(const l of r)o.appendChild(yy(t,l));return o}function Q_(t,e){t=t.replace(/AriaRole\s*\.\s*([\w]+)/g,(l,c)=>c.toLowerCase()).replace(/(get_by_role|getByRole)\s*\(\s*(?:["'`])([^'"`]+)['"`]/g,(l,c,u)=>`${c}(${u.toLowerCase()}`);const n=[];let r="";for(let l=0;l<t.length;++l){const c=t[l];if(c!=='"'&&c!=="'"&&c!=="`"&&c!=="/"){r+=c;continue}const u=t[l-1]==="r"||t[l]==="/";++l;let d="";for(;l<t.length;){if(t[l]==="\\"){u?(t[l+1]!==c&&(d+=t[l]),++l,d+=t[l]):(++l,t[l]==="n"?d+=`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as s,j as e,T as F,D as M,M as E,a as B,W as C,b as U,c as z,d as I}from"./assets/defaultSettingsView-
|
|
1
|
+
import{r as s,j as e,T as F,D as M,M as E,a as B,W as C,b as U,c as z,d as I}from"./assets/defaultSettingsView-CUd-tHFm.js";const A=({className:n,style:o,open:r,width:a,verticalOffset:d,requestClose:u,anchor:h,dataTestId:T,children:y})=>{const w=s.useRef(null),[b,x]=s.useState(0);let S=o;if(h!=null&&h.current){const g=h.current.getBoundingClientRect();S={position:"fixed",margin:0,top:g.bottom+(d??0),left:O(g,a),width:a,zIndex:1,...o}}return s.useEffect(()=>{const g=j=>{!w.current||!(j.target instanceof Node)||w.current.contains(j.target)||u==null||u()},p=j=>{j.key==="Escape"&&(u==null||u())};return r?(document.addEventListener("mousedown",g),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",p)}):()=>{}},[r,u]),s.useEffect(()=>{const g=()=>x(p=>p+1);return window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}},[]),r&&e.jsx("dialog",{ref:w,style:S,className:n,"data-testid":T,open:!0,children:y})},O=(n,o)=>{const r=N(n,o,"left");if(r.inBounds)return r.value;const a=N(n,o,"right");return a.inBounds?a.value:r.value},N=(n,o,r)=>{const a=document.documentElement.clientWidth;if(r==="left"){const d=n.left;return{value:d,inBounds:d+o<=a}}else return{value:n.right-o,inBounds:n.right-o>=0}},V=()=>{const n=s.useRef(null),[o,r]=s.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(F,{ref:n,icon:"settings-gear",title:"Settings",onClick:()=>r(a=>!a)}),e.jsx(A,{style:{backgroundColor:"var(--vscode-sideBar-background)",padding:"4px 8px"},open:o,width:200,verticalOffset:8,requestClose:()=>r(!1),anchor:n,dataTestId:"settings-toolbar-dialog",children:e.jsx(M,{})})]})},$=()=>{const[n,o]=s.useState(!1),[r,a]=s.useState([]),[d,u]=s.useState([]),[h,T]=s.useState(D),[y,w]=s.useState({done:0,total:0}),[b,x]=s.useState(!1),[S,g]=s.useState(null),[p,j]=s.useState(null),L=s.useCallback(t=>{const c=[],l=[],i=new URL(window.location.href);for(let f=0;f<t.length;f++){const v=t.item(f);if(!v)continue;const R=URL.createObjectURL(v);c.push(R),l.push(v.name),i.searchParams.append("trace",R),i.searchParams.append("traceFileName",v.name)}const m=i.toString();window.history.pushState({},"",m),a(c),u(l),x(!1),g(null)},[]);s.useEffect(()=>{const t=async c=>{var l;if((l=c.clipboardData)!=null&&l.files.length){for(const i of c.clipboardData.files)if(i.type!=="application/zip")return;c.preventDefault(),L(c.clipboardData.files)}};return document.addEventListener("paste",t),()=>document.removeEventListener("paste",t)}),s.useEffect(()=>{const t=c=>{const{method:l,params:i}=c.data;if(l!=="load"||!((i==null?void 0:i.trace)instanceof Blob))return;const m=new File([i.trace],"trace.zip",{type:"application/zip"}),f=new DataTransfer;f.items.add(m),L(f.files)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const P=s.useCallback(t=>{t.preventDefault(),L(t.dataTransfer.files)},[L]),W=s.useCallback(t=>{t.preventDefault(),t.target.files&&L(t.target.files)},[L]);s.useEffect(()=>{const t=new URL(window.location.href).searchParams,c=t.getAll("trace");o(t.has("isServer"));for(const l of c)if(l.startsWith("file:")){j(l||null);return}if(t.has("isServer")){const l=new URLSearchParams(window.location.search).get("ws"),i=new URL(`../${l}`,window.location.toString());i.protocol=window.location.protocol==="https:"?"wss:":"ws:";const m=new B(new C(i));m.onLoadTraceRequested(async f=>{a(f.traceUrl?[f.traceUrl]:[]),x(!1),g(null)}),m.initialize({}).catch(()=>{})}else c.some(l=>l.startsWith("blob:"))||a(c)},[]),s.useEffect(()=>{(async()=>{if(r.length){const t=i=>{i.data.method==="progress"&&w(i.data.params)};navigator.serviceWorker.addEventListener("message",t),w({done:0,total:1});const c=[];for(let i=0;i<r.length;i++){const m=r[i],f=new URLSearchParams;f.set("trace",m),d.length&&f.set("traceFileName",d[i]),f.set("limit",String(r.length));const v=await fetch(`contexts?${f.toString()}`);if(!v.ok){n||a([]),g((await v.json()).error);return}c.push(...await v.json())}navigator.serviceWorker.removeEventListener("message",t);const l=new E(c);w({done:0,total:0}),T(l)}else T(D)})()},[n,r,d]);const k=!!(!n&&!b&&!p&&(!r.length||S));return e.jsxs("div",{className:"vbox workbench-loader",onDragOver:t=>{t.preventDefault(),x(!0)},children:[e.jsxs("div",{className:"hbox header",...k?{inert:"true"}:{},children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),h.title&&e.jsx("div",{className:"title",children:h.title}),e.jsx("div",{className:"spacer"}),e.jsx(V,{})]}),e.jsx("div",{className:"progress",children:e.jsx("div",{className:"inner-progress",style:{width:y.total?100*y.done/y.total+"%":0}})}),e.jsx(U,{model:h,inert:k}),p&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:p,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),k&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",role:"alert",children:S}),e.jsx("div",{className:"title",role:"heading","aria-level":1,children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const t=document.createElement("input");t.type="file",t.multiple=!0,t.click(),t.addEventListener("change",c=>W(c))},type:"button",children:"Select file(s)"}),e.jsx("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),n&&!r.length&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),b&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{x(!1)},onDrop:t=>P(t),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},D=new E([]),G=({traceJson:n})=>{const[o,r]=s.useState(void 0),[a,d]=s.useState(0),u=s.useRef(null);return s.useEffect(()=>(u.current&&clearTimeout(u.current),u.current=setTimeout(async()=>{try{const h=await H(n);r(h)}catch{const h=new E([]);r(h)}finally{d(a+1)}},500),()=>{u.current&&clearTimeout(u.current)}),[n,a]),e.jsx(U,{model:o,isLive:!0})};async function H(n){const o=new URLSearchParams;o.set("trace",n),o.set("limit","1");const a=await(await fetch(`contexts?${o.toString()}`)).json();return new E(a)}(async()=>{const n=new URLSearchParams(window.location.search);if(z(),window.location.protocol!=="file:"){if(n.get("isUnderTest")==="true"&&await new Promise(d=>setTimeout(d,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
|
|
2
2
|
Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(d=>{navigator.serviceWorker.oncontrollerchange=()=>d()}),setInterval(function(){fetch("ping")},1e4)}const o=n.get("trace"),a=(o==null?void 0:o.endsWith(".json"))?e.jsx(G,{traceJson:o}):e.jsx($,{});I.createRoot(document.querySelector("#root")).render(a)})();
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<link rel="icon" href="./playwright-logo.svg" type="image/svg+xml">
|
|
8
8
|
<link rel="manifest" href="./manifest.webmanifest">
|
|
9
9
|
<title>Playwright Trace Viewer</title>
|
|
10
|
-
<script type="module" crossorigin src="./index.
|
|
11
|
-
<link rel="modulepreload" crossorigin href="./assets/defaultSettingsView-
|
|
10
|
+
<script type="module" crossorigin src="./index.Cu8n3rOi.js"></script>
|
|
11
|
+
<link rel="modulepreload" crossorigin href="./assets/defaultSettingsView-CUd-tHFm.js">
|
|
12
12
|
<link rel="stylesheet" crossorigin href="./defaultSettingsView.NYBT19Ch.css">
|
|
13
13
|
<link rel="stylesheet" crossorigin href="./index.CFOW-Ezb.css">
|
|
14
14
|
</head>
|