playwright-core 1.58.0-alpha-2025-12-04 → 1.58.0-alpha-2025-12-05

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.
@@ -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-D4haJlGv.js"></script>
23
+ <script type="module" crossorigin src="/assets/index-DAlURJuJ.js"></script>
24
24
  <link rel="stylesheet" crossorigin href="/assets/index-BSjZa4pk.css">
25
25
  </head>
26
26
  <body>
@@ -1,4 +1,4 @@
1
- import{v as Ju}from"./defaultSettingsView-DTAwf90E.js";var vi={exports:{}},Zu=vi.exports,pa;function mt(){return pa||(pa=1,(function(ct,xt){(function(b,pe){ct.exports=pe()})(Zu,(function(){var b=navigator.userAgent,pe=navigator.platform,_=/gecko\/\d/i.test(b),te=/MSIE \d/.test(b),oe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(b),Q=/Edge\/(\d+)/.exec(b),k=te||oe||Q,I=k&&(te?document.documentMode||6:+(Q||oe)[1]),Y=!Q&&/WebKit\//.test(b),ne=Y&&/Qt\/\d+\.\d+/.test(b),S=!Q&&/Chrome\/(\d+)/.exec(b),R=S&&+S[1],A=/Opera\//.test(b),V=/Apple Computer/.test(navigator.vendor),ue=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(b),O=/PhantomJS/.test(b),w=V&&(/Mobile\/\w+/.test(b)||navigator.maxTouchPoints>2),M=/Android/.test(b),N=w||M||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(b),z=w||/Mac/.test(pe),X=/\bCrOS\b/.test(b),q=/win/i.test(pe),p=A&&b.match(/Version\/(\d*\.\d*)/);p&&(p=Number(p[1])),p&&p>=15&&(A=!1,Y=!0);var W=z&&(ne||A&&(p==null||p<12.11)),J=_||k&&I>=9;function P(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var $=function(e,t){var n=e.className,r=P(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 F(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function G(e,t){return F(e).appendChild(t)}function c(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 T(e,t,n,r){var i=c(e,t,n,r);return i.setAttribute("role","presentation"),i}var C;document.createRange?C=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:C=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 g(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 j(e,t){var n=e.className;P(t).test(n)||(e.className+=(n?" ":"")+t)}function de(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!P(n[r]).test(t)&&(t+=" "+n[r]);return t}var v=function(e){e.select()};w?v=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:k&&(v=function(e){try{e.select()}catch{}});function d(e){return e.display.wrapper.ownerDocument}function fe(e){return Te(e.display.wrapper)}function Te(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function le(e){return d(e).defaultView}function xe(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Me(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 Fe(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 Ce=function(){this.id=null,this.f=null,this.time=0,this.handler=xe(this.onTimeout,this)};Ce.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ce.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 ve(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Oe=50,qe={toString:function(){return"CodeMirror.Pass"}},Ve={scroll:!1},dt={origin:"*mouse"},Pe={origin:"+move"};function _e(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(we(Ue)+" ");return Ue[e]}function we(e){return e[e.length-1]}function Ie(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function E(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function ee(){}function K(e,t){var n;return Object.create?n=Object.create(e):(ee.prototype=e,n=new ee),t&&Me(t,n),n}var ze=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function me(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||ze.test(e))}function De(e,t){return t?t.source.indexOf("\\w")>-1&&me(e)?!0:t.test(e):me(e)}function be(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 Ne(e){return e.charCodeAt(0)>=768&&Be.test(e)}function Mt(e,t,n){for(;(n<0?t>0:t<e.length)&&Ne(e.charAt(t));)t+=n;return t}function Pt(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,x){this.level=u,this.from=h,this.to=x}return function(u,h){var x=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var D=u.length,L=[],H=0;H<D;++H)L.push(n(u.charCodeAt(H)));for(var Z=0,ie=x;Z<D;++Z){var ae=L[Z];ae=="m"?L[Z]=ie:ie=ae}for(var he=0,se=x;he<D;++he){var ge=L[he];ge=="1"&&se=="r"?L[he]="n":o.test(ge)&&(se=ge,ge=="r"&&(L[he]="R"))}for(var Le=1,ke=L[0];Le<D-1;++Le){var Ee=L[Le];Ee=="+"&&ke=="1"&&L[Le+1]=="1"?L[Le]="1":Ee==","&&ke==L[Le+1]&&(ke=="1"||ke=="n")&&(L[Le]=ke),ke=Ee}for(var Ke=0;Ke<D;++Ke){var st=L[Ke];if(st==",")L[Ke]="N";else if(st=="%"){var Xe=void 0;for(Xe=Ke+1;Xe<D&&L[Xe]=="%";++Xe);for(var Nt=Ke&&L[Ke-1]=="!"||Xe<D&&L[Xe]=="1"?"1":"N",Tt=Ke;Tt<Xe;++Tt)L[Tt]=Nt;Ke=Xe-1}}for(var tt=0,Ct=x;tt<D;++tt){var ft=L[tt];Ct=="L"&&ft=="1"?L[tt]="L":o.test(ft)&&(Ct=ft)}for(var nt=0;nt<D;++nt)if(i.test(L[nt])){var rt=void 0;for(rt=nt+1;rt<D&&i.test(L[rt]);++rt);for(var Ze=(nt?L[nt-1]:x)=="L",Dt=(rt<D?L[rt]:x)=="L",nn=Ze==Dt?Ze?"L":"R":x,yr=nt;yr<rt;++yr)L[yr]=nn;nt=rt-1}for(var vt=[],Jt,ut=0;ut<D;)if(l.test(L[ut])){var co=ut;for(++ut;ut<D&&l.test(L[ut]);++ut);vt.push(new s(0,co,ut))}else{var ir=ut,Ar=vt.length,Nr=h=="rtl"?1:0;for(++ut;ut<D&&L[ut]!="L";++ut);for(var bt=ir;bt<ut;)if(a.test(L[bt])){ir<bt&&(vt.splice(Ar,0,new s(1,ir,bt)),Ar+=Nr);var on=bt;for(++bt;bt<ut&&a.test(L[bt]);++bt);vt.splice(Ar,0,new s(2,on,bt)),Ar+=Nr,ir=bt}else++bt;ir<ut&&vt.splice(Ar,0,new s(1,ir,ut))}return h=="ltr"&&(vt[0].level==1&&(Jt=u.match(/^\s+/))&&(vt[0].from=Jt[0].length,vt.unshift(new s(0,0,Jt[0].length))),we(vt).level==1&&(Jt=u.match(/\s+$/))&&(we(vt).to-=Jt[0].length,vt.push(new s(0,D-Jt[0].length,D)))),h=="rtl"?vt.reverse():vt}})();function Re(e,t){var n=e.order;return n==null&&(n=e.order=mi(e.text,t)),n}var Bn=[],Se=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 Zt(e,t){return e._handlers&&e._handlers[t]||Bn}function ht(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=ve(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ye(e,t){var n=Zt(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 Qe(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ye(e,n||t.type,e,t),kt(t)||t.codemirrorIgnore}function It(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)ve(n,t[r])==-1&&n.push(t[r])}function Ft(e,t){return Zt(e,t).length>0}function Bt(e){e.prototype.on=function(t,n){Se(this,t,n)},e.prototype.off=function(t,n){ht(this,t,n)}}function pt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Er(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function kt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ar(e){pt(e),Er(e)}function ln(e){return e.target||e.srcElement}function Rt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),z&&e.ctrlKey&&t==1&&(t=3),t}var xi=(function(){if(k&&I<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e})(),Or;function Rn(e){if(Or==null){var t=c("span","​");G(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Or=t.offsetWidth<=1&&t.offsetHeight>2&&!(k&&I<8))}var n=Or?c("span","​"):c("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=G(e,document.createTextNode("AخA")),n=C(t,0,1).getBoundingClientRect(),r=C(t,1,2).getBoundingClientRect();return F(e),!n||n.left==n.right?!1:an=r.right-n.right<3}var zt=`
1
+ import{v as Ju}from"./defaultSettingsView-CFbbG_bM.js";var vi={exports:{}},Zu=vi.exports,pa;function mt(){return pa||(pa=1,(function(ct,xt){(function(b,pe){ct.exports=pe()})(Zu,(function(){var b=navigator.userAgent,pe=navigator.platform,_=/gecko\/\d/i.test(b),te=/MSIE \d/.test(b),oe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(b),Q=/Edge\/(\d+)/.exec(b),k=te||oe||Q,I=k&&(te?document.documentMode||6:+(Q||oe)[1]),Y=!Q&&/WebKit\//.test(b),ne=Y&&/Qt\/\d+\.\d+/.test(b),S=!Q&&/Chrome\/(\d+)/.exec(b),R=S&&+S[1],A=/Opera\//.test(b),V=/Apple Computer/.test(navigator.vendor),ue=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(b),O=/PhantomJS/.test(b),w=V&&(/Mobile\/\w+/.test(b)||navigator.maxTouchPoints>2),M=/Android/.test(b),N=w||M||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(b),z=w||/Mac/.test(pe),X=/\bCrOS\b/.test(b),q=/win/i.test(pe),p=A&&b.match(/Version\/(\d*\.\d*)/);p&&(p=Number(p[1])),p&&p>=15&&(A=!1,Y=!0);var W=z&&(ne||A&&(p==null||p<12.11)),J=_||k&&I>=9;function P(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var $=function(e,t){var n=e.className,r=P(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 F(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function G(e,t){return F(e).appendChild(t)}function c(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 T(e,t,n,r){var i=c(e,t,n,r);return i.setAttribute("role","presentation"),i}var C;document.createRange?C=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:C=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 g(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 j(e,t){var n=e.className;P(t).test(n)||(e.className+=(n?" ":"")+t)}function de(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!P(n[r]).test(t)&&(t+=" "+n[r]);return t}var v=function(e){e.select()};w?v=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:k&&(v=function(e){try{e.select()}catch{}});function d(e){return e.display.wrapper.ownerDocument}function fe(e){return Te(e.display.wrapper)}function Te(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function le(e){return d(e).defaultView}function xe(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Me(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 Fe(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 Ce=function(){this.id=null,this.f=null,this.time=0,this.handler=xe(this.onTimeout,this)};Ce.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ce.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 ve(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Oe=50,qe={toString:function(){return"CodeMirror.Pass"}},Ve={scroll:!1},dt={origin:"*mouse"},Pe={origin:"+move"};function _e(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(we(Ue)+" ");return Ue[e]}function we(e){return e[e.length-1]}function Ie(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function E(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function ee(){}function K(e,t){var n;return Object.create?n=Object.create(e):(ee.prototype=e,n=new ee),t&&Me(t,n),n}var ze=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function me(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||ze.test(e))}function De(e,t){return t?t.source.indexOf("\\w")>-1&&me(e)?!0:t.test(e):me(e)}function be(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 Ne(e){return e.charCodeAt(0)>=768&&Be.test(e)}function Mt(e,t,n){for(;(n<0?t>0:t<e.length)&&Ne(e.charAt(t));)t+=n;return t}function Pt(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,x){this.level=u,this.from=h,this.to=x}return function(u,h){var x=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var D=u.length,L=[],H=0;H<D;++H)L.push(n(u.charCodeAt(H)));for(var Z=0,ie=x;Z<D;++Z){var ae=L[Z];ae=="m"?L[Z]=ie:ie=ae}for(var he=0,se=x;he<D;++he){var ge=L[he];ge=="1"&&se=="r"?L[he]="n":o.test(ge)&&(se=ge,ge=="r"&&(L[he]="R"))}for(var Le=1,ke=L[0];Le<D-1;++Le){var Ee=L[Le];Ee=="+"&&ke=="1"&&L[Le+1]=="1"?L[Le]="1":Ee==","&&ke==L[Le+1]&&(ke=="1"||ke=="n")&&(L[Le]=ke),ke=Ee}for(var Ke=0;Ke<D;++Ke){var st=L[Ke];if(st==",")L[Ke]="N";else if(st=="%"){var Xe=void 0;for(Xe=Ke+1;Xe<D&&L[Xe]=="%";++Xe);for(var Nt=Ke&&L[Ke-1]=="!"||Xe<D&&L[Xe]=="1"?"1":"N",Tt=Ke;Tt<Xe;++Tt)L[Tt]=Nt;Ke=Xe-1}}for(var tt=0,Ct=x;tt<D;++tt){var ft=L[tt];Ct=="L"&&ft=="1"?L[tt]="L":o.test(ft)&&(Ct=ft)}for(var nt=0;nt<D;++nt)if(i.test(L[nt])){var rt=void 0;for(rt=nt+1;rt<D&&i.test(L[rt]);++rt);for(var Ze=(nt?L[nt-1]:x)=="L",Dt=(rt<D?L[rt]:x)=="L",nn=Ze==Dt?Ze?"L":"R":x,yr=nt;yr<rt;++yr)L[yr]=nn;nt=rt-1}for(var vt=[],Jt,ut=0;ut<D;)if(l.test(L[ut])){var co=ut;for(++ut;ut<D&&l.test(L[ut]);++ut);vt.push(new s(0,co,ut))}else{var ir=ut,Ar=vt.length,Nr=h=="rtl"?1:0;for(++ut;ut<D&&L[ut]!="L";++ut);for(var bt=ir;bt<ut;)if(a.test(L[bt])){ir<bt&&(vt.splice(Ar,0,new s(1,ir,bt)),Ar+=Nr);var on=bt;for(++bt;bt<ut&&a.test(L[bt]);++bt);vt.splice(Ar,0,new s(2,on,bt)),Ar+=Nr,ir=bt}else++bt;ir<ut&&vt.splice(Ar,0,new s(1,ir,ut))}return h=="ltr"&&(vt[0].level==1&&(Jt=u.match(/^\s+/))&&(vt[0].from=Jt[0].length,vt.unshift(new s(0,0,Jt[0].length))),we(vt).level==1&&(Jt=u.match(/\s+$/))&&(we(vt).to-=Jt[0].length,vt.push(new s(0,D-Jt[0].length,D)))),h=="rtl"?vt.reverse():vt}})();function Re(e,t){var n=e.order;return n==null&&(n=e.order=mi(e.text,t)),n}var Bn=[],Se=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 Zt(e,t){return e._handlers&&e._handlers[t]||Bn}function ht(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=ve(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ye(e,t){var n=Zt(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 Qe(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ye(e,n||t.type,e,t),kt(t)||t.codemirrorIgnore}function It(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)ve(n,t[r])==-1&&n.push(t[r])}function Ft(e,t){return Zt(e,t).length>0}function Bt(e){e.prototype.on=function(t,n){Se(this,t,n)},e.prototype.off=function(t,n){ht(this,t,n)}}function pt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Er(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function kt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ar(e){pt(e),Er(e)}function ln(e){return e.target||e.srcElement}function Rt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),z&&e.ctrlKey&&t==1&&(t=3),t}var xi=(function(){if(k&&I<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e})(),Or;function Rn(e){if(Or==null){var t=c("span","​");G(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Or=t.offsetWidth<=1&&t.offsetHeight>2&&!(k&&I<8))}var n=Or?c("span","​"):c("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=G(e,document.createTextNode("AخA")),n=C(t,0,1).getBoundingClientRect(),r=C(t,1,2).getBoundingClientRect();return F(e),!n||n.left==n.right?!1:an=r.right-n.right<3}var zt=`
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},Wn=(function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")})(),Wt=null;function yi(e){if(Wt!=null)return Wt;var t=G(e,c("span","x")),n=t.getBoundingClientRect(),r=C(t,0,1).getBoundingClientRect();return Wt=Math.abs(n.left-r.left)>1}var Pr={},Ht={};function _t(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=K(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]={};Me(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 Rr(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=Fe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Fe(this.string,this.lineStart,this.tabSize):0)},Je.prototype.indentation=function(){return Fe(this.string,null,this.tabSize)-(this.lineStart?Fe(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 ye(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 Et(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=ve(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 m(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 U(e,t){return t>=e.first&&t<e.first+e.size}function re(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function B(e,t,n){if(n===void 0&&(n=null),!(this instanceof B))return new B(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ce(e,t){return e.line-t.line||e.ch-t.ch}function We(e,t){return e.sticky==t.sticky&&ce(e,t)==0}function it(e){return B(e.line,e.ch)}function wt(e,t){return ce(e,t)<0?t:e}function Wr(e,t){return ce(e,t)<0?e:t}function go(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ae(e,t){if(t.line<e.first)return B(e.first,0);var n=e.first+e.size-1;return t.line>n?B(n,ye(e,n).text.length):Za(t,ye(e,t.line).text.length)}function Za(e,t){var n=e.ch;return n==null||n>t?B(e.line,t):n<0?B(e.line,0):e}function vo(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Ae(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 mo(e,t,n,r){var i=[e.state.modeGen],o={};So(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],x=1,D=0;n.state=!0,So(e,t.text,h.mode,n,function(L,H){for(var Z=x;D<L;){var ie=i[x];ie>L&&i.splice(x,1,L,i[x+1],ie),x+=2,D=Math.min(L,ie)}if(H)if(h.opaque)i.splice(Z,x-Z,L,"overlay "+H),x=Z+2;else for(;Z<x;Z+=2){var ae=i[Z+1];i[Z+1]=(ae?ae+" ":"")+"overlay "+H}},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 xo(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=mo(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=Va(e,t,n),l=o>r.first&&ye(r,o-1).stateAfter,a=l?Xt.fromSaved(r,l,o):new Xt(r,Rr(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 bo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function ko(e,t,n,r){var i=e.doc,o=i.mode,l;t=Ae(i,t);var a=ye(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 bo(u,l,Gt(i.mode,s.state)));return r?h:new bo(u,l,s.state)}function wo(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 So(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),x,D=e.options.addModeClass&&[null];for(t==""&&wo(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,x=null):x=wo(ki(n,h,r.state,D),o),D){var L=D[0].name;L&&(x="m-"+(x?L+" "+x:L))}if(!a||u!=x){for(;s<h.start;)s=Math.min(h.start,s+5e3),i(s,u);u=x}h.start=h.pos}for(;s<h.pos;){var H=Math.min(h.pos,s+5e3);i(H,u),s=H}}function Va(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=ye(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof Hn?u.lookAhead:0)<=o.modeFrontier))return a;var h=Fe(s.text,null,e.options.tabSize);(i==null||r>h)&&(i=a-1,r=h)}return i}function $a(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=ye(e,r).stateAfter;if(i&&(!(i instanceof Hn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Lo=!1,$t=!1;function es(){Lo=!0}function ts(){$t=!0}function _n(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 rs(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function ns(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 is(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 _n(l,o.from,s?null:o.to))}}return r}function os(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 _n(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=U(e,t.from.line)&&ye(e,t.from.line).markedSpans,r=U(e,t.to.line)&&ye(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,l=ce(t.from,t.to)==0,a=is(n,i,l),s=os(r,o,l),u=t.text.length==1,h=we(t.text).length+(u?i:0);if(a)for(var x=0;x<a.length;++x){var D=a[x];if(D.to==null){var L=cn(s,D.marker);L?u&&(D.to=L.to==null?null:L.to+h):D.to=i}}if(s)for(var H=0;H<s.length;++H){var Z=s[H];if(Z.to!=null&&(Z.to+=h),Z.from==null){var ie=cn(a,Z.marker);ie||(Z.from=h,u&&(a||(a=[])).push(Z))}else Z.from+=h,u&&(a||(a=[])).push(Z)}a&&(a=To(a)),s&&s!=a&&(s=To(s));var ae=[a];if(!u){var he=t.text.length-2,se;if(he>0&&a)for(var ge=0;ge<a.length;++ge)a[ge].to==null&&(se||(se=[])).push(new _n(a[ge].marker,null,null));for(var Le=0;Le<he;++Le)ae.push(se);ae.push(s)}return ae}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 ls(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(L){if(L.markedSpans)for(var H=0;H<L.markedSpans.length;++H){var Z=L.markedSpans[H].marker;Z.readOnly&&(!r||ve(r,Z)==-1)&&(r||(r=[])).push(Z)}}),!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(!(ce(u.to,a.from)<0||ce(u.from,a.to)>0)){var h=[s,1],x=ce(u.from,a.from),D=ce(u.to,a.to);(x<0||!l.inclusiveLeft&&!x)&&h.push({from:u.from,to:a.from}),(D>0||!l.inclusiveRight&&!D)&&h.push({from:a.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function Co(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Do(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=ce(r.from,i.from)||qn(e)-qn(t);if(o)return-o;var l=ce(r.to,i.to)||jn(e)-jn(t);return l||t.id-e.id}function Mo(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 Fo(e){return Mo(e,!0)}function Kn(e){return Mo(e,!1)}function as(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 Ao(e,t,n,r,i){var o=ye(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=ce(u.from,n)||qn(s.marker)-qn(i),x=ce(u.to,r)||jn(s.marker)-jn(i);if(!(h>=0&&x<=0||h<=0&&x>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ce(u.to,n)>=0:ce(u.to,n)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ce(u.from,r)<=0:ce(u.from,r)<0)))return!0}}}function qt(e){for(var t;t=Fo(e);)e=t.find(-1,!0).line;return e}function ss(e){for(var t;t=Kn(e);)e=t.find(1,!0).line;return e}function us(e){for(var t,n;t=Kn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Li(e,t){var n=ye(e,t),r=qt(n);return n==r?t:f(r)}function No(e,t){if(t>e.lastLine())return t;var n=ye(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&&Ti(e,t,r))return!0}}}function Ti(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Ti(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)&&Ti(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=Fo(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=ye(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,Do(this,t),this.height=n?n(this):1};Hr.prototype.lineNo=function(){return f(this)},Bt(Hr);function fs(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Co(e),Do(e,n);var i=r?r(e):1;i!=e.height&&Et(e,i)}function cs(e){e.parent=null,Co(e)}var ds={},hs={};function Eo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?hs:ds;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Oo(e,t){var n=T("span",null,null,Y?"padding-right: .1px":null),r={pre:T("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=gs,sr(e.display.measure)&&(l=Re(o,e.doc.direction))&&(r.addToken=ms(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&f(o);xs(o,r,xo(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=de(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=de(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Rn(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(Y){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=de(r.pre.className,r.textClass||"")),r}function ps(e){var t=c("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gs(e,t,n,r,i,o,l){if(t){var a=e.splitSpaces?vs(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),k&&I<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var x=0;;){s.lastIndex=x;var D=s.exec(t),L=D?D.index-x:t.length-x;if(L){var H=document.createTextNode(a.slice(x,x+L));k&&I<9?h.appendChild(c("span",[H])):h.appendChild(H),e.map.push(e.pos,e.pos+L,H),e.col+=L,e.pos+=L}if(!D)break;x+=L+1;var Z=void 0;if(D[0]==" "){var ie=e.cm.options.tabSize,ae=ie-e.col%ie;Z=h.appendChild(c("span",et(ae),"cm-tab")),Z.setAttribute("role","presentation"),Z.setAttribute("cm-text"," "),e.col+=ae}else D[0]=="\r"||D[0]==`
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeMirrorModule-CvSe_Ehm.js","../codeMirrorModule.DYBRYzYX.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeMirrorModule-D7ZzvGBV.js","../codeMirrorModule.DYBRYzYX.css"])))=>i.map(i=>d[i]);
2
2
  var Dw=Object.defineProperty;var Bw=(n,e,i)=>e in n?Dw(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i;var ka=(n,e,i)=>Bw(n,typeof e!="symbol"?e+"":e,i);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(l){if(l.ep)return;l.ep=!0;const o=i(l);fetch(l.href,o)}})();function Uw(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Yf={exports:{}},Ma={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -56,7 +56,7 @@ Error generating stack: `+a.message+`
56
56
  rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
57
57
  rgb(0 0 0 / 10%) 0px -2px 4px,
58
58
  rgb(0 0 0 / 15%) 0px -6.1px 12px,
59
- rgb(0 0 0 / 25%) 0px 6px 12px`},r_=({diff:n,noTargetBlank:e,hideDetails:i})=>{const[s,l]=z.useState(n.diff?"diff":"actual"),[o,u]=z.useState(!1),[f,d]=z.useState(null),[p,m]=z.useState("Expected"),[y,b]=z.useState(null),[v,E]=z.useState(null),[x,T]=os();z.useEffect(()=>{(async()=>{var j,ie,le,I;d(await Jf((j=n.expected)==null?void 0:j.attachment.path)),m(((ie=n.expected)==null?void 0:ie.title)||"Expected"),b(await Jf((le=n.actual)==null?void 0:le.attachment.path)),E(await Jf((I=n.diff)==null?void 0:I.attachment.path))})()},[n]);const C=f&&y&&v,k=C?Math.max(f.naturalWidth,y.naturalWidth,200):500,$=C?Math.max(f.naturalHeight,y.naturalHeight,200):500,V=Math.min(1,(x.width-30)/k),R=Math.min(1,(x.width-50)/k/2),G=k*V,Z=$*V,q={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return S.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:T,children:C&&S.jsxs(S.Fragment,{children:[S.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[n.diff&&S.jsx("div",{style:{...q,fontWeight:s==="diff"?600:"initial"},onClick:()=>l("diff"),children:"Diff"}),S.jsx("div",{style:{...q,fontWeight:s==="actual"?600:"initial"},onClick:()=>l("actual"),children:"Actual"}),S.jsx("div",{style:{...q,fontWeight:s==="expected"?600:"initial"},onClick:()=>l("expected"),children:p}),S.jsx("div",{style:{...q,fontWeight:s==="sxs"?600:"initial"},onClick:()=>l("sxs"),children:"Side by side"}),S.jsx("div",{style:{...q,fontWeight:s==="slider"?600:"initial"},onClick:()=>l("slider"),children:"Slider"})]}),S.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:Z+60},children:[n.diff&&s==="diff"&&S.jsx(Gn,{image:v,alt:"Diff",hideSize:i,canvasWidth:G,canvasHeight:Z,scale:V}),n.diff&&s==="actual"&&S.jsx(Gn,{image:y,alt:"Actual",hideSize:i,canvasWidth:G,canvasHeight:Z,scale:V}),n.diff&&s==="expected"&&S.jsx(Gn,{image:f,alt:p,hideSize:i,canvasWidth:G,canvasHeight:Z,scale:V}),n.diff&&s==="slider"&&S.jsx(a_,{expectedImage:f,actualImage:y,hideSize:i,canvasWidth:G,canvasHeight:Z,scale:V,expectedTitle:p}),n.diff&&s==="sxs"&&S.jsxs("div",{style:{display:"flex"},children:[S.jsx(Gn,{image:f,title:p,hideSize:i,canvasWidth:R*k,canvasHeight:R*$,scale:R}),S.jsx(Gn,{image:o?v:y,title:o?"Diff":"Actual",onClick:()=>u(!o),hideSize:i,canvasWidth:R*k,canvasHeight:R*$,scale:R})]}),!n.diff&&s==="actual"&&S.jsx(Gn,{image:y,title:"Actual",hideSize:i,canvasWidth:G,canvasHeight:Z,scale:V}),!n.diff&&s==="expected"&&S.jsx(Gn,{image:f,title:p,hideSize:i,canvasWidth:G,canvasHeight:Z,scale:V}),!n.diff&&s==="sxs"&&S.jsxs("div",{style:{display:"flex"},children:[S.jsx(Gn,{image:f,title:p,canvasWidth:R*k,canvasHeight:R*$,scale:R}),S.jsx(Gn,{image:y,title:"Actual",canvasWidth:R*k,canvasHeight:R*$,scale:R})]})]}),!i&&S.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[S.jsx("div",{children:n.diff&&S.jsx("a",{target:"_blank",href:n.diff.attachment.path,rel:"noreferrer",children:n.diff.attachment.name})}),S.jsx("div",{children:S.jsx("a",{target:e?"":"_blank",href:n.actual.attachment.path,rel:"noreferrer",children:n.actual.attachment.name})}),S.jsx("div",{children:S.jsx("a",{target:e?"":"_blank",href:n.expected.attachment.path,rel:"noreferrer",children:n.expected.attachment.name})})]})]})})},a_=({expectedImage:n,actualImage:e,canvasWidth:i,canvasHeight:s,scale:l,expectedTitle:o,hideSize:u})=>{const f={position:"absolute",top:0,left:0},[d,p]=z.useState(i/2),m=n.naturalWidth===e.naturalWidth&&n.naturalHeight===e.naturalHeight;return S.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!u&&S.jsxs("div",{style:{margin:5},children:[!m&&S.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),S.jsx("span",{children:n.naturalWidth}),S.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),S.jsx("span",{children:n.naturalHeight}),!m&&S.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!m&&S.jsx("span",{children:e.naturalWidth}),!m&&S.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!m&&S.jsx("span",{children:e.naturalHeight})]}),S.jsxs("div",{style:{position:"relative",width:i,height:s,margin:15,...xh},children:[S.jsx(f0,{orientation:"horizontal",offsets:[d],setOffsets:y=>p(y[0]),resizerColor:"#57606a80",resizerWidth:6}),S.jsx("img",{alt:o,style:{width:n.naturalWidth*l,height:n.naturalHeight*l},draggable:"false",src:n.src}),S.jsx("div",{style:{...f,bottom:0,overflow:"hidden",width:d,...xh},children:S.jsx("img",{alt:"Actual",style:{width:e.naturalWidth*l,height:e.naturalHeight*l},draggable:"false",src:e.src})})]})]})},Gn=({image:n,title:e,alt:i,hideSize:s,canvasWidth:l,canvasHeight:o,scale:u,onClick:f})=>S.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!s&&S.jsxs("div",{style:{margin:5},children:[e&&S.jsx("span",{style:{flex:"none",margin:"0 5px"},children:e}),S.jsx("span",{children:n.naturalWidth}),S.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),S.jsx("span",{children:n.naturalHeight})]}),S.jsx("div",{style:{display:"flex",flex:"none",width:l,height:o,margin:15,...xh},children:S.jsx("img",{width:n.naturalWidth*u,height:n.naturalHeight*u,alt:e||i,style:{cursor:f?"pointer":"initial"},draggable:"false",src:n.src,onClick:f})})]}),l_="modulepreload",o_=function(n,e){return new URL(n,e).href},Vy={},c_=function(e,i,s){let l=Promise.resolve();if(i&&i.length>0){let u=function(m){return Promise.all(m.map(y=>Promise.resolve(y).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const f=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));l=u(i.map(m=>{if(m=o_(m,s),m in Vy)return;Vy[m]=!0;const y=m.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(!!s)for(let x=f.length-1;x>=0;x--){const T=f[x];if(T.href===m&&(!y||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${b}`))return;const E=document.createElement("link");if(E.rel=y?"stylesheet":l_,y||(E.as="script"),E.crossOrigin="",E.href=m,p&&E.setAttribute("nonce",p),document.head.appendChild(E),y)return new Promise((x,T)=>{E.addEventListener("load",x),E.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return l.then(u=>{for(const f of u||[])f.status==="rejected"&&o(f.reason);return e().catch(o)})},u_=20,vr=({text:n,highlighter:e,mimeType:i,linkify:s,readOnly:l,highlight:o,revealLine:u,lineNumbers:f,isFocused:d,focusOnChange:p,wrapLines:m,onChange:y,dataTestId:b,placeholder:v})=>{const[E,x]=os(),[T]=z.useState(c_(()=>import("./codeMirrorModule-CvSe_Ehm.js"),__vite__mapDeps([0,1]),import.meta.url).then(V=>V.default)),C=z.useRef(null),[k,$]=z.useState();return z.useEffect(()=>{(async()=>{var q,j;const V=await T;h_(V);const R=x.current;if(!R)return;const G=p_(e)||d_(i)||(s?"text/linkified":"");if(C.current&&G===C.current.cm.getOption("mode")&&!!l===C.current.cm.getOption("readOnly")&&f===C.current.cm.getOption("lineNumbers")&&m===C.current.cm.getOption("lineWrapping")&&v===C.current.cm.getOption("placeholder"))return;(j=(q=C.current)==null?void 0:q.cm)==null||j.getWrapperElement().remove();const Z=V(R,{value:"",mode:G,readOnly:!!l,lineNumbers:f,lineWrapping:m,placeholder:v,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-F":"findPersistent","Cmd-F":"findPersistent"}});return C.current={cm:Z},d&&Z.focus(),$(Z),Z})()},[T,k,x,e,i,s,f,m,l,d,v]),z.useEffect(()=>{C.current&&C.current.cm.setSize(E.width,E.height)},[E]),z.useLayoutEffect(()=>{var G;if(!k)return;let V=!1;if(k.getValue()!==n&&(k.setValue(n),V=!0,p&&(k.execCommand("selectAll"),k.focus())),V||JSON.stringify(o)!==JSON.stringify(C.current.highlight)){for(const j of C.current.highlight||[])k.removeLineClass(j.line-1,"wrap");for(const j of o||[])k.addLineClass(j.line-1,"wrap",`source-line-${j.type}`);for(const j of C.current.widgets||[])k.removeLineWidget(j);for(const j of C.current.markers||[])j.clear();const Z=[],q=[];for(const j of o||[]){if(j.type!=="subtle-error"&&j.type!=="error")continue;const ie=(G=C.current)==null?void 0:G.cm.getLine(j.line-1);if(ie){const le={};le.title=j.message||"",q.push(k.markText({line:j.line-1,ch:0},{line:j.line-1,ch:j.column||ie.length},{className:"source-line-error-underline",attributes:le}))}if(j.type==="error"){const le=document.createElement("div");le.innerHTML=el(j.message||""),le.className="source-line-error-widget",Z.push(k.addLineWidget(j.line,le,{above:!0,coverGutter:!1}))}}C.current.highlight=o,C.current.widgets=Z,C.current.markers=q}typeof u=="number"&&C.current.cm.lineCount()>=u&&k.scrollIntoView({line:Math.max(0,u-1),ch:0},50);let R;return y&&(R=()=>y(k.getValue()),k.on("change",R)),()=>{R&&k.off("change",R)}},[k,n,o,u,p,y]),S.jsx("div",{"data-testid":b,className:"cm-wrapper",ref:x,onClick:f_})};function f_(n){var i;if(!(n.target instanceof HTMLElement))return;let e;n.target.classList.contains("cm-linkified")?e=n.target.textContent:n.target.classList.contains("cm-link")&&((i=n.target.nextElementSibling)!=null&&i.classList.contains("cm-url"))&&(e=n.target.nextElementSibling.textContent.slice(1,-1)),e&&(n.preventDefault(),n.stopPropagation(),window.open(e,"_blank"))}let Gy=!1;function h_(n){Gy||(Gy=!0,n.defineSimpleMode("text/linkified",{start:[{regex:Mb,token:"linkified"}]}))}function d_(n){if(n){if(n.includes("javascript")||n.includes("json"))return"javascript";if(n.includes("python"))return"python";if(n.includes("csharp"))return"text/x-csharp";if(n.includes("java"))return"text/x-java";if(n.includes("markdown"))return"markdown";if(n.includes("html")||n.includes("svg"))return"htmlmixed";if(n.includes("css"))return"css"}}function p_(n){if(n)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[n]}function g_(n){return!!n.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const h0=({title:n,children:e,setExpanded:i,expanded:s,expandOnTitleClick:l,className:o})=>{const u=z.useId(),f=z.useId(),d=z.useCallback(()=>i(!s),[s,i]),p=S.jsx("div",{className:Ke("codicon",s?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:l?void 0:d});return S.jsxs("div",{className:Ke("expandable",s&&"expanded",o),children:[l?S.jsxs("div",{id:u,role:"button","aria-expanded":s,"aria-controls":f,className:"expandable-title",onClick:d,children:[p,n]}):S.jsxs("div",{className:"expandable-title",children:[p,n]}),s&&S.jsx("div",{id:f,"aria-labelledby":u,role:"region",className:"expandable-content",children:e})]})};function d0(n){const e=[];let i=0,s;for(;(s=Mb.exec(n))!==null;){const o=n.substring(i,s.index);o&&e.push(o);const u=s[0];e.push(m_(u)),i=s.index+u.length}const l=n.substring(i);return l&&e.push(l),e}function m_(n){let e=n;return e.startsWith("www.")&&(e="https://"+e),S.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:n})}const p0=z.createContext(void 0),Ci=()=>z.useContext(p0),y_=({attachment:n,reveal:e})=>{const i=Ci(),[s,l]=z.useState(!1),[o,u]=z.useState(null),[f,d]=z.useState(null),[p,m]=Gw(),y=z.useRef(null),b=g_(n.contentType),v=!!n.sha1||!!n.path;z.useEffect(()=>{var T;if(e)return(T=y.current)==null||T.scrollIntoView({behavior:"smooth"}),m()},[e,m]),z.useEffect(()=>{s&&o===null&&f===null&&(d("Loading ..."),fetch(hc(i,n)).then(T=>T.text()).then(T=>{u(T),d(null)}).catch(T=>{d("Failed to load: "+T.message)}))},[i,s,o,f,n]);const E=z.useMemo(()=>{const T=o?o.split(`
59
+ rgb(0 0 0 / 25%) 0px 6px 12px`},r_=({diff:n,noTargetBlank:e,hideDetails:i})=>{const[s,l]=z.useState(n.diff?"diff":"actual"),[o,u]=z.useState(!1),[f,d]=z.useState(null),[p,m]=z.useState("Expected"),[y,b]=z.useState(null),[v,E]=z.useState(null),[x,T]=os();z.useEffect(()=>{(async()=>{var j,ie,le,I;d(await Jf((j=n.expected)==null?void 0:j.attachment.path)),m(((ie=n.expected)==null?void 0:ie.title)||"Expected"),b(await Jf((le=n.actual)==null?void 0:le.attachment.path)),E(await Jf((I=n.diff)==null?void 0:I.attachment.path))})()},[n]);const C=f&&y&&v,k=C?Math.max(f.naturalWidth,y.naturalWidth,200):500,$=C?Math.max(f.naturalHeight,y.naturalHeight,200):500,V=Math.min(1,(x.width-30)/k),R=Math.min(1,(x.width-50)/k/2),G=k*V,Z=$*V,q={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return S.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:T,children:C&&S.jsxs(S.Fragment,{children:[S.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[n.diff&&S.jsx("div",{style:{...q,fontWeight:s==="diff"?600:"initial"},onClick:()=>l("diff"),children:"Diff"}),S.jsx("div",{style:{...q,fontWeight:s==="actual"?600:"initial"},onClick:()=>l("actual"),children:"Actual"}),S.jsx("div",{style:{...q,fontWeight:s==="expected"?600:"initial"},onClick:()=>l("expected"),children:p}),S.jsx("div",{style:{...q,fontWeight:s==="sxs"?600:"initial"},onClick:()=>l("sxs"),children:"Side by side"}),S.jsx("div",{style:{...q,fontWeight:s==="slider"?600:"initial"},onClick:()=>l("slider"),children:"Slider"})]}),S.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:Z+60},children:[n.diff&&s==="diff"&&S.jsx(Gn,{image:v,alt:"Diff",hideSize:i,canvasWidth:G,canvasHeight:Z,scale:V}),n.diff&&s==="actual"&&S.jsx(Gn,{image:y,alt:"Actual",hideSize:i,canvasWidth:G,canvasHeight:Z,scale:V}),n.diff&&s==="expected"&&S.jsx(Gn,{image:f,alt:p,hideSize:i,canvasWidth:G,canvasHeight:Z,scale:V}),n.diff&&s==="slider"&&S.jsx(a_,{expectedImage:f,actualImage:y,hideSize:i,canvasWidth:G,canvasHeight:Z,scale:V,expectedTitle:p}),n.diff&&s==="sxs"&&S.jsxs("div",{style:{display:"flex"},children:[S.jsx(Gn,{image:f,title:p,hideSize:i,canvasWidth:R*k,canvasHeight:R*$,scale:R}),S.jsx(Gn,{image:o?v:y,title:o?"Diff":"Actual",onClick:()=>u(!o),hideSize:i,canvasWidth:R*k,canvasHeight:R*$,scale:R})]}),!n.diff&&s==="actual"&&S.jsx(Gn,{image:y,title:"Actual",hideSize:i,canvasWidth:G,canvasHeight:Z,scale:V}),!n.diff&&s==="expected"&&S.jsx(Gn,{image:f,title:p,hideSize:i,canvasWidth:G,canvasHeight:Z,scale:V}),!n.diff&&s==="sxs"&&S.jsxs("div",{style:{display:"flex"},children:[S.jsx(Gn,{image:f,title:p,canvasWidth:R*k,canvasHeight:R*$,scale:R}),S.jsx(Gn,{image:y,title:"Actual",canvasWidth:R*k,canvasHeight:R*$,scale:R})]})]}),!i&&S.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[S.jsx("div",{children:n.diff&&S.jsx("a",{target:"_blank",href:n.diff.attachment.path,rel:"noreferrer",children:n.diff.attachment.name})}),S.jsx("div",{children:S.jsx("a",{target:e?"":"_blank",href:n.actual.attachment.path,rel:"noreferrer",children:n.actual.attachment.name})}),S.jsx("div",{children:S.jsx("a",{target:e?"":"_blank",href:n.expected.attachment.path,rel:"noreferrer",children:n.expected.attachment.name})})]})]})})},a_=({expectedImage:n,actualImage:e,canvasWidth:i,canvasHeight:s,scale:l,expectedTitle:o,hideSize:u})=>{const f={position:"absolute",top:0,left:0},[d,p]=z.useState(i/2),m=n.naturalWidth===e.naturalWidth&&n.naturalHeight===e.naturalHeight;return S.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!u&&S.jsxs("div",{style:{margin:5},children:[!m&&S.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),S.jsx("span",{children:n.naturalWidth}),S.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),S.jsx("span",{children:n.naturalHeight}),!m&&S.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!m&&S.jsx("span",{children:e.naturalWidth}),!m&&S.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!m&&S.jsx("span",{children:e.naturalHeight})]}),S.jsxs("div",{style:{position:"relative",width:i,height:s,margin:15,...xh},children:[S.jsx(f0,{orientation:"horizontal",offsets:[d],setOffsets:y=>p(y[0]),resizerColor:"#57606a80",resizerWidth:6}),S.jsx("img",{alt:o,style:{width:n.naturalWidth*l,height:n.naturalHeight*l},draggable:"false",src:n.src}),S.jsx("div",{style:{...f,bottom:0,overflow:"hidden",width:d,...xh},children:S.jsx("img",{alt:"Actual",style:{width:e.naturalWidth*l,height:e.naturalHeight*l},draggable:"false",src:e.src})})]})]})},Gn=({image:n,title:e,alt:i,hideSize:s,canvasWidth:l,canvasHeight:o,scale:u,onClick:f})=>S.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!s&&S.jsxs("div",{style:{margin:5},children:[e&&S.jsx("span",{style:{flex:"none",margin:"0 5px"},children:e}),S.jsx("span",{children:n.naturalWidth}),S.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),S.jsx("span",{children:n.naturalHeight})]}),S.jsx("div",{style:{display:"flex",flex:"none",width:l,height:o,margin:15,...xh},children:S.jsx("img",{width:n.naturalWidth*u,height:n.naturalHeight*u,alt:e||i,style:{cursor:f?"pointer":"initial"},draggable:"false",src:n.src,onClick:f})})]}),l_="modulepreload",o_=function(n,e){return new URL(n,e).href},Vy={},c_=function(e,i,s){let l=Promise.resolve();if(i&&i.length>0){let u=function(m){return Promise.all(m.map(y=>Promise.resolve(y).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const f=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));l=u(i.map(m=>{if(m=o_(m,s),m in Vy)return;Vy[m]=!0;const y=m.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(!!s)for(let x=f.length-1;x>=0;x--){const T=f[x];if(T.href===m&&(!y||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${b}`))return;const E=document.createElement("link");if(E.rel=y?"stylesheet":l_,y||(E.as="script"),E.crossOrigin="",E.href=m,p&&E.setAttribute("nonce",p),document.head.appendChild(E),y)return new Promise((x,T)=>{E.addEventListener("load",x),E.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return l.then(u=>{for(const f of u||[])f.status==="rejected"&&o(f.reason);return e().catch(o)})},u_=20,vr=({text:n,highlighter:e,mimeType:i,linkify:s,readOnly:l,highlight:o,revealLine:u,lineNumbers:f,isFocused:d,focusOnChange:p,wrapLines:m,onChange:y,dataTestId:b,placeholder:v})=>{const[E,x]=os(),[T]=z.useState(c_(()=>import("./codeMirrorModule-D7ZzvGBV.js"),__vite__mapDeps([0,1]),import.meta.url).then(V=>V.default)),C=z.useRef(null),[k,$]=z.useState();return z.useEffect(()=>{(async()=>{var q,j;const V=await T;h_(V);const R=x.current;if(!R)return;const G=p_(e)||d_(i)||(s?"text/linkified":"");if(C.current&&G===C.current.cm.getOption("mode")&&!!l===C.current.cm.getOption("readOnly")&&f===C.current.cm.getOption("lineNumbers")&&m===C.current.cm.getOption("lineWrapping")&&v===C.current.cm.getOption("placeholder"))return;(j=(q=C.current)==null?void 0:q.cm)==null||j.getWrapperElement().remove();const Z=V(R,{value:"",mode:G,readOnly:!!l,lineNumbers:f,lineWrapping:m,placeholder:v,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-F":"findPersistent","Cmd-F":"findPersistent"}});return C.current={cm:Z},d&&Z.focus(),$(Z),Z})()},[T,k,x,e,i,s,f,m,l,d,v]),z.useEffect(()=>{C.current&&C.current.cm.setSize(E.width,E.height)},[E]),z.useLayoutEffect(()=>{var G;if(!k)return;let V=!1;if(k.getValue()!==n&&(k.setValue(n),V=!0,p&&(k.execCommand("selectAll"),k.focus())),V||JSON.stringify(o)!==JSON.stringify(C.current.highlight)){for(const j of C.current.highlight||[])k.removeLineClass(j.line-1,"wrap");for(const j of o||[])k.addLineClass(j.line-1,"wrap",`source-line-${j.type}`);for(const j of C.current.widgets||[])k.removeLineWidget(j);for(const j of C.current.markers||[])j.clear();const Z=[],q=[];for(const j of o||[]){if(j.type!=="subtle-error"&&j.type!=="error")continue;const ie=(G=C.current)==null?void 0:G.cm.getLine(j.line-1);if(ie){const le={};le.title=j.message||"",q.push(k.markText({line:j.line-1,ch:0},{line:j.line-1,ch:j.column||ie.length},{className:"source-line-error-underline",attributes:le}))}if(j.type==="error"){const le=document.createElement("div");le.innerHTML=el(j.message||""),le.className="source-line-error-widget",Z.push(k.addLineWidget(j.line,le,{above:!0,coverGutter:!1}))}}C.current.highlight=o,C.current.widgets=Z,C.current.markers=q}typeof u=="number"&&C.current.cm.lineCount()>=u&&k.scrollIntoView({line:Math.max(0,u-1),ch:0},50);let R;return y&&(R=()=>y(k.getValue()),k.on("change",R)),()=>{R&&k.off("change",R)}},[k,n,o,u,p,y]),S.jsx("div",{"data-testid":b,className:"cm-wrapper",ref:x,onClick:f_})};function f_(n){var i;if(!(n.target instanceof HTMLElement))return;let e;n.target.classList.contains("cm-linkified")?e=n.target.textContent:n.target.classList.contains("cm-link")&&((i=n.target.nextElementSibling)!=null&&i.classList.contains("cm-url"))&&(e=n.target.nextElementSibling.textContent.slice(1,-1)),e&&(n.preventDefault(),n.stopPropagation(),window.open(e,"_blank"))}let Gy=!1;function h_(n){Gy||(Gy=!0,n.defineSimpleMode("text/linkified",{start:[{regex:Mb,token:"linkified"}]}))}function d_(n){if(n){if(n.includes("javascript")||n.includes("json"))return"javascript";if(n.includes("python"))return"python";if(n.includes("csharp"))return"text/x-csharp";if(n.includes("java"))return"text/x-java";if(n.includes("markdown"))return"markdown";if(n.includes("html")||n.includes("svg"))return"htmlmixed";if(n.includes("css"))return"css"}}function p_(n){if(n)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[n]}function g_(n){return!!n.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const h0=({title:n,children:e,setExpanded:i,expanded:s,expandOnTitleClick:l,className:o})=>{const u=z.useId(),f=z.useId(),d=z.useCallback(()=>i(!s),[s,i]),p=S.jsx("div",{className:Ke("codicon",s?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:l?void 0:d});return S.jsxs("div",{className:Ke("expandable",s&&"expanded",o),children:[l?S.jsxs("div",{id:u,role:"button","aria-expanded":s,"aria-controls":f,className:"expandable-title",onClick:d,children:[p,n]}):S.jsxs("div",{className:"expandable-title",children:[p,n]}),s&&S.jsx("div",{id:f,"aria-labelledby":u,role:"region",className:"expandable-content",children:e})]})};function d0(n){const e=[];let i=0,s;for(;(s=Mb.exec(n))!==null;){const o=n.substring(i,s.index);o&&e.push(o);const u=s[0];e.push(m_(u)),i=s.index+u.length}const l=n.substring(i);return l&&e.push(l),e}function m_(n){let e=n;return e.startsWith("www.")&&(e="https://"+e),S.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:n})}const p0=z.createContext(void 0),Ci=()=>z.useContext(p0),y_=({attachment:n,reveal:e})=>{const i=Ci(),[s,l]=z.useState(!1),[o,u]=z.useState(null),[f,d]=z.useState(null),[p,m]=Gw(),y=z.useRef(null),b=g_(n.contentType),v=!!n.sha1||!!n.path;z.useEffect(()=>{var T;if(e)return(T=y.current)==null||T.scrollIntoView({behavior:"smooth"}),m()},[e,m]),z.useEffect(()=>{s&&o===null&&f===null&&(d("Loading ..."),fetch(hc(i,n)).then(T=>T.text()).then(T=>{u(T),d(null)}).catch(T=>{d("Failed to load: "+T.message)}))},[i,s,o,f,n]);const E=z.useMemo(()=>{const T=o?o.split(`
60
60
  `).length:0;return Math.min(Math.max(5,T),20)*u_},[o]),x=S.jsxs("span",{style:{marginLeft:5},ref:y,"aria-label":n.name,children:[S.jsx("span",{children:d0(n.name)}),v&&S.jsx("a",{style:{marginLeft:5},href:qo(i,n),children:"download"})]});return!b||!v?S.jsx("div",{style:{marginLeft:20},children:x}):S.jsxs("div",{className:Ke(p&&"yellow-flash"),children:[S.jsx(h0,{title:x,expanded:s,setExpanded:l,expandOnTitleClick:!0,children:f&&S.jsx("i",{children:f})}),s&&o!==null&&S.jsx("div",{className:"vbox",style:{height:E},children:S.jsx(vr,{text:o,readOnly:!0,mimeType:n.contentType,linkify:!0,lineNumbers:!0,wrapLines:!1})})]})},b_=({revealedAttachmentCallId:n})=>{const e=Ci(),{diffMap:i,screenshots:s,attachments:l}=z.useMemo(()=>{const o=new Set((e==null?void 0:e.visibleAttachments)??[]),u=new Set,f=new Map;for(const d of o){if(!d.path&&!d.sha1)continue;const p=d.name.match(/^(.*)-(expected|actual|diff)\.png$/);if(p){const m=p[1],y=p[2],b=f.get(m)||{expected:void 0,actual:void 0,diff:void 0};b[y]=d,f.set(m,b),o.delete(d)}else d.contentType.startsWith("image/")&&(u.add(d),o.delete(d))}return{diffMap:f,attachments:o,screenshots:u}},[e]);return!i.size&&!s.size&&!l.size?S.jsx(cs,{text:"No attachments"}):S.jsxs("div",{className:"attachments-tab",children:[[...i.values()].map(({expected:o,actual:u,diff:f})=>S.jsxs(S.Fragment,{children:[o&&u&&S.jsx("div",{className:"attachments-section",children:"Image diff"}),o&&u&&S.jsx(r_,{noTargetBlank:!0,diff:{name:"Image diff",expected:{attachment:{...o,path:qo(e,o)},title:"Expected"},actual:{attachment:{...u,path:qo(e,u)}},diff:f?{attachment:{...f,path:qo(e,f)}}:void 0}})]})),s.size?S.jsx("div",{className:"attachments-section",children:"Screenshots"}):void 0,[...s.values()].map((o,u)=>{const f=hc(e,o);return S.jsxs("div",{className:"attachment-item",children:[S.jsx("div",{children:S.jsx("img",{draggable:"false",src:f})}),S.jsx("div",{children:S.jsx("a",{target:"_blank",href:f,rel:"noreferrer",children:o.name})})]},`screenshot-${u}`)}),l.size?S.jsx("div",{className:"attachments-section",children:"Attachments"}):void 0,[...l.values()].map((o,u)=>S.jsx("div",{className:"attachment-item",children:S.jsx(y_,{attachment:o,reveal:n&&o.callId===n.callId?n:void 0})},v_(o,u)))]})};function hc(n,e){return n&&e.sha1?n.createRelativeUrl(`sha1/${e.sha1}`):`file?path=${encodeURIComponent(e.path)}`}function qo(n,e){let i=e.contentType?`&dn=${encodeURIComponent(e.name)}`:"";return e.contentType&&(i+=`&dct=${encodeURIComponent(e.contentType)}`),hc(n,e)+i}function v_(n,e){return e+"-"+(n.sha1?"sha1-"+n.sha1:"path-"+n.path)}const S_=`
61
61
  # Instructions
62
62
 
@@ -263,4 +263,4 @@ ${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.pus
263
263
  `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
264
264
  `,i)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var s;const i=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,i.value){const l="end"in i.value?i.value.end:void 0,o=Array.isArray(l)?l[l.length-1]:void 0;(o==null?void 0:o.type)==="comment"?l==null||l.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else if(i.sep)i.sep.push(this.sourceToken);else{if(this.atIndentedComment(i.start,e.indent)){const l=e.items[e.items.length-2],o=(s=l==null?void 0:l.value)==null?void 0:s.end;if(Array.isArray(o)){Array.prototype.push.apply(o,i.start),o.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const l=!this.onKeyLine&&this.indent===e.indent,o=l&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind";let u=[];if(o&&i.sep&&!i.value){const f=[];for(let d=0;d<i.sep.length;++d){const p=i.sep[d];switch(p.type){case"newline":f.push(d);break;case"space":break;case"comment":p.indent>e.indent&&(f.length=0);break;default:f.length=0}}f.length>=2&&(u=i.sep.splice(f[1]))}switch(this.type){case"anchor":case"tag":o||i.value?(u.push(this.sourceToken),e.items.push({start:u}),this.onKeyLine=!0):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"explicit-key-ind":!i.sep&&!i.explicitKey?(i.start.push(this.sourceToken),i.explicitKey=!0):o||i.value?(u.push(this.sourceToken),e.items.push({start:u,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(i.explicitKey)if(i.sep)if(i.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ns(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]});else if(hS(i.key)&&!ns(i.sep,"newline")){const f=rr(i.start),d=i.key,p=i.sep;p.push(this.sourceToken),delete i.key,delete i.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:f,key:d,sep:p}]})}else u.length>0?i.sep=i.sep.concat(u,this.sourceToken):i.sep.push(this.sourceToken);else if(ns(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{const f=rr(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:f,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||o?e.items.push({start:u,key:null,sep:[this.sourceToken]}):ns(i.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const f=this.flowScalar(this.type);o||i.value?(e.items.push({start:u,key:f,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(f):(Object.assign(i,{key:f,sep:[]}),this.onKeyLine=!0);return}default:{const f=this.startBlockValue(e);if(f){l&&f.type!=="block-seq"&&e.items.push({start:u}),this.stack.push(f);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var s;const i=e.items[e.items.length-1];switch(this.type){case"newline":if(i.value){const l="end"in i.value?i.value.end:void 0,o=Array.isArray(l)?l[l.length-1]:void 0;(o==null?void 0:o.type)==="comment"?l==null||l.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,e.indent)){const l=e.items[e.items.length-2],o=(s=l==null?void 0:l.value)==null?void 0:s.end;if(Array.isArray(o)){Array.prototype.push.apply(o,i.start),o.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=e.indent)break;i.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;i.value||ns(i.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return}if(this.indent>e.indent){const l=this.startBlockValue(e);if(l){this.stack.push(l);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const i=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s&&s.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!i||i.sep?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return;case"map-value-ind":!i||i.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!i||i.value?e.items.push({start:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);!i||i.value?e.items.push({start:[],key:l,sep:[]}):i.sep?this.stack.push(l):Object.assign(i,{key:l,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const l=Lo(s),o=rr(l);Tb(e);const u=e.end.splice(1,e.end.length);u.push(this.sourceToken);const f={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:u}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=f}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let i=this.source.indexOf(`
265
265
  `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
266
- `,i)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const i=Lo(e),s=rr(i);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const i=Lo(e),s=rr(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,i){return this.type!=="comment"||this.indent<=i?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function dS(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new fS||null,prettyErrors:e}}function RN(n,e={}){const{lineCounter:i,prettyErrors:s}=dS(e),l=new Md(i==null?void 0:i.addNewLine),o=new kd(e),u=Array.from(o.compose(l.parse(n)));if(s&&i)for(const f of u)f.errors.forEach(lc(n,i)),f.warnings.forEach(lc(n,i));return u.length>0?u:Object.assign([],{empty:!0},o.streamInfo())}function pS(n,e={}){const{lineCounter:i,prettyErrors:s}=dS(e),l=new Md(i==null?void 0:i.addNewLine),o=new kd(e);let u=null;for(const f of o.compose(l.parse(n),!0,n.length))if(!u)u=f;else if(u.options.logLevel!=="silent"){u.errors.push(new rs(f.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&i&&(u.errors.forEach(lc(n,i)),u.warnings.forEach(lc(n,i))),u}function jN(n,e,i){let s;typeof e=="function"?s=e:i===void 0&&e&&typeof e=="object"&&(i=e);const l=pS(n,i);if(!l)return null;if(l.warnings.forEach(o=>Lv(l.options.logLevel,o)),l.errors.length>0){if(l.options.logLevel!=="silent")throw l.errors[0];l.errors=[]}return l.toJS(Object.assign({reviver:s},i))}function LN(n,e,i){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:i===void 0&&e&&(i=e),typeof i=="string"&&(i=i.length),typeof i=="number"){const l=Math.round(i);i=l<1?void 0:l>8?{indent:8}:{indent:l}}if(n===void 0){const{keepUndefined:l}=i??e??{};if(!l)return}return fs(n)&&!s?n.toString(i):new Or(n,s,i).toString(i)}const gS=Object.freeze(Object.defineProperty({__proto__:null,Alias:yc,CST:kN,Composer:kd,Document:Or,Lexer:uS,LineCounter:fS,Pair:gt,Parser:Md,Scalar:he,Schema:Ac,YAMLError:Nd,YAMLMap:It,YAMLParseError:rs,YAMLSeq:Ni,YAMLWarning:Wv,isAlias:us,isCollection:ze,isDocument:fs,isMap:Nr,isNode:He,isPair:De,isScalar:Oe,isSeq:Cr,parse:jN,parseAllDocuments:RN,parseDocument:pS,stringify:LN,visit:Ai,visitAsync:mc},Symbol.toStringTag,{value:"Module"})),DN=({action:n,model:e,sdkLanguage:i,testIdAttributeName:s,isInspecting:l,setIsInspecting:o,highlightedElement:u,setHighlightedElement:f})=>{const[d,p]=z.useState("action"),[m]=sn("shouldPopulateCanvasFromScreenshot",!1),y=z.useMemo(()=>HN(n),[n]),{snapshotInfoUrl:b,snapshotUrl:v,popoutUrl:E}=z.useMemo(()=>{const T=y[d];return e&&T?qN(e.traceUrl,T,m):{snapshotInfoUrl:void 0,snapshotUrl:void 0,popoutUrl:void 0}},[y,d,m,e]),x=z.useMemo(()=>b!==void 0?{snapshotInfoUrl:b,snapshotUrl:v,popoutUrl:E}:void 0,[b,v,E]);return S.jsxs("div",{className:"snapshot-tab vbox",children:[S.jsxs(Kh,{children:[S.jsx(Lt,{className:"pick-locator",title:"Pick locator",icon:"target",toggled:l,onClick:()=>o(!l)}),S.jsx("div",{className:"hbox",style:{height:"100%"},role:"tablist",children:["action","before","after"].map(T=>S.jsx(y0,{id:T,title:zN(T),selected:d===T,onSelect:()=>p(T)},T))}),S.jsx("div",{style:{flex:"auto"}}),S.jsx(Lt,{icon:"link-external",title:"Open snapshot in a new tab",disabled:!(x!=null&&x.popoutUrl),onClick:()=>{const T=window.open((x==null?void 0:x.popoutUrl)||"","_blank");T==null||T.addEventListener("DOMContentLoaded",()=>{new yv(T,{isUnderTest:yS,sdkLanguage:i,testIdAttributeName:s,stableRafCount:1,browserName:"chromium",customEngines:[]}).consoleApi.install()})}})]}),S.jsx(BN,{snapshotUrls:x,sdkLanguage:i,testIdAttributeName:s,isInspecting:l,setIsInspecting:o,highlightedElement:u,setHighlightedElement:f})]})},BN=({snapshotUrls:n,sdkLanguage:e,testIdAttributeName:i,isInspecting:s,setIsInspecting:l,highlightedElement:o,setHighlightedElement:u})=>{const f=z.useRef(null),d=z.useRef(null),[p,m]=z.useState({viewport:bS,url:""}),y=z.useRef({iteration:0,visibleIframe:0});return z.useEffect(()=>{(async()=>{const b=y.current.iteration+1,v=1-y.current.visibleIframe;y.current.iteration=b;const E=await $N(n==null?void 0:n.snapshotInfoUrl);if(y.current.iteration!==b)return;const x=[f,d][v].current;if(x){let T=()=>{};const C=new Promise(k=>T=k);try{x.addEventListener("load",T),x.addEventListener("error",T);const k=(n==null?void 0:n.snapshotUrl)||IN;x.contentWindow?x.contentWindow.location.replace(k):x.src=k,await C}catch{}finally{x.removeEventListener("load",T),x.removeEventListener("error",T)}}y.current.iteration===b&&(y.current.visibleIframe=v,m(E))})()},[n]),S.jsxs("div",{className:"vbox",tabIndex:0,onKeyDown:b=>{b.key==="Escape"&&s&&l(!1)},children:[S.jsx(Eb,{isInspecting:s,sdkLanguage:e,testIdAttributeName:i,highlightedElement:o,setHighlightedElement:u,iframe:f.current,iteration:y.current.iteration}),S.jsx(Eb,{isInspecting:s,sdkLanguage:e,testIdAttributeName:i,highlightedElement:o,setHighlightedElement:u,iframe:d.current,iteration:y.current.iteration}),S.jsx(UN,{snapshotInfo:p,children:S.jsxs("div",{className:"snapshot-switcher",children:[S.jsx("iframe",{ref:f,name:"snapshot",title:"DOM Snapshot",className:Ke(y.current.visibleIframe===0&&"snapshot-visible")}),S.jsx("iframe",{ref:d,name:"snapshot",title:"DOM Snapshot",className:Ke(y.current.visibleIframe===1&&"snapshot-visible")})]})})]})},UN=({snapshotInfo:n,children:e})=>{const[i,s]=os(),l=40,o={width:n.viewport.width,height:n.viewport.height},u={width:Math.max(o.width,480),height:Math.max(o.height+l,320)},f=Math.min(i.width/u.width,i.height/u.height,1),d={x:(i.width-u.width)/2,y:(i.height-u.height)/2};return S.jsx("div",{ref:s,className:"snapshot-wrapper",children:S.jsxs("div",{className:"snapshot-container",style:{width:u.width+"px",height:u.height+"px",transform:`translate(${d.x}px, ${d.y}px) scale(${f})`},children:[S.jsx(EA,{url:n.url}),S.jsx("div",{className:"snapshot-browser-body",children:S.jsx("div",{style:{width:o.width+"px",height:o.height+"px"},children:e})})]})})};function zN(n){return n==="before"?"Before":n==="after"?"After":n==="action"?"Action":n}const Eb=({iframe:n,isInspecting:e,sdkLanguage:i,testIdAttributeName:s,highlightedElement:l,setHighlightedElement:o,iteration:u})=>(z.useEffect(()=>{const f=l.lastEdited==="ariaSnapshot"?l.ariaSnapshot:void 0,d=l.lastEdited==="locator"?l.locator:void 0,p=!!f||!!d||e,m=[],y=new URLSearchParams(window.location.search).get("isUnderTest")==="true";try{mS(m,p,i,s,y,"",n==null?void 0:n.contentWindow)}catch{}const b=f?Yh(gS,f):void 0,v=d?_A(i,d,s):void 0;for(const{recorder:E,frameSelector:x}of m){const T=v!=null&&v.startsWith(x)?v.substring(x.length).trim():void 0,C=(b==null?void 0:b.errors.length)===0?b.fragment:void 0;E.setUIState({mode:e?"inspecting":"none",actionSelector:T,ariaTemplate:C,language:i,testIdAttributeName:s,overlay:{offsetX:0}},{async elementPicked(k){o({locator:_i(i,x+k.selector),ariaSnapshot:k.ariaSnapshot,lastEdited:"none"})},highlightUpdated(){for(const k of m)k.recorder!==E&&k.recorder.clearHighlight()}})}},[n,e,l,o,i,s,u]),S.jsx(S.Fragment,{}));function mS(n,e,i,s,l,o,u){if(!u)return;const f=u;if(!f._recorder&&e){const d=new yv(u,{isUnderTest:l,sdkLanguage:i,testIdAttributeName:s,stableRafCount:1,browserName:"chromium",customEngines:[]}),p=new yA(d);f._injectedScript=d,f._recorder={recorder:p,frameSelector:o},l&&(window._weakRecordersForTest=window._weakRecordersForTest||new Set,window._weakRecordersForTest.add(new WeakRef(p)))}f._recorder&&n.push(f._recorder);for(let d=0;d<u.frames.length;++d){const p=u.frames[d],m=p.frameElement?f._injectedScript.generateSelectorSimple(p.frameElement,{omitInternalEngines:!0,testIdAttributeName:s})+" >> internal:control=enter-frame >> ":"";mS(n,e,i,s,l,o+m,p)}}const za=(n,e,i=!1)=>{if(!n)return;const s=n[e];if(s){if(!n.pageId){console.error("snapshot action must have a pageId");return}return{action:n,snapshotName:s,pageId:n.pageId,point:n.point,hasInputTarget:i}}};function HN(n){if(!n)return{};let e=za(n,"beforeSnapshot");if(!e){for(let l=Ry(n);l;l=Ry(l))if(l.endTime<=n.startTime&&l.afterSnapshot){e=za(l,"afterSnapshot");break}}let i=za(n,"afterSnapshot");if(!i){let l;for(let o=jy(n);o&&o.startTime<=n.endTime;o=jy(o))o.endTime>n.endTime||!o.afterSnapshot||l&&l.endTime>o.endTime||(l=o);l?i=za(l,"afterSnapshot"):i=e}const s=za(n,"inputSnapshot",!0)??i;return s&&(s.point=n.point),{action:s,before:e,after:i}}const yS=new URLSearchParams(window.location.search).has("isUnderTest");function qN(n,e,i){const s=new URLSearchParams;s.set("trace",n),s.set("name",e.snapshotName),yS&&s.set("isUnderTest","true"),e.point&&(s.set("pointX",String(e.point.x)),s.set("pointY",String(e.point.y)),e.hasInputTarget&&s.set("hasInputTarget","1")),i&&s.set("shouldPopulateCanvasFromScreenshot","1");const l=new URL(`snapshot/${e.pageId}?${s.toString()}`,window.location.href).toString(),o=new URL(`snapshotInfo/${e.pageId}?${s.toString()}`,window.location.href).toString(),u=new URLSearchParams;u.set("r",l),u.set("trace",n);const f=new URL(`snapshot.html?${u.toString()}`,window.location.href).toString();return{snapshotInfoUrl:o,snapshotUrl:l,popoutUrl:f}}async function $N(n){const e={url:"",viewport:bS,timestamp:void 0,wallTime:void 0};if(n){const s=await(await fetch(n)).json();s.error||(e.url=s.url,e.viewport=s.viewport,e.timestamp=s.timestamp,e.wallTime=s.wallTime)}return e}const bS={width:1280,height:720},IN='data:text/html,<body style="background: #ddd"></body>',vS={width:200,height:45},cr=2.5,VN=vS.height+cr*2,GN=({boundaries:n,previewPoint:e})=>{var m,y;const i=Ci(),[s,l]=os(),o=z.useRef(null);let u=0;if(o.current&&e){const b=o.current.getBoundingClientRect();u=(e.clientY-b.top+o.current.scrollTop)/VN|0}const f=(y=(m=i==null?void 0:i.pages)==null?void 0:m[u])==null?void 0:y.screencastFrames;let d,p;if(e!==void 0&&f&&f.length){const b=n.minimum+(n.maximum-n.minimum)*e.x/s.width;d=f[Nb(f,b,SS)-1];const v={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};p=d?wS({width:d.width,height:d.height},v):void 0}return S.jsxs("div",{className:"film-strip",ref:l,children:[S.jsx("div",{className:"film-strip-lanes",ref:o,children:i==null?void 0:i.pages.map((b,v)=>b.screencastFrames.length?S.jsx(KN,{boundaries:n,page:b,width:s.width},v):null)}),i&&(e==null?void 0:e.x)!==void 0&&S.jsxs("div",{className:"film-strip-hover",style:{top:s.bottom+5,left:Math.min(e.x,s.width-(p?p.width:0)-10)},children:[e.action&&S.jsx("div",{className:"film-strip-hover-title",children:Vh(e.action,e)}),d&&p&&S.jsx("div",{style:{width:p.width,height:p.height},children:S.jsx("img",{src:i.createRelativeUrl(`sha1/${d.sha1}`),width:p.width,height:p.height})})]})]})},KN=({boundaries:n,page:e,width:i})=>{const s=Ci(),l={width:0,height:0},o=e.screencastFrames;for(const T of o)l.width=Math.max(l.width,T.width),l.height=Math.max(l.height,T.height);const u=wS(l,vS),f=o[0].timestamp,d=o[o.length-1].timestamp,p=n.maximum-n.minimum,m=(f-n.minimum)/p*i,y=(n.maximum-d)/p*i,v=(d-f)/p*i/(u.width+2*cr)|0,E=(d-f)/v,x=[];for(let T=0;f&&E&&T<v;++T){const C=f+E*T,k=Nb(o,C,SS)-1;x.push(S.jsx("div",{className:"film-strip-frame",style:{width:u.width,height:u.height,backgroundImage:`url(${s==null?void 0:s.createRelativeUrl("sha1/"+o[k].sha1)})`,backgroundSize:`${u.width}px ${u.height}px`,margin:cr,marginRight:cr}},T))}return x.push(S.jsx("div",{className:"film-strip-frame",style:{width:u.width,height:u.height,backgroundImage:`url(${s==null?void 0:s.createRelativeUrl("sha1/"+o[o.length-1].sha1)})`,backgroundSize:`${u.width}px ${u.height}px`,margin:cr,marginRight:cr}},x.length)),S.jsx("div",{className:"film-strip-lane",style:{marginLeft:m+"px",marginRight:y+"px"},children:x})};function SS(n,e){return n-e.timestamp}function wS(n,e){const i=Math.max(n.width/e.width,n.height/e.height);return{width:n.width/i|0,height:n.height/i|0}}const YN=({model:n,boundaries:e,consoleEntries:i,networkResources:s,onSelected:l,highlightedAction:o,highlightedResourceOrdinal:u,highlightedConsoleEntryOrdinal:f,selectedTime:d,setSelectedTime:p,sdkLanguage:m})=>{const[y,b]=os(),[v,E]=z.useState(),[x,T]=z.useState(),[C]=sn("actionsFilter",[]),{offsets:k,curtainLeft:$,curtainRight:V}=z.useMemo(()=>{let F=d||e;if(v&&v.startX!==v.endX){const Q=wn(y.width,e,v.startX),se=wn(y.width,e,v.endX);F={minimum:Math.min(Q,se),maximum:Math.max(Q,se)}}const ee=tn(y.width,e,F.minimum),H=tn(y.width,e,e.maximum)-tn(y.width,e,F.maximum);return{offsets:XN(y.width,e),curtainLeft:ee,curtainRight:H}},[d,e,v,y]),R=z.useMemo(()=>n==null?void 0:n.filteredActions(C),[n,C]),G=z.useMemo(()=>{const F=[];for(const ee of R||[])F.push({action:ee,leftTime:ee.startTime,rightTime:ee.endTime||e.maximum,leftPosition:tn(y.width,e,ee.startTime),rightPosition:tn(y.width,e,ee.endTime||e.maximum),active:!1,error:!!ee.error});for(const ee of(n==null?void 0:n.resources)||[]){const ve=ee._monotonicTime,H=ee._monotonicTime+ee.time;F.push({resource:ee,leftTime:ve,rightTime:H,leftPosition:tn(y.width,e,ve),rightPosition:tn(y.width,e,H),active:!1,error:!1})}for(const ee of i||[])F.push({consoleMessage:ee,leftTime:ee.timestamp,rightTime:ee.timestamp,leftPosition:tn(y.width,e,ee.timestamp),rightPosition:tn(y.width,e,ee.timestamp),active:!1,error:ee.isError});return F},[n,R,i,e,y]);z.useMemo(()=>{for(const F of G)o?F.active=F.action===o:u!==void 0?F.active=F.resource===(s==null?void 0:s[u]):f!==void 0?F.active=F.consoleMessage===(i==null?void 0:i[f]):F.active=!1},[G,o,u,f,i,s]);const Z=z.useCallback(F=>{if(T(void 0),!b.current)return;const ee=F.clientX-b.current.getBoundingClientRect().left,ve=wn(y.width,e,ee),H=d?tn(y.width,e,d.minimum):0,Q=d?tn(y.width,e,d.maximum):0;d&&Math.abs(ee-H)<10?E({startX:Q,endX:ee,type:"resize"}):d&&Math.abs(ee-Q)<10?E({startX:H,endX:ee,type:"resize"}):d&&ve>d.minimum&&ve<d.maximum&&F.clientY-b.current.getBoundingClientRect().top<20?E({startX:H,endX:Q,pivot:ee,type:"move"}):E({startX:ee,endX:ee,type:"resize"})},[e,y,b,d]),q=z.useCallback(F=>{if(!b.current)return;const ee=F.clientX-b.current.getBoundingClientRect().left,ve=wn(y.width,e,ee),H=R==null?void 0:R.findLast(N=>N.startTime<=ve);if(!F.buttons){E(void 0);return}if(H&&l(H),!v)return;let Q=v;if(v.type==="resize")Q={...v,endX:ee};else{const N=ee-v.pivot;let P=v.startX+N,W=v.endX+N;P<0&&(P=0,W=P+(v.endX-v.startX)),W>y.width&&(W=y.width,P=W-(v.endX-v.startX)),Q={...v,startX:P,endX:W,pivot:ee}}E(Q);const se=wn(y.width,e,Q.startX),we=wn(y.width,e,Q.endX);se!==we&&p({minimum:Math.min(se,we),maximum:Math.max(se,we)})},[e,v,y,R,l,b,p]),j=z.useCallback(()=>{if(T(void 0),!!v){if(v.startX!==v.endX){const F=wn(y.width,e,v.startX),ee=wn(y.width,e,v.endX);p({minimum:Math.min(F,ee),maximum:Math.max(F,ee)})}else{const F=wn(y.width,e,v.startX),ee=R==null?void 0:R.findLast(ve=>ve.startTime<=F);ee&&l(ee),p(void 0)}E(void 0)}},[e,v,y,R,p,l]),ie=z.useCallback(F=>{if(!b.current)return;const ee=F.clientX-b.current.getBoundingClientRect().left,ve=wn(y.width,e,ee),H=R==null?void 0:R.findLast(Q=>Q.startTime<=ve);T({x:ee,clientY:F.clientY,action:H,sdkLanguage:m})},[e,y,R,b,m]),le=z.useCallback(()=>{T(void 0)},[]),I=z.useCallback(()=>{p(void 0)},[p]);return S.jsxs("div",{className:"timeline-view-container",children:[!!v&&S.jsx(u0,{cursor:(v==null?void 0:v.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:j,onPaneMouseMove:q,onPaneDoubleClick:I}),S.jsxs("div",{ref:b,className:"timeline-view",onMouseDown:Z,onMouseMove:ie,onMouseLeave:le,children:[S.jsx("div",{className:"timeline-grid",children:k.map((F,ee)=>S.jsx("div",{className:"timeline-divider",style:{left:F.position+"px"},children:S.jsx("div",{className:"timeline-time",children:xt(F.time-e.minimum)})},ee))}),S.jsx("div",{style:{height:8}}),S.jsx(GN,{boundaries:e,previewPoint:x}),S.jsx("div",{className:"timeline-bars",children:G.filter(F=>!F.action||F.action.class!=="Test").map((F,ee)=>S.jsx("div",{className:Ke("timeline-bar",F.action&&"action",F.resource&&"network",F.consoleMessage&&"console-message",F.active&&"active",F.error&&"error"),style:{left:F.leftPosition,width:Math.max(5,F.rightPosition-F.leftPosition),top:PN(F),bottom:0}},ee))}),S.jsx("div",{className:"timeline-marker",style:{display:x!==void 0?"block":"none",left:((x==null?void 0:x.x)||0)+"px"}}),d&&S.jsxs("div",{className:"timeline-window",children:[S.jsx("div",{className:"timeline-window-curtain left",style:{width:$}}),S.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),S.jsx("div",{className:"timeline-window-center",children:S.jsx("div",{className:"timeline-window-drag"})}),S.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),S.jsx("div",{className:"timeline-window-curtain right",style:{width:V}})]})]})]})};function XN(n,e){let s=n/64;const l=e.maximum-e.minimum,o=n/l;let u=l/s;const f=Math.ceil(Math.log(u)/Math.LN10);u=Math.pow(10,f),u*o>=320&&(u=u/5),u*o>=128&&(u=u/2);const d=e.minimum;let p=e.maximum;p+=64/o,s=Math.ceil((p-d)/u),u||(s=0);const m=[];for(let y=0;y<s;++y){const b=d+u*y;m.push({position:tn(n,e,b),time:b})}return m}function tn(n,e,i){return(i-e.minimum)/(e.maximum-e.minimum)*n}function wn(n,e,i){return i/n*(e.maximum-e.minimum)+e.minimum}function PN(n){return n.resource?25:20}const FN=({model:n})=>{var i,s;if(!n)return S.jsx(S.Fragment,{});const e=n.wallTime!==void 0?new Date(n.wallTime).toLocaleString(void 0,{timeZoneName:"short"}):void 0;return S.jsxs("div",{style:{flex:"auto",display:"block",overflow:"hidden auto"},children:[S.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!e&&S.jsxs("div",{className:"call-line",children:["start time:",S.jsx("span",{className:"call-value datetime",title:e,children:e})]}),S.jsxs("div",{className:"call-line",children:["duration:",S.jsx("span",{className:"call-value number",title:xt(n.endTime-n.startTime),children:xt(n.endTime-n.startTime)})]}),S.jsx("div",{className:"call-section",children:"Browser"}),S.jsxs("div",{className:"call-line",children:["engine:",S.jsx("span",{className:"call-value string",title:n.browserName,children:n.browserName})]}),n.channel&&S.jsxs("div",{className:"call-line",children:["channel:",S.jsx("span",{className:"call-value string",title:n.channel,children:n.channel})]}),n.platform&&S.jsxs("div",{className:"call-line",children:["platform:",S.jsx("span",{className:"call-value string",title:n.platform,children:n.platform})]}),n.playwrightVersion&&S.jsxs("div",{className:"call-line",children:["playwright version:",S.jsx("span",{className:"call-value string",title:n.playwrightVersion,children:n.playwrightVersion})]}),n.options.userAgent&&S.jsxs("div",{className:"call-line",children:["user agent:",S.jsx("span",{className:"call-value datetime",title:n.options.userAgent,children:n.options.userAgent})]}),n.options.baseURL&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),S.jsxs("div",{className:"call-line",children:["baseURL:",S.jsx("a",{className:"call-value string",href:n.options.baseURL,title:n.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:n.options.baseURL})]})]}),S.jsx("div",{className:"call-section",children:"Viewport"}),n.options.viewport&&S.jsxs("div",{className:"call-line",children:["width:",S.jsx("span",{className:"call-value number",title:String(!!((i=n.options.viewport)!=null&&i.width)),children:n.options.viewport.width})]}),n.options.viewport&&S.jsxs("div",{className:"call-line",children:["height:",S.jsx("span",{className:"call-value number",title:String(!!((s=n.options.viewport)!=null&&s.height)),children:n.options.viewport.height})]}),S.jsxs("div",{className:"call-line",children:["is mobile:",S.jsx("span",{className:"call-value boolean",title:String(!!n.options.isMobile),children:String(!!n.options.isMobile)})]}),n.options.deviceScaleFactor&&S.jsxs("div",{className:"call-line",children:["device scale:",S.jsx("span",{className:"call-value number",title:String(n.options.deviceScaleFactor),children:String(n.options.deviceScaleFactor)})]}),S.jsx("div",{className:"call-section",children:"Counts"}),S.jsxs("div",{className:"call-line",children:["pages:",S.jsx("span",{className:"call-value number",children:n.pages.length})]}),S.jsxs("div",{className:"call-line",children:["actions:",S.jsx("span",{className:"call-value number",children:n.actions.length})]}),S.jsxs("div",{className:"call-line",children:["events:",S.jsx("span",{className:"call-value number",children:n.events.length})]})]})},QN=({annotations:n})=>n.length?S.jsx("div",{className:"annotations-tab",children:n.map((e,i)=>S.jsxs("div",{className:"annotation-item",children:[S.jsx("span",{style:{fontWeight:"bold"},children:e.type}),e.description&&S.jsxs("span",{children:[": ",d0(e.description)]})]},`annotation-${i}`))}):S.jsx(cs,{text:"No annotations"}),ZN=({sdkLanguage:n,isInspecting:e,setIsInspecting:i,highlightedElement:s,setHighlightedElement:l})=>{const[o,u]=z.useState(),f=z.useCallback(d=>{const{errors:p}=Yh(gS,d,{prettyErrors:!1}),m=p.map(y=>({message:y.message,line:y.range[1].line,column:y.range[1].col,type:"subtle-error"}));u(m),l({...s,ariaSnapshot:d,lastEdited:"ariaSnapshot"}),i(!1)},[s,l,i]);return S.jsxs("div",{style:{flex:"auto",backgroundColor:"var(--vscode-sideBar-background)",padding:"0 10px 10px 10px",overflow:"auto"},children:[S.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[S.jsx("div",{children:"Locator"}),S.jsx(Lt,{style:{margin:"0 4px"},title:"Pick locator",icon:"target",toggled:e,onClick:()=>i(!e)}),S.jsx("div",{style:{flex:"auto"}}),S.jsx(Lt,{icon:"files",title:"Copy locator",onClick:()=>{xy(s.locator||"")}})]}),S.jsx("div",{style:{height:50},children:S.jsx(vr,{text:s.locator||"",highlighter:n,isFocused:!0,wrapLines:!0,onChange:d=>{l({...s,locator:d,lastEdited:"locator"}),i(!1)}})}),S.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[S.jsx("div",{style:{flex:"auto"},children:"Aria snapshot"}),S.jsx(Lt,{icon:"files",title:"Copy snapshot",onClick:()=>{xy(s.ariaSnapshot||"")}})]}),S.jsx("div",{style:{height:150},children:S.jsx(vr,{text:s.ariaSnapshot||"",highlighter:"yaml",wrapLines:!1,highlight:o,onChange:f})})]})},JN=({className:n,style:e,open:i,isModal:s,minWidth:l,verticalOffset:o,requestClose:u,anchor:f,dataTestId:d,children:p})=>{const m=z.useRef(null),[y,b]=z.useState(0),[v]=mh(m),[E,x]=mh(f),T=WN(v,E,o);return z.useEffect(()=>{const C=$=>{!m.current||!($.target instanceof Node)||m.current.contains($.target)||u==null||u()},k=$=>{$.key==="Escape"&&(u==null||u())};return i?(document.addEventListener("mousedown",C),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",k)}):()=>{}},[i,u]),z.useLayoutEffect(()=>x(),[i,x]),z.useEffect(()=>{const C=()=>b(k=>k+1);return window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}},[]),z.useLayoutEffect(()=>{m.current&&(i?s?m.current.showModal():m.current.show():m.current.close())},[i,s]),S.jsx("dialog",{ref:m,style:{position:"fixed",margin:0,zIndex:110,top:T.top,left:T.left,minWidth:l||0,...e},className:n,"data-testid":d,children:p})};function WN(n,e,i=4,s=4){let l=Math.max(s,e.left);l+n.width>window.innerWidth-s&&(l=window.innerWidth-n.width-s);let o=Math.max(0,e.bottom)+i;return o+n.height>window.innerHeight-i&&(Math.max(0,e.top)>n.height+i?o=Math.max(0,e.top)-n.height-i:o=window.innerHeight-i-n.height),{left:l,top:o}}const e2=({title:n,icon:e,buttonChildren:i,anchorRef:s,dialogDataTestId:l,children:o})=>{const u=z.useRef(null),f=s??u,[d,p]=z.useState(!1);return S.jsxs(S.Fragment,{children:[S.jsx(Lt,{ref:u,icon:e,title:n,onClick:()=>p(m=>!m),children:i}),S.jsx(JN,{style:{backgroundColor:"var(--vscode-sideBar-background)",padding:"4px 8px"},open:d,verticalOffset:8,requestClose:()=>p(!1),anchor:f,dataTestId:l,children:o})]})},xS=({settings:n})=>S.jsx("div",{className:"vbox settings-view",children:n.map(e=>{const i=`setting-${e.name.replaceAll(/\s+/g,"-")}`;return S.jsx("div",{className:`setting setting-${e.type}`,title:e.title,children:t2(e,i)},e.name)})}),t2=(n,e)=>{switch(n.type){case"check":return S.jsxs(S.Fragment,{children:[S.jsx("input",{type:"checkbox",id:e,checked:n.value,onChange:()=>n.set(!n.value)}),S.jsxs("label",{htmlFor:e,children:[n.name,!!n.count&&S.jsx("span",{className:"setting-counter",children:n.count})]})]});case"select":return S.jsxs(S.Fragment,{children:[S.jsxs("label",{htmlFor:e,children:[n.name,":",!!n.count&&S.jsx("span",{className:"setting-counter",children:n.count})]}),S.jsx("select",{id:e,value:n.value,onChange:i=>n.set(i.target.value),children:n.options.map(i=>S.jsx("option",{value:i.value,children:i.label},i.value))})]});default:return null}},h2=n=>{var i;const e=((i=n.model)==null?void 0:i.traceUrl)??"default";return S.jsx(p0.Provider,{value:n.model,children:S.jsx(n2,{partition:e,...n})})},n2=n=>{var dl;const{partition:e,model:i,showSourcesFirst:s,rootDir:l,fallbackLocation:o,isLive:u,hideTimeline:f,status:d,annotations:p,inert:m,onOpenExternally:y,revealSource:b,testRunMetadata:v}=n,[E,x]=sn("navigatorTab","actions"),[T,C]=sn("propertiesTab",s?"source":"call"),[k,$]=sn("propertiesSidebarLocation","bottom"),[V]=sn("actionsFilter",[]),[R,G]=wi("selectedCallId"),[Z,q]=wi("selectedTime"),[j,ie]=wi("highlightedCallId"),[le,I]=wi("revealedErrorKey"),[F,ee]=wi("highlightedConsoleMessageOrdinal"),[ve,H]=wi("revealedAttachmentCallId"),[Q,se]=wi("highlightedResourceOrdinal"),[we,N]=wi("treeState",{expandedItems:new Map});Iw(e);const[P,W]=z.useState({lastEdited:"none"}),[J,ae]=z.useState(!1),be=z.useCallback(ce=>{G(ce==null?void 0:ce.callId),I(void 0)},[G,I]),te=z.useMemo(()=>i==null?void 0:i.filteredActions(V),[i,V]),mt=((i==null?void 0:i.actions.length)??0)-((te==null?void 0:te.length)??0),Ae=z.useMemo(()=>te==null?void 0:te.find(ce=>ce.callId===j),[te,j]),Vt=z.useCallback(ce=>{ie(ce==null?void 0:ce.callId)},[ie]),Rr=z.useMemo(()=>(i==null?void 0:i.sources)||new Map,[i]);z.useEffect(()=>{q(void 0),I(void 0)},[i,q,I]);const En=z.useMemo(()=>{if(R){const Zn=te==null?void 0:te.find(cn=>cn.callId===R);if(Zn)return Zn}const ce=i==null?void 0:i.failedAction();if(ce)return ce;if(te!=null&&te.length){let Zn=te.length-1;for(let cn=0;cn<te.length;++cn)if(te[cn].title==="After Hooks"&&cn){Zn=cn-1;break}return te[Zn]}},[i,te,R]),on=z.useMemo(()=>Ae||En,[En,Ae]),hs=z.useCallback(ce=>{be(ce),Vt(void 0)},[be,Vt]),yt=z.useCallback(ce=>{C(ce),ce!=="inspector"&&ae(!1)},[C]),fl=z.useCallback(ce=>{!J&&ce&&yt("inspector"),ae(ce)},[ae,yt,J]),Mc=z.useCallback(ce=>{W(ce),yt("inspector")},[yt]),Gt=z.useCallback(ce=>{yt("attachments"),H({callId:ce})},[yt,H]);z.useEffect(()=>{b&&yt("source")},[b,yt]);const jr=L_(i,Z),ds=rT(i,Z),Mi=k_(i),ps=z.useMemo(()=>{var ce;return le!==void 0?(ce=Mi.errors.get(le))==null?void 0:ce.stack:on==null?void 0:on.stack},[on,le,Mi]),Fn=(i==null?void 0:i.sdkLanguage)||"javascript",hl={id:"inspector",title:"Locator",render:()=>S.jsx(ZN,{sdkLanguage:Fn,isInspecting:J,setIsInspecting:fl,highlightedElement:P,setHighlightedElement:W})},Oc={id:"call",title:"Call",render:()=>S.jsx(Zx,{action:on,startTimeOffset:(i==null?void 0:i.startTime)??0,sdkLanguage:Fn})},Rc={id:"log",title:"Log",render:()=>S.jsx(e_,{action:on,isLive:u})},Oi={id:"errors",title:"Errors",errorCount:Mi.errors.size,render:()=>S.jsx(O_,{errorsModel:Mi,testRunMetadata:v,sdkLanguage:Fn,revealInSource:ce=>{ce.action?be(ce.action):I(ce.message),yt("source")},wallTime:(i==null?void 0:i.wallTime)??0})};let ut;!En&&o&&(ut=(dl=o.source)==null?void 0:dl.errors.length);const Kt={id:"source",title:"Source",errorCount:ut,render:()=>S.jsx(A_,{stack:ps,sources:Rr,rootDir:l,stackFrameLocation:k==="bottom"?"right":"bottom",fallbackLocation:o,onOpenExternally:y})},bt={id:"console",title:"Console",count:jr.entries.length,render:()=>S.jsx(D_,{consoleModel:jr,boundaries:Qn,selectedTime:Z,onAccepted:ce=>q({minimum:ce.timestamp,maximum:ce.timestamp}),onEntryHovered:ee})},jc={id:"network",title:"Network",count:ds.resources.length,render:()=>S.jsx(aT,{boundaries:Qn,networkModel:ds,onResourceHovered:se,sdkLanguage:(i==null?void 0:i.sdkLanguage)??"javascript"})},Lc={id:"attachments",title:"Attachments",count:i==null?void 0:i.visibleAttachments.length,render:()=>S.jsx(b_,{revealedAttachmentCallId:ve})},Ri=[hl,Oc,Rc,Oi,bt,jc,Kt,Lc];if(p!==void 0){const ce={id:"annotations",title:"Annotations",count:p.length,render:()=>S.jsx(QN,{annotations:p})};Ri.push(ce)}if(s){const ce=Ri.indexOf(Kt);Ri.splice(ce,1),Ri.splice(1,0,Kt)}const{boundaries:Qn}=z.useMemo(()=>{const ce={minimum:(i==null?void 0:i.startTime)||0,maximum:(i==null?void 0:i.endTime)||3e4};return ce.minimum>ce.maximum&&(ce.minimum=0,ce.maximum=3e4),ce.maximum+=(ce.maximum-ce.minimum)/20,{boundaries:ce}},[i]);let An=0;!u&&i&&i.endTime>=0?An=i.endTime-i.startTime:i&&i.wallTime&&(An=Date.now()-i.wallTime);const Nn={id:"actions",title:"Actions",component:S.jsxs("div",{className:"vbox",children:[d&&S.jsxs("div",{className:"workbench-run-status",children:[S.jsx("span",{className:Ke("codicon",o0(d))}),S.jsx("div",{children:Px(d)}),S.jsx("div",{className:"spacer"}),S.jsx("div",{className:"workbench-run-duration",children:An?xt(An):""})]}),S.jsx(Qx,{sdkLanguage:Fn,actions:te||[],selectedAction:i?En:void 0,selectedTime:Z,setSelectedTime:q,treeState:we,setTreeState:N,onSelected:hs,onHighlighted:Vt,revealActionAttachment:Gt,revealConsole:()=>yt("console"),isLive:u})]})},gs={id:"metadata",title:"Metadata",component:S.jsx(FN,{model:i})},ji=E==="actions"&&S.jsx(i2,{counters:i==null?void 0:i.actionCounters,hiddenActionsCount:mt});return S.jsxs("div",{className:"vbox workbench",...m?{inert:!0}:{},children:[!f&&S.jsx(YN,{model:i,consoleEntries:jr.entries,networkResources:ds.resources,boundaries:Qn,highlightedAction:Ae,highlightedResourceOrdinal:Q,highlightedConsoleEntryOrdinal:F,onSelected:hs,sdkLanguage:Fn,selectedTime:Z,setSelectedTime:q}),S.jsx(Qo,{sidebarSize:250,orientation:k==="bottom"?"vertical":"horizontal",settingName:"propertiesSidebar",main:S.jsx(Qo,{sidebarSize:250,orientation:"horizontal",sidebarIsFirst:!0,settingName:"actionListSidebar",main:S.jsx(DN,{action:on,model:i,sdkLanguage:Fn,testIdAttributeName:(i==null?void 0:i.testIdAttributeName)||"data-testid",isInspecting:J,setIsInspecting:fl,highlightedElement:P,setHighlightedElement:Mc}),sidebar:S.jsx(_h,{tabs:[Nn,gs],rightToolbar:[ji],selectedTab:E,setSelectedTab:x})}),sidebar:S.jsx(_h,{tabs:Ri,selectedTab:T,setSelectedTab:yt,rightToolbar:[k==="bottom"?S.jsx(Lt,{title:"Dock to right",icon:"layout-sidebar-right-off",onClick:()=>{$("right")}}):S.jsx(Lt,{title:"Dock to bottom",icon:"layout-panel-off",onClick:()=>{$("bottom")}})],mode:k==="bottom"?"default":"select"})})]})},i2=({counters:n,hiddenActionsCount:e})=>{const[i,s]=sn("actionsFilter",[]),l=z.useRef(null),o=S.jsxs(S.Fragment,{children:[e>0&&S.jsxs("span",{className:"workbench-actions-hidden-count",title:e+" actions hidden by filters",children:[e," hidden"]}),S.jsx("span",{ref:l,className:"codicon codicon-filter"})]});return S.jsx(e2,{title:"Filter actions",dialogDataTestId:"actions-filter-dialog",buttonChildren:o,anchorRef:l,children:S.jsx(xS,{settings:[{type:"check",value:i.includes("getter"),set:u=>s(u?[...i,"getter"]:i.filter(f=>f!=="getter")),name:"Getters",count:n==null?void 0:n.get("getter")},{type:"check",value:i.includes("route"),set:u=>s(u?[...i,"route"]:i.filter(f=>f!=="route")),name:"Network routes",count:n==null?void 0:n.get("route")},{type:"check",value:i.includes("configuration"),set:u=>s(u?[...i,"configuration"]:i.filter(f=>f!=="configuration")),name:"Configuration",count:n==null?void 0:n.get("configuration")}]})})};var Ab;(n=>{function e(i){for(const s of i.splice(0))s.dispose()}n.disposeAll=e})(Ab||(Ab={}));class ar{constructor(){this._listeners=new Set,this.event=(e,i)=>{this._listeners.add(e);let s=!1;const l=this,o={dispose(){s||(s=!0,l._listeners.delete(e))}};return i&&i.push(o),o}}fire(e){const i=!this._deliveryQueue;this._deliveryQueue||(this._deliveryQueue=[]);for(const s of this._listeners)this._deliveryQueue.push({listener:s,event:e});if(i){for(let s=0;s<this._deliveryQueue.length;s++){const{listener:l,event:o}=this._deliveryQueue[s];l.call(null,o)}this._deliveryQueue=void 0}}dispose(){this._listeners.clear(),this._deliveryQueue&&(this._deliveryQueue=[])}}class s2 extends Error{constructor(){super("Test server connection closed")}}class d2{constructor(e){this._ws=new WebSocket(e)}onmessage(e){this._ws.addEventListener("message",i=>e(i.data.toString()))}onopen(e){this._ws.addEventListener("open",e)}onerror(e){this._ws.addEventListener("error",e)}onclose(e){this._ws.addEventListener("close",e)}send(e){this._ws.send(e)}close(){this._ws.close()}}class p2{constructor(e){this._onCloseEmitter=new ar,this._onReportEmitter=new ar,this._onStdioEmitter=new ar,this._onTestFilesChangedEmitter=new ar,this._onLoadTraceRequestedEmitter=new ar,this._onTestPausedEmitter=new ar,this._lastId=0,this._callbacks=new Map,this._isClosed=!1,this.onClose=this._onCloseEmitter.event,this.onReport=this._onReportEmitter.event,this.onStdio=this._onStdioEmitter.event,this.onTestFilesChanged=this._onTestFilesChangedEmitter.event,this.onLoadTraceRequested=this._onLoadTraceRequestedEmitter.event,this.onTestPaused=this._onTestPausedEmitter.event,this._transport=e,this._transport.onmessage(s=>{const l=JSON.parse(s),{id:o,result:u,error:f,method:d,params:p}=l;if(o){const m=this._callbacks.get(o);if(!m)return;this._callbacks.delete(o),f?m.reject(new Error(f)):m.resolve(u)}else this._dispatchEvent(d,p)});const i=setInterval(()=>this._sendMessage("ping").catch(()=>{}),3e4);this._connectedPromise=new Promise((s,l)=>{this._transport.onopen(s),this._transport.onerror(l)}),this._transport.onclose(()=>{this._isClosed=!0,this._onCloseEmitter.fire(),clearInterval(i);for(const s of this._callbacks.values())s.reject(new s2);this._callbacks.clear()})}isClosed(){return this._isClosed}async _sendMessage(e,i){const s=globalThis.__logForTest;s==null||s({method:e,params:i}),await this._connectedPromise;const l=++this._lastId,o={id:l,method:e,params:i};return this._transport.send(JSON.stringify(o)),new Promise((u,f)=>{this._callbacks.set(l,{resolve:u,reject:f})})}_sendMessageNoReply(e,i){this._sendMessage(e,i).catch(()=>{})}_dispatchEvent(e,i){e==="report"?this._onReportEmitter.fire(i):e==="stdio"?this._onStdioEmitter.fire(i):e==="testFilesChanged"?this._onTestFilesChangedEmitter.fire(i):e==="loadTraceRequested"?this._onLoadTraceRequestedEmitter.fire(i):e==="testPaused"&&this._onTestPausedEmitter.fire(i)}async initialize(e){await this._sendMessage("initialize",e)}async ping(e){await this._sendMessage("ping",e)}async pingNoReply(e){this._sendMessageNoReply("ping",e)}async watch(e){await this._sendMessage("watch",e)}watchNoReply(e){this._sendMessageNoReply("watch",e)}async open(e){await this._sendMessage("open",e)}openNoReply(e){this._sendMessageNoReply("open",e)}async resizeTerminal(e){await this._sendMessage("resizeTerminal",e)}resizeTerminalNoReply(e){this._sendMessageNoReply("resizeTerminal",e)}async checkBrowsers(e){return await this._sendMessage("checkBrowsers",e)}async installBrowsers(e){await this._sendMessage("installBrowsers",e)}async runGlobalSetup(e){return await this._sendMessage("runGlobalSetup",e)}async runGlobalTeardown(e){return await this._sendMessage("runGlobalTeardown",e)}async startDevServer(e){return await this._sendMessage("startDevServer",e)}async stopDevServer(e){return await this._sendMessage("stopDevServer",e)}async clearCache(e){return await this._sendMessage("clearCache",e)}async listFiles(e){return await this._sendMessage("listFiles",e)}async listTests(e){return await this._sendMessage("listTests",e)}async runTests(e){return await this._sendMessage("runTests",e)}async findRelatedTestFiles(e){return await this._sendMessage("findRelatedTestFiles",e)}async stopTests(e){await this._sendMessage("stopTests",e)}stopTestsNoReply(e){this._sendMessageNoReply("stopTests",e)}async closeGracefully(e){await this._sendMessage("closeGracefully",e)}close(){try{this._transport.close()}catch{}}}const g2=({location:n})=>{const[e,i]=sn("shouldPopulateCanvasFromScreenshot",!1),[s,l]=Pw(),[o,u]=sn("mergeFiles",!1);return S.jsx(xS,{settings:[{type:"select",value:s,set:l,name:"Theme",options:Yw},...n==="ui-mode"?[{type:"check",value:o,set:u,name:"Merge files"}]:[],{type:"check",value:e,set:i,name:"Display canvas content",title:"Attempt to display the captured canvas appearance in the snapshot preview. May not be accurate."}]})};export{e2 as D,h0 as E,ot as R,Qo as S,u2 as T,d2 as W,c_ as _,p2 as a,g2 as b,h2 as c,JN as d,a2 as e,c2 as f,Xw as g,l2 as h,o2 as i,S as j,Ke as k,Yx as l,xt as m,Kh as n,Lt as o,sn as p,xS as q,z as r,es as s,o0 as t,os as u,Uw as v};
266
+ `,i)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const i=Lo(e),s=rr(i);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const i=Lo(e),s=rr(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,i){return this.type!=="comment"||this.indent<=i?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function dS(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new fS||null,prettyErrors:e}}function RN(n,e={}){const{lineCounter:i,prettyErrors:s}=dS(e),l=new Md(i==null?void 0:i.addNewLine),o=new kd(e),u=Array.from(o.compose(l.parse(n)));if(s&&i)for(const f of u)f.errors.forEach(lc(n,i)),f.warnings.forEach(lc(n,i));return u.length>0?u:Object.assign([],{empty:!0},o.streamInfo())}function pS(n,e={}){const{lineCounter:i,prettyErrors:s}=dS(e),l=new Md(i==null?void 0:i.addNewLine),o=new kd(e);let u=null;for(const f of o.compose(l.parse(n),!0,n.length))if(!u)u=f;else if(u.options.logLevel!=="silent"){u.errors.push(new rs(f.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&i&&(u.errors.forEach(lc(n,i)),u.warnings.forEach(lc(n,i))),u}function jN(n,e,i){let s;typeof e=="function"?s=e:i===void 0&&e&&typeof e=="object"&&(i=e);const l=pS(n,i);if(!l)return null;if(l.warnings.forEach(o=>Lv(l.options.logLevel,o)),l.errors.length>0){if(l.options.logLevel!=="silent")throw l.errors[0];l.errors=[]}return l.toJS(Object.assign({reviver:s},i))}function LN(n,e,i){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:i===void 0&&e&&(i=e),typeof i=="string"&&(i=i.length),typeof i=="number"){const l=Math.round(i);i=l<1?void 0:l>8?{indent:8}:{indent:l}}if(n===void 0){const{keepUndefined:l}=i??e??{};if(!l)return}return fs(n)&&!s?n.toString(i):new Or(n,s,i).toString(i)}const gS=Object.freeze(Object.defineProperty({__proto__:null,Alias:yc,CST:kN,Composer:kd,Document:Or,Lexer:uS,LineCounter:fS,Pair:gt,Parser:Md,Scalar:he,Schema:Ac,YAMLError:Nd,YAMLMap:It,YAMLParseError:rs,YAMLSeq:Ni,YAMLWarning:Wv,isAlias:us,isCollection:ze,isDocument:fs,isMap:Nr,isNode:He,isPair:De,isScalar:Oe,isSeq:Cr,parse:jN,parseAllDocuments:RN,parseDocument:pS,stringify:LN,visit:Ai,visitAsync:mc},Symbol.toStringTag,{value:"Module"})),DN=({action:n,model:e,sdkLanguage:i,testIdAttributeName:s,isInspecting:l,setIsInspecting:o,highlightedElement:u,setHighlightedElement:f})=>{const[d,p]=z.useState("action"),[m]=sn("shouldPopulateCanvasFromScreenshot",!1),y=z.useMemo(()=>HN(n),[n]),{snapshotInfoUrl:b,snapshotUrl:v,popoutUrl:E}=z.useMemo(()=>{const T=y[d];return e&&T?qN(e.traceUrl,T,m):{snapshotInfoUrl:void 0,snapshotUrl:void 0,popoutUrl:void 0}},[y,d,m,e]),x=z.useMemo(()=>b!==void 0?{snapshotInfoUrl:b,snapshotUrl:v,popoutUrl:E}:void 0,[b,v,E]);return S.jsxs("div",{className:"snapshot-tab vbox",children:[S.jsxs(Kh,{children:[S.jsx(Lt,{className:"pick-locator",title:"Pick locator",icon:"target",toggled:l,onClick:()=>o(!l)}),S.jsx("div",{className:"hbox",style:{height:"100%"},role:"tablist",children:["action","before","after"].map(T=>S.jsx(y0,{id:T,title:zN(T),selected:d===T,onSelect:()=>p(T)},T))}),S.jsx("div",{style:{flex:"auto"}}),S.jsx(Lt,{icon:"link-external",title:"Open snapshot in a new tab",disabled:!(x!=null&&x.popoutUrl),onClick:()=>{const T=window.open((x==null?void 0:x.popoutUrl)||"","_blank");T==null||T.addEventListener("DOMContentLoaded",()=>{new yv(T,{isUnderTest:yS,sdkLanguage:i,testIdAttributeName:s,stableRafCount:1,browserName:"chromium",customEngines:[]}).consoleApi.install()})}})]}),S.jsx(BN,{snapshotUrls:x,sdkLanguage:i,testIdAttributeName:s,isInspecting:l,setIsInspecting:o,highlightedElement:u,setHighlightedElement:f})]})},BN=({snapshotUrls:n,sdkLanguage:e,testIdAttributeName:i,isInspecting:s,setIsInspecting:l,highlightedElement:o,setHighlightedElement:u})=>{const f=z.useRef(null),d=z.useRef(null),[p,m]=z.useState({viewport:bS,url:""}),y=z.useRef({iteration:0,visibleIframe:0});return z.useEffect(()=>{(async()=>{const b=y.current.iteration+1,v=1-y.current.visibleIframe;y.current.iteration=b;const E=await $N(n==null?void 0:n.snapshotInfoUrl);if(y.current.iteration!==b)return;const x=[f,d][v].current;if(x){let T=()=>{};const C=new Promise(k=>T=k);try{x.addEventListener("load",T),x.addEventListener("error",T);const k=(n==null?void 0:n.snapshotUrl)||IN;x.contentWindow?x.contentWindow.location.replace(k):x.src=k,await C}catch{}finally{x.removeEventListener("load",T),x.removeEventListener("error",T)}}y.current.iteration===b&&(y.current.visibleIframe=v,m(E))})()},[n]),S.jsxs("div",{className:"vbox",tabIndex:0,onKeyDown:b=>{b.key==="Escape"&&s&&l(!1)},children:[S.jsx(Eb,{isInspecting:s,sdkLanguage:e,testIdAttributeName:i,highlightedElement:o,setHighlightedElement:u,iframe:f.current,iteration:y.current.iteration}),S.jsx(Eb,{isInspecting:s,sdkLanguage:e,testIdAttributeName:i,highlightedElement:o,setHighlightedElement:u,iframe:d.current,iteration:y.current.iteration}),S.jsx(UN,{snapshotInfo:p,children:S.jsxs("div",{className:"snapshot-switcher",children:[S.jsx("iframe",{ref:f,name:"snapshot",title:"DOM Snapshot",className:Ke(y.current.visibleIframe===0&&"snapshot-visible")}),S.jsx("iframe",{ref:d,name:"snapshot",title:"DOM Snapshot",className:Ke(y.current.visibleIframe===1&&"snapshot-visible")})]})})]})},UN=({snapshotInfo:n,children:e})=>{const[i,s]=os(),l=40,o={width:n.viewport.width,height:n.viewport.height},u={width:Math.max(o.width,480),height:Math.max(o.height+l,320)},f=Math.min(i.width/u.width,i.height/u.height,1),d={x:(i.width-u.width)/2,y:(i.height-u.height)/2};return S.jsx("div",{ref:s,className:"snapshot-wrapper",children:S.jsxs("div",{className:"snapshot-container",style:{width:u.width+"px",height:u.height+"px",transform:`translate(${d.x}px, ${d.y}px) scale(${f})`},children:[S.jsx(EA,{url:n.url}),S.jsx("div",{className:"snapshot-browser-body",children:S.jsx("div",{style:{width:o.width+"px",height:o.height+"px"},children:e})})]})})};function zN(n){return n==="before"?"Before":n==="after"?"After":n==="action"?"Action":n}const Eb=({iframe:n,isInspecting:e,sdkLanguage:i,testIdAttributeName:s,highlightedElement:l,setHighlightedElement:o,iteration:u})=>(z.useEffect(()=>{const f=l.lastEdited==="ariaSnapshot"?l.ariaSnapshot:void 0,d=l.lastEdited==="locator"?l.locator:void 0,p=!!f||!!d||e,m=[],y=new URLSearchParams(window.location.search).get("isUnderTest")==="true";try{mS(m,p,i,s,y,"",n==null?void 0:n.contentWindow)}catch{}const b=f?Yh(gS,f):void 0,v=d?_A(i,d,s):void 0;for(const{recorder:E,frameSelector:x}of m){const T=v!=null&&v.startsWith(x)?v.substring(x.length).trim():void 0,C=(b==null?void 0:b.errors.length)===0?b.fragment:void 0;E.setUIState({mode:e?"inspecting":"none",actionSelector:T,ariaTemplate:C,language:i,testIdAttributeName:s,overlay:{offsetX:0}},{async elementPicked(k){o({locator:_i(i,x+k.selector),ariaSnapshot:k.ariaSnapshot,lastEdited:"none"})},highlightUpdated(){for(const k of m)k.recorder!==E&&k.recorder.clearHighlight()}})}},[n,e,l,o,i,s,u]),S.jsx(S.Fragment,{}));function mS(n,e,i,s,l,o,u){if(!u)return;const f=u;if(!f._recorder&&e){const d=new yv(u,{isUnderTest:l,sdkLanguage:i,testIdAttributeName:s,stableRafCount:1,browserName:"chromium",customEngines:[]}),p=new yA(d);f._injectedScript=d,f._recorder={recorder:p,frameSelector:o},l&&(window._weakRecordersForTest=window._weakRecordersForTest||new Set,window._weakRecordersForTest.add(new WeakRef(p)))}f._recorder&&n.push(f._recorder);for(let d=0;d<u.frames.length;++d){const p=u.frames[d],m=p.frameElement?f._injectedScript.generateSelectorSimple(p.frameElement,{omitInternalEngines:!0,testIdAttributeName:s})+" >> internal:control=enter-frame >> ":"";mS(n,e,i,s,l,o+m,p)}}const za=(n,e,i=!1)=>{if(!n)return;const s=n[e];if(s){if(!n.pageId){console.error("snapshot action must have a pageId");return}return{action:n,snapshotName:s,pageId:n.pageId,point:n.point,hasInputTarget:i}}};function HN(n){if(!n)return{};let e=za(n,"beforeSnapshot");if(!e){for(let l=Ry(n);l;l=Ry(l))if(l.endTime<=n.startTime&&l.afterSnapshot){e=za(l,"afterSnapshot");break}}let i=za(n,"afterSnapshot");if(!i){let l;for(let o=jy(n);o&&o.startTime<=n.endTime;o=jy(o))o.endTime>n.endTime||!o.afterSnapshot||l&&l.endTime>o.endTime||(l=o);l?i=za(l,"afterSnapshot"):i=e}const s=za(n,"inputSnapshot",!0)??i;return s&&(s.point=n.point),{action:s,before:e,after:i}}const yS=new URLSearchParams(window.location.search).has("isUnderTest");function qN(n,e,i){const s=new URLSearchParams;s.set("trace",n),s.set("name",e.snapshotName),yS&&s.set("isUnderTest","true"),e.point&&(s.set("pointX",String(e.point.x)),s.set("pointY",String(e.point.y)),e.hasInputTarget&&s.set("hasInputTarget","1")),i&&s.set("shouldPopulateCanvasFromScreenshot","1");const l=new URL(`snapshot/${e.pageId}?${s.toString()}`,window.location.href).toString(),o=new URL(`snapshotInfo/${e.pageId}?${s.toString()}`,window.location.href).toString(),u=new URLSearchParams;u.set("r",l),u.set("trace",n);const f=new URL(`snapshot.html?${u.toString()}`,window.location.href).toString();return{snapshotInfoUrl:o,snapshotUrl:l,popoutUrl:f}}async function $N(n){const e={url:"",viewport:bS,timestamp:void 0,wallTime:void 0};if(n){const s=await(await fetch(n)).json();s.error||(e.url=s.url,e.viewport=s.viewport,e.timestamp=s.timestamp,e.wallTime=s.wallTime)}return e}const bS={width:1280,height:720},IN='data:text/html,<body style="background: #ddd"></body>',vS={width:200,height:45},cr=2.5,VN=vS.height+cr*2,GN=({boundaries:n,previewPoint:e})=>{var m,y;const i=Ci(),[s,l]=os(),o=z.useRef(null);let u=0;if(o.current&&e){const b=o.current.getBoundingClientRect();u=(e.clientY-b.top+o.current.scrollTop)/VN|0}const f=(y=(m=i==null?void 0:i.pages)==null?void 0:m[u])==null?void 0:y.screencastFrames;let d,p;if(e!==void 0&&f&&f.length){const b=n.minimum+(n.maximum-n.minimum)*e.x/s.width;d=f[Nb(f,b,SS)-1];const v={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};p=d?wS({width:d.width,height:d.height},v):void 0}return S.jsxs("div",{className:"film-strip",ref:l,children:[S.jsx("div",{className:"film-strip-lanes",ref:o,children:i==null?void 0:i.pages.map((b,v)=>b.screencastFrames.length?S.jsx(KN,{boundaries:n,page:b,width:s.width},v):null)}),i&&(e==null?void 0:e.x)!==void 0&&S.jsxs("div",{className:"film-strip-hover",style:{top:s.bottom+5,left:Math.min(e.x,s.width-(p?p.width:0)-10)},children:[e.action&&S.jsx("div",{className:"film-strip-hover-title",children:Vh(e.action,e)}),d&&p&&S.jsx("div",{style:{width:p.width,height:p.height},children:S.jsx("img",{src:i.createRelativeUrl(`sha1/${d.sha1}`),width:p.width,height:p.height})})]})]})},KN=({boundaries:n,page:e,width:i})=>{const s=Ci(),l={width:0,height:0},o=e.screencastFrames;for(const T of o)l.width=Math.max(l.width,T.width),l.height=Math.max(l.height,T.height);const u=wS(l,vS),f=o[0].timestamp,d=o[o.length-1].timestamp,p=n.maximum-n.minimum,m=(f-n.minimum)/p*i,y=(n.maximum-d)/p*i,v=(d-f)/p*i/(u.width+2*cr)|0,E=(d-f)/v,x=[];for(let T=0;f&&E&&T<v;++T){const C=f+E*T,k=Nb(o,C,SS)-1;x.push(S.jsx("div",{className:"film-strip-frame",style:{width:u.width,height:u.height,backgroundImage:`url(${s==null?void 0:s.createRelativeUrl("sha1/"+o[k].sha1)})`,backgroundSize:`${u.width}px ${u.height}px`,margin:cr,marginRight:cr}},T))}return x.push(S.jsx("div",{className:"film-strip-frame",style:{width:u.width,height:u.height,backgroundImage:`url(${s==null?void 0:s.createRelativeUrl("sha1/"+o[o.length-1].sha1)})`,backgroundSize:`${u.width}px ${u.height}px`,margin:cr,marginRight:cr}},x.length)),S.jsx("div",{className:"film-strip-lane",style:{marginLeft:m+"px",marginRight:y+"px"},children:x})};function SS(n,e){return n-e.timestamp}function wS(n,e){const i=Math.max(n.width/e.width,n.height/e.height);return{width:n.width/i|0,height:n.height/i|0}}const YN=({model:n,boundaries:e,consoleEntries:i,networkResources:s,onSelected:l,highlightedAction:o,highlightedResourceOrdinal:u,highlightedConsoleEntryOrdinal:f,selectedTime:d,setSelectedTime:p,sdkLanguage:m})=>{const[y,b]=os(),[v,E]=z.useState(),[x,T]=z.useState(),[C]=sn("actionsFilter",[]),{offsets:k,curtainLeft:$,curtainRight:V}=z.useMemo(()=>{let F=d||e;if(v&&v.startX!==v.endX){const Q=wn(y.width,e,v.startX),se=wn(y.width,e,v.endX);F={minimum:Math.min(Q,se),maximum:Math.max(Q,se)}}const ee=tn(y.width,e,F.minimum),H=tn(y.width,e,e.maximum)-tn(y.width,e,F.maximum);return{offsets:XN(y.width,e),curtainLeft:ee,curtainRight:H}},[d,e,v,y]),R=z.useMemo(()=>n==null?void 0:n.filteredActions(C),[n,C]),G=z.useMemo(()=>{const F=[];for(const ee of R||[])F.push({action:ee,leftTime:ee.startTime,rightTime:ee.endTime||e.maximum,leftPosition:tn(y.width,e,ee.startTime),rightPosition:tn(y.width,e,ee.endTime||e.maximum),active:!1,error:!!ee.error});for(const ee of(n==null?void 0:n.resources)||[]){const ve=ee._monotonicTime,H=ee._monotonicTime+ee.time;F.push({resource:ee,leftTime:ve,rightTime:H,leftPosition:tn(y.width,e,ve),rightPosition:tn(y.width,e,H),active:!1,error:!1})}for(const ee of i||[])F.push({consoleMessage:ee,leftTime:ee.timestamp,rightTime:ee.timestamp,leftPosition:tn(y.width,e,ee.timestamp),rightPosition:tn(y.width,e,ee.timestamp),active:!1,error:ee.isError});return F},[n,R,i,e,y]);z.useMemo(()=>{for(const F of G)o?F.active=F.action===o:u!==void 0?F.active=F.resource===(s==null?void 0:s[u]):f!==void 0?F.active=F.consoleMessage===(i==null?void 0:i[f]):F.active=!1},[G,o,u,f,i,s]);const Z=z.useCallback(F=>{if(T(void 0),!b.current)return;const ee=F.clientX-b.current.getBoundingClientRect().left,ve=wn(y.width,e,ee),H=d?tn(y.width,e,d.minimum):0,Q=d?tn(y.width,e,d.maximum):0;d&&Math.abs(ee-H)<10?E({startX:Q,endX:ee,type:"resize"}):d&&Math.abs(ee-Q)<10?E({startX:H,endX:ee,type:"resize"}):d&&ve>d.minimum&&ve<d.maximum&&F.clientY-b.current.getBoundingClientRect().top<20?E({startX:H,endX:Q,pivot:ee,type:"move"}):E({startX:ee,endX:ee,type:"resize"})},[e,y,b,d]),q=z.useCallback(F=>{if(!b.current)return;const ee=F.clientX-b.current.getBoundingClientRect().left,ve=wn(y.width,e,ee),H=R==null?void 0:R.findLast(N=>N.startTime<=ve);if(!F.buttons){E(void 0);return}if(H&&l(H),!v)return;let Q=v;if(v.type==="resize")Q={...v,endX:ee};else{const N=ee-v.pivot;let P=v.startX+N,W=v.endX+N;P<0&&(P=0,W=P+(v.endX-v.startX)),W>y.width&&(W=y.width,P=W-(v.endX-v.startX)),Q={...v,startX:P,endX:W,pivot:ee}}E(Q);const se=wn(y.width,e,Q.startX),we=wn(y.width,e,Q.endX);se!==we&&p({minimum:Math.min(se,we),maximum:Math.max(se,we)})},[e,v,y,R,l,b,p]),j=z.useCallback(()=>{if(T(void 0),!!v){if(v.startX!==v.endX){const F=wn(y.width,e,v.startX),ee=wn(y.width,e,v.endX);p({minimum:Math.min(F,ee),maximum:Math.max(F,ee)})}else{const F=wn(y.width,e,v.startX),ee=R==null?void 0:R.findLast(ve=>ve.startTime<=F);ee&&l(ee),p(void 0)}E(void 0)}},[e,v,y,R,p,l]),ie=z.useCallback(F=>{if(!b.current)return;const ee=F.clientX-b.current.getBoundingClientRect().left,ve=wn(y.width,e,ee),H=R==null?void 0:R.findLast(Q=>Q.startTime<=ve);T({x:ee,clientY:F.clientY,action:H,sdkLanguage:m})},[e,y,R,b,m]),le=z.useCallback(()=>{T(void 0)},[]),I=z.useCallback(()=>{p(void 0)},[p]);return S.jsxs("div",{className:"timeline-view-container",children:[!!v&&S.jsx(u0,{cursor:(v==null?void 0:v.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:j,onPaneMouseMove:q,onPaneDoubleClick:I}),S.jsxs("div",{ref:b,className:"timeline-view",onMouseDown:Z,onMouseMove:ie,onMouseLeave:le,children:[S.jsx("div",{className:"timeline-grid",children:k.map((F,ee)=>S.jsx("div",{className:"timeline-divider",style:{left:F.position+"px"},children:S.jsx("div",{className:"timeline-time",children:xt(F.time-e.minimum)})},ee))}),S.jsx("div",{style:{height:8}}),S.jsx(GN,{boundaries:e,previewPoint:x}),S.jsx("div",{className:"timeline-bars",children:G.filter(F=>!F.action||F.action.class!=="Test").map((F,ee)=>S.jsx("div",{className:Ke("timeline-bar",F.action&&"action",F.resource&&"network",F.consoleMessage&&"console-message",F.active&&"active",F.error&&"error"),style:{left:F.leftPosition,width:Math.max(5,F.rightPosition-F.leftPosition),top:PN(F),bottom:0}},ee))}),S.jsx("div",{className:"timeline-marker",style:{display:x!==void 0?"block":"none",left:((x==null?void 0:x.x)||0)+"px"}}),d&&S.jsxs("div",{className:"timeline-window",children:[S.jsx("div",{className:"timeline-window-curtain left",style:{width:$}}),S.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),S.jsx("div",{className:"timeline-window-center",children:S.jsx("div",{className:"timeline-window-drag"})}),S.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),S.jsx("div",{className:"timeline-window-curtain right",style:{width:V}})]})]})]})};function XN(n,e){let s=n/64;const l=e.maximum-e.minimum,o=n/l;let u=l/s;const f=Math.ceil(Math.log(u)/Math.LN10);u=Math.pow(10,f),u*o>=320&&(u=u/5),u*o>=128&&(u=u/2);const d=e.minimum;let p=e.maximum;p+=64/o,s=Math.ceil((p-d)/u),u||(s=0);const m=[];for(let y=0;y<s;++y){const b=d+u*y;m.push({position:tn(n,e,b),time:b})}return m}function tn(n,e,i){return(i-e.minimum)/(e.maximum-e.minimum)*n}function wn(n,e,i){return i/n*(e.maximum-e.minimum)+e.minimum}function PN(n){return n.resource?25:20}const FN=({model:n})=>{var i,s;if(!n)return S.jsx(S.Fragment,{});const e=n.wallTime!==void 0?new Date(n.wallTime).toLocaleString(void 0,{timeZoneName:"short"}):void 0;return S.jsxs("div",{style:{flex:"auto",display:"block",overflow:"hidden auto"},children:[S.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!e&&S.jsxs("div",{className:"call-line",children:["start time:",S.jsx("span",{className:"call-value datetime",title:e,children:e})]}),S.jsxs("div",{className:"call-line",children:["duration:",S.jsx("span",{className:"call-value number",title:xt(n.endTime-n.startTime),children:xt(n.endTime-n.startTime)})]}),S.jsx("div",{className:"call-section",children:"Browser"}),S.jsxs("div",{className:"call-line",children:["engine:",S.jsx("span",{className:"call-value string",title:n.browserName,children:n.browserName})]}),n.channel&&S.jsxs("div",{className:"call-line",children:["channel:",S.jsx("span",{className:"call-value string",title:n.channel,children:n.channel})]}),n.platform&&S.jsxs("div",{className:"call-line",children:["platform:",S.jsx("span",{className:"call-value string",title:n.platform,children:n.platform})]}),n.playwrightVersion&&S.jsxs("div",{className:"call-line",children:["playwright version:",S.jsx("span",{className:"call-value string",title:n.playwrightVersion,children:n.playwrightVersion})]}),n.options.userAgent&&S.jsxs("div",{className:"call-line",children:["user agent:",S.jsx("span",{className:"call-value datetime",title:n.options.userAgent,children:n.options.userAgent})]}),n.options.baseURL&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),S.jsxs("div",{className:"call-line",children:["baseURL:",S.jsx("a",{className:"call-value string",href:n.options.baseURL,title:n.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:n.options.baseURL})]})]}),S.jsx("div",{className:"call-section",children:"Viewport"}),n.options.viewport&&S.jsxs("div",{className:"call-line",children:["width:",S.jsx("span",{className:"call-value number",title:String(!!((i=n.options.viewport)!=null&&i.width)),children:n.options.viewport.width})]}),n.options.viewport&&S.jsxs("div",{className:"call-line",children:["height:",S.jsx("span",{className:"call-value number",title:String(!!((s=n.options.viewport)!=null&&s.height)),children:n.options.viewport.height})]}),S.jsxs("div",{className:"call-line",children:["is mobile:",S.jsx("span",{className:"call-value boolean",title:String(!!n.options.isMobile),children:String(!!n.options.isMobile)})]}),n.options.deviceScaleFactor&&S.jsxs("div",{className:"call-line",children:["device scale:",S.jsx("span",{className:"call-value number",title:String(n.options.deviceScaleFactor),children:String(n.options.deviceScaleFactor)})]}),S.jsx("div",{className:"call-section",children:"Counts"}),S.jsxs("div",{className:"call-line",children:["pages:",S.jsx("span",{className:"call-value number",children:n.pages.length})]}),S.jsxs("div",{className:"call-line",children:["actions:",S.jsx("span",{className:"call-value number",children:n.actions.length})]}),S.jsxs("div",{className:"call-line",children:["events:",S.jsx("span",{className:"call-value number",children:n.events.length})]})]})},QN=({annotations:n})=>n.length?S.jsx("div",{className:"annotations-tab",children:n.map((e,i)=>S.jsxs("div",{className:"annotation-item",children:[S.jsx("span",{style:{fontWeight:"bold"},children:e.type}),e.description&&S.jsxs("span",{children:[": ",d0(e.description)]})]},`annotation-${i}`))}):S.jsx(cs,{text:"No annotations"}),ZN=({sdkLanguage:n,isInspecting:e,setIsInspecting:i,highlightedElement:s,setHighlightedElement:l})=>{const[o,u]=z.useState(),f=z.useCallback(d=>{const{errors:p}=Yh(gS,d,{prettyErrors:!1}),m=p.map(y=>({message:y.message,line:y.range[1].line,column:y.range[1].col,type:"subtle-error"}));u(m),l({...s,ariaSnapshot:d,lastEdited:"ariaSnapshot"}),i(!1)},[s,l,i]);return S.jsxs("div",{style:{flex:"auto",backgroundColor:"var(--vscode-sideBar-background)",padding:"0 10px 10px 10px",overflow:"auto"},children:[S.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[S.jsx("div",{children:"Locator"}),S.jsx(Lt,{style:{margin:"0 4px"},title:"Pick locator",icon:"target",toggled:e,onClick:()=>i(!e)}),S.jsx("div",{style:{flex:"auto"}}),S.jsx(Lt,{icon:"files",title:"Copy locator",onClick:()=>{xy(s.locator||"")}})]}),S.jsx("div",{style:{height:50},children:S.jsx(vr,{text:s.locator||"",highlighter:n,isFocused:!0,wrapLines:!0,onChange:d=>{l({...s,locator:d,lastEdited:"locator"}),i(!1)}})}),S.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[S.jsx("div",{style:{flex:"auto"},children:"Aria snapshot"}),S.jsx(Lt,{icon:"files",title:"Copy snapshot",onClick:()=>{xy(s.ariaSnapshot||"")}})]}),S.jsx("div",{style:{height:150},children:S.jsx(vr,{text:s.ariaSnapshot||"",highlighter:"yaml",wrapLines:!1,highlight:o,onChange:f})})]})},JN=({className:n,style:e,open:i,isModal:s,minWidth:l,verticalOffset:o,requestClose:u,anchor:f,dataTestId:d,children:p})=>{const m=z.useRef(null),[y,b]=z.useState(0),[v]=mh(m),[E,x]=mh(f),T=f?WN(v,E,o):void 0;return z.useEffect(()=>{const C=$=>{!m.current||!($.target instanceof Node)||m.current.contains($.target)||u==null||u()},k=$=>{$.key==="Escape"&&(u==null||u())};return i?(document.addEventListener("mousedown",C),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",k)}):()=>{}},[i,u]),z.useLayoutEffect(()=>x(),[i,x]),z.useEffect(()=>{const C=()=>b(k=>k+1);return window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}},[]),z.useLayoutEffect(()=>{m.current&&(i?s?m.current.showModal():m.current.show():m.current.close())},[i,s]),S.jsx("dialog",{ref:m,style:{position:"fixed",margin:T?0:void 0,zIndex:110,top:T==null?void 0:T.top,left:T==null?void 0:T.left,minWidth:l||0,...e},className:n,"data-testid":d,children:p})};function WN(n,e,i=4,s=4){let l=Math.max(s,e.left);l+n.width>window.innerWidth-s&&(l=window.innerWidth-n.width-s);let o=Math.max(0,e.bottom)+i;return o+n.height>window.innerHeight-i&&(Math.max(0,e.top)>n.height+i?o=Math.max(0,e.top)-n.height-i:o=window.innerHeight-i-n.height),{left:l,top:o}}const e2=({title:n,icon:e,buttonChildren:i,anchorRef:s,dialogDataTestId:l,children:o})=>{const u=z.useRef(null),f=s??u,[d,p]=z.useState(!1);return S.jsxs(S.Fragment,{children:[S.jsx(Lt,{ref:u,icon:e,title:n,onClick:()=>p(m=>!m),children:i}),S.jsx(JN,{style:{backgroundColor:"var(--vscode-sideBar-background)",padding:"4px 8px"},open:d,verticalOffset:8,requestClose:()=>p(!1),anchor:f,dataTestId:l,children:o})]})},xS=({settings:n})=>S.jsx("div",{className:"vbox settings-view",children:n.map(e=>{const i=`setting-${e.name.replaceAll(/\s+/g,"-")}`;return S.jsx("div",{className:`setting setting-${e.type}`,title:e.title,children:t2(e,i)},e.name)})}),t2=(n,e)=>{switch(n.type){case"check":return S.jsxs(S.Fragment,{children:[S.jsx("input",{type:"checkbox",id:e,checked:n.value,onChange:()=>n.set(!n.value)}),S.jsxs("label",{htmlFor:e,children:[n.name,!!n.count&&S.jsx("span",{className:"setting-counter",children:n.count})]})]});case"select":return S.jsxs(S.Fragment,{children:[S.jsxs("label",{htmlFor:e,children:[n.name,":",!!n.count&&S.jsx("span",{className:"setting-counter",children:n.count})]}),S.jsx("select",{id:e,value:n.value,onChange:i=>n.set(i.target.value),children:n.options.map(i=>S.jsx("option",{value:i.value,children:i.label},i.value))})]});default:return null}},h2=n=>{var i;const e=((i=n.model)==null?void 0:i.traceUrl)??"default";return S.jsx(p0.Provider,{value:n.model,children:S.jsx(n2,{partition:e,...n})})},n2=n=>{var dl;const{partition:e,model:i,showSourcesFirst:s,rootDir:l,fallbackLocation:o,isLive:u,hideTimeline:f,status:d,annotations:p,inert:m,onOpenExternally:y,revealSource:b,testRunMetadata:v}=n,[E,x]=sn("navigatorTab","actions"),[T,C]=sn("propertiesTab",s?"source":"call"),[k,$]=sn("propertiesSidebarLocation","bottom"),[V]=sn("actionsFilter",[]),[R,G]=wi("selectedCallId"),[Z,q]=wi("selectedTime"),[j,ie]=wi("highlightedCallId"),[le,I]=wi("revealedErrorKey"),[F,ee]=wi("highlightedConsoleMessageOrdinal"),[ve,H]=wi("revealedAttachmentCallId"),[Q,se]=wi("highlightedResourceOrdinal"),[we,N]=wi("treeState",{expandedItems:new Map});Iw(e);const[P,W]=z.useState({lastEdited:"none"}),[J,ae]=z.useState(!1),be=z.useCallback(ce=>{G(ce==null?void 0:ce.callId),I(void 0)},[G,I]),te=z.useMemo(()=>i==null?void 0:i.filteredActions(V),[i,V]),mt=((i==null?void 0:i.actions.length)??0)-((te==null?void 0:te.length)??0),Ae=z.useMemo(()=>te==null?void 0:te.find(ce=>ce.callId===j),[te,j]),Vt=z.useCallback(ce=>{ie(ce==null?void 0:ce.callId)},[ie]),Rr=z.useMemo(()=>(i==null?void 0:i.sources)||new Map,[i]);z.useEffect(()=>{q(void 0),I(void 0)},[i,q,I]);const En=z.useMemo(()=>{if(R){const Zn=te==null?void 0:te.find(cn=>cn.callId===R);if(Zn)return Zn}const ce=i==null?void 0:i.failedAction();if(ce)return ce;if(te!=null&&te.length){let Zn=te.length-1;for(let cn=0;cn<te.length;++cn)if(te[cn].title==="After Hooks"&&cn){Zn=cn-1;break}return te[Zn]}},[i,te,R]),on=z.useMemo(()=>Ae||En,[En,Ae]),hs=z.useCallback(ce=>{be(ce),Vt(void 0)},[be,Vt]),yt=z.useCallback(ce=>{C(ce),ce!=="inspector"&&ae(!1)},[C]),fl=z.useCallback(ce=>{!J&&ce&&yt("inspector"),ae(ce)},[ae,yt,J]),Mc=z.useCallback(ce=>{W(ce),yt("inspector")},[yt]),Gt=z.useCallback(ce=>{yt("attachments"),H({callId:ce})},[yt,H]);z.useEffect(()=>{b&&yt("source")},[b,yt]);const jr=L_(i,Z),ds=rT(i,Z),Mi=k_(i),ps=z.useMemo(()=>{var ce;return le!==void 0?(ce=Mi.errors.get(le))==null?void 0:ce.stack:on==null?void 0:on.stack},[on,le,Mi]),Fn=(i==null?void 0:i.sdkLanguage)||"javascript",hl={id:"inspector",title:"Locator",render:()=>S.jsx(ZN,{sdkLanguage:Fn,isInspecting:J,setIsInspecting:fl,highlightedElement:P,setHighlightedElement:W})},Oc={id:"call",title:"Call",render:()=>S.jsx(Zx,{action:on,startTimeOffset:(i==null?void 0:i.startTime)??0,sdkLanguage:Fn})},Rc={id:"log",title:"Log",render:()=>S.jsx(e_,{action:on,isLive:u})},Oi={id:"errors",title:"Errors",errorCount:Mi.errors.size,render:()=>S.jsx(O_,{errorsModel:Mi,testRunMetadata:v,sdkLanguage:Fn,revealInSource:ce=>{ce.action?be(ce.action):I(ce.message),yt("source")},wallTime:(i==null?void 0:i.wallTime)??0})};let ut;!En&&o&&(ut=(dl=o.source)==null?void 0:dl.errors.length);const Kt={id:"source",title:"Source",errorCount:ut,render:()=>S.jsx(A_,{stack:ps,sources:Rr,rootDir:l,stackFrameLocation:k==="bottom"?"right":"bottom",fallbackLocation:o,onOpenExternally:y})},bt={id:"console",title:"Console",count:jr.entries.length,render:()=>S.jsx(D_,{consoleModel:jr,boundaries:Qn,selectedTime:Z,onAccepted:ce=>q({minimum:ce.timestamp,maximum:ce.timestamp}),onEntryHovered:ee})},jc={id:"network",title:"Network",count:ds.resources.length,render:()=>S.jsx(aT,{boundaries:Qn,networkModel:ds,onResourceHovered:se,sdkLanguage:(i==null?void 0:i.sdkLanguage)??"javascript"})},Lc={id:"attachments",title:"Attachments",count:i==null?void 0:i.visibleAttachments.length,render:()=>S.jsx(b_,{revealedAttachmentCallId:ve})},Ri=[hl,Oc,Rc,Oi,bt,jc,Kt,Lc];if(p!==void 0){const ce={id:"annotations",title:"Annotations",count:p.length,render:()=>S.jsx(QN,{annotations:p})};Ri.push(ce)}if(s){const ce=Ri.indexOf(Kt);Ri.splice(ce,1),Ri.splice(1,0,Kt)}const{boundaries:Qn}=z.useMemo(()=>{const ce={minimum:(i==null?void 0:i.startTime)||0,maximum:(i==null?void 0:i.endTime)||3e4};return ce.minimum>ce.maximum&&(ce.minimum=0,ce.maximum=3e4),ce.maximum+=(ce.maximum-ce.minimum)/20,{boundaries:ce}},[i]);let An=0;!u&&i&&i.endTime>=0?An=i.endTime-i.startTime:i&&i.wallTime&&(An=Date.now()-i.wallTime);const Nn={id:"actions",title:"Actions",component:S.jsxs("div",{className:"vbox",children:[d&&S.jsxs("div",{className:"workbench-run-status",children:[S.jsx("span",{className:Ke("codicon",o0(d))}),S.jsx("div",{children:Px(d)}),S.jsx("div",{className:"spacer"}),S.jsx("div",{className:"workbench-run-duration",children:An?xt(An):""})]}),S.jsx(Qx,{sdkLanguage:Fn,actions:te||[],selectedAction:i?En:void 0,selectedTime:Z,setSelectedTime:q,treeState:we,setTreeState:N,onSelected:hs,onHighlighted:Vt,revealActionAttachment:Gt,revealConsole:()=>yt("console"),isLive:u})]})},gs={id:"metadata",title:"Metadata",component:S.jsx(FN,{model:i})},ji=E==="actions"&&S.jsx(i2,{counters:i==null?void 0:i.actionCounters,hiddenActionsCount:mt});return S.jsxs("div",{className:"vbox workbench",...m?{inert:!0}:{},children:[!f&&S.jsx(YN,{model:i,consoleEntries:jr.entries,networkResources:ds.resources,boundaries:Qn,highlightedAction:Ae,highlightedResourceOrdinal:Q,highlightedConsoleEntryOrdinal:F,onSelected:hs,sdkLanguage:Fn,selectedTime:Z,setSelectedTime:q}),S.jsx(Qo,{sidebarSize:250,orientation:k==="bottom"?"vertical":"horizontal",settingName:"propertiesSidebar",main:S.jsx(Qo,{sidebarSize:250,orientation:"horizontal",sidebarIsFirst:!0,settingName:"actionListSidebar",main:S.jsx(DN,{action:on,model:i,sdkLanguage:Fn,testIdAttributeName:(i==null?void 0:i.testIdAttributeName)||"data-testid",isInspecting:J,setIsInspecting:fl,highlightedElement:P,setHighlightedElement:Mc}),sidebar:S.jsx(_h,{tabs:[Nn,gs],rightToolbar:[ji],selectedTab:E,setSelectedTab:x})}),sidebar:S.jsx(_h,{tabs:Ri,selectedTab:T,setSelectedTab:yt,rightToolbar:[k==="bottom"?S.jsx(Lt,{title:"Dock to right",icon:"layout-sidebar-right-off",onClick:()=>{$("right")}}):S.jsx(Lt,{title:"Dock to bottom",icon:"layout-panel-off",onClick:()=>{$("bottom")}})],mode:k==="bottom"?"default":"select"})})]})},i2=({counters:n,hiddenActionsCount:e})=>{const[i,s]=sn("actionsFilter",[]),l=z.useRef(null),o=S.jsxs(S.Fragment,{children:[e>0&&S.jsxs("span",{className:"workbench-actions-hidden-count",title:e+" actions hidden by filters",children:[e," hidden"]}),S.jsx("span",{ref:l,className:"codicon codicon-filter"})]});return S.jsx(e2,{title:"Filter actions",dialogDataTestId:"actions-filter-dialog",buttonChildren:o,anchorRef:l,children:S.jsx(xS,{settings:[{type:"check",value:i.includes("getter"),set:u=>s(u?[...i,"getter"]:i.filter(f=>f!=="getter")),name:"Getters",count:n==null?void 0:n.get("getter")},{type:"check",value:i.includes("route"),set:u=>s(u?[...i,"route"]:i.filter(f=>f!=="route")),name:"Network routes",count:n==null?void 0:n.get("route")},{type:"check",value:i.includes("configuration"),set:u=>s(u?[...i,"configuration"]:i.filter(f=>f!=="configuration")),name:"Configuration",count:n==null?void 0:n.get("configuration")}]})})};var Ab;(n=>{function e(i){for(const s of i.splice(0))s.dispose()}n.disposeAll=e})(Ab||(Ab={}));class ar{constructor(){this._listeners=new Set,this.event=(e,i)=>{this._listeners.add(e);let s=!1;const l=this,o={dispose(){s||(s=!0,l._listeners.delete(e))}};return i&&i.push(o),o}}fire(e){const i=!this._deliveryQueue;this._deliveryQueue||(this._deliveryQueue=[]);for(const s of this._listeners)this._deliveryQueue.push({listener:s,event:e});if(i){for(let s=0;s<this._deliveryQueue.length;s++){const{listener:l,event:o}=this._deliveryQueue[s];l.call(null,o)}this._deliveryQueue=void 0}}dispose(){this._listeners.clear(),this._deliveryQueue&&(this._deliveryQueue=[])}}class s2 extends Error{constructor(){super("Test server connection closed")}}class d2{constructor(e){this._ws=new WebSocket(e)}onmessage(e){this._ws.addEventListener("message",i=>e(i.data.toString()))}onopen(e){this._ws.addEventListener("open",e)}onerror(e){this._ws.addEventListener("error",e)}onclose(e){this._ws.addEventListener("close",e)}send(e){this._ws.send(e)}close(){this._ws.close()}}class p2{constructor(e){this._onCloseEmitter=new ar,this._onReportEmitter=new ar,this._onStdioEmitter=new ar,this._onTestFilesChangedEmitter=new ar,this._onLoadTraceRequestedEmitter=new ar,this._onTestPausedEmitter=new ar,this._lastId=0,this._callbacks=new Map,this._isClosed=!1,this.onClose=this._onCloseEmitter.event,this.onReport=this._onReportEmitter.event,this.onStdio=this._onStdioEmitter.event,this.onTestFilesChanged=this._onTestFilesChangedEmitter.event,this.onLoadTraceRequested=this._onLoadTraceRequestedEmitter.event,this.onTestPaused=this._onTestPausedEmitter.event,this._transport=e,this._transport.onmessage(s=>{const l=JSON.parse(s),{id:o,result:u,error:f,method:d,params:p}=l;if(o){const m=this._callbacks.get(o);if(!m)return;this._callbacks.delete(o),f?m.reject(new Error(f)):m.resolve(u)}else this._dispatchEvent(d,p)});const i=setInterval(()=>this._sendMessage("ping").catch(()=>{}),3e4);this._connectedPromise=new Promise((s,l)=>{this._transport.onopen(s),this._transport.onerror(l)}),this._transport.onclose(()=>{this._isClosed=!0,this._onCloseEmitter.fire(),clearInterval(i);for(const s of this._callbacks.values())s.reject(new s2);this._callbacks.clear()})}isClosed(){return this._isClosed}async _sendMessage(e,i){const s=globalThis.__logForTest;s==null||s({method:e,params:i}),await this._connectedPromise;const l=++this._lastId,o={id:l,method:e,params:i};return this._transport.send(JSON.stringify(o)),new Promise((u,f)=>{this._callbacks.set(l,{resolve:u,reject:f})})}_sendMessageNoReply(e,i){this._sendMessage(e,i).catch(()=>{})}_dispatchEvent(e,i){e==="report"?this._onReportEmitter.fire(i):e==="stdio"?this._onStdioEmitter.fire(i):e==="testFilesChanged"?this._onTestFilesChangedEmitter.fire(i):e==="loadTraceRequested"?this._onLoadTraceRequestedEmitter.fire(i):e==="testPaused"&&this._onTestPausedEmitter.fire(i)}async initialize(e){await this._sendMessage("initialize",e)}async ping(e){await this._sendMessage("ping",e)}async pingNoReply(e){this._sendMessageNoReply("ping",e)}async watch(e){await this._sendMessage("watch",e)}watchNoReply(e){this._sendMessageNoReply("watch",e)}async open(e){await this._sendMessage("open",e)}openNoReply(e){this._sendMessageNoReply("open",e)}async resizeTerminal(e){await this._sendMessage("resizeTerminal",e)}resizeTerminalNoReply(e){this._sendMessageNoReply("resizeTerminal",e)}async checkBrowsers(e){return await this._sendMessage("checkBrowsers",e)}async installBrowsers(e){await this._sendMessage("installBrowsers",e)}async runGlobalSetup(e){return await this._sendMessage("runGlobalSetup",e)}async runGlobalTeardown(e){return await this._sendMessage("runGlobalTeardown",e)}async startDevServer(e){return await this._sendMessage("startDevServer",e)}async stopDevServer(e){return await this._sendMessage("stopDevServer",e)}async clearCache(e){return await this._sendMessage("clearCache",e)}async listFiles(e){return await this._sendMessage("listFiles",e)}async listTests(e){return await this._sendMessage("listTests",e)}async runTests(e){return await this._sendMessage("runTests",e)}async findRelatedTestFiles(e){return await this._sendMessage("findRelatedTestFiles",e)}async stopTests(e){await this._sendMessage("stopTests",e)}stopTestsNoReply(e){this._sendMessageNoReply("stopTests",e)}async closeGracefully(e){await this._sendMessage("closeGracefully",e)}close(){try{this._transport.close()}catch{}}}const g2=({location:n})=>{const[e,i]=sn("shouldPopulateCanvasFromScreenshot",!1),[s,l]=Pw(),[o,u]=sn("mergeFiles",!1);return S.jsx(xS,{settings:[{type:"select",value:s,set:l,name:"Theme",options:Yw},...n==="ui-mode"?[{type:"check",value:o,set:u,name:"Merge files"}]:[],{type:"check",value:e,set:i,name:"Display canvas content",title:"Attempt to display the captured canvas appearance in the snapshot preview. May not be accurate."}]})};export{e2 as D,h0 as E,ot as R,Qo as S,u2 as T,d2 as W,c_ as _,p2 as a,g2 as b,h2 as c,JN as d,a2 as e,c2 as f,Xw as g,l2 as h,o2 as i,S as j,Ke as k,Yx as l,xt as m,Kh as n,Lt as o,sn as p,xS as q,z as r,es as s,o0 as t,os as u,Uw as v};
@@ -0,0 +1,2 @@
1
+ import{T as m,r,a as F,W as M,j as e,D as C,b as I,c as k,d as z,e as O,f as V}from"./assets/defaultSettingsView-CFbbG_bM.js";const $=()=>{const[o,i]=r.useState(!1),[c,l]=r.useState(),[h,u]=r.useState(),[p,L]=r.useState(N),[g,x]=r.useState({done:0,total:0}),[b,f]=r.useState(!1),[j,S]=r.useState(null),[y,P]=r.useState(null),[R,E]=r.useState(!1),w=r.useCallback(t=>{const s=new URL(window.location.href);if(!t.length)return;const n=t.item(0),a=URL.createObjectURL(n);s.searchParams.append("trace",a);const d=s.toString();window.history.pushState({},"",d),l(a),u(n.name),f(!1),S(null)},[]);r.useEffect(()=>{const t=async s=>{var n;if((n=s.clipboardData)!=null&&n.files.length){for(const a of s.clipboardData.files)if(a.type!=="application/zip")return;s.preventDefault(),w(s.clipboardData.files)}};return document.addEventListener("paste",t),()=>document.removeEventListener("paste",t)}),r.useEffect(()=>{const t=s=>{const{method:n,params:a}=s.data;if(n!=="load"||!((a==null?void 0:a.trace)instanceof Blob))return;const d=new File([a.trace],"trace.zip",{type:"application/zip"}),v=new DataTransfer;v.items.add(d),w(v.files)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const U=r.useCallback(t=>{t.preventDefault(),w(t.dataTransfer.files)},[w]),W=r.useCallback(t=>{t.preventDefault(),t.target.files&&w(t.target.files)},[w]);r.useEffect(()=>{const t=new URL(window.location.href).searchParams,s=t.get("trace");if(i(t.has("isServer")),s!=null&&s.startsWith("file:")){P(s||null);return}if(t.has("isServer")){const n=new URLSearchParams(window.location.search).get("ws"),a=new URL(`../${n}`,window.location.toString());a.protocol=window.location.protocol==="https:"?"wss:":"ws:";const d=new F(new M(a));d.onLoadTraceRequested(async v=>{l(v.traceUrl),f(!1),S(null)}),d.initialize({}).catch(()=>{})}else s&&!s.startsWith("blob:")&&l(s)},[]),r.useEffect(()=>{(async()=>{if(!c){L(N);return}const t=s=>{s.data.method==="progress"&&x(s.data.params)};try{navigator.serviceWorker.addEventListener("message",t),x({done:0,total:1});const s=new URLSearchParams;s.set("trace",c);const n=await fetch(`contexts?${s.toString()}`);if(!n.ok){o||l(void 0),S((await n.json()).error);return}const a=await n.json(),d=new m(c,a);x({done:0,total:0}),L(d)}finally{navigator.serviceWorker.removeEventListener("message",t)}})()},[o,c,h]);const D=g.done!==g.total&&g.total!==0&&!j;r.useEffect(()=>{if(D){const t=setTimeout(()=>{E(!0)},200);return()=>clearTimeout(t)}else E(!1)},[D]);const T=!!(!o&&!b&&!y&&(!c||j));return e.jsxs("div",{className:"vbox workbench-loader",onDragOver:t=>{t.preventDefault(),t.dataTransfer.types.includes("Files")&&f(!0)},children:[e.jsxs("div",{className:"hbox header",...T?{inert:!0}:{},children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),p.title&&e.jsx("div",{className:"title",children:p.title}),e.jsx("div",{className:"spacer"}),e.jsx(C,{icon:"settings-gear",title:"Settings",dialogDataTestId:"settings-toolbar-dialog",children:e.jsx(I,{location:"trace-viewer"})})]}),e.jsx(k,{model:p,inert:T}),y&&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:y,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"})]})]}),e.jsx(z,{open:R,isModal:!0,className:"progress-dialog",children:e.jsxs("div",{className:"progress-content",children:[e.jsx("div",{className:"title",role:"heading","aria-level":1,children:"Loading Playwright Trace..."}),e.jsx("div",{className:"progress-wrapper",children:e.jsx("div",{className:"inner-progress",style:{width:g.total?100*g.done/g.total+"%":0}})})]})}),T&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",role:"alert",children:j}),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.click(),t.addEventListener("change",s=>W(s))},type:"button",children:"Select file"}),e.jsx("div",{className:"info",children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."}),e.jsxs("div",{className:"version",children:["Playwright v","1.58.0-next"]})]}),o&&!c&&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:()=>{f(!1)},onDrop:t=>U(t),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},N=new m("",[]),q=({traceJson:o})=>{const[i,c]=r.useState(void 0),[l,h]=r.useState(0),u=r.useRef(null);return r.useEffect(()=>(u.current&&clearTimeout(u.current),u.current=setTimeout(async()=>{try{const p=await A(o);c(p)}catch{const p=new m("",[]);c(p)}finally{h(l+1)}},500),()=>{u.current&&clearTimeout(u.current)}),[o,l]),e.jsx(k,{isLive:!0,model:i})};async function A(o){const i=new URLSearchParams;i.set("trace",o);const l=await(await fetch(`contexts?${i.toString()}`)).json();return new m(o,l)}(async()=>{const o=new URLSearchParams(window.location.search);if(O(),window.location.protocol!=="file:"){if(o.get("isUnderTest")==="true"&&await new Promise(h=>setTimeout(h,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
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(h=>{navigator.serviceWorker.oncontrollerchange=()=>h()}),setInterval(function(){fetch("ping")},1e4)}const i=o.get("trace"),l=(i==null?void 0:i.endsWith(".json"))?e.jsx(q,{traceJson:i}):e.jsx($,{});V.createRoot(document.querySelector("#root")).render(l)})();
@@ -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.H3S_T-cq.js"></script>
11
- <link rel="modulepreload" crossorigin href="./assets/defaultSettingsView-DTAwf90E.js">
10
+ <script type="module" crossorigin src="./index.B_hycly9.js"></script>
11
+ <link rel="modulepreload" crossorigin href="./assets/defaultSettingsView-CFbbG_bM.js">
12
12
  <link rel="stylesheet" crossorigin href="./defaultSettingsView.CpI7RarT.css">
13
13
  <link rel="stylesheet" crossorigin href="./index.C4Y3Aw8n.css">
14
14
  </head>