const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/codeMirrorModule-C8KMvO9L.js","assets/codeMirrorModule-DYBRYzYX.css"])))=>i.map(i=>d[i]); (function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const o of c)if(o.type==="childList")for(const h of o.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function i(c){const o={};return c.integrity&&(o.integrity=c.integrity),c.referrerPolicy&&(o.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?o.credentials="include":c.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(c){if(c.ep)return;c.ep=!0;const o=i(c);fetch(c.href,o)}})();function b1(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var lf={exports:{}},Oi={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Wm;function S1(){if(Wm)return Oi;Wm=1;var u=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function i(s,c,o){var h=null;if(o!==void 0&&(h=""+o),c.key!==void 0&&(h=""+c.key),"key"in c){o={};for(var m in c)m!=="key"&&(o[m]=c[m])}else o=c;return c=o.ref,{$$typeof:u,type:s,key:h,ref:c!==void 0?c:null,props:o}}return Oi.Fragment=l,Oi.jsx=i,Oi.jsxs=i,Oi}var Fm;function T1(){return Fm||(Fm=1,lf.exports=S1()),lf.exports}var X=T1(),af={exports:{}},ue={};/** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Im;function E1(){if(Im)return ue;Im=1;var u=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),_=Symbol.iterator;function E(O){return O===null||typeof O!="object"?null:(O=_&&O[_]||O["@@iterator"],typeof O=="function"?O:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function M(O,Y,J){this.props=O,this.context=Y,this.refs=w,this.updater=J||x}M.prototype.isReactComponent={},M.prototype.setState=function(O,Y){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,Y,"setState")},M.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function R(){}R.prototype=M.prototype;function G(O,Y,J){this.props=O,this.context=Y,this.refs=w,this.updater=J||x}var Q=G.prototype=new R;Q.constructor=G,S(Q,M.prototype),Q.isPureReactComponent=!0;var Z=Array.isArray;function W(){}var k={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function U(O,Y,J){var I=J.ref;return{$$typeof:u,type:O,key:Y,ref:I!==void 0?I:null,props:J}}function ie(O,Y){return U(O.type,Y,O.props)}function te(O){return typeof O=="object"&&O!==null&&O.$$typeof===u}function $(O){var Y={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(J){return Y[J]})}var ee=/\/+/g;function Ae(O,Y){return typeof O=="object"&&O!==null&&O.key!=null?$(""+O.key):Y.toString(36)}function se(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(W,W):(O.status="pending",O.then(function(Y){O.status==="pending"&&(O.status="fulfilled",O.value=Y)},function(Y){O.status==="pending"&&(O.status="rejected",O.reason=Y)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function D(O,Y,J,I,re){var me=typeof O;(me==="undefined"||me==="boolean")&&(O=null);var we=!1;if(O===null)we=!0;else switch(me){case"bigint":case"string":case"number":we=!0;break;case"object":switch(O.$$typeof){case u:case l:we=!0;break;case T:return we=O._init,D(we(O._payload),Y,J,I,re)}}if(we)return re=re(O),we=I===""?"."+Ae(O,0):I,Z(re)?(J="",we!=null&&(J=we.replace(ee,"$&/")+"/"),D(re,Y,J,"",function(Da){return Da})):re!=null&&(te(re)&&(re=ie(re,J+(re.key==null||O&&O.key===re.key?"":(""+re.key).replace(ee,"$&/")+"/")+we)),Y.push(re)),1;we=0;var rt=I===""?".":I+":";if(Z(O))for(var Ye=0;Ye{const c=u==null?void 0:u.current;c&&i(c.getBoundingClientRect())},[u]);return wn.useLayoutEffect(()=>{const c=u==null?void 0:u.current;if(!c)return;s();const o=new ResizeObserver(s);return o.observe(c),window.addEventListener("resize",s),()=>{o.disconnect(),window.removeEventListener("resize",s)}},[s,u]),[l,s]}function eg(u){const l=document.createElement("textarea");l.style.position="absolute",l.style.zIndex="-1000",l.value=u,document.body.appendChild(l),l.select(),document.execCommand("copy"),l.remove()}function pu(u,l){u&&(l=Sl.getObject(u,l));const[i,s]=wn.useState(l),c=wn.useCallback(o=>{u?Sl.setObject(u,o):s(o)},[u,s]);return wn.useEffect(()=>{if(u){const o=()=>s(Sl.getObject(u,l));return Sl.onChangeEmitter.addEventListener(u,o),()=>Sl.onChangeEmitter.removeEventListener(u,o)}},[l,u]),[i,c]}class A1{constructor(){this.onChangeEmitter=new EventTarget}getString(l,i){return localStorage[l]||i}setString(l,i){var s;localStorage[l]=i,this.onChangeEmitter.dispatchEvent(new Event(l)),(s=window.saveSettings)==null||s.call(window)}getObject(l,i){if(!localStorage[l])return i;try{return JSON.parse(localStorage[l])}catch{return i}}setObject(l,i){var s;localStorage[l]=JSON.stringify(i),this.onChangeEmitter.dispatchEvent(new Event(l)),(s=window.saveSettings)==null||s.call(window)}}const Sl=new A1;function wl(...u){return u.filter(Boolean).join(" ")}const tg="\\u0000-\\u0020\\u007f-\\u009f",w1=new RegExp("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|www\\.)[^\\s"+tg+'"]{2,}[^\\s'+tg+`"')}\\],:;.!?]`,"ug"),O1="system",Cg="theme",_1=[{label:"Dark mode",value:"dark-mode"},{label:"Light mode",value:"light-mode"},{label:"System",value:"system"}],zg=window.matchMedia("(prefers-color-scheme: dark)");function N1(){document.playwrightThemeInitialized||(document.playwrightThemeInitialized=!0,document.defaultView.addEventListener("focus",u=>{u.target.document.nodeType===Node.DOCUMENT_NODE&&document.body.classList.remove("inactive")},!1),document.defaultView.addEventListener("blur",u=>{document.body.classList.add("inactive")},!1),Tf(Ef()),zg.addEventListener("change",()=>{Tf(Ef())}))}const M1=new Set;function Tf(u){const l=C1(),i=u==="system"?zg.matches?"dark-mode":"light-mode":u;if(l!==i){l&&document.documentElement.classList.remove(l),document.documentElement.classList.add(i);for(const s of M1)s(i)}}function Ef(){return Sl.getString(Cg,O1)}function C1(){return document.documentElement.classList.contains("dark-mode")?"dark-mode":document.documentElement.classList.contains("light-mode")?"light-mode":null}function z1(){const[u,l]=wn.useState(Ef());return wn.useEffect(()=>{Sl.setString(Cg,u),Tf(u)},[u]),[u,l]}var sf={exports:{}},_i={},uf={exports:{}},cf={};/** * @license React * scheduler.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ng;function x1(){return ng||(ng=1,(function(u){function l(D,K){var ne=D.length;D.push(K);e:for(;0>>1,Ne=D[de];if(0>>1;dec(J,ne))Ic(re,J)?(D[de]=re,D[I]=ne,de=I):(D[de]=J,D[Y]=ne,de=Y);else if(Ic(re,ne))D[de]=re,D[I]=ne,de=I;else break e}}return K}function c(D,K){var ne=D.sortIndex-K.sortIndex;return ne!==0?ne:D.id-K.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;u.unstable_now=function(){return o.now()}}else{var h=Date,m=h.now();u.unstable_now=function(){return h.now()-m}}var g=[],p=[],T=1,v=null,_=3,E=!1,x=!1,S=!1,w=!1,M=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function Q(D){for(var K=i(p);K!==null;){if(K.callback===null)s(p);else if(K.startTime<=D)s(p),K.sortIndex=K.expirationTime,l(g,K);else break;K=i(p)}}function Z(D){if(S=!1,Q(D),!x)if(i(g)!==null)x=!0,W||(W=!0,$());else{var K=i(p);K!==null&&se(Z,K.startTime-D)}}var W=!1,k=-1,V=5,U=-1;function ie(){return w?!0:!(u.unstable_now()-UD&&ie());){var de=v.callback;if(typeof de=="function"){v.callback=null,_=v.priorityLevel;var Ne=de(v.expirationTime<=D);if(D=u.unstable_now(),typeof Ne=="function"){v.callback=Ne,Q(D),K=!0;break t}v===i(g)&&s(g),Q(D)}else s(g);v=i(g)}if(v!==null)K=!0;else{var O=i(p);O!==null&&se(Z,O.startTime-D),K=!1}}break e}finally{v=null,_=ne,E=!1}K=void 0}}finally{K?$():W=!1}}}var $;if(typeof G=="function")$=function(){G(te)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,Ae=ee.port2;ee.port1.onmessage=te,$=function(){Ae.postMessage(null)}}else $=function(){M(te,0)};function se(D,K){k=M(function(){D(u.unstable_now())},K)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(D){D.callback=null},u.unstable_forceFrameRate=function(D){0>D||125de?(D.sortIndex=ne,l(p,D),i(g)===null&&D===i(p)&&(S?(R(k),k=-1):S=!0,se(Z,ne-de))):(D.sortIndex=Ne,l(g,D),x||E||(x=!0,W||(W=!0,$()))),D},u.unstable_shouldYield=ie,u.unstable_wrapCallback=function(D){var K=_;return function(){var ne=_;_=K;try{return D.apply(this,arguments)}finally{_=ne}}}})(cf)),cf}var lg;function D1(){return lg||(lg=1,uf.exports=x1()),uf.exports}var rf={exports:{}},st={};/** * @license React * react-dom.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ag;function L1(){if(ag)return st;ag=1;var u=xf();function l(g){var p="https://react.dev/errors/"+g;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(l){console.error(l)}}return u(),rf.exports=L1(),rf.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var sg;function R1(){if(sg)return _i;sg=1;var u=D1(),l=xf(),i=U1();function s(e){var t="https://react.dev/errors/"+e;if(1Ne||(e.current=de[Ne],de[Ne]=null,Ne--)}function J(e,t){Ne++,de[Ne]=e.current,e.current=t}var I=O(null),re=O(null),me=O(null),we=O(null);function rt(e,t){switch(J(me,t),J(re,e),J(I,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?bm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=bm(t),e=Sm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(I),J(I,e)}function Ye(){Y(I),Y(re),Y(me)}function Da(e){e.memoizedState!==null&&J(we,e);var t=I.current,n=Sm(t,e.type);t!==n&&(J(re,e),J(I,n))}function ki(e){re.current===e&&(Y(I),Y(re)),we.current===e&&(Y(we),Ti._currentValue=ne)}var qu,Zf;function tl(e){if(qu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);qu=t&&t[1]||"",Zf=-1)":-1r||b[a]!==z[r]){var B=` `+b[a].replace(" at new "," at ");return e.displayName&&B.includes("")&&(B=B.replace("",e.displayName)),B}while(1<=a&&0<=r);break}}}finally{Hu=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?tl(n):""}function Wp(e,t){switch(e.tag){case 26:case 27:case 5:return tl(e.type);case 16:return tl("Lazy");case 13:return e.child!==t&&t!==null?tl("Suspense Fallback"):tl("Suspense");case 19:return tl("SuspenseList");case 0:case 15:return Yu(e.type,!1);case 11:return Yu(e.type.render,!1);case 1:return Yu(e.type,!0);case 31:return tl("Activity");default:return""}}function Jf(e){try{var t="",n=null;do t+=Wp(e,n),n=e,e=e.return;while(e);return t}catch(a){return` Error generating stack: `+a.message+` `+a.stack}}var $u=Object.prototype.hasOwnProperty,Gu=u.unstable_scheduleCallback,Ku=u.unstable_cancelCallback,Fp=u.unstable_shouldYield,Ip=u.unstable_requestPaint,Et=u.unstable_now,Pp=u.unstable_getCurrentPriorityLevel,Wf=u.unstable_ImmediatePriority,Ff=u.unstable_UserBlockingPriority,qi=u.unstable_NormalPriority,ey=u.unstable_LowPriority,If=u.unstable_IdlePriority,ty=u.log,ny=u.unstable_setDisableYieldValue,La=null,At=null;function _n(e){if(typeof ty=="function"&&ny(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(La,e)}catch{}}var wt=Math.clz32?Math.clz32:iy,ly=Math.log,ay=Math.LN2;function iy(e){return e>>>=0,e===0?32:31-(ly(e)/ay|0)|0}var Hi=256,Yi=262144,$i=4194304;function nl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Gi(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var r=0,f=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var y=a&134217727;return y!==0?(a=y&~f,a!==0?r=nl(a):(d&=y,d!==0?r=nl(d):n||(n=y&~e,n!==0&&(r=nl(n))))):(y=a&~f,y!==0?r=nl(y):d!==0?r=nl(d):n||(n=a&~e,n!==0&&(r=nl(n)))),r===0?0:t!==0&&t!==r&&(t&f)===0&&(f=r&-r,n=t&-t,f>=n||f===32&&(n&4194048)!==0)?t:r}function Ua(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function sy(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pf(){var e=$i;return $i<<=1,($i&62914560)===0&&($i=4194304),e}function Vu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ra(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function uy(e,t,n,a,r,f){var d=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var y=e.entanglements,b=e.expirationTimes,z=e.hiddenUpdates;for(n=d&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var dy=/[\n"\\]/g;function Rt(e){return e.replace(dy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Fu(e,t,n,a,r,f,d,y){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ut(t)):e.value!==""+Ut(t)&&(e.value=""+Ut(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Iu(e,d,Ut(t)):n!=null?Iu(e,d,Ut(n)):a!=null&&e.removeAttribute("value"),r==null&&f!=null&&(e.defaultChecked=!!f),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.name=""+Ut(y):e.removeAttribute("name")}function ho(e,t,n,a,r,f,d,y){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||n!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Wu(e);return}n=n!=null?""+Ut(n):"",t=t!=null?""+Ut(t):n,y||t===e.value||(e.value=t),e.defaultValue=t}a=a??r,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=y?e.checked:!!a,e.defaultChecked=!!a,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Wu(e)}function Iu(e,t,n){t==="number"&&Qi(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ll(e,t,n,a){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lc=!1;if(sn)try{var qa={};Object.defineProperty(qa,"passive",{get:function(){lc=!0}}),window.addEventListener("test",qa,qa),window.removeEventListener("test",qa,qa)}catch{lc=!1}var Mn=null,ac=null,Zi=null;function So(){if(Zi)return Zi;var e,t=ac,n=t.length,a,r="value"in Mn?Mn.value:Mn.textContent,f=r.length;for(e=0;e=$a),_o=" ",No=!1;function Mo(e,t){switch(e){case"keyup":return Yy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Co(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bl=!1;function Gy(e,t){switch(e){case"compositionend":return Co(t);case"keypress":return t.which!==32?null:(No=!0,_o);case"textInput":return e=t.data,e===_o&&No?null:e;default:return null}}function Ky(e,t){if(Bl)return e==="compositionend"||!rc&&Mo(e,t)?(e=So(),Zi=ac=Mn=null,Bl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Bo(n)}}function qo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ho(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Qi(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qi(e.document)}return t}function hc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Iy=sn&&"documentMode"in document&&11>=document.documentMode,kl=null,dc=null,Qa=null,mc=!1;function Yo(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mc||kl==null||kl!==Qi(a)||(a=kl,"selectionStart"in a&&hc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Qa&&Va(Qa,a)||(Qa=a,a=Ys(dc,"onSelect"),0>=d,r-=d,Ft=1<<32-wt(t)+r|n<oe?(ve=P,P=null):ve=P.sibling;var Te=L(N,P,C[oe],q);if(Te===null){P===null&&(P=ve);break}e&&P&&Te.alternate===null&&t(N,P),A=f(Te,A,oe),Se===null?le=Te:Se.sibling=Te,Se=Te,P=ve}if(oe===C.length)return n(N,P),be&&cn(N,oe),le;if(P===null){for(;oeoe?(ve=P,P=null):ve=P.sibling;var Wn=L(N,P,Te.value,q);if(Wn===null){P===null&&(P=ve);break}e&&P&&Wn.alternate===null&&t(N,P),A=f(Wn,A,oe),Se===null?le=Wn:Se.sibling=Wn,Se=Wn,P=ve}if(Te.done)return n(N,P),be&&cn(N,oe),le;if(P===null){for(;!Te.done;oe++,Te=C.next())Te=H(N,Te.value,q),Te!==null&&(A=f(Te,A,oe),Se===null?le=Te:Se.sibling=Te,Se=Te);return be&&cn(N,oe),le}for(P=a(P);!Te.done;oe++,Te=C.next())Te=j(P,N,oe,Te.value,q),Te!==null&&(e&&Te.alternate!==null&&P.delete(Te.key===null?oe:Te.key),A=f(Te,A,oe),Se===null?le=Te:Se.sibling=Te,Se=Te);return e&&P.forEach(function(v1){return t(N,v1)}),be&&cn(N,oe),le}function ze(N,A,C,q){if(typeof C=="object"&&C!==null&&C.type===S&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case E:e:{for(var le=C.key;A!==null;){if(A.key===le){if(le=C.type,le===S){if(A.tag===7){n(N,A.sibling),q=r(A,C.props.children),q.return=N,N=q;break e}}else if(A.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===V&&dl(le)===A.type){n(N,A.sibling),q=r(A,C.props),Ia(q,C),q.return=N,N=q;break e}n(N,A);break}else t(N,A);A=A.sibling}C.type===S?(q=cl(C.props.children,N.mode,q,C.key),q.return=N,N=q):(q=as(C.type,C.key,C.props,null,N.mode,q),Ia(q,C),q.return=N,N=q)}return d(N);case x:e:{for(le=C.key;A!==null;){if(A.key===le)if(A.tag===4&&A.stateNode.containerInfo===C.containerInfo&&A.stateNode.implementation===C.implementation){n(N,A.sibling),q=r(A,C.children||[]),q.return=N,N=q;break e}else{n(N,A);break}else t(N,A);A=A.sibling}q=Tc(C,N.mode,q),q.return=N,N=q}return d(N);case V:return C=dl(C),ze(N,A,C,q)}if(se(C))return F(N,A,C,q);if($(C)){if(le=$(C),typeof le!="function")throw Error(s(150));return C=le.call(C),ae(N,A,C,q)}if(typeof C.then=="function")return ze(N,A,os(C),q);if(C.$$typeof===G)return ze(N,A,us(N,C),q);hs(N,C)}return typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint"?(C=""+C,A!==null&&A.tag===6?(n(N,A.sibling),q=r(A,C),q.return=N,N=q):(n(N,A),q=Sc(C,N.mode,q),q.return=N,N=q),d(N)):n(N,A)}return function(N,A,C,q){try{Fa=0;var le=ze(N,A,C,q);return Jl=null,le}catch(P){if(P===Zl||P===rs)throw P;var Se=_t(29,P,null,N.mode);return Se.lanes=q,Se.return=N,Se}finally{}}}var gl=fh(!0),oh=fh(!1),Ln=!1;function Lc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Uc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Un(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Rn(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ee&2)!==0){var r=a.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),a.pending=t,t=ls(e),Zo(e,null,n),t}return ns(e,a,t,n),ls(e)}function Pa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,to(e,n)}}function Rc(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var r=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?r=f=d:f=f.next=d,n=n.next}while(n!==null);f===null?r=f=t:f=f.next=t}else r=f=t;n={baseState:a.baseState,firstBaseUpdate:r,lastBaseUpdate:f,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var jc=!1;function ei(){if(jc){var e=Xl;if(e!==null)throw e}}function ti(e,t,n,a){jc=!1;var r=e.updateQueue;Ln=!1;var f=r.firstBaseUpdate,d=r.lastBaseUpdate,y=r.shared.pending;if(y!==null){r.shared.pending=null;var b=y,z=b.next;b.next=null,d===null?f=z:d.next=z,d=b;var B=e.alternate;B!==null&&(B=B.updateQueue,y=B.lastBaseUpdate,y!==d&&(y===null?B.firstBaseUpdate=z:y.next=z,B.lastBaseUpdate=b))}if(f!==null){var H=r.baseState;d=0,B=z=b=null,y=f;do{var L=y.lane&-536870913,j=L!==y.lane;if(j?(ye&L)===L:(a&L)===L){L!==0&&L===Ql&&(jc=!0),B!==null&&(B=B.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var F=e,ae=y;L=t;var ze=n;switch(ae.tag){case 1:if(F=ae.payload,typeof F=="function"){H=F.call(ze,H,L);break e}H=F;break e;case 3:F.flags=F.flags&-65537|128;case 0:if(F=ae.payload,L=typeof F=="function"?F.call(ze,H,L):F,L==null)break e;H=v({},H,L);break e;case 2:Ln=!0}}L=y.callback,L!==null&&(e.flags|=64,j&&(e.flags|=8192),j=r.callbacks,j===null?r.callbacks=[L]:j.push(L))}else j={lane:L,tag:y.tag,payload:y.payload,callback:y.callback,next:null},B===null?(z=B=j,b=H):B=B.next=j,d|=L;if(y=y.next,y===null){if(y=r.shared.pending,y===null)break;j=y,y=j.next,j.next=null,r.lastBaseUpdate=j,r.shared.pending=null}}while(!0);B===null&&(b=H),r.baseState=b,r.firstBaseUpdate=z,r.lastBaseUpdate=B,f===null&&(r.shared.lanes=0),Hn|=d,e.lanes=d,e.memoizedState=H}}function hh(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function dh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ef?f:8;var d=D.T,y={};D.T=y,tr(e,!1,t,n);try{var b=r(),z=D.S;if(z!==null&&z(y,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var B=u0(b,a);ai(e,t,B,xt(e))}else ai(e,t,a,xt(e))}catch(H){ai(e,t,{then:function(){},status:"rejected",reason:H},xt())}finally{K.p=f,d!==null&&y.types!==null&&(d.types=y.types),D.T=d}}function d0(){}function Pc(e,t,n,a){if(e.tag!==5)throw Error(s(476));var r=Vh(e).queue;Kh(e,r,t,ne,n===null?d0:function(){return Qh(e),n(a)})}function Vh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hn,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qh(e){var t=Vh(e);t.next===null&&(t=e.alternate.memoizedState),ai(e,t.next.queue,{},xt())}function er(){return nt(Ti)}function Xh(){return Ge().memoizedState}function Zh(){return Ge().memoizedState}function m0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=xt();e=Un(n);var a=Rn(t,e,n);a!==null&&(vt(a,t,n),Pa(a,t,n)),t={cache:Cc()},e.payload=t;return}t=t.return}}function g0(e,t,n){var a=xt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Es(e)?Wh(t,n):(n=vc(e,t,n,a),n!==null&&(vt(n,e,a),Fh(n,t,a)))}function Jh(e,t,n){var a=xt();ai(e,t,n,a)}function ai(e,t,n,a){var r={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Es(e))Wh(t,r);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var d=t.lastRenderedState,y=f(d,n);if(r.hasEagerState=!0,r.eagerState=y,Ot(y,d))return ns(e,t,r,0),xe===null&&ts(),!1}catch{}finally{}if(n=vc(e,t,r,a),n!==null)return vt(n,e,a),Fh(n,t,a),!0}return!1}function tr(e,t,n,a){if(a={lane:2,revertLane:Lr(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Es(e)){if(t)throw Error(s(479))}else t=vc(e,n,a,2),t!==null&&vt(t,e,2)}function Es(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function Wh(e,t){Fl=gs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fh(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,to(e,n)}}var ii={readContext:nt,use:vs,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useLayoutEffect:qe,useInsertionEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useSyncExternalStore:qe,useId:qe,useHostTransitionStatus:qe,useFormState:qe,useActionState:qe,useOptimistic:qe,useMemoCache:qe,useCacheRefresh:qe};ii.useEffectEvent=qe;var Ih={readContext:nt,use:vs,useCallback:function(e,t){return ft().memoizedState=[e,t===void 0?null:t],e},useContext:nt,useEffect:Rh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ss(4194308,4,qh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ss(4194308,4,e,t)},useInsertionEffect:function(e,t){Ss(4,2,e,t)},useMemo:function(e,t){var n=ft();t=t===void 0?null:t;var a=e();if(pl){_n(!0);try{e()}finally{_n(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=ft();if(n!==void 0){var r=n(t);if(pl){_n(!0);try{n(t)}finally{_n(!1)}}}else r=t;return a.memoizedState=a.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},a.queue=e,e=e.dispatch=g0.bind(null,fe,e),[a.memoizedState,e]},useRef:function(e){var t=ft();return e={current:e},t.memoizedState=e},useState:function(e){e=Zc(e);var t=e.queue,n=Jh.bind(null,fe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Fc,useDeferredValue:function(e,t){var n=ft();return Ic(n,e,t)},useTransition:function(){var e=Zc(!1);return e=Kh.bind(null,fe,e.queue,!0,!1),ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=fe,r=ft();if(be){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),xe===null)throw Error(s(349));(ye&127)!==0||bh(a,t,n)}r.memoizedState=n;var f={value:n,getSnapshot:t};return r.queue=f,Rh(Th.bind(null,a,f,e),[e]),a.flags|=2048,Pl(9,{destroy:void 0},Sh.bind(null,a,f,n,t),null),n},useId:function(){var e=ft(),t=xe.identifierPrefix;if(be){var n=It,a=Ft;n=(a&~(1<<32-wt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ps++,0<\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof a.is=="string"?d.createElement("select",{is:a.is}):d.createElement("select"),a.multiple?f.multiple=!0:a.size&&(f.size=a.size);break;default:f=typeof a.is=="string"?d.createElement(r,{is:a.is}):d.createElement(r)}}f[et]=t,f[ht]=a;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)f.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=f;e:switch(at(f,r,a),r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&mn(t)}}return Ue(t),gr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&mn(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(s(166));if(e=me.current,Kl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,r=tt,r!==null)switch(r.tag){case 27:case 5:a=r.memoizedProps}e[et]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||ym(e.nodeValue,n)),e||xn(t,!0)}else e=$s(e).createTextNode(a),e[et]=t,t.stateNode=e}return Ue(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Kl(t),n!==null){if(e===null){if(!a)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[et]=t}else rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ue(t),e=!1}else n=Oc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Mt(t),t):(Mt(t),null);if((t.flags&128)!==0)throw Error(s(558))}return Ue(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Kl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!r)throw Error(s(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));r[et]=t}else rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ue(t),r=!1}else r=Oc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Mt(t),t):(Mt(t),null)}return Mt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,r=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(r=a.alternate.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==r&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ns(t,t.updateQueue),Ue(t),null);case 4:return Ye(),e===null&&Br(t.stateNode.containerInfo),Ue(t),null;case 10:return fn(t.type),Ue(t),null;case 19:if(Y($e),a=t.memoizedState,a===null)return Ue(t),null;if(r=(t.flags&128)!==0,f=a.rendering,f===null)if(r)ui(a,!1);else{if(He!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=ms(e),f!==null){for(t.flags|=128,ui(a,!1),e=f.updateQueue,t.updateQueue=e,Ns(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Jo(n,e),n=n.sibling;return J($e,$e.current&1|2),be&&cn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Et()>Ds&&(t.flags|=128,r=!0,ui(a,!1),t.lanes=4194304)}else{if(!r)if(e=ms(f),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Ns(t,e),ui(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!be)return Ue(t),null}else 2*Et()-a.renderingStartTime>Ds&&n!==536870912&&(t.flags|=128,r=!0,ui(a,!1),t.lanes=4194304);a.isBackwards?(f.sibling=t.child,t.child=f):(e=a.last,e!==null?e.sibling=f:t.child=f,a.last=f)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Et(),e.sibling=null,n=$e.current,J($e,r?n&1|2:n&1),be&&cn(t,a.treeForkCount),e):(Ue(t),null);case 22:case 23:return Mt(t),kc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),n=t.updateQueue,n!==null&&Ns(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&Y(hl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),fn(Ve),Ue(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function S0(e,t){switch(Ac(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fn(Ve),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ki(t),null;case 31:if(t.memoizedState!==null){if(Mt(t),t.alternate===null)throw Error(s(340));rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y($e),null;case 4:return Ye(),null;case 10:return fn(t.type),null;case 22:case 23:return Mt(t),kc(),e!==null&&Y(hl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return fn(Ve),null;case 25:return null;default:return null}}function Ed(e,t){switch(Ac(t),t.tag){case 3:fn(Ve),Ye();break;case 26:case 27:case 5:ki(t);break;case 4:Ye();break;case 31:t.memoizedState!==null&&Mt(t);break;case 13:Mt(t);break;case 19:Y($e);break;case 10:fn(t.type);break;case 22:case 23:Mt(t),kc(),e!==null&&Y(hl);break;case 24:fn(Ve)}}function ci(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var r=a.next;n=r;do{if((n.tag&e)===e){a=void 0;var f=n.create,d=n.inst;a=f(),d.destroy=a}n=n.next}while(n!==r)}}catch(y){_e(t,t.return,y)}}function kn(e,t,n){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var f=r.next;a=f;do{if((a.tag&e)===e){var d=a.inst,y=d.destroy;if(y!==void 0){d.destroy=void 0,r=t;var b=n,z=y;try{z()}catch(B){_e(r,b,B)}}}a=a.next}while(a!==f)}}catch(B){_e(t,t.return,B)}}function Ad(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{dh(t,n)}catch(a){_e(e,e.return,a)}}}function wd(e,t,n){n.props=yl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){_e(e,t,a)}}function ri(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(r){_e(e,t,r)}}function Pt(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(r){_e(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){_e(e,t,r)}else n.current=null}function Od(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(r){_e(e,e.return,r)}}function pr(e,t,n){try{var a=e.stateNode;$0(a,e.type,n,t),a[ht]=t}catch(r){_e(e,e.return,r)}}function _d(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vn(e.type)||e.tag===4}function yr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_d(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Vn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function vr(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=an));else if(a!==4&&(a===27&&Vn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(vr(e,t,n),e=e.sibling;e!==null;)vr(e,t,n),e=e.sibling}function Ms(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&Vn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Ms(e,t,n),e=e.sibling;e!==null;)Ms(e,t,n),e=e.sibling}function Nd(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);at(t,a,n),t[et]=e,t[ht]=n}catch(f){_e(e,e.return,f)}}var gn=!1,Ze=!1,br=!1,Md=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function T0(e,t){if(e=e.containerInfo,Hr=Js,e=Ho(e),hc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var r=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var d=0,y=-1,b=-1,z=0,B=0,H=e,L=null;t:for(;;){for(var j;H!==n||r!==0&&H.nodeType!==3||(y=d+r),H!==f||a!==0&&H.nodeType!==3||(b=d+a),H.nodeType===3&&(d+=H.nodeValue.length),(j=H.firstChild)!==null;)L=H,H=j;for(;;){if(H===e)break t;if(L===n&&++z===r&&(y=d),L===f&&++B===a&&(b=d),(j=H.nextSibling)!==null)break;H=L,L=H.parentNode}H=j}n=y===-1||b===-1?null:{start:y,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yr={focusedElem:e,selectionRange:n},Js=!1,Pe=t;Pe!==null;)if(t=Pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Pe=e;else for(;Pe!==null;){switch(t=Pe,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),at(f,a,n),f[et]=e,Ie(f),a=f;break e;case"link":var d=Um("link","href",r).get(a+(n.href||""));if(d){for(var y=0;yze&&(d=ze,ze=ae,ae=d);var N=ko(y,ae),A=ko(y,ze);if(N&&A&&(j.rangeCount!==1||j.anchorNode!==N.node||j.anchorOffset!==N.offset||j.focusNode!==A.node||j.focusOffset!==A.offset)){var C=H.createRange();C.setStart(N.node,N.offset),j.removeAllRanges(),ae>ze?(j.addRange(C),j.extend(A.node,A.offset)):(C.setEnd(A.node,A.offset),j.addRange(C))}}}}for(H=[],j=y;j=j.parentNode;)j.nodeType===1&&H.push({element:j,left:j.scrollLeft,top:j.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;yn?32:n,D.T=null,n=_r,_r=null;var f=$n,d=Sn;if(We=0,aa=$n=null,Sn=0,(Ee&6)!==0)throw Error(s(331));var y=Ee;if(Ee|=4,qd(f.current),jd(f,f.current,d,n),Ee=y,gi(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(La,f)}catch{}return!0}finally{K.p=r,D.T=a,lm(e,t)}}function im(e,t,n){t=Bt(n,t),t=ir(e.stateNode,t,2),e=Rn(e,t,2),e!==null&&(Ra(e,2),en(e))}function _e(e,t,n){if(e.tag===3)im(e,e,n);else for(;t!==null;){if(t.tag===3){im(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Yn===null||!Yn.has(a))){e=Bt(n,e),n=sd(2),a=Rn(t,n,2),a!==null&&(ud(n,a,t,e),Ra(a,2),en(a));break}}t=t.return}}function zr(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new w0;var r=new Set;a.set(t,r)}else r=a.get(t),r===void 0&&(r=new Set,a.set(t,r));r.has(n)||(Er=!0,r.add(n),e=C0.bind(null,e,t,n),t.then(e,e))}function C0(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,xe===e&&(ye&n)===n&&(He===4||He===3&&(ye&62914560)===ye&&300>Et()-xs?(Ee&2)===0&&ia(e,0):Ar|=n,la===ye&&(la=0)),en(e)}function sm(e,t){t===0&&(t=Pf()),e=ul(e,t),e!==null&&(Ra(e,t),en(e))}function z0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sm(e,n)}function x0(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(s(314))}a!==null&&a.delete(t),sm(e,n)}function D0(e,t){return Gu(e,t)}var ks=null,ua=null,xr=!1,qs=!1,Dr=!1,Kn=0;function en(e){e!==ua&&e.next===null&&(ua===null?ks=ua=e:ua=ua.next=e),qs=!0,xr||(xr=!0,U0())}function gi(e,t){if(!Dr&&qs){Dr=!0;do for(var n=!1,a=ks;a!==null;){if(e!==0){var r=a.pendingLanes;if(r===0)var f=0;else{var d=a.suspendedLanes,y=a.pingedLanes;f=(1<<31-wt(42|e)+1)-1,f&=r&~(d&~y),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,fm(a,f))}else f=ye,f=Gi(a,a===xe?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(f&3)===0||Ua(a,f)||(n=!0,fm(a,f));a=a.next}while(n);Dr=!1}}function L0(){um()}function um(){qs=xr=!1;var e=0;Kn!==0&&K0()&&(e=Kn);for(var t=Et(),n=null,a=ks;a!==null;){var r=a.next,f=cm(a,t);f===0?(a.next=null,n===null?ks=r:n.next=r,r===null&&(ua=n)):(n=a,(e!==0||(f&3)!==0)&&(qs=!0)),a=r}We!==0&&We!==5||gi(e),Kn!==0&&(Kn=0)}function cm(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,r=e.expirationTimes,f=e.pendingLanes&-62914561;0y)break;var B=b.transferSize,H=b.initiatorType;B&&vm(H)&&(b=b.responseEnd,d+=B*(b"u"?null:document;function zm(e,t,n){var a=ca;if(a&&typeof t=="string"&&t){var r=Rt(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Cm.has(r)||(Cm.add(r),e={rel:e,crossOrigin:n,href:t},a.querySelector(r)===null&&(t=a.createElement("link"),at(t,"link",e),Ie(t),a.head.appendChild(t)))}}function P0(e){Tn.D(e),zm("dns-prefetch",e,null)}function e1(e,t){Tn.C(e,t),zm("preconnect",e,t)}function t1(e,t,n){Tn.L(e,t,n);var a=ca;if(a&&e&&t){var r='link[rel="preload"][as="'+Rt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Rt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Rt(n.imageSizes)+'"]')):r+='[href="'+Rt(e)+'"]';var f=r;switch(t){case"style":f=ra(e);break;case"script":f=fa(e)}Gt.has(f)||(e=v({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Gt.set(f,e),a.querySelector(r)!==null||t==="style"&&a.querySelector(bi(f))||t==="script"&&a.querySelector(Si(f))||(t=a.createElement("link"),at(t,"link",e),Ie(t),a.head.appendChild(t)))}}function n1(e,t){Tn.m(e,t);var n=ca;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Rt(a)+'"][href="'+Rt(e)+'"]',f=r;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=fa(e)}if(!Gt.has(f)&&(e=v({rel:"modulepreload",href:e},t),Gt.set(f,e),n.querySelector(r)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Si(f)))return}a=n.createElement("link"),at(a,"link",e),Ie(a),n.head.appendChild(a)}}}function l1(e,t,n){Tn.S(e,t,n);var a=ca;if(a&&e){var r=xl(a).hoistableStyles,f=ra(e);t=t||"default";var d=r.get(f);if(!d){var y={loading:0,preload:null};if(d=a.querySelector(bi(f)))y.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Gt.get(f))&&Zr(e,n);var b=d=a.createElement("link");Ie(b),at(b,"link",e),b._p=new Promise(function(z,B){b.onload=z,b.onerror=B}),b.addEventListener("load",function(){y.loading|=1}),b.addEventListener("error",function(){y.loading|=2}),y.loading|=4,Ks(d,t,a)}d={type:"stylesheet",instance:d,count:1,state:y},r.set(f,d)}}}function a1(e,t){Tn.X(e,t);var n=ca;if(n&&e){var a=xl(n).hoistableScripts,r=fa(e),f=a.get(r);f||(f=n.querySelector(Si(r)),f||(e=v({src:e,async:!0},t),(t=Gt.get(r))&&Jr(e,t),f=n.createElement("script"),Ie(f),at(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(r,f))}}function i1(e,t){Tn.M(e,t);var n=ca;if(n&&e){var a=xl(n).hoistableScripts,r=fa(e),f=a.get(r);f||(f=n.querySelector(Si(r)),f||(e=v({src:e,async:!0,type:"module"},t),(t=Gt.get(r))&&Jr(e,t),f=n.createElement("script"),Ie(f),at(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(r,f))}}function xm(e,t,n,a){var r=(r=me.current)?Gs(r):null;if(!r)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ra(n.href),n=xl(r).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ra(n.href);var f=xl(r).hoistableStyles,d=f.get(e);if(d||(r=r.ownerDocument||r,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,d),(f=r.querySelector(bi(e)))&&!f._p&&(d.instance=f,d.state.loading=5),Gt.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Gt.set(e,n),f||s1(r,e,n,d.state))),t&&a===null)throw Error(s(528,""));return d}if(t&&a!==null)throw Error(s(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=fa(n),n=xl(r).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function ra(e){return'href="'+Rt(e)+'"'}function bi(e){return'link[rel="stylesheet"]['+e+"]"}function Dm(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function s1(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),at(t,"link",n),Ie(t),e.head.appendChild(t))}function fa(e){return'[src="'+Rt(e)+'"]'}function Si(e){return"script[async]"+e}function Lm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Rt(n.href)+'"]');if(a)return t.instance=a,Ie(a),a;var r=v({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ie(a),at(a,"style",r),Ks(a,n.precedence,e),t.instance=a;case"stylesheet":r=ra(n.href);var f=e.querySelector(bi(r));if(f)return t.state.loading|=4,t.instance=f,Ie(f),f;a=Dm(n),(r=Gt.get(r))&&Zr(a,r),f=(e.ownerDocument||e).createElement("link"),Ie(f);var d=f;return d._p=new Promise(function(y,b){d.onload=y,d.onerror=b}),at(f,"link",a),t.state.loading|=4,Ks(f,n.precedence,e),t.instance=f;case"script":return f=fa(n.src),(r=e.querySelector(Si(f)))?(t.instance=r,Ie(r),r):(a=n,(r=Gt.get(f))&&(a=v({},n),Jr(a,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ie(r),at(r,"link",a),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Ks(a,n.precedence,e));return t.instance}function Ks(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=a.length?a[a.length-1]:null,f=r,d=0;d title"):null)}function u1(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function jm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function c1(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=ra(a.href),f=t.querySelector(bi(r));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Qs.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,Ie(f);return}f=t.ownerDocument||t,a=Dm(a),(r=Gt.get(r))&&Zr(a,r),f=f.createElement("link"),Ie(f);var d=f;d._p=new Promise(function(y,b){d.onload=y,d.onerror=b}),at(f,"link",a),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Qs.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Wr=0;function r1(e,t){return e.stylesheets&&e.count===0&&Zs(e,e.stylesheets),0Wr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(r)}}:null}function Qs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xs=null;function Zs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xs=new Map,t.forEach(f1,e),Xs=null,Qs.call(e))}function f1(e,t){if(!(t.state.loading&4)){var n=Xs.get(e);if(n)var a=n.get(null);else{n=new Map,Xs.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(l){console.error(l)}}return u(),sf.exports=R1(),sf.exports}var B1=j1();const k1="modulepreload",q1=function(u){return"/"+u},cg={},H1=function(l,i,s){let c=Promise.resolve();if(i&&i.length>0){let h=function(p){return Promise.all(p.map(T=>Promise.resolve(T).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),g=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));c=h(i.map(p=>{if(p=q1(p),p in cg)return;cg[p]=!0;const T=p.endsWith(".css"),v=T?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${v}`))return;const _=document.createElement("link");if(_.rel=T?"stylesheet":k1,T||(_.as="script"),_.crossOrigin="",_.href=p,g&&_.setAttribute("nonce",g),document.head.appendChild(_),T)return new Promise((E,x)=>{_.addEventListener("load",E),_.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${p}`)))})}))}function o(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return c.then(h=>{for(const m of h||[])m.status==="rejected"&&o(m.reason);return l().catch(o)})};function Y1(u,l){const i=/(\x1b\[(\d+(;\d+)*)m)|([^\x1b]+)/g,s=[];let c,o={},h=!1,m=l==null?void 0:l.fg,g=l==null?void 0:l.bg;for(;(c=i.exec(u))!==null;){const[,,p,,T]=c;if(p){const v=+p;switch(v){case 0:o={};break;case 1:o["font-weight"]="bold";break;case 2:o.opacity="0.8";break;case 3:o["font-style"]="italic";break;case 4:o["text-decoration"]="underline";break;case 7:h=!0;break;case 8:o.display="none";break;case 9:o["text-decoration"]="line-through";break;case 22:delete o["font-weight"],delete o["font-style"],delete o.opacity,delete o["text-decoration"];break;case 23:delete o["font-weight"],delete o["font-style"],delete o.opacity;break;case 24:delete o["text-decoration"];break;case 27:h=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:m=rg[v-30];break;case 39:m=l==null?void 0:l.fg;break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:g=rg[v-40];break;case 49:g=l==null?void 0:l.bg;break;case 53:o["text-decoration"]="overline";break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:m=fg[v-90];break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:g=fg[v-100];break}}else if(T){const v={...o},_=h?g:m;_!==void 0&&(v.color=_);const E=h?m:g;E!==void 0&&(v["background-color"]=E),s.push(`${$1(T)}`)}}return s.join("")}const rg={0:"var(--vscode-terminal-ansiBlack)",1:"var(--vscode-terminal-ansiRed)",2:"var(--vscode-terminal-ansiGreen)",3:"var(--vscode-terminal-ansiYellow)",4:"var(--vscode-terminal-ansiBlue)",5:"var(--vscode-terminal-ansiMagenta)",6:"var(--vscode-terminal-ansiCyan)",7:"var(--vscode-terminal-ansiWhite)"},fg={0:"var(--vscode-terminal-ansiBrightBlack)",1:"var(--vscode-terminal-ansiBrightRed)",2:"var(--vscode-terminal-ansiBrightGreen)",3:"var(--vscode-terminal-ansiBrightYellow)",4:"var(--vscode-terminal-ansiBrightBlue)",5:"var(--vscode-terminal-ansiBrightMagenta)",6:"var(--vscode-terminal-ansiBrightCyan)",7:"var(--vscode-terminal-ansiBrightWhite)"};function $1(u){return u.replace(/[&"<>]/g,l=>({"&":"&",'"':""","<":"<",">":">"})[l])}function G1(u){return Object.entries(u).map(([l,i])=>`${l}: ${i}`).join("; ")}const ff=({text:u,highlighter:l,mimeType:i,linkify:s,readOnly:c,highlight:o,revealLine:h,lineNumbers:m,isFocused:g,focusOnChange:p,wrapLines:T,onChange:v,dataTestId:_,placeholder:E})=>{const[x,S]=Mg(),[w]=he.useState(H1(()=>import("./codeMirrorModule-C8KMvO9L.js"),__vite__mapDeps([0,1])).then(Q=>Q.default)),M=he.useRef(null),[R,G]=he.useState();return he.useEffect(()=>{(async()=>{var V,U;const Q=await w;V1(Q);const Z=S.current;if(!Z)return;const W=X1(l)||Q1(i)||(s?"text/linkified":"");if(M.current&&W===M.current.cm.getOption("mode")&&!!c===M.current.cm.getOption("readOnly")&&m===M.current.cm.getOption("lineNumbers")&&T===M.current.cm.getOption("lineWrapping")&&E===M.current.cm.getOption("placeholder"))return;(U=(V=M.current)==null?void 0:V.cm)==null||U.getWrapperElement().remove();const k=Q(Z,{value:"",mode:W,readOnly:!!c,lineNumbers:m,lineWrapping:T,placeholder:E,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-F":"findPersistent","Cmd-F":"findPersistent"}});return M.current={cm:k},g&&k.focus(),G(k),k})()},[w,R,S,l,i,s,m,T,c,g,E]),he.useEffect(()=>{M.current&&M.current.cm.setSize(x.width,x.height)},[x]),he.useLayoutEffect(()=>{var W;if(!R)return;let Q=!1;if(R.getValue()!==u&&(R.setValue(u),Q=!0,p&&(R.execCommand("selectAll"),R.focus())),Q||JSON.stringify(o)!==JSON.stringify(M.current.highlight)){for(const U of M.current.highlight||[])R.removeLineClass(U.line-1,"wrap");for(const U of o||[])R.addLineClass(U.line-1,"wrap",`source-line-${U.type}`);for(const U of M.current.widgets||[])R.removeLineWidget(U);for(const U of M.current.markers||[])U.clear();const k=[],V=[];for(const U of o||[]){if(U.type!=="subtle-error"&&U.type!=="error")continue;const ie=(W=M.current)==null?void 0:W.cm.getLine(U.line-1);if(ie){const te={};te.title=U.message||"",V.push(R.markText({line:U.line-1,ch:0},{line:U.line-1,ch:U.column||ie.length},{className:"source-line-error-underline",attributes:te}))}if(U.type==="error"){const te=document.createElement("div");te.innerHTML=Y1(U.message||""),te.className="source-line-error-widget",k.push(R.addLineWidget(U.line,te,{above:!0,coverGutter:!1}))}}M.current.highlight=o,M.current.widgets=k,M.current.markers=V}typeof h=="number"&&M.current.cm.lineCount()>=h&&R.scrollIntoView({line:Math.max(0,h-1),ch:0},50);let Z;return v&&(Z=()=>v(R.getValue()),R.on("change",Z)),()=>{Z&&R.off("change",Z)}},[R,u,o,h,p,v]),X.jsx("div",{"data-testid":_,className:"cm-wrapper",ref:S,onClick:K1})};function K1(u){var i;if(!(u.target instanceof HTMLElement))return;let l;u.target.classList.contains("cm-linkified")?l=u.target.textContent:u.target.classList.contains("cm-link")&&((i=u.target.nextElementSibling)!=null&&i.classList.contains("cm-url"))&&(l=u.target.nextElementSibling.textContent.slice(1,-1)),l&&(u.preventDefault(),u.stopPropagation(),window.open(l,"_blank"))}let og=!1;function V1(u){og||(og=!0,u.defineSimpleMode("text/linkified",{start:[{regex:w1,token:"linkified"}]}))}function Q1(u){if(u){if(u.includes("javascript")||u.includes("json"))return"javascript";if(u.includes("python"))return"python";if(u.includes("csharp"))return"text/x-csharp";if(u.includes("java"))return"text/x-java";if(u.includes("markdown"))return"markdown";if(u.includes("html")||u.includes("svg"))return"htmlmixed";if(u.includes("css"))return"css"}}function X1(u){if(u)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[u]}const Z1=50,J1=({sidebarSize:u,sidebarHidden:l=!1,sidebarIsFirst:i=!1,orientation:s="vertical",minSidebarSize:c=Z1,settingName:o,sidebar:h,main:m})=>{const g=Math.max(c,u)*window.devicePixelRatio,[p,T]=pu(o?o+"."+s+":size":void 0,g),[v,_]=pu(o?o+"."+s+":size":void 0,g),[E,x]=he.useState(null),[S,w]=Mg();let M;s==="vertical"?(M=v/window.devicePixelRatio,S&&S.heightx({offset:s==="vertical"?G.clientY:G.clientX,size:M}),onMouseUp:()=>x(null),onMouseMove:G=>{if(!G.buttons)x(null);else if(E){const Z=(s==="vertical"?G.clientY:G.clientX)-E.offset,W=i?E.size+Z:E.size-Z,V=G.target.parentElement.getBoundingClientRect(),U=Math.min(Math.max(c,W),(s==="vertical"?V.height:V.width)-c);s==="vertical"?_(U*window.devicePixelRatio):T(U*window.devicePixelRatio)}}})]})},xg=({noShadow:u,children:l,noMinHeight:i,className:s,sidebarBackground:c,onClick:o})=>X.jsx("div",{className:wl("toolbar",u&&"no-shadow",i&&"no-min-height",s,c&&"toolbar-sidebar-background"),onClick:o,children:l}),W1=({tabs:u,selectedTab:l,setSelectedTab:i,leftToolbar:s,rightToolbar:c,dataTestId:o,mode:h})=>{const m=he.useId();return l||(l=u[0].id),h||(h="default"),X.jsx("div",{className:"tabbed-pane","data-testid":o,children:X.jsxs("div",{className:"vbox",children:[X.jsxs(xg,{children:[s&&X.jsxs("div",{style:{flex:"none",display:"flex",margin:"0 4px",alignItems:"center"},children:[...s]}),h==="default"&&X.jsx("div",{style:{flex:"auto",display:"flex",height:"100%",overflow:"hidden"},role:"tablist",children:[...u.map(g=>X.jsx(F1,{id:g.id,ariaControls:`${m}-${g.id}`,title:g.title,count:g.count,errorCount:g.errorCount,selected:l===g.id,onSelect:i},g.id))]}),h==="select"&&X.jsx("div",{style:{flex:"auto",display:"flex",height:"100%",overflow:"hidden"},role:"tablist",children:X.jsx("select",{style:{width:"100%",background:"none",cursor:"pointer"},value:l,onChange:g=>{i==null||i(u[g.currentTarget.selectedIndex].id)},children:u.map(g=>{let p="";return g.count&&(p=` (${g.count})`),g.errorCount&&(p=` (${g.errorCount})`),X.jsxs("option",{value:g.id,role:"tab","aria-controls":`${m}-${g.id}`,children:[g.title,p]},g.id)})})}),c&&X.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:[...c]})]}),u.map(g=>{const p="tab-content tab-"+g.id;if(g.component)return X.jsx("div",{id:`${m}-${g.id}`,role:"tabpanel","aria-label":g.title,className:p,style:{display:l===g.id?"inherit":"none"},children:g.component},g.id);if(l===g.id)return X.jsx("div",{id:`${m}-${g.id}`,role:"tabpanel","aria-label":g.title,className:p,children:g.render()},g.id)})]})})},F1=({id:u,title:l,count:i,errorCount:s,selected:c,onSelect:o,ariaControls:h})=>X.jsxs("div",{className:wl("tabbed-pane-tab",c&&"selected"),onClick:()=>o==null?void 0:o(u),role:"tab",title:l,"aria-controls":h,"aria-selected":c,children:[X.jsx("div",{className:"tabbed-pane-tab-label",children:l}),!!i&&X.jsx("div",{className:"tabbed-pane-tab-counter",children:i}),!!s&&X.jsx("div",{className:"tabbed-pane-tab-counter error",children:s})]}),I1=({sources:u,fileId:l,setFileId:i})=>X.jsx("select",{className:"source-chooser",hidden:!u.length,title:"Source chooser",value:l,onChange:s=>{i(s.target.selectedOptions[0].value)},children:P1(u)});function P1(u){const l=c=>c.replace(/.*[/\\]([^/\\]+)/,"$1"),i=c=>X.jsx("option",{value:c.id,children:l(c.label)},c.id),s=new Map;for(const c of u){let o=s.get(c.group||"Debugger");o||(o=[],s.set(c.group||"Debugger",o)),o.push(c)}return[...s.entries()].map(([c,o])=>X.jsx("optgroup",{label:c,children:o.filter(h=>(h.group||"Debugger")===c).map(h=>i(h))},c))}function ev(){return{id:"default",isRecorded:!1,text:"",language:"javascript",label:"",highlight:[]}}const Dt=he.forwardRef(function({children:l,title:i="",icon:s,disabled:c=!1,toggled:o=!1,onClick:h=()=>{},style:m,testId:g,className:p,ariaLabel:T},v){return X.jsxs("button",{ref:v,className:wl(p,"toolbar-button",s,o&&"toggled"),onMouseDown:dg,onClick:h,onDoubleClick:dg,title:i,disabled:!!c,style:m,"data-testid":g,"aria-label":T||i,children:[s&&X.jsx("span",{className:`codicon codicon-${s}`,style:l?{marginRight:5}:{}}),l]})}),hg=({style:u})=>X.jsx("div",{className:"toolbar-separator",style:u}),dg=u=>{u.stopPropagation(),u.preventDefault()};function tv(u){if(u<0||!isFinite(u))return"-";if(u===0)return"0ms";if(u<1e3)return u.toFixed(0)+"ms";const l=u/1e3;if(l<60)return l.toFixed(1)+"s";const i=l/60;if(i<60)return i.toFixed(1)+"m";const s=i/60;return s<24?s.toFixed(1)+"h":(s/24).toFixed(1)+"d"}const Je=function(u,l,i){return u>=l&&u<=i};function bt(u){return Je(u,48,57)}function mg(u){return bt(u)||Je(u,65,70)||Je(u,97,102)}function nv(u){return Je(u,65,90)}function lv(u){return Je(u,97,122)}function av(u){return nv(u)||lv(u)}function iv(u){return u>=128}function uu(u){return av(u)||iv(u)||u===95}function gg(u){return uu(u)||bt(u)||u===45}function sv(u){return Je(u,0,8)||u===11||Je(u,14,31)||u===127}function cu(u){return u===10}function En(u){return cu(u)||u===9||u===32}const uv=1114111;class Df extends Error{constructor(l){super(l),this.name="InvalidCharacterError"}}function cv(u){const l=[];for(let i=0;i=l.length?-1:l[$]},h=function($){if($===void 0&&($=1),$>3)throw"Spec Error: no more than three codepoints of lookahead.";return o(i+$)},m=function($){return $===void 0&&($=1),i+=$,c=o(i),!0},g=function(){return i-=1,!0},p=function($){return $===void 0&&($=c),$===-1},T=function(){if(v(),m(),En(c)){for(;En(h());)m();return new Af}else{if(c===34)return x();if(c===35)if(gg(h())||M(h(1),h(2))){const $=new Qg("");return G(h(1),h(2),h(3))&&($.type="id"),$.value=k(),$}else return new ut(c);else return c===36?h()===61?(m(),new dv):new ut(c):c===39?x():c===40?new Yg:c===41?new $g:c===42?h()===61?(m(),new mv):new ut(c):c===43?W()?(g(),_()):new ut(c):c===44?new Bg:c===45?W()?(g(),_()):h(1)===45&&h(2)===62?(m(2),new Ug):Q()?(g(),E()):new ut(c):c===46?W()?(g(),_()):new ut(c):c===58?new Rg:c===59?new jg:c===60?h(1)===33&&h(2)===45&&h(3)===45?(m(3),new Lg):new ut(c):c===64?G(h(1),h(2),h(3))?new Vg(k()):new ut(c):c===91?new Hg:c===92?R()?(g(),E()):new ut(c):c===93?new wf:c===94?h()===61?(m(),new hv):new ut(c):c===123?new kg:c===124?h()===61?(m(),new ov):h()===124?(m(),new Gg):new ut(c):c===125?new qg:c===126?h()===61?(m(),new fv):new ut(c):bt(c)?(g(),_()):uu(c)?(g(),E()):p()?new fu:new ut(c)}},v=function(){for(;h(1)===47&&h(2)===42;)for(m(2);;)if(m(),c===42&&h()===47){m();break}else if(p())return},_=function(){const $=V();if(G(h(1),h(2),h(3))){const ee=new gv;return ee.value=$.value,ee.repr=$.repr,ee.type=$.type,ee.unit=k(),ee}else if(h()===37){m();const ee=new Wg;return ee.value=$.value,ee.repr=$.repr,ee}else{const ee=new Jg;return ee.value=$.value,ee.repr=$.repr,ee.type=$.type,ee}},E=function(){const $=k();if($.toLowerCase()==="url"&&h()===40){for(m();En(h(1))&&En(h(2));)m();return h()===34||h()===39?new ou($):En(h())&&(h(2)===34||h(2)===39)?new ou($):S()}else return h()===40?(m(),new ou($)):new Kg($)},x=function($){$===void 0&&($=c);let ee="";for(;m();){if(c===$||p())return new Xg(ee);if(cu(c))return g(),new Dg;c===92?p(h())||(cu(h())?m():ee+=Fe(w())):ee+=Fe(c)}throw new Error("Internal error")},S=function(){const $=new Zg("");for(;En(h());)m();if(p(h()))return $;for(;m();){if(c===41||p())return $;if(En(c)){for(;En(h());)m();return h()===41||p(h())?(m(),$):(ie(),new ru)}else{if(c===34||c===39||c===40||sv(c))return ie(),new ru;if(c===92)if(R())$.value+=Fe(w());else return ie(),new ru;else $.value+=Fe(c)}}throw new Error("Internal error")},w=function(){if(m(),mg(c)){const $=[c];for(let Ae=0;Ae<5&&mg(h());Ae++)m(),$.push(c);En(h())&&m();let ee=parseInt($.map(function(Ae){return String.fromCharCode(Ae)}).join(""),16);return ee>uv&&(ee=65533),ee}else return p()?65533:c},M=function($,ee){return!($!==92||cu(ee))},R=function(){return M(c,h())},G=function($,ee,Ae){return $===45?uu(ee)||ee===45||M(ee,Ae):uu($)?!0:$===92?M($,ee):!1},Q=function(){return G(c,h(1),h(2))},Z=function($,ee,Ae){return $===43||$===45?!!(bt(ee)||ee===46&&bt(Ae)):$===46?!!bt(ee):!!bt($)},W=function(){return Z(c,h(1),h(2))},k=function(){let $="";for(;m();)if(gg(c))$+=Fe(c);else if(R())$+=Fe(w());else return g(),$;throw new Error("Internal parse error")},V=function(){let $="",ee="integer";for((h()===43||h()===45)&&(m(),$+=Fe(c));bt(h());)m(),$+=Fe(c);if(h(1)===46&&bt(h(2)))for(m(),$+=Fe(c),m(),$+=Fe(c),ee="number";bt(h());)m(),$+=Fe(c);const Ae=h(1),se=h(2),D=h(3);if((Ae===69||Ae===101)&&bt(se))for(m(),$+=Fe(c),m(),$+=Fe(c),ee="number";bt(h());)m(),$+=Fe(c);else if((Ae===69||Ae===101)&&(se===43||se===45)&&bt(D))for(m(),$+=Fe(c),m(),$+=Fe(c),m(),$+=Fe(c),ee="number";bt(h());)m(),$+=Fe(c);const K=U($);return{type:ee,value:K,repr:$}},U=function($){return+$},ie=function(){for(;m();){if(c===41||p())return;R()&&w()}};let te=0;for(;!p(h());)if(s.push(T()),te++,te>l.length*2)throw new Error("I'm infinite-looping!");return s}class Ke{constructor(){this.tokenType=""}toJSON(){return{token:this.tokenType}}toString(){return this.tokenType}toSource(){return""+this}}class Dg extends Ke{constructor(){super(...arguments),this.tokenType="BADSTRING"}}class ru extends Ke{constructor(){super(...arguments),this.tokenType="BADURL"}}class Af extends Ke{constructor(){super(...arguments),this.tokenType="WHITESPACE"}toString(){return"WS"}toSource(){return" "}}class Lg extends Ke{constructor(){super(...arguments),this.tokenType="CDO"}toSource(){return""}}class Rg extends Ke{constructor(){super(...arguments),this.tokenType=":"}}class jg extends Ke{constructor(){super(...arguments),this.tokenType=";"}}class Bg extends Ke{constructor(){super(...arguments),this.tokenType=","}}class wa extends Ke{constructor(){super(...arguments),this.value="",this.mirror=""}}class kg extends wa{constructor(){super(),this.tokenType="{",this.value="{",this.mirror="}"}}class qg extends wa{constructor(){super(),this.tokenType="}",this.value="}",this.mirror="{"}}class Hg extends wa{constructor(){super(),this.tokenType="[",this.value="[",this.mirror="]"}}class wf extends wa{constructor(){super(),this.tokenType="]",this.value="]",this.mirror="["}}class Yg extends wa{constructor(){super(),this.tokenType="(",this.value="(",this.mirror=")"}}class $g extends wa{constructor(){super(),this.tokenType=")",this.value=")",this.mirror="("}}class fv extends Ke{constructor(){super(...arguments),this.tokenType="~="}}class ov extends Ke{constructor(){super(...arguments),this.tokenType="|="}}class hv extends Ke{constructor(){super(...arguments),this.tokenType="^="}}class dv extends Ke{constructor(){super(...arguments),this.tokenType="$="}}class mv extends Ke{constructor(){super(...arguments),this.tokenType="*="}}class Gg extends Ke{constructor(){super(...arguments),this.tokenType="||"}}class fu extends Ke{constructor(){super(...arguments),this.tokenType="EOF"}toSource(){return""}}class ut extends Ke{constructor(l){super(),this.tokenType="DELIM",this.value="",this.value=Fe(l)}toString(){return"DELIM("+this.value+")"}toJSON(){const l=this.constructor.prototype.constructor.prototype.toJSON.call(this);return l.value=this.value,l}toSource(){return this.value==="\\"?`\\ `:this.value}}class Oa extends Ke{constructor(){super(...arguments),this.value=""}ASCIIMatch(l){return this.value.toLowerCase()===l.toLowerCase()}toJSON(){const l=this.constructor.prototype.constructor.prototype.toJSON.call(this);return l.value=this.value,l}}class Kg extends Oa{constructor(l){super(),this.tokenType="IDENT",this.value=l}toString(){return"IDENT("+this.value+")"}toSource(){return Ui(this.value)}}class ou extends Oa{constructor(l){super(),this.tokenType="FUNCTION",this.value=l,this.mirror=")"}toString(){return"FUNCTION("+this.value+")"}toSource(){return Ui(this.value)+"("}}class Vg extends Oa{constructor(l){super(),this.tokenType="AT-KEYWORD",this.value=l}toString(){return"AT("+this.value+")"}toSource(){return"@"+Ui(this.value)}}class Qg extends Oa{constructor(l){super(),this.tokenType="HASH",this.value=l,this.type="unrestricted"}toString(){return"HASH("+this.value+")"}toJSON(){const l=this.constructor.prototype.constructor.prototype.toJSON.call(this);return l.value=this.value,l.type=this.type,l}toSource(){return this.type==="id"?"#"+Ui(this.value):"#"+pv(this.value)}}class Xg extends Oa{constructor(l){super(),this.tokenType="STRING",this.value=l}toString(){return'"'+Fg(this.value)+'"'}}class Zg extends Oa{constructor(l){super(),this.tokenType="URL",this.value=l}toString(){return"URL("+this.value+")"}toSource(){return'url("'+Fg(this.value)+'")'}}class Jg extends Ke{constructor(){super(),this.tokenType="NUMBER",this.type="integer",this.repr=""}toString(){return this.type==="integer"?"INT("+this.value+")":"NUMBER("+this.value+")"}toJSON(){const l=super.toJSON();return l.value=this.value,l.type=this.type,l.repr=this.repr,l}toSource(){return this.repr}}class Wg extends Ke{constructor(){super(),this.tokenType="PERCENTAGE",this.repr=""}toString(){return"PERCENTAGE("+this.value+")"}toJSON(){const l=this.constructor.prototype.constructor.prototype.toJSON.call(this);return l.value=this.value,l.repr=this.repr,l}toSource(){return this.repr+"%"}}class gv extends Ke{constructor(){super(),this.tokenType="DIMENSION",this.type="integer",this.repr="",this.unit=""}toString(){return"DIM("+this.value+","+this.unit+")"}toJSON(){const l=this.constructor.prototype.constructor.prototype.toJSON.call(this);return l.value=this.value,l.type=this.type,l.repr=this.repr,l.unit=this.unit,l}toSource(){const l=this.repr;let i=Ui(this.unit);return i[0].toLowerCase()==="e"&&(i[1]==="-"||Je(i.charCodeAt(1),48,57))&&(i="\\65 "+i.slice(1,i.length)),l+i}}function Ui(u){u=""+u;let l="";const i=u.charCodeAt(0);for(let s=0;s=128||c===45||c===95||Je(c,48,57)||Je(c,65,90)||Je(c,97,122)?l+=u[s]:l+="\\"+u[s]}return l}function pv(u){u=""+u;let l="";for(let i=0;i=128||s===45||s===95||Je(s,48,57)||Je(s,65,90)||Je(s,97,122)?l+=u[i]:l+="\\"+s.toString(16)+" "}return l}function Fg(u){u=""+u;let l="";for(let i=0;iU instanceof Vg||U instanceof Dg||U instanceof ru||U instanceof Gg||U instanceof Lg||U instanceof Ug||U instanceof jg||U instanceof kg||U instanceof qg||U instanceof Zg||U instanceof Wg);if(s)throw new St(`Unsupported token "${s.toSource()}" while parsing css selector "${u}". Did you mean to CSS.escape it?`);let c=0;const o=new Set;function h(){return new St(`Unexpected token "${i[c].toSource()}" while parsing css selector "${u}". Did you mean to CSS.escape it?`)}function m(){for(;i[c]instanceof Af;)c++}function g(U=c){return i[U]instanceof Kg}function p(U=c){return i[U]instanceof Xg}function T(U=c){return i[U]instanceof Jg}function v(U=c){return i[U]instanceof Bg}function _(U=c){return i[U]instanceof Yg}function E(U=c){return i[U]instanceof $g}function x(U=c){return i[U]instanceof ou}function S(U=c){return i[U]instanceof ut&&i[U].value==="*"}function w(U=c){return i[U]instanceof fu}function M(U=c){return i[U]instanceof ut&&[">","+","~"].includes(i[U].value)}function R(U=c){return v(U)||E(U)||w(U)||M(U)||i[U]instanceof Af}function G(){const U=[Q()];for(;m(),!!v();)c++,U.push(Q());return U}function Q(){return m(),T()||p()?i[c++].value:Z()}function Z(){const U={simples:[]};for(m(),M()?U.simples.push({selector:{functions:[{name:"scope",args:[]}]},combinator:""}):U.simples.push({selector:W(),combinator:""});;){if(m(),M())U.simples[U.simples.length-1].combinator=i[c++].value,m();else if(R())break;U.simples.push({combinator:"",selector:W()})}return U}function W(){let U="";const ie=[];for(;!R();)if(g()||S())U+=i[c++].toSource();else if(i[c]instanceof Qg)U+=i[c++].toSource();else if(i[c]instanceof ut&&i[c].value===".")if(c++,g())U+="."+i[c++].toSource();else throw h();else if(i[c]instanceof Rg)if(c++,g())if(!l.has(i[c].value.toLowerCase()))U+=":"+i[c++].toSource();else{const te=i[c++].value.toLowerCase();ie.push({name:te,args:[]}),o.add(te)}else if(x()){const te=i[c++].value.toLowerCase();if(l.has(te)?(ie.push({name:te,args:G()}),o.add(te)):U+=`:${te}(${k()})`,m(),!E())throw h();c++}else throw h();else if(i[c]instanceof Hg){for(U+="[",c++;!(i[c]instanceof wf)&&!w();)U+=i[c++].toSource();if(!(i[c]instanceof wf))throw h();U+="]",c++}else throw h();if(!U&&!ie.length)throw h();return{css:U||void 0,functions:ie}}function k(){let U="",ie=1;for(;!w()&&((_()||x())&&ie++,E()&&ie--,!!ie);)U+=i[c++].toSource();return U}const V=G();if(!w())throw h();if(V.some(U=>typeof U!="object"||!("simples"in U)))throw new St(`Error while parsing css selector "${u}". Did you mean to CSS.escape it?`);return{selector:V,names:Array.from(o)}}const pg=new Set(["internal:has","internal:has-not","internal:and","internal:or","internal:chain","left-of","right-of","above","below","near"]),vv=new Set(["left-of","right-of","above","below","near"]),bv=new Set(["not","is","where","has","scope","light","visible","text","text-matches","text-is","has-text","above","below","right-of","left-of","near","nth-match"]);function Ig(u){const l=Tv(u),i=[];for(const s of l.parts){if(s.name==="css"||s.name==="css:light"){s.name==="css:light"&&(s.body=":light("+s.body+")");const c=yv(s.body,bv);i.push({name:"css",body:c.selector,source:s.body});continue}if(pg.has(s.name)){let c,o;try{const p=JSON.parse("["+s.body+"]");if(!Array.isArray(p)||p.length<1||p.length>2||typeof p[0]!="string")throw new St(`Malformed selector: ${s.name}=`+s.body);if(c=p[0],p.length===2){if(typeof p[1]!="number"||!vv.has(s.name))throw new St(`Malformed selector: ${s.name}=`+s.body);o=p[1]}}catch{throw new St(`Malformed selector: ${s.name}=`+s.body)}const h={name:s.name,source:s.body,body:{parsed:Ig(c),distance:o}},m=[...h.body.parsed.parts].reverse().find(p=>p.name==="internal:control"&&p.body==="enter-frame"),g=m?h.body.parsed.parts.indexOf(m):-1;g!==-1&&Sv(h.body.parsed.parts.slice(0,g+1),i.slice(0,g+1))&&h.body.parsed.parts.splice(0,g+1),i.push(h);continue}i.push({...s,source:s.body})}if(pg.has(i[0].name))throw new St(`"${i[0].name}" selector cannot be first`);return{capture:l.capture,parts:i}}function Sv(u,l){return ga({parts:u})===ga({parts:l})}function ga(u,l){return typeof u=="string"?u:u.parts.map((i,s)=>{let c=!0;!l&&s!==u.capture&&(i.name==="css"||i.name==="xpath"&&i.source.startsWith("//")||i.source.startsWith(".."))&&(c=!1);const o=c?i.name+"=":"";return`${s===u.capture?"*":""}${o}${i.source}`}).join(" >> ")}function Tv(u){let l=0,i,s=0;const c={parts:[]},o=()=>{const m=u.substring(s,l).trim(),g=m.indexOf("=");let p,T;g!==-1&&m.substring(0,g).trim().match(/^[a-zA-Z_0-9-+:*]+$/)?(p=m.substring(0,g).trim(),T=m.substring(g+1)):m.length>1&&m[0]==='"'&&m[m.length-1]==='"'||m.length>1&&m[0]==="'"&&m[m.length-1]==="'"?(p="text",T=m):/^\(*\/\//.test(m)||m.startsWith("..")?(p="xpath",T=m):(p="css",T=m);let v=!1;if(p[0]==="*"&&(v=!0,p=p.substring(1)),c.parts.push({name:p,body:T}),v){if(c.capture!==void 0)throw new St("Only one of the selectors can capture using * modifier");c.capture=c.parts.length-1}};if(!u.includes(">>"))return l=u.length,o(),c;const h=()=>{const g=u.substring(s,l).match(/^\s*text\s*=(.*)$/);return!!g&&!!g[1]};for(;l"&&u[l+1]===">"?(o(),l+=2,s=l):l++}return o(),c}function of(u,l){let i=0,s=u.length===0;const c=()=>u[i]||"",o=()=>{const w=c();return++i,s=i>=u.length,w},h=w=>{throw s?new St(`Unexpected end of selector while parsing selector \`${u}\``):new St(`Error while parsing selector \`${u}\` - unexpected symbol "${c()}" at position ${i}`+(w?" during "+w:""))};function m(){for(;!s&&/\s/.test(c());)o()}function g(w){return w>="€"||w>="0"&&w<="9"||w>="A"&&w<="Z"||w>="a"&&w<="z"||w>="0"&&w<="9"||w==="_"||w==="-"}function p(){let w="";for(m();!s&&g(c());)w+=o();return w}function T(w){let M=o();for(M!==w&&h("parsing quoted string");!s&&c()!==w;)c()==="\\"&&o(),M+=o();return c()!==w&&h("parsing quoted string"),M+=o(),M}function v(){o()!=="/"&&h("parsing regular expression");let w="",M=!1;for(;!s;){if(c()==="\\")w+=o(),s&&h("parsing regular expression");else if(M&&c()==="]")M=!1;else if(!M&&c()==="[")M=!0;else if(!M&&c()==="/")break;w+=o()}o()!=="/"&&h("parsing regular expression");let R="";for(;!s&&c().match(/[dgimsuy]/);)R+=o();try{return new RegExp(w,R)}catch(G){throw new St(`Error while parsing selector \`${u}\`: ${G.message}`)}}function _(){let w="";return m(),c()==="'"||c()==='"'?w=T(c()).slice(1,-1):w=p(),w||h("parsing property path"),w}function E(){m();let w="";return s||(w+=o()),!s&&w!=="="&&(w+=o()),["=","*=","^=","$=","|=","~="].includes(w)||h("parsing operator"),w}function x(){o();const w=[];for(w.push(_()),m();c()===".";)o(),w.push(_()),m();if(c()==="]")return o(),{name:w.join("."),jsonPath:w,op:"",value:null,caseSensitive:!1};const M=E();let R,G=!0;if(m(),c()==="/"){if(M!=="=")throw new St(`Error while parsing selector \`${u}\` - cannot use ${M} in attribute with regular expression`);R=v()}else if(c()==="'"||c()==='"')R=T(c()).slice(1,-1),m(),c()==="i"||c()==="I"?(G=!1,o()):(c()==="s"||c()==="S")&&(G=!0,o());else{for(R="";!s&&(g(c())||c()==="+"||c()===".");)R+=o();R==="true"?R=!0:R==="false"&&(R=!1)}if(m(),c()!=="]"&&h("parsing attribute value"),o(),M!=="="&&typeof R!="string")throw new St(`Error while parsing selector \`${u}\` - cannot use ${M} in attribute with non-string matching value - ${R}`);return{name:w.join("."),jsonPath:w,op:M,value:R,caseSensitive:G}}const S={name:"",attributes:[]};for(S.name=p(),m();c()==="[";)S.attributes.push(x()),m();if(s||h(void 0),!S.name&&!S.attributes.length)throw new St(`Error while parsing selector \`${u}\` - selector cannot be empty`);return S}function Au(u,l="'"){const i=JSON.stringify(u),s=i.substring(1,i.length-1).replace(/\\"/g,'"');if(l==="'")return l+s.replace(/[']/g,"\\'")+l;if(l==='"')return l+s.replace(/["]/g,'\\"')+l;if(l==="`")return l+s.replace(/[`]/g,"\\`")+l;throw new Error("Invalid escape char")}function yu(u){return u.charAt(0).toUpperCase()+u.substring(1)}function Pg(u){return u.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function wu(u){return u.replace(/(^|[^\\])(\\\\)*\\(['"`])/g,"$1$2$3")}function ep(u,l,i=!1){return Ev(u,l,i,1)[0]}function Ev(u,l,i=!1,s=20,c){try{return ma(new Cv[u](c),Ig(l),i,s)}catch{return[l]}}function ma(u,l,i=!1,s=20){const c=[...l.parts],o=[];let h=i?"frame-locator":"page";for(let m=0;mu.generateLocator(p,"has",S)));continue}if(g.name==="internal:has-not"){const x=ma(u,g.body.parsed,!1,s);o.push(x.map(S=>u.generateLocator(p,"hasNot",S)));continue}if(g.name==="internal:and"){const x=ma(u,g.body.parsed,!1,s);o.push(x.map(S=>u.generateLocator(p,"and",S)));continue}if(g.name==="internal:or"){const x=ma(u,g.body.parsed,!1,s);o.push(x.map(S=>u.generateLocator(p,"or",S)));continue}if(g.name==="internal:chain"){const x=ma(u,g.body.parsed,!1,s);o.push(x.map(S=>u.generateLocator(p,"chain",S)));continue}if(g.name==="internal:label"){const{exact:x,text:S}=Ni(g.body);o.push([u.generateLocator(p,"label",S,{exact:x})]);continue}if(g.name==="internal:role"){const x=of(g.body),S={attrs:[]};for(const w of x.attributes)w.name==="name"?(S.exact=w.caseSensitive,S.name=w.value):(w.name==="level"&&typeof w.value=="string"&&(w.value=+w.value),S.attrs.push({name:w.name==="include-hidden"?"includeHidden":w.name,value:w.value}));o.push([u.generateLocator(p,"role",x.name,S)]);continue}if(g.name==="internal:testid"){const x=of(g.body),{value:S}=x.attributes[0];o.push([u.generateLocator(p,"test-id",S)]);continue}if(g.name==="internal:attr"){const x=of(g.body),{name:S,value:w,caseSensitive:M}=x.attributes[0],R=w,G=!!M;if(S==="placeholder"){o.push([u.generateLocator(p,"placeholder",R,{exact:G})]);continue}if(S==="alt"){o.push([u.generateLocator(p,"alt",R,{exact:G})]);continue}if(S==="title"){o.push([u.generateLocator(p,"title",R,{exact:G})]);continue}}if(g.name==="internal:control"&&g.body==="enter-frame"){const x=o[o.length-1],S=c[m-1],w=x.map(M=>u.chainLocators([M,u.generateLocator(p,"frame","")]));["xpath","css"].includes(S.name)&&w.push(u.generateLocator(p,"frame-locator",ga({parts:[S]})),u.generateLocator(p,"frame-locator",ga({parts:[S]},!0))),x.splice(0,x.length,...w),h="frame-locator";continue}const T=c[m+1],v=ga({parts:[g]}),_=u.generateLocator(p,"default",v);if(T&&["internal:has-text","internal:has-not-text"].includes(T.name)){const{exact:x,text:S}=Ni(T.body);if(!x){const w=u.generateLocator("locator",T.name==="internal:has-text"?"has-text":"has-not-text",S,{exact:x}),M={};T.name==="internal:has-text"?M.hasText=S:M.hasNotText=S;const R=u.generateLocator(p,"default",v,M);o.push([u.chainLocators([_,w]),R]),m++;continue}}let E;if(["xpath","css"].includes(g.name)){const x=ga({parts:[g]},!0);E=u.generateLocator(p,"default",x)}o.push([_,E].filter(Boolean))}return Av(u,o,s)}function Av(u,l,i){const s=l.map(()=>""),c=[],o=h=>{if(h===l.length)return c.push(u.chainLocators(s)),c.lengthJSON.parse(s));for(let s=0;s{const i=he.useRef(null),[s,c]=he.useState(new Map);return he.useLayoutEffect(()=>{var o;l.find(h=>h.reveal)&&((o=i.current)==null||o.scrollIntoView({block:"center",inline:"nearest"}))},[i,l]),X.jsxs("div",{className:"call-log",style:{flex:"auto"},children:[l.map(o=>{const h=s.get(o.id),m=typeof h=="boolean"?h:o.status!=="done",g=o.params.selector?ep(u,o.params.selector):null;let p=o.title,T="";return o.title.startsWith("expect.to")||o.title.startsWith("expect.not.to")?(p="expect(",T=`).${o.title.substring(7)}()`):o.title.startsWith("locator.")?(p="",T=`.${o.title.substring(8)}()`):(g||o.params.url)&&(p=o.title+"(",T=")"),X.jsxs("div",{className:wl("call-log-call",o.status),children:[X.jsxs("div",{className:"call-log-call-header",children:[X.jsx("span",{className:wl("codicon",`codicon-chevron-${m?"down":"right"}`),style:{cursor:"pointer"},onClick:()=>{const v=new Map(s);v.set(o.id,!m),c(v)}}),p,o.params.url?X.jsx("span",{className:"call-log-details",children:X.jsx("span",{className:"call-log-url",title:o.params.url,children:o.params.url})}):void 0,g?X.jsx("span",{className:"call-log-details",children:X.jsx("span",{className:"call-log-selector",title:`page.${g}`,children:`page.${g}`})}):void 0,T,X.jsx("span",{className:wl("codicon",xv(o))}),typeof o.duration=="number"?X.jsxs("span",{className:"call-log-time",children:["— ",tv(o.duration)]}):void 0]}),(m?o.messages:[]).map((v,_)=>X.jsx("div",{className:"call-log-message",children:v.trim()},_)),!!o.error&&X.jsx("div",{className:"call-log-message error",hidden:!m,children:o.error})]},o.id)}),X.jsx("div",{ref:i})]})};function xv(u){switch(u.status){case"done":return"codicon-check";case"in-progress":return"codicon-clock";case"paused":return"codicon-debug-pause";case"error":return"codicon-error"}}const Lf=Symbol.for("yaml.alias"),Of=Symbol.for("yaml.document"),In=Symbol.for("yaml.map"),tp=Symbol.for("yaml.pair"),nn=Symbol.for("yaml.scalar"),_a=Symbol.for("yaml.seq"),Vt=Symbol.for("yaml.node.type"),el=u=>!!u&&typeof u=="object"&&u[Vt]===Lf,_l=u=>!!u&&typeof u=="object"&&u[Vt]===Of,Na=u=>!!u&&typeof u=="object"&&u[Vt]===In,je=u=>!!u&&typeof u=="object"&&u[Vt]===tp,De=u=>!!u&&typeof u=="object"&&u[Vt]===nn,Ma=u=>!!u&&typeof u=="object"&&u[Vt]===_a;function Be(u){if(u&&typeof u=="object")switch(u[Vt]){case In:case _a:return!0}return!1}function ke(u){if(u&&typeof u=="object")switch(u[Vt]){case Lf:case In:case nn:case _a:return!0}return!1}const np=u=>(De(u)||Be(u))&&!!u.anchor,Tt=Symbol("break visit"),lp=Symbol("skip children"),tn=Symbol("remove node");function Nl(u,l){const i=ap(l);_l(u)?pa(null,u.contents,i,Object.freeze([u]))===tn&&(u.contents=null):pa(null,u,i,Object.freeze([]))}Nl.BREAK=Tt;Nl.SKIP=lp;Nl.REMOVE=tn;function pa(u,l,i,s){const c=ip(u,l,i,s);if(ke(c)||je(c))return sp(u,s,c),pa(u,c,i,s);if(typeof c!="symbol"){if(Be(l)){s=Object.freeze(s.concat(l));for(let o=0;ou.replace(/[!,[\]{}]/g,l=>Dv[l]);class ot{constructor(l,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ot.defaultYaml,l),this.tags=Object.assign({},ot.defaultTags,i)}clone(){const l=new ot(this.yaml,this.tags);return l.docStart=this.docStart,l}atDocument(){const l=new ot(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ot.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ot.defaultTags);break}return l}add(l,i){this.atNextDocument&&(this.yaml={explicit:ot.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ot.defaultTags),this.atNextDocument=!1);const s=l.trim().split(/[ \t]+/),c=s.shift();switch(c){case"%TAG":{if(s.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[o,h]=s;return this.tags[o]=h,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;const[o]=s;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const h=/^\d+\.\d+$/.test(o);return i(6,`Unsupported YAML version ${o}`,h),!1}}default:return i(0,`Unknown directive ${c}`,!0),!1}}tagName(l,i){if(l==="!")return"!";if(l[0]!=="!")return i(`Not a valid tag: ${l}`),null;if(l[1]==="<"){const h=l.slice(2,-1);return h==="!"||h==="!!"?(i(`Verbatim tags aren't resolved, so ${l} is invalid.`),null):(l[l.length-1]!==">"&&i("Verbatim tags must end with a >"),h)}const[,s,c]=l.match(/^(.*!)([^!]*)$/s);c||i(`The ${l} tag has no suffix`);const o=this.tags[s];if(o)try{return o+decodeURIComponent(c)}catch(h){return i(String(h)),null}return s==="!"?l:(i(`Could not resolve tag: ${l}`),null)}tagString(l){for(const[i,s]of Object.entries(this.tags))if(l.startsWith(s))return i+Lv(l.substring(s.length));return l[0]==="!"?l:`!<${l}>`}toString(l){const i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let c;if(l&&s.length>0&&ke(l.contents)){const o={};Nl(l.contents,(h,m)=>{ke(m)&&m.tag&&(o[m.tag]=!0)}),c=Object.keys(o)}else c=[];for(const[o,h]of s)o==="!!"&&h==="tag:yaml.org,2002:"||(!l||c.some(m=>m.startsWith(h)))&&i.push(`%TAG ${o} ${h}`);return i.join(` `)}}ot.defaultYaml={explicit:!1,version:"1.2"};ot.defaultTags={"!!":"tag:yaml.org,2002:"};function up(u){if(/[\x00-\x19\s,[\]{}]/.test(u)){const i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(u)}`;throw new Error(i)}return!0}function cp(u){const l=new Set;return Nl(u,{Value(i,s){s.anchor&&l.add(s.anchor)}}),l}function rp(u,l){for(let i=1;;++i){const s=`${u}${i}`;if(!l.has(s))return s}}function Uv(u,l){const i=[],s=new Map;let c=null;return{onAnchor:o=>{i.push(o),c??(c=cp(u));const h=rp(l,c);return c.add(h),h},setAnchors:()=>{for(const o of i){const h=s.get(o);if(typeof h=="object"&&h.anchor&&(De(h.node)||Be(h.node)))h.node.anchor=h.anchor;else{const m=new Error("Failed to resolve repeated object (this should not happen)");throw m.source=o,m}}},sourceObjects:s}}function va(u,l,i,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let c=0,o=s.length;cKt(s,String(c),i));if(u&&typeof u.toJSON=="function"){if(!i||!np(u))return u.toJSON(l,i);const s={aliasCount:0,count:1,res:void 0};i.anchors.set(u,s),i.onCreate=o=>{s.res=o,delete i.onCreate};const c=u.toJSON(l,i);return i.onCreate&&i.onCreate(c),c}return typeof u=="bigint"&&!(i!=null&&i.keep)?Number(u):u}class Uf{constructor(l){Object.defineProperty(this,Vt,{value:l})}clone(){const l=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(l.range=this.range.slice()),l}toJS(l,{mapAsMap:i,maxAliasCount:s,onAnchor:c,reviver:o}={}){if(!_l(l))throw new TypeError("A document argument is required");const h={anchors:new Map,doc:l,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},m=Kt(this,"",h);if(typeof c=="function")for(const{count:g,res:p}of h.anchors.values())c(p,g);return typeof o=="function"?va(o,{"":m},"",m):m}}class _u extends Uf{constructor(l){super(Lf),this.source=l,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(l,i){let s;i!=null&&i.aliasResolveCache?s=i.aliasResolveCache:(s=[],Nl(l,{Node:(o,h)=>{(el(h)||np(h))&&s.push(h)}}),i&&(i.aliasResolveCache=s));let c;for(const o of s){if(o===this)break;o.anchor===this.source&&(c=o)}return c}toJSON(l,i){if(!i)return{source:this.source};const{anchors:s,doc:c,maxAliasCount:o}=i,h=this.resolve(c,i);if(!h){const g=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(g)}let m=s.get(h);if(m||(Kt(h,null,i),m=s.get(h)),(m==null?void 0:m.res)===void 0){const g="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(g)}if(o>=0&&(m.count+=1,m.aliasCount===0&&(m.aliasCount=hu(c,h,s)),m.count*m.aliasCount>o)){const g="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(g)}return m.res}toString(l,i,s){const c=`*${this.source}`;if(l){if(up(this.source),l.options.verifyAliasOrder&&!l.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(l.implicitKey)return`${c} `}return c}}function hu(u,l,i){if(el(l)){const s=l.resolve(u),c=i&&s&&i.get(s);return c?c.count*c.aliasCount:0}else if(Be(l)){let s=0;for(const c of l.items){const o=hu(u,c,i);o>s&&(s=o)}return s}else if(je(l)){const s=hu(u,l.key,i),c=hu(u,l.value,i);return Math.max(s,c)}return 1}const fp=u=>!u||typeof u!="function"&&typeof u!="object";class ce extends Uf{constructor(l){super(nn),this.value=l}toJSON(l,i){return i!=null&&i.keep?this.value:Kt(this.value,l,i)}toString(){return String(this.value)}}ce.BLOCK_FOLDED="BLOCK_FOLDED";ce.BLOCK_LITERAL="BLOCK_LITERAL";ce.PLAIN="PLAIN";ce.QUOTE_DOUBLE="QUOTE_DOUBLE";ce.QUOTE_SINGLE="QUOTE_SINGLE";const Rv="tag:yaml.org,2002:";function jv(u,l,i){if(l){const s=i.filter(o=>o.tag===l),c=s.find(o=>!o.format)??s[0];if(!c)throw new Error(`Tag ${l} not found`);return c}return i.find(s=>{var c;return((c=s.identify)==null?void 0:c.call(s,u))&&!s.format})}function xi(u,l,i){var v,_,E;if(_l(u)&&(u=u.contents),ke(u))return u;if(je(u)){const x=(_=(v=i.schema[In]).createNode)==null?void 0:_.call(v,i.schema,null,i);return x.items.push(u),x}(u instanceof String||u instanceof Number||u instanceof Boolean||typeof BigInt<"u"&&u instanceof BigInt)&&(u=u.valueOf());const{aliasDuplicateObjects:s,onAnchor:c,onTagObj:o,schema:h,sourceObjects:m}=i;let g;if(s&&u&&typeof u=="object"){if(g=m.get(u),g)return g.anchor??(g.anchor=c(u)),new _u(g.anchor);g={anchor:null,node:null},m.set(u,g)}l!=null&&l.startsWith("!!")&&(l=Rv+l.slice(2));let p=jv(u,l,h.tags);if(!p){if(u&&typeof u.toJSON=="function"&&(u=u.toJSON()),!u||typeof u!="object"){const x=new ce(u);return g&&(g.node=x),x}p=u instanceof Map?h[In]:Symbol.iterator in Object(u)?h[_a]:h[In]}o&&(o(p),delete i.onTagObj);const T=p!=null&&p.createNode?p.createNode(i.schema,u,i):typeof((E=p==null?void 0:p.nodeClass)==null?void 0:E.from)=="function"?p.nodeClass.from(i.schema,u,i):new ce(u);return l?T.tag=l:p.default||(T.tag=p.tag),g&&(g.node=T),T}function vu(u,l,i){let s=i;for(let c=l.length-1;c>=0;--c){const o=l[c];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const h=[];h[o]=s,s=h}else s=new Map([[o,s]])}return xi(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:u,sourceObjects:new Map})}const Ci=u=>u==null||typeof u=="object"&&!!u[Symbol.iterator]().next().done;class op extends Uf{constructor(l,i){super(l),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(l){const i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return l&&(i.schema=l),i.items=i.items.map(s=>ke(s)||je(s)?s.clone(l):s),this.range&&(i.range=this.range.slice()),i}addIn(l,i){if(Ci(l))this.add(i);else{const[s,...c]=l,o=this.get(s,!0);if(Be(o))o.addIn(c,i);else if(o===void 0&&this.schema)this.set(s,vu(this.schema,c,i));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${c}`)}}deleteIn(l){const[i,...s]=l;if(s.length===0)return this.delete(i);const c=this.get(i,!0);if(Be(c))return c.deleteIn(s);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${s}`)}getIn(l,i){const[s,...c]=l,o=this.get(s,!0);return c.length===0?!i&&De(o)?o.value:o:Be(o)?o.getIn(c,i):void 0}hasAllNullValues(l){return this.items.every(i=>{if(!je(i))return!1;const s=i.value;return s==null||l&&De(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(l){const[i,...s]=l;if(s.length===0)return this.has(i);const c=this.get(i,!0);return Be(c)?c.hasIn(s):!1}setIn(l,i){const[s,...c]=l;if(c.length===0)this.set(s,i);else{const o=this.get(s,!0);if(Be(o))o.setIn(c,i);else if(o===void 0&&this.schema)this.set(s,vu(this.schema,c,i));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${c}`)}}}const Bv=u=>u.replace(/^(?!$)(?: $)?/gm,"#");function An(u,l){return/^\n+$/.test(u)?u.substring(1):l?u.replace(/^(?! *$)/gm,l):u}const Tl=(u,l,i)=>u.endsWith(` `)?An(i,l):i.includes(` `)?` `+An(i,l):(u.endsWith(" ")?"":" ")+i,hp="flow",_f="block",du="quoted";function Nu(u,l,i="flow",{indentAtStart:s,lineWidth:c=80,minContentWidth:o=20,onFold:h,onOverflow:m}={}){if(!c||c<0)return u;cc-Math.max(2,o)?p.push(0):v=c-s);let _,E,x=!1,S=-1,w=-1,M=-1;i===_f&&(S=yg(u,S,l.length),S!==-1&&(v=S+g));for(let G;G=u[S+=1];){if(i===du&&G==="\\"){switch(w=S,u[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}M=S}if(G===` `)i===_f&&(S=yg(u,S,l.length)),v=S+l.length+g,_=void 0;else{if(G===" "&&E&&E!==" "&&E!==` `&&E!==" "){const Q=u[S+1];Q&&Q!==" "&&Q!==` `&&Q!==" "&&(_=S)}if(S>=v)if(_)p.push(_),v=_+g,_=void 0;else if(i===du){for(;E===" "||E===" ";)E=G,G=u[S+=1],x=!0;const Q=S>M+1?S-2:w-1;if(T[Q])return u;p.push(Q),T[Q]=!0,v=Q+g,_=void 0}else x=!0}E=G}if(x&&m&&m(),p.length===0)return u;h&&h();let R=u.slice(0,p[0]);for(let G=0;G({indentAtStart:l?u.indent.length:u.indentAtStart,lineWidth:u.options.lineWidth,minContentWidth:u.options.minContentWidth}),Cu=u=>/^(%|---|\.\.\.)/m.test(u);function kv(u,l,i){if(!l||l<0)return!1;const s=l-i,c=u.length;if(c<=s)return!1;for(let o=0,h=0;os)return!0;if(h=o+1,c-h<=s)return!1}return!0}function zi(u,l){const i=JSON.stringify(u);if(l.options.doubleQuotedAsJSON)return i;const{implicitKey:s}=l,c=l.options.doubleQuotedMinMultiLineLength,o=l.indent||(Cu(u)?" ":"");let h="",m=0;for(let g=0,p=i[g];p;p=i[++g])if(p===" "&&i[g+1]==="\\"&&i[g+2]==="n"&&(h+=i.slice(m,g)+"\\ ",g+=1,m=g,p="\\"),p==="\\")switch(i[g+1]){case"u":{h+=i.slice(m,g);const T=i.substr(g+2,4);switch(T){case"0000":h+="\\0";break;case"0007":h+="\\a";break;case"000b":h+="\\v";break;case"001b":h+="\\e";break;case"0085":h+="\\N";break;case"00a0":h+="\\_";break;case"2028":h+="\\L";break;case"2029":h+="\\P";break;default:T.substr(0,2)==="00"?h+="\\x"+T.substr(2):h+=i.substr(g,6)}g+=5,m=g+1}break;case"n":if(s||i[g+2]==='"'||i.length `;let v,_;for(_=i.length;_>0;--_){const Z=i[_-1];if(Z!==` `&&Z!==" "&&Z!==" ")break}let E=i.substring(_);const x=E.indexOf(` `);x===-1?v="-":i===E||x!==E.length-1?(v="+",o&&o()):v="",E&&(i=i.slice(0,-E.length),E[E.length-1]===` `&&(E=E.slice(0,-1)),E=E.replace(Mf,`$&${p}`));let S=!1,w,M=-1;for(w=0;w{W=!0});const V=Nu(`${R}${Z}${E}`,p,_f,k);if(!W)return`>${Q} ${p}${V}`}return i=i.replace(/\n+/g,`$&${p}`),`|${Q} ${p}${R}${i}${E}`}function qv(u,l,i,s){const{type:c,value:o}=u,{actualString:h,implicitKey:m,indent:g,indentStep:p,inFlow:T}=l;if(m&&o.includes(` `)||T&&/[[\]{},]/.test(o))return ba(o,l);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return m||T||!o.includes(` `)?ba(o,l):mu(u,l,i,s);if(!m&&!T&&c!==ce.PLAIN&&o.includes(` `))return mu(u,l,i,s);if(Cu(o)){if(g==="")return l.forceBlockIndent=!0,mu(u,l,i,s);if(m&&g===p)return ba(o,l)}const v=o.replace(/\n+/g,`$& ${g}`);if(h){const _=S=>{var w;return S.default&&S.tag!=="tag:yaml.org,2002:str"&&((w=S.test)==null?void 0:w.test(v))},{compat:E,tags:x}=l.doc.schema;if(x.some(_)||E!=null&&E.some(_))return ba(o,l)}return m?v:Nu(v,g,hp,Mu(l,!1))}function Ri(u,l,i,s){const{implicitKey:c,inFlow:o}=l,h=typeof u.value=="string"?u:Object.assign({},u,{value:String(u.value)});let{type:m}=u;m!==ce.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(h.value)&&(m=ce.QUOTE_DOUBLE);const g=T=>{switch(T){case ce.BLOCK_FOLDED:case ce.BLOCK_LITERAL:return c||o?ba(h.value,l):mu(h,l,i,s);case ce.QUOTE_DOUBLE:return zi(h.value,l);case ce.QUOTE_SINGLE:return Nf(h.value,l);case ce.PLAIN:return qv(h,l,i,s);default:return null}};let p=g(m);if(p===null){const{defaultKeyType:T,defaultStringType:v}=l.options,_=c&&T||v;if(p=g(_),p===null)throw new Error(`Unsupported default string type ${_}`)}return p}function dp(u,l){const i=Object.assign({blockQuote:!0,commentString:Bv,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},u.schema.toStringOptions,l);let s;switch(i.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:u,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):" ",inFlow:s,options:i}}function Hv(u,l){var c;if(l.tag){const o=u.filter(h=>h.tag===l.tag);if(o.length>0)return o.find(h=>h.format===l.format)??o[0]}let i,s;if(De(l)){s=l.value;let o=u.filter(h=>{var m;return(m=h.identify)==null?void 0:m.call(h,s)});if(o.length>1){const h=o.filter(m=>m.test);h.length>0&&(o=h)}i=o.find(h=>h.format===l.format)??o.find(h=>!h.format)}else s=l,i=u.find(o=>o.nodeClass&&s instanceof o.nodeClass);if(!i){const o=((c=s==null?void 0:s.constructor)==null?void 0:c.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${o} value`)}return i}function Yv(u,l,{anchors:i,doc:s}){if(!s.directives)return"";const c=[],o=(De(u)||Be(u))&&u.anchor;o&&up(o)&&(i.add(o),c.push(`&${o}`));const h=u.tag??(l.default?null:l.tag);return h&&c.push(s.directives.tagString(h)),c.join(" ")}function Ea(u,l,i,s){var g;if(je(u))return u.toString(l,i,s);if(el(u)){if(l.doc.directives)return u.toString(l);if((g=l.resolvedAliases)!=null&&g.has(u))throw new TypeError("Cannot stringify circular structure without alias nodes");l.resolvedAliases?l.resolvedAliases.add(u):l.resolvedAliases=new Set([u]),u=u.resolve(l.doc)}let c;const o=ke(u)?u:l.doc.createNode(u,{onTagObj:p=>c=p});c??(c=Hv(l.doc.schema.tags,o));const h=Yv(o,c,l);h.length>0&&(l.indentAtStart=(l.indentAtStart??0)+h.length+1);const m=typeof c.stringify=="function"?c.stringify(o,l,i,s):De(o)?Ri(o,l,i,s):o.toString(l,i,s);return h?De(o)||m[0]==="{"||m[0]==="["?`${h} ${m}`:`${h} ${l.indent}${m}`:m}function $v({key:u,value:l},i,s,c){const{allNullValues:o,doc:h,indent:m,indentStep:g,options:{commentString:p,indentSeq:T,simpleKeys:v}}=i;let _=ke(u)&&u.comment||null;if(v){if(_)throw new Error("With simple keys, key nodes cannot have comments");if(Be(u)||!ke(u)&&typeof u=="object"){const k="With simple keys, collection cannot be used as a key value";throw new Error(k)}}let E=!v&&(!u||_&&l==null&&!i.inFlow||Be(u)||(De(u)?u.type===ce.BLOCK_FOLDED||u.type===ce.BLOCK_LITERAL:typeof u=="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!E&&(v||!o),indent:m+g});let x=!1,S=!1,w=Ea(u,i,()=>x=!0,()=>S=!0);if(!E&&!i.inFlow&&w.length>1024){if(v)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");E=!0}if(i.inFlow){if(o||l==null)return x&&s&&s(),w===""?"?":E?`? ${w}`:w}else if(o&&!v||l==null&&E)return w=`? ${w}`,_&&!x?w+=Tl(w,i.indent,p(_)):S&&c&&c(),w;x&&(_=null),E?(_&&(w+=Tl(w,i.indent,p(_))),w=`? ${w} ${m}:`):(w=`${w}:`,_&&(w+=Tl(w,i.indent,p(_))));let M,R,G;ke(l)?(M=!!l.spaceBefore,R=l.commentBefore,G=l.comment):(M=!1,R=null,G=null,l&&typeof l=="object"&&(l=h.createNode(l))),i.implicitKey=!1,!E&&!_&&De(l)&&(i.indentAtStart=w.length+1),S=!1,!T&&g.length>=2&&!i.inFlow&&!E&&Ma(l)&&!l.flow&&!l.tag&&!l.anchor&&(i.indent=i.indent.substring(2));let Q=!1;const Z=Ea(l,i,()=>Q=!0,()=>S=!0);let W=" ";if(_||M||R){if(W=M?` `:"",R){const k=p(R);W+=` ${An(k,i.indent)}`}Z===""&&!i.inFlow?W===` `&&G&&(W=` `):W+=` ${i.indent}`}else if(!E&&Be(l)){const k=Z[0],V=Z.indexOf(` `),U=V!==-1,ie=i.inFlow??l.flow??l.items.length===0;if(U||!ie){let te=!1;if(U&&(k==="&"||k==="!")){let $=Z.indexOf(" ");k==="&"&&$!==-1&&$u===nu||typeof u=="symbol"&&u.description===nu,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ce(Symbol(nu)),{addToJSMap:gp}),stringify:()=>nu},Gv=(u,l)=>(On.identify(l)||De(l)&&(!l.type||l.type===ce.PLAIN)&&On.identify(l.value))&&(u==null?void 0:u.doc.schema.tags.some(i=>i.tag===On.tag&&i.default));function gp(u,l,i){if(i=u&&el(i)?i.resolve(u.doc):i,Ma(i))for(const s of i.items)hf(u,l,s);else if(Array.isArray(i))for(const s of i)hf(u,l,s);else hf(u,l,i)}function hf(u,l,i){const s=u&&el(i)?i.resolve(u.doc):i;if(!Na(s))throw new Error("Merge sources must be maps or map aliases");const c=s.toJSON(null,u,Map);for(const[o,h]of c)l instanceof Map?l.has(o)||l.set(o,h):l instanceof Set?l.add(o):Object.prototype.hasOwnProperty.call(l,o)||Object.defineProperty(l,o,{value:h,writable:!0,enumerable:!0,configurable:!0});return l}function pp(u,l,{key:i,value:s}){if(ke(i)&&i.addToJSMap)i.addToJSMap(u,l,s);else if(Gv(u,i))gp(u,l,s);else{const c=Kt(i,"",u);if(l instanceof Map)l.set(c,Kt(s,c,u));else if(l instanceof Set)l.add(c);else{const o=Kv(i,c,u),h=Kt(s,o,u);o in l?Object.defineProperty(l,o,{value:h,writable:!0,enumerable:!0,configurable:!0}):l[o]=h}}return l}function Kv(u,l,i){if(l===null)return"";if(typeof l!="object")return String(l);if(ke(u)&&(i!=null&&i.doc)){const s=dp(i.doc,{});s.anchors=new Set;for(const o of i.anchors.keys())s.anchors.add(o.anchor);s.inFlow=!0,s.inStringifyKey=!0;const c=u.toString(s);if(!i.mapKeyWarned){let o=JSON.stringify(c);o.length>40&&(o=o.substring(0,36)+'..."'),mp(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return c}return JSON.stringify(l)}function Rf(u,l,i){const s=xi(u,void 0,i),c=xi(l,void 0,i);return new ct(s,c)}class ct{constructor(l,i=null){Object.defineProperty(this,Vt,{value:tp}),this.key=l,this.value=i}clone(l){let{key:i,value:s}=this;return ke(i)&&(i=i.clone(l)),ke(s)&&(s=s.clone(l)),new ct(i,s)}toJSON(l,i){const s=i!=null&&i.mapAsMap?new Map:{};return pp(i,s,this)}toString(l,i,s){return l!=null&&l.doc?$v(this,l,i,s):JSON.stringify(this)}}function yp(u,l,i){return(l.inFlow??u.flow?Qv:Vv)(u,l,i)}function Vv({comment:u,items:l},i,{blockItemPrefix:s,flowChars:c,itemIndent:o,onChompKeep:h,onComment:m}){const{indent:g,options:{commentString:p}}=i,T=Object.assign({},i,{indent:o,type:null});let v=!1;const _=[];for(let x=0;xw=null,()=>v=!0);w&&(M+=Tl(M,o,p(w))),v&&w&&(v=!1),_.push(s+M)}let E;if(_.length===0)E=c.start+c.end;else{E=_[0];for(let x=1;x<_.length;++x){const S=_[x];E+=S?` ${g}${S}`:` `}}return u?(E+=` `+An(p(u),g),m&&m()):v&&h&&h(),E}function Qv({items:u},l,{flowChars:i,itemIndent:s}){const{indent:c,indentStep:o,flowCollectionPadding:h,options:{commentString:m}}=l;s+=o;const g=Object.assign({},l,{indent:s,inFlow:!0,type:null});let p=!1,T=0;const v=[];for(let x=0;xw=null);p||(p=v.length>T||M.includes(` `)),x0&&(p||(p=v.reduce((R,G)=>R+G.length+2,2)+(M.length+2)>l.options.lineWidth)),p&&(M+=",")),w&&(M+=Tl(M,s,m(w))),v.push(M),T=v.length}const{start:_,end:E}=i;if(v.length===0)return _+E;if(!p){const x=v.reduce((S,w)=>S+w.length+2,2);p=l.options.lineWidth>0&&x>l.options.lineWidth}if(p){let x=_;for(const S of v)x+=S?` ${o}${c}${S}`:` `;return`${x} ${c}${E}`}else return`${_}${h}${v.join(" ")}${h}${E}`}function bu({indent:u,options:{commentString:l}},i,s,c){if(s&&c&&(s=s.replace(/^\n+/,"")),s){const o=An(l(s),u);i.push(o.trimStart())}}function El(u,l){const i=De(l)?l.value:l;for(const s of u)if(je(s)&&(s.key===l||s.key===i||De(s.key)&&s.key.value===i))return s}class Lt extends op{static get tagName(){return"tag:yaml.org,2002:map"}constructor(l){super(In,l),this.items=[]}static from(l,i,s){const{keepUndefined:c,replacer:o}=s,h=new this(l),m=(g,p)=>{if(typeof o=="function")p=o.call(i,g,p);else if(Array.isArray(o)&&!o.includes(g))return;(p!==void 0||c)&&h.items.push(Rf(g,p,s))};if(i instanceof Map)for(const[g,p]of i)m(g,p);else if(i&&typeof i=="object")for(const g of Object.keys(i))m(g,i[g]);return typeof l.sortMapEntries=="function"&&h.items.sort(l.sortMapEntries),h}add(l,i){var h;let s;je(l)?s=l:!l||typeof l!="object"||!("key"in l)?s=new ct(l,l==null?void 0:l.value):s=new ct(l.key,l.value);const c=El(this.items,s.key),o=(h=this.schema)==null?void 0:h.sortMapEntries;if(c){if(!i)throw new Error(`Key ${s.key} already set`);De(c.value)&&fp(s.value)?c.value.value=s.value:c.value=s.value}else if(o){const m=this.items.findIndex(g=>o(s,g)<0);m===-1?this.items.push(s):this.items.splice(m,0,s)}else this.items.push(s)}delete(l){const i=El(this.items,l);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(l,i){const s=El(this.items,l),c=s==null?void 0:s.value;return(!i&&De(c)?c.value:c)??void 0}has(l){return!!El(this.items,l)}set(l,i){this.add(new ct(l,i),!0)}toJSON(l,i,s){const c=s?new s:i!=null&&i.mapAsMap?new Map:{};i!=null&&i.onCreate&&i.onCreate(c);for(const o of this.items)pp(i,c,o);return c}toString(l,i,s){if(!l)return JSON.stringify(this);for(const c of this.items)if(!je(c))throw new Error(`Map items must all be pairs; found ${JSON.stringify(c)} instead`);return!l.allNullValues&&this.hasAllNullValues(!1)&&(l=Object.assign({},l,{allNullValues:!0})),yp(this,l,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:l.indent||"",onChompKeep:s,onComment:i})}}const Ca={collection:"map",default:!0,nodeClass:Lt,tag:"tag:yaml.org,2002:map",resolve(u,l){return Na(u)||l("Expected a mapping for this tag"),u},createNode:(u,l,i)=>Lt.from(u,l,i)};class Pn extends op{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(l){super(_a,l),this.items=[]}add(l){this.items.push(l)}delete(l){const i=lu(l);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(l,i){const s=lu(l);if(typeof s!="number")return;const c=this.items[s];return!i&&De(c)?c.value:c}has(l){const i=lu(l);return typeof i=="number"&&i=0?l:null}const za={collection:"seq",default:!0,nodeClass:Pn,tag:"tag:yaml.org,2002:seq",resolve(u,l){return Ma(u)||l("Expected a sequence for this tag"),u},createNode:(u,l,i)=>Pn.from(u,l,i)},zu={identify:u=>typeof u=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:u=>u,stringify(u,l,i,s){return l=Object.assign({actualString:!0},l),Ri(u,l,i,s)}},xu={identify:u=>u==null,createNode:()=>new ce(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ce(null),stringify:({source:u},l)=>typeof u=="string"&&xu.test.test(u)?u:l.options.nullStr},jf={identify:u=>typeof u=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:u=>new ce(u[0]==="t"||u[0]==="T"),stringify({source:u,value:l},i){if(u&&jf.test.test(u)){const s=u[0]==="t"||u[0]==="T";if(l===s)return u}return l?i.options.trueStr:i.options.falseStr}};function Wt({format:u,minFractionDigits:l,tag:i,value:s}){if(typeof s=="bigint")return String(s);const c=typeof s=="number"?s:Number(s);if(!isFinite(c))return isNaN(c)?".nan":c<0?"-.inf":".inf";let o=Object.is(s,-0)?"-0":JSON.stringify(s);if(!u&&l&&(!i||i==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let h=o.indexOf(".");h<0&&(h=o.length,o+=".");let m=l-(o.length-h-1);for(;m-- >0;)o+="0"}return o}const vp={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:u=>u.slice(-3).toLowerCase()==="nan"?NaN:u[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Wt},bp={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:u=>parseFloat(u),stringify(u){const l=Number(u.value);return isFinite(l)?l.toExponential():Wt(u)}},Sp={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(u){const l=new ce(parseFloat(u)),i=u.indexOf(".");return i!==-1&&u[u.length-1]==="0"&&(l.minFractionDigits=u.length-i-1),l},stringify:Wt},Du=u=>typeof u=="bigint"||Number.isInteger(u),Bf=(u,l,i,{intAsBigInt:s})=>s?BigInt(u):parseInt(u.substring(l),i);function Tp(u,l,i){const{value:s}=u;return Du(s)&&s>=0?i+s.toString(l):Wt(u)}const Ep={identify:u=>Du(u)&&u>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(u,l,i)=>Bf(u,2,8,i),stringify:u=>Tp(u,8,"0o")},Ap={identify:Du,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(u,l,i)=>Bf(u,0,10,i),stringify:Wt},wp={identify:u=>Du(u)&&u>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(u,l,i)=>Bf(u,2,16,i),stringify:u=>Tp(u,16,"0x")},Xv=[Ca,za,zu,xu,jf,Ep,Ap,wp,vp,bp,Sp];function vg(u){return typeof u=="bigint"||Number.isInteger(u)}const au=({value:u})=>JSON.stringify(u),Zv=[{identify:u=>typeof u=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:u=>u,stringify:au},{identify:u=>u==null,createNode:()=>new ce(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:au},{identify:u=>typeof u=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:u=>u==="true",stringify:au},{identify:vg,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(u,l,{intAsBigInt:i})=>i?BigInt(u):parseInt(u,10),stringify:({value:u})=>vg(u)?u.toString():JSON.stringify(u)},{identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:u=>parseFloat(u),stringify:au}],Jv={default:!0,tag:"",test:/^/,resolve(u,l){return l(`Unresolved plain scalar ${JSON.stringify(u)}`),u}},Wv=[Ca,za].concat(Zv,Jv),kf={identify:u=>u instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(u,l){if(typeof atob=="function"){const i=atob(u.replace(/[\n\r]/g,"")),s=new Uint8Array(i.length);for(let c=0;c1&&l("Each pair must have its own sequence indicator");const c=s.items[0]||new ct(new ce(null));if(s.commentBefore&&(c.key.commentBefore=c.key.commentBefore?`${s.commentBefore} ${c.key.commentBefore}`:s.commentBefore),s.comment){const o=c.value??c.key;o.comment=o.comment?`${s.comment} ${o.comment}`:s.comment}s=c}u.items[i]=je(s)?s:new ct(s)}}else l("Expected a sequence for this tag");return u}function _p(u,l,i){const{replacer:s}=i,c=new Pn(u);c.tag="tag:yaml.org,2002:pairs";let o=0;if(l&&Symbol.iterator in Object(l))for(let h of l){typeof s=="function"&&(h=s.call(l,String(o++),h));let m,g;if(Array.isArray(h))if(h.length===2)m=h[0],g=h[1];else throw new TypeError(`Expected [key, value] tuple: ${h}`);else if(h&&h instanceof Object){const p=Object.keys(h);if(p.length===1)m=p[0],g=h[m];else throw new TypeError(`Expected tuple with one key, not ${p.length} keys`)}else m=h;c.items.push(Rf(m,g,i))}return c}const qf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Op,createNode:_p};class Sa extends Pn{constructor(){super(),this.add=Lt.prototype.add.bind(this),this.delete=Lt.prototype.delete.bind(this),this.get=Lt.prototype.get.bind(this),this.has=Lt.prototype.has.bind(this),this.set=Lt.prototype.set.bind(this),this.tag=Sa.tag}toJSON(l,i){if(!i)return super.toJSON(l);const s=new Map;i!=null&&i.onCreate&&i.onCreate(s);for(const c of this.items){let o,h;if(je(c)?(o=Kt(c.key,"",i),h=Kt(c.value,o,i)):o=Kt(c,"",i),s.has(o))throw new Error("Ordered maps must not include duplicate keys");s.set(o,h)}return s}static from(l,i,s){const c=_p(l,i,s),o=new this;return o.items=c.items,o}}Sa.tag="tag:yaml.org,2002:omap";const Hf={collection:"seq",identify:u=>u instanceof Map,nodeClass:Sa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(u,l){const i=Op(u,l),s=[];for(const{key:c}of i.items)De(c)&&(s.includes(c.value)?l(`Ordered maps must not include duplicate keys: ${c.value}`):s.push(c.value));return Object.assign(new Sa,i)},createNode:(u,l,i)=>Sa.from(u,l,i)};function Np({value:u,source:l},i){return l&&(u?Mp:Cp).test.test(l)?l:u?i.options.trueStr:i.options.falseStr}const Mp={identify:u=>u===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ce(!0),stringify:Np},Cp={identify:u=>u===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ce(!1),stringify:Np},Fv={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:u=>u.slice(-3).toLowerCase()==="nan"?NaN:u[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Wt},Iv={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:u=>parseFloat(u.replace(/_/g,"")),stringify(u){const l=Number(u.value);return isFinite(l)?l.toExponential():Wt(u)}},Pv={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(u){const l=new ce(parseFloat(u.replace(/_/g,""))),i=u.indexOf(".");if(i!==-1){const s=u.substring(i+1).replace(/_/g,"");s[s.length-1]==="0"&&(l.minFractionDigits=s.length)}return l},stringify:Wt},ji=u=>typeof u=="bigint"||Number.isInteger(u);function Lu(u,l,i,{intAsBigInt:s}){const c=u[0];if((c==="-"||c==="+")&&(l+=1),u=u.substring(l).replace(/_/g,""),s){switch(i){case 2:u=`0b${u}`;break;case 8:u=`0o${u}`;break;case 16:u=`0x${u}`;break}const h=BigInt(u);return c==="-"?BigInt(-1)*h:h}const o=parseInt(u,i);return c==="-"?-1*o:o}function Yf(u,l,i){const{value:s}=u;if(ji(s)){const c=s.toString(l);return s<0?"-"+i+c.substr(1):i+c}return Wt(u)}const eb={identify:ji,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(u,l,i)=>Lu(u,2,2,i),stringify:u=>Yf(u,2,"0b")},tb={identify:ji,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(u,l,i)=>Lu(u,1,8,i),stringify:u=>Yf(u,8,"0")},nb={identify:ji,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(u,l,i)=>Lu(u,0,10,i),stringify:Wt},lb={identify:ji,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(u,l,i)=>Lu(u,2,16,i),stringify:u=>Yf(u,16,"0x")};class Ta extends Lt{constructor(l){super(l),this.tag=Ta.tag}add(l){let i;je(l)?i=l:l&&typeof l=="object"&&"key"in l&&"value"in l&&l.value===null?i=new ct(l.key,null):i=new ct(l,null),El(this.items,i.key)||this.items.push(i)}get(l,i){const s=El(this.items,l);return!i&&je(s)?De(s.key)?s.key.value:s.key:s}set(l,i){if(typeof i!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof i}`);const s=El(this.items,l);s&&!i?this.items.splice(this.items.indexOf(s),1):!s&&i&&this.items.push(new ct(l))}toJSON(l,i){return super.toJSON(l,i,Set)}toString(l,i,s){if(!l)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},l,{allNullValues:!0}),i,s);throw new Error("Set items must all have null values")}static from(l,i,s){const{replacer:c}=s,o=new this(l);if(i&&Symbol.iterator in Object(i))for(let h of i)typeof c=="function"&&(h=c.call(i,h,h)),o.items.push(Rf(h,null,s));return o}}Ta.tag="tag:yaml.org,2002:set";const $f={collection:"map",identify:u=>u instanceof Set,nodeClass:Ta,default:!1,tag:"tag:yaml.org,2002:set",createNode:(u,l,i)=>Ta.from(u,l,i),resolve(u,l){if(Na(u)){if(u.hasAllNullValues(!0))return Object.assign(new Ta,u);l("Set items must all have null values")}else l("Expected a mapping for this tag");return u}};function Gf(u,l){const i=u[0],s=i==="-"||i==="+"?u.substring(1):u,c=h=>l?BigInt(h):Number(h),o=s.replace(/_/g,"").split(":").reduce((h,m)=>h*c(60)+c(m),c(0));return i==="-"?c(-1)*o:o}function zp(u){let{value:l}=u,i=h=>h;if(typeof l=="bigint")i=h=>BigInt(h);else if(isNaN(l)||!isFinite(l))return Wt(u);let s="";l<0&&(s="-",l*=i(-1));const c=i(60),o=[l%c];return l<60?o.unshift(0):(l=(l-o[0])/c,o.unshift(l%c),l>=60&&(l=(l-o[0])/c,o.unshift(l))),s+o.map(h=>String(h).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const xp={identify:u=>typeof u=="bigint"||Number.isInteger(u),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(u,l,{intAsBigInt:i})=>Gf(u,i),stringify:zp},Dp={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:u=>Gf(u,!1),stringify:zp},Uu={identify:u=>u instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(u){const l=u.match(Uu.test);if(!l)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,i,s,c,o,h,m]=l.map(Number),g=l[7]?Number((l[7]+"00").substr(1,3)):0;let p=Date.UTC(i,s-1,c,o||0,h||0,m||0,g);const T=l[8];if(T&&T!=="Z"){let v=Gf(T,!1);Math.abs(v)<30&&(v*=60),p-=6e4*v}return new Date(p)},stringify:({value:u})=>(u==null?void 0:u.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},bg=[Ca,za,zu,xu,Mp,Cp,eb,tb,nb,lb,Fv,Iv,Pv,kf,On,Hf,qf,$f,xp,Dp,Uu],Sg=new Map([["core",Xv],["failsafe",[Ca,za,zu]],["json",Wv],["yaml11",bg],["yaml-1.1",bg]]),Tg={binary:kf,bool:jf,float:Sp,floatExp:bp,floatNaN:vp,floatTime:Dp,int:Ap,intHex:wp,intOct:Ep,intTime:xp,map:Ca,merge:On,null:xu,omap:Hf,pairs:qf,seq:za,set:$f,timestamp:Uu},ab={"tag:yaml.org,2002:binary":kf,"tag:yaml.org,2002:merge":On,"tag:yaml.org,2002:omap":Hf,"tag:yaml.org,2002:pairs":qf,"tag:yaml.org,2002:set":$f,"tag:yaml.org,2002:timestamp":Uu};function df(u,l,i){const s=Sg.get(l);if(s&&!u)return i&&!s.includes(On)?s.concat(On):s.slice();let c=s;if(!c)if(Array.isArray(u))c=[];else{const o=Array.from(Sg.keys()).filter(h=>h!=="yaml11").map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown schema "${l}"; use one of ${o} or define customTags array`)}if(Array.isArray(u))for(const o of u)c=c.concat(o);else typeof u=="function"&&(c=u(c.slice()));return i&&(c=c.concat(On)),c.reduce((o,h)=>{const m=typeof h=="string"?Tg[h]:h;if(!m){const g=JSON.stringify(h),p=Object.keys(Tg).map(T=>JSON.stringify(T)).join(", ");throw new Error(`Unknown custom tag ${g}; use one of ${p}`)}return o.includes(m)||o.push(m),o},[])}const ib=(u,l)=>u.keyl.key?1:0;class Ru{constructor({compat:l,customTags:i,merge:s,resolveKnownTags:c,schema:o,sortMapEntries:h,toStringDefaults:m}){this.compat=Array.isArray(l)?df(l,"compat"):l?df(null,l):null,this.name=typeof o=="string"&&o||"core",this.knownTags=c?ab:{},this.tags=df(i,this.name,s),this.toStringOptions=m??null,Object.defineProperty(this,In,{value:Ca}),Object.defineProperty(this,nn,{value:zu}),Object.defineProperty(this,_a,{value:za}),this.sortMapEntries=typeof h=="function"?h:h===!0?ib:null}clone(){const l=Object.create(Ru.prototype,Object.getOwnPropertyDescriptors(this));return l.tags=this.tags.slice(),l}}function sb(u,l){var g;const i=[];let s=l.directives===!0;if(l.directives!==!1&&u.directives){const p=u.directives.toString(u);p?(i.push(p),s=!0):u.directives.docStart&&(s=!0)}s&&i.push("---");const c=dp(u,l),{commentString:o}=c.options;if(u.commentBefore){i.length!==1&&i.unshift("");const p=o(u.commentBefore);i.unshift(An(p,""))}let h=!1,m=null;if(u.contents){if(ke(u.contents)){if(u.contents.spaceBefore&&s&&i.push(""),u.contents.commentBefore){const v=o(u.contents.commentBefore);i.push(An(v,""))}c.forceBlockIndent=!!u.comment,m=u.contents.comment}const p=m?void 0:()=>h=!0;let T=Ea(u.contents,c,()=>m=null,p);m&&(T+=Tl(T,"",o(m))),(T[0]==="|"||T[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${T}`:i.push(T)}else i.push(Ea(u.contents,c));if((g=u.directives)!=null&&g.docEnd)if(u.comment){const p=o(u.comment);p.includes(` `)?(i.push("..."),i.push(An(p,""))):i.push(`... ${p}`)}else i.push("...");else{let p=u.comment;p&&h&&(p=p.replace(/^\n+/,"")),p&&((!h||m)&&i[i.length-1]!==""&&i.push(""),i.push(An(o(p),"")))}return i.join(` `)+` `}class xa{constructor(l,i,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Vt,{value:Of});let c=null;typeof i=="function"||Array.isArray(i)?c=i:s===void 0&&i&&(s=i,i=void 0);const o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=o;let{version:h}=o;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(h=this.directives.yaml.version)):this.directives=new ot({version:h}),this.setSchema(h,s),this.contents=l===void 0?null:this.createNode(l,c,s)}clone(){const l=Object.create(xa.prototype,{[Vt]:{value:Of}});return l.commentBefore=this.commentBefore,l.comment=this.comment,l.errors=this.errors.slice(),l.warnings=this.warnings.slice(),l.options=Object.assign({},this.options),this.directives&&(l.directives=this.directives.clone()),l.schema=this.schema.clone(),l.contents=ke(this.contents)?this.contents.clone(l.schema):this.contents,this.range&&(l.range=this.range.slice()),l}add(l){ha(this.contents)&&this.contents.add(l)}addIn(l,i){ha(this.contents)&&this.contents.addIn(l,i)}createAlias(l,i){if(!l.anchor){const s=cp(this);l.anchor=!i||s.has(i)?rp(i||"a",s):i}return new _u(l.anchor)}createNode(l,i,s){let c;if(typeof i=="function")l=i.call({"":l},"",l),c=i;else if(Array.isArray(i)){const w=R=>typeof R=="number"||R instanceof String||R instanceof Number,M=i.filter(w).map(String);M.length>0&&(i=i.concat(M)),c=i}else s===void 0&&i&&(s=i,i=void 0);const{aliasDuplicateObjects:o,anchorPrefix:h,flow:m,keepUndefined:g,onTagObj:p,tag:T}=s??{},{onAnchor:v,setAnchors:_,sourceObjects:E}=Uv(this,h||"a"),x={aliasDuplicateObjects:o??!0,keepUndefined:g??!1,onAnchor:v,onTagObj:p,replacer:c,schema:this.schema,sourceObjects:E},S=xi(l,T,x);return m&&Be(S)&&(S.flow=!0),_(),S}createPair(l,i,s={}){const c=this.createNode(l,null,s),o=this.createNode(i,null,s);return new ct(c,o)}delete(l){return ha(this.contents)?this.contents.delete(l):!1}deleteIn(l){return Ci(l)?this.contents==null?!1:(this.contents=null,!0):ha(this.contents)?this.contents.deleteIn(l):!1}get(l,i){return Be(this.contents)?this.contents.get(l,i):void 0}getIn(l,i){return Ci(l)?!i&&De(this.contents)?this.contents.value:this.contents:Be(this.contents)?this.contents.getIn(l,i):void 0}has(l){return Be(this.contents)?this.contents.has(l):!1}hasIn(l){return Ci(l)?this.contents!==void 0:Be(this.contents)?this.contents.hasIn(l):!1}set(l,i){this.contents==null?this.contents=vu(this.schema,[l],i):ha(this.contents)&&this.contents.set(l,i)}setIn(l,i){Ci(l)?this.contents=i:this.contents==null?this.contents=vu(this.schema,Array.from(l),i):ha(this.contents)&&this.contents.setIn(l,i)}setSchema(l,i={}){typeof l=="number"&&(l=String(l));let s;switch(l){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ot({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=l:this.directives=new ot({version:l}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const c=JSON.stringify(l);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${c}`)}}if(i.schema instanceof Object)this.schema=i.schema;else if(s)this.schema=new Ru(Object.assign(s,i));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:l,jsonArg:i,mapAsMap:s,maxAliasCount:c,onAnchor:o,reviver:h}={}){const m={anchors:new Map,doc:this,keep:!l,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof c=="number"?c:100},g=Kt(this.contents,i??"",m);if(typeof o=="function")for(const{count:p,res:T}of m.anchors.values())o(T,p);return typeof h=="function"?va(h,{"":g},"",g):g}toJSON(l,i){return this.toJS({json:!0,jsonArg:l,mapAsMap:!1,onAnchor:i})}toString(l={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in l&&(!Number.isInteger(l.indent)||Number(l.indent)<=0)){const i=JSON.stringify(l.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return sb(this,l)}}function ha(u){if(Be(u))return!0;throw new Error("Expected a YAML collection as document contents")}class Kf extends Error{constructor(l,i,s,c){super(),this.name=l,this.code=s,this.message=c,this.pos=i}}class Al extends Kf{constructor(l,i,s){super("YAMLParseError",l,i,s)}}class Lp extends Kf{constructor(l,i,s){super("YAMLWarning",l,i,s)}}const Su=(u,l)=>i=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map(m=>l.linePos(m));const{line:s,col:c}=i.linePos[0];i.message+=` at line ${s}, column ${c}`;let o=c-1,h=u.substring(l.lineStarts[s-1],l.lineStarts[s]).replace(/[\n\r]+$/,"");if(o>=60&&h.length>80){const m=Math.min(o-39,h.length-79);h="…"+h.substring(m),o-=m-1}if(h.length>80&&(h=h.substring(0,79)+"…"),s>1&&/^ *$/.test(h.substring(0,o))){let m=u.substring(l.lineStarts[s-2],l.lineStarts[s-1]);m.length>80&&(m=m.substring(0,79)+`… `),h=m+h}if(/[^ ]/.test(h)){let m=1;const g=i.linePos[1];(g==null?void 0:g.line)===s&&g.col>c&&(m=Math.max(1,Math.min(g.col-c,80-o)));const p=" ".repeat(o)+"^".repeat(m);i.message+=`: ${h} ${p} `}};function Aa(u,{flow:l,indicator:i,next:s,offset:c,onError:o,parentIndent:h,startOnNewline:m}){let g=!1,p=m,T=m,v="",_="",E=!1,x=!1,S=null,w=null,M=null,R=null,G=null,Q=null,Z=null;for(const V of u)switch(x&&(V.type!=="space"&&V.type!=="newline"&&V.type!=="comma"&&o(V.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x=!1),S&&(p&&V.type!=="comment"&&V.type!=="newline"&&o(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),V.type){case"space":!l&&(i!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&V.source.includes(" ")&&(S=V),T=!0;break;case"comment":{T||o(V,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const U=V.source.substring(1)||" ";v?v+=_+U:v=U,_="",p=!1;break}case"newline":p?v?v+=V.source:(!Q||i!=="seq-item-ind")&&(g=!0):_+=V.source,p=!0,E=!0,(w||M)&&(R=V),T=!0;break;case"anchor":w&&o(V,"MULTIPLE_ANCHORS","A node can have at most one anchor"),V.source.endsWith(":")&&o(V.offset+V.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=V,Z??(Z=V.offset),p=!1,T=!1,x=!0;break;case"tag":{M&&o(V,"MULTIPLE_TAGS","A node can have at most one tag"),M=V,Z??(Z=V.offset),p=!1,T=!1,x=!0;break}case i:(w||M)&&o(V,"BAD_PROP_ORDER",`Anchors and tags must be after the ${V.source} indicator`),Q&&o(V,"UNEXPECTED_TOKEN",`Unexpected ${V.source} in ${l??"collection"}`),Q=V,p=i==="seq-item-ind"||i==="explicit-key-ind",T=!1;break;case"comma":if(l){G&&o(V,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`),G=V,p=!1,T=!1;break}default:o(V,"UNEXPECTED_TOKEN",`Unexpected ${V.type} token`),p=!1,T=!1}const W=u[u.length-1],k=W?W.offset+W.source.length:c;return x&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&o(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S&&(p&&S.indent<=h||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&o(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:G,found:Q,spaceBefore:g,comment:v,hasNewline:E,anchor:w,tag:M,newlineAfterProp:R,end:k,start:Z??k}}function Di(u){if(!u)return null;switch(u.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(u.source.includes(` `))return!0;if(u.end){for(const l of u.end)if(l.type==="newline")return!0}return!1;case"flow-collection":for(const l of u.items){for(const i of l.start)if(i.type==="newline")return!0;if(l.sep){for(const i of l.sep)if(i.type==="newline")return!0}if(Di(l.key)||Di(l.value))return!0}return!1;default:return!0}}function Cf(u,l,i){if((l==null?void 0:l.type)==="flow-collection"){const s=l.end[0];s.indent===u&&(s.source==="]"||s.source==="}")&&Di(l)&&i(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Up(u,l,i){const{uniqueKeys:s}=u.options;if(s===!1)return!1;const c=typeof s=="function"?s:(o,h)=>o===h||De(o)&&De(h)&&o.value===h.value;return l.some(o=>c(o.key,i))}const Eg="All mapping items must start at the same column";function ub({composeNode:u,composeEmptyNode:l},i,s,c,o){var T;const h=(o==null?void 0:o.nodeClass)??Lt,m=new h(i.schema);i.atRoot&&(i.atRoot=!1);let g=s.offset,p=null;for(const v of s.items){const{start:_,key:E,sep:x,value:S}=v,w=Aa(_,{indicator:"explicit-key-ind",next:E??(x==null?void 0:x[0]),offset:g,onError:c,parentIndent:s.indent,startOnNewline:!0}),M=!w.found;if(M){if(E&&(E.type==="block-seq"?c(g,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in E&&E.indent!==s.indent&&c(g,"BAD_INDENT",Eg)),!w.anchor&&!w.tag&&!x){p=w.end,w.comment&&(m.comment?m.comment+=` `+w.comment:m.comment=w.comment);continue}(w.newlineAfterProp||Di(E))&&c(E??_[_.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((T=w.found)==null?void 0:T.indent)!==s.indent&&c(g,"BAD_INDENT",Eg);i.atKey=!0;const R=w.end,G=E?u(i,E,w,c):l(i,R,_,null,w,c);i.schema.compat&&Cf(s.indent,E,c),i.atKey=!1,Up(i,m.items,G)&&c(R,"DUPLICATE_KEY","Map keys must be unique");const Q=Aa(x??[],{indicator:"map-value-ind",next:S,offset:G.range[2],onError:c,parentIndent:s.indent,startOnNewline:!E||E.type==="block-scalar"});if(g=Q.end,Q.found){M&&((S==null?void 0:S.type)==="block-map"&&!Q.hasNewline&&c(g,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),i.options.strict&&w.startu&&(u.type==="block-map"||u.type==="block-seq");function rb({composeNode:u,composeEmptyNode:l},i,s,c,o){var w;const h=s.start.source==="{",m=h?"flow map":"flow sequence",g=(o==null?void 0:o.nodeClass)??(h?Lt:Pn),p=new g(i.schema);p.flow=!0;const T=i.atRoot;T&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let v=s.offset+s.start.source.length;for(let M=0;M0){const M=Bi(x,S,i.options.strict,c);M.comment&&(p.comment?p.comment+=` `+M.comment:p.comment=M.comment),p.range=[s.offset,S,M.offset]}else p.range=[s.offset,S,S];return p}function pf(u,l,i,s,c,o){const h=i.type==="block-map"?ub(u,l,i,s,o):i.type==="block-seq"?cb(u,l,i,s,o):rb(u,l,i,s,o),m=h.constructor;return c==="!"||c===m.tagName?(h.tag=m.tagName,h):(c&&(h.tag=c),h)}function fb(u,l,i,s,c){var _;const o=s.tag,h=o?l.directives.tagName(o.source,E=>c(o,"TAG_RESOLVE_FAILED",E)):null;if(i.type==="block-seq"){const{anchor:E,newlineAfterProp:x}=s,S=E&&o?E.offset>o.offset?E:o:E??o;S&&(!x||x.offsetE.tag===h&&E.collection===m);if(!g){const E=l.schema.knownTags[h];if((E==null?void 0:E.collection)===m)l.schema.tags.push(Object.assign({},E,{default:!1})),g=E;else return E?c(o,"BAD_COLLECTION_TYPE",`${E.tag} used for ${m} collection, but expects ${E.collection??"scalar"}`,!0):c(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${h}`,!0),pf(u,l,i,c,h)}const p=pf(u,l,i,c,h,g),T=((_=g.resolve)==null?void 0:_.call(g,p,E=>c(o,"TAG_RESOLVE_FAILED",E),l.options))??p,v=ke(T)?T:new ce(T);return v.range=p.range,v.tag=h,g!=null&&g.format&&(v.format=g.format),v}function Rp(u,l,i){const s=l.offset,c=ob(l,u.options.strict,i);if(!c)return{value:"",type:null,comment:"",range:[s,s,s]};const o=c.mode===">"?ce.BLOCK_FOLDED:ce.BLOCK_LITERAL,h=l.source?hb(l.source):[];let m=h.length;for(let S=h.length-1;S>=0;--S){const w=h[S][1];if(w===""||w==="\r")m=S;else break}if(m===0){const S=c.chomp==="+"&&h.length>0?` `.repeat(Math.max(1,h.length-1)):"";let w=s+c.length;return l.source&&(w+=l.source.length),{value:S,type:o,comment:c.comment,range:[s,w,w]}}let g=l.indent+c.indent,p=l.offset+c.length,T=0;for(let S=0;Sg&&(g=w.length);else{w.length=m;--S)h[S][0].length>g&&(m=S+1);let v="",_="",E=!1;for(let S=0;Sg||M[0]===" "?(_===" "?_=` `:!E&&_===` `&&(_=` `),v+=_+w.slice(g)+M,_=` `,E=!0):M===""?_===` `?v+=` `:_=` `:(v+=_+M,_=" ",E=!1)}switch(c.chomp){case"-":break;case"+":for(let S=m;Si(s+_,E,x);switch(c){case"scalar":m=ce.PLAIN,g=db(o,p);break;case"single-quoted-scalar":m=ce.QUOTE_SINGLE,g=mb(o,p);break;case"double-quoted-scalar":m=ce.QUOTE_DOUBLE,g=gb(o,p);break;default:return i(u,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${c}`),{value:"",type:null,comment:"",range:[s,s+o.length,s+o.length]}}const T=s+o.length,v=Bi(h,T,l,i);return{value:g,type:m,comment:v.comment,range:[s,T,v.offset]}}function db(u,l){let i="";switch(u[0]){case" ":i="a tab character";break;case",":i="flow indicator character ,";break;case"%":i="directive indicator character %";break;case"|":case">":{i=`block scalar indicator ${u[0]}`;break}case"@":case"`":{i=`reserved character ${u[0]}`;break}}return i&&l(0,"BAD_SCALAR_START",`Plain value cannot start with ${i}`),Bp(u)}function mb(u,l){return(u[u.length-1]!=="'"||u.length===1)&&l(u.length,"MISSING_CHAR","Missing closing 'quote"),Bp(u.slice(1,-1)).replace(/''/g,"'")}function Bp(u){let l,i;try{l=new RegExp(`(.*?)(?o?u.slice(o,s+1):c)}else i+=c}return(u[u.length-1]!=='"'||u.length===1)&&l(u.length,"MISSING_CHAR",'Missing closing "quote'),i}function pb(u,l){let i="",s=u[l+1];for(;(s===" "||s===" "||s===` `||s==="\r")&&!(s==="\r"&&u[l+2]!==` `);)s===` `&&(i+=` `),l+=1,s=u[l+1];return i||(i=" "),{fold:i,offset:l}}const yb={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function vb(u,l,i,s){const c=u.substr(l,i),h=c.length===i&&/^[0-9a-fA-F]+$/.test(c)?parseInt(c,16):NaN;if(isNaN(h)){const m=u.substr(l-2,i+2);return s(l-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${m}`),m}return String.fromCodePoint(h)}function kp(u,l,i,s){const{value:c,type:o,comment:h,range:m}=l.type==="block-scalar"?Rp(u,l,s):jp(l,u.options.strict,s),g=i?u.directives.tagName(i.source,v=>s(i,"TAG_RESOLVE_FAILED",v)):null;let p;u.options.stringKeys&&u.atKey?p=u.schema[nn]:g?p=bb(u.schema,c,g,i,s):l.type==="scalar"?p=Sb(u,c,l,s):p=u.schema[nn];let T;try{const v=p.resolve(c,_=>s(i??l,"TAG_RESOLVE_FAILED",_),u.options);T=De(v)?v:new ce(v)}catch(v){const _=v instanceof Error?v.message:String(v);s(i??l,"TAG_RESOLVE_FAILED",_),T=new ce(c)}return T.range=m,T.source=c,o&&(T.type=o),g&&(T.tag=g),p.format&&(T.format=p.format),h&&(T.comment=h),T}function bb(u,l,i,s,c){var m;if(i==="!")return u[nn];const o=[];for(const g of u.tags)if(!g.collection&&g.tag===i)if(g.default&&g.test)o.push(g);else return g;for(const g of o)if((m=g.test)!=null&&m.test(l))return g;const h=u.knownTags[i];return h&&!h.collection?(u.tags.push(Object.assign({},h,{default:!1,test:void 0})),h):(c(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,i!=="tag:yaml.org,2002:str"),u[nn])}function Sb({atKey:u,directives:l,schema:i},s,c,o){const h=i.tags.find(m=>{var g;return(m.default===!0||u&&m.default==="key")&&((g=m.test)==null?void 0:g.test(s))})||i[nn];if(i.compat){const m=i.compat.find(g=>{var p;return g.default&&((p=g.test)==null?void 0:p.test(s))})??i[nn];if(h.tag!==m.tag){const g=l.tagString(h.tag),p=l.tagString(m.tag),T=`Value may be parsed as either ${g} or ${p}`;o(c,"TAG_RESOLVE_FAILED",T,!0)}}return h}function Tb(u,l,i){if(l){i??(i=l.length);for(let s=i-1;s>=0;--s){let c=l[s];switch(c.type){case"space":case"comment":case"newline":u-=c.source.length;continue}for(c=l[++s];(c==null?void 0:c.type)==="space";)u+=c.source.length,c=l[++s];break}}return u}const Eb={composeNode:qp,composeEmptyNode:Vf};function qp(u,l,i,s){const c=u.atKey,{spaceBefore:o,comment:h,anchor:m,tag:g}=i;let p,T=!0;switch(l.type){case"alias":p=Ab(u,l,s),(m||g)&&s(l,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":p=kp(u,l,g,s),m&&(p.anchor=m.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{p=fb(Eb,u,l,i,s),m&&(p.anchor=m.source.substring(1))}catch(v){const _=v instanceof Error?v.message:String(v);s(l,"RESOURCE_EXHAUSTION",_)}break;default:{const v=l.type==="error"?l.message:`Unsupported token (type: ${l.type})`;s(l,"UNEXPECTED_TOKEN",v),T=!1}}return p??(p=Vf(u,l.offset,void 0,null,i,s)),m&&p.anchor===""&&s(m,"BAD_ALIAS","Anchor cannot be an empty string"),c&&u.options.stringKeys&&(!De(p)||typeof p.value!="string"||p.tag&&p.tag!=="tag:yaml.org,2002:str")&&s(g??l,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(p.spaceBefore=!0),h&&(l.type==="scalar"&&l.source===""?p.comment=h:p.commentBefore=h),u.options.keepSourceTokens&&T&&(p.srcToken=l),p}function Vf(u,l,i,s,{spaceBefore:c,comment:o,anchor:h,tag:m,end:g},p){const T={type:"scalar",offset:Tb(l,i,s),indent:-1,source:""},v=kp(u,T,m,p);return h&&(v.anchor=h.source.substring(1),v.anchor===""&&p(h,"BAD_ALIAS","Anchor cannot be an empty string")),c&&(v.spaceBefore=!0),o&&(v.comment=o,v.range[2]=g),v}function Ab({options:u},{offset:l,source:i,end:s},c){const o=new _u(i.substring(1));o.source===""&&c(l,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&c(l+i.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const h=l+i.length,m=Bi(s,h,u.strict,c);return o.range=[l,h,m.offset],m.comment&&(o.comment=m.comment),o}function wb(u,l,{offset:i,start:s,value:c,end:o},h){const m=Object.assign({_directives:l},u),g=new xa(void 0,m),p={atKey:!1,atRoot:!0,directives:g.directives,options:g.options,schema:g.schema},T=Aa(s,{indicator:"doc-start",next:c??(o==null?void 0:o[0]),offset:i,onError:h,parentIndent:0,startOnNewline:!0});T.found&&(g.directives.docStart=!0,c&&(c.type==="block-map"||c.type==="block-seq")&&!T.hasNewline&&h(T.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),g.contents=c?qp(p,c,T,h):Vf(p,T.end,s,null,T,h);const v=g.contents.range[2],_=Bi(o,v,!1,h);return _.comment&&(g.comment=_.comment),g.range=[i,v,_.offset],g}function Mi(u){if(typeof u=="number")return[u,u+1];if(Array.isArray(u))return u.length===2?u:[u[0],u[1]];const{offset:l,source:i}=u;return[l,l+(typeof i=="string"?i.length:1)]}function Ag(u){var c;let l="",i=!1,s=!1;for(let o=0;o{const h=Mi(i);o?this.warnings.push(new Lp(h,s,c)):this.errors.push(new Al(h,s,c))},this.directives=new ot({version:l.version||"1.2"}),this.options=l}decorate(l,i){const{comment:s,afterEmptyLine:c}=Ag(this.prelude);if(s){const o=l.contents;if(i)l.comment=l.comment?`${l.comment} ${s}`:s;else if(c||l.directives.docStart||!o)l.commentBefore=s;else if(Be(o)&&!o.flow&&o.items.length>0){let h=o.items[0];je(h)&&(h=h.key);const m=h.commentBefore;h.commentBefore=m?`${s} ${m}`:s}else{const h=o.commentBefore;o.commentBefore=h?`${s} ${h}`:s}}i?(Array.prototype.push.apply(l.errors,this.errors),Array.prototype.push.apply(l.warnings,this.warnings)):(l.errors=this.errors,l.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ag(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(l,i=!1,s=-1){for(const c of l)yield*this.next(c);yield*this.end(i,s)}*next(l){switch(l.type){case"directive":this.directives.add(l.source,(i,s,c)=>{const o=Mi(l);o[0]+=i,this.onError(o,"BAD_DIRECTIVE",s,c)}),this.prelude.push(l.source),this.atDirectives=!0;break;case"document":{const i=wb(this.options,this.directives,l,this.onError);this.atDirectives&&!i.directives.docStart&&this.onError(l,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(i,!1),this.doc&&(yield this.doc),this.doc=i,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(l.source);break;case"error":{const i=l.source?`${l.message}: ${JSON.stringify(l.source)}`:l.message,s=new Al(Mi(l),"UNEXPECTED_TOKEN",i);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new Al(Mi(l),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const i=Bi(l.end,l.offset+l.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),i.comment){const s=this.doc.comment;this.doc.comment=s?`${s} ${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.push(new Al(Mi(l),"UNEXPECTED_TOKEN",`Unsupported token ${l.type}`))}}*end(l=!1,i=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(l){const s=Object.assign({_directives:this.directives},this.options),c=new xa(void 0,s);this.atDirectives&&this.onError(i,"MISSING_CHAR","Missing directives-end indicator line"),c.range=[0,i,i],this.decorate(c,!1),yield c}}}function Ob(u,l=!0,i){if(u){const s=(c,o,h)=>{const m=typeof c=="number"?c:Array.isArray(c)?c[0]:c.offset;if(i)i(m,o,h);else throw new Al([m,m+1],o,h)};switch(u.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return jp(u,l,s);case"block-scalar":return Rp({options:{strict:l}},u,s)}}return null}function _b(u,l){const{implicitKey:i=!1,indent:s,inFlow:c=!1,offset:o=-1,type:h="PLAIN"}=l,m=Ri({type:h,value:u},{implicitKey:i,indent:s>0?" ".repeat(s):"",inFlow:c,options:{blockQuote:!0,lineWidth:-1}}),g=l.end??[{type:"newline",offset:-1,indent:s,source:` `}];switch(m[0]){case"|":case">":{const p=m.indexOf(` `),T=m.substring(0,p),v=m.substring(p+1)+` `,_=[{type:"block-scalar-header",offset:o,indent:s,source:T}];return Hp(_,g)||_.push({type:"newline",offset:-1,indent:s,source:` `}),{type:"block-scalar",offset:o,indent:s,props:_,source:v}}case'"':return{type:"double-quoted-scalar",offset:o,indent:s,source:m,end:g};case"'":return{type:"single-quoted-scalar",offset:o,indent:s,source:m,end:g};default:return{type:"scalar",offset:o,indent:s,source:m,end:g}}}function Nb(u,l,i={}){let{afterKey:s=!1,implicitKey:c=!1,inFlow:o=!1,type:h}=i,m="indent"in u?u.indent:null;if(s&&typeof m=="number"&&(m+=2),!h)switch(u.type){case"single-quoted-scalar":h="QUOTE_SINGLE";break;case"double-quoted-scalar":h="QUOTE_DOUBLE";break;case"block-scalar":{const p=u.props[0];if(p.type!=="block-scalar-header")throw new Error("Invalid block scalar header");h=p.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:h="PLAIN"}const g=Ri({type:h,value:l},{implicitKey:c||m===null,indent:m!==null&&m>0?" ".repeat(m):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(g[0]){case"|":case">":Mb(u,g);break;case'"':yf(u,g,"double-quoted-scalar");break;case"'":yf(u,g,"single-quoted-scalar");break;default:yf(u,g,"scalar")}}function Mb(u,l){const i=l.indexOf(` `),s=l.substring(0,i),c=l.substring(i+1)+` `;if(u.type==="block-scalar"){const o=u.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=s,u.source=c}else{const{offset:o}=u,h="indent"in u?u.indent:-1,m=[{type:"block-scalar-header",offset:o,indent:h,source:s}];Hp(m,"end"in u?u.end:void 0)||m.push({type:"newline",offset:-1,indent:h,source:` `});for(const g of Object.keys(u))g!=="type"&&g!=="offset"&&delete u[g];Object.assign(u,{type:"block-scalar",indent:h,props:m,source:c})}}function Hp(u,l){if(l)for(const i of l)switch(i.type){case"space":case"comment":u.push(i);break;case"newline":return u.push(i),!0}return!1}function yf(u,l,i){switch(u.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":u.type=i,u.source=l;break;case"block-scalar":{const s=u.props.slice(1);let c=l.length;u.props[0].type==="block-scalar-header"&&(c-=u.props[0].source.length);for(const o of s)o.offset+=c;delete u.props,Object.assign(u,{type:i,source:l,end:s});break}case"block-map":case"block-seq":{const c={type:"newline",offset:u.offset+l.length,indent:u.indent,source:` `};delete u.items,Object.assign(u,{type:i,source:l,end:[c]});break}default:{const s="indent"in u?u.indent:-1,c="end"in u&&Array.isArray(u.end)?u.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(const o of Object.keys(u))o!=="type"&&o!=="offset"&&delete u[o];Object.assign(u,{type:i,indent:s,source:l,end:c})}}}const Cb=u=>"type"in u?Tu(u):gu(u);function Tu(u){switch(u.type){case"block-scalar":{let l="";for(const i of u.props)l+=Tu(i);return l+u.source}case"block-map":case"block-seq":{let l="";for(const i of u.items)l+=gu(i);return l}case"flow-collection":{let l=u.start.source;for(const i of u.items)l+=gu(i);for(const i of u.end)l+=i.source;return l}case"document":{let l=gu(u);if(u.end)for(const i of u.end)l+=i.source;return l}default:{let l=u.source;if("end"in u&&u.end)for(const i of u.end)l+=i.source;return l}}}function gu({start:u,key:l,sep:i,value:s}){let c="";for(const o of u)c+=o.source;if(l&&(c+=Tu(l)),i)for(const o of i)c+=o.source;return s&&(c+=Tu(s)),c}const zf=Symbol("break visit"),zb=Symbol("skip children"),Yp=Symbol("remove item");function Ol(u,l){"type"in u&&u.type==="document"&&(u={start:u.start,value:u.value}),$p(Object.freeze([]),u,l)}Ol.BREAK=zf;Ol.SKIP=zb;Ol.REMOVE=Yp;Ol.itemAtPath=(u,l)=>{let i=u;for(const[s,c]of l){const o=i==null?void 0:i[s];if(o&&"items"in o)i=o.items[c];else return}return i};Ol.parentCollection=(u,l)=>{const i=Ol.itemAtPath(u,l.slice(0,-1)),s=l[l.length-1][0],c=i==null?void 0:i[s];if(c&&"items"in c)return c;throw new Error("Parent collection not found")};function $p(u,l,i){let s=i(l,u);if(typeof s=="symbol")return s;for(const c of["key","value"]){const o=l[c];if(o&&"items"in o){for(let h=0;h!!u&&"items"in u,Db=u=>!!u&&(u.type==="scalar"||u.type==="single-quoted-scalar"||u.type==="double-quoted-scalar"||u.type==="block-scalar");function Lb(u){switch(u){case ju:return"";case Bu:return"";case ku:return"";case Li:return"";default:return JSON.stringify(u)}}function Gp(u){switch(u){case ju:return"byte-order-mark";case Bu:return"doc-mode";case ku:return"flow-error-end";case Li:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(u[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const Ub=Object.freeze(Object.defineProperty({__proto__:null,BOM:ju,DOCUMENT:Bu,FLOW_END:ku,SCALAR:Li,createScalarToken:_b,isCollection:xb,isScalar:Db,prettyToken:Lb,resolveAsScalar:Ob,setScalarValue:Nb,stringify:Cb,tokenType:Gp,visit:Ol},Symbol.toStringTag,{value:"Module"}));function Jt(u){switch(u){case void 0:case" ":case` `:case"\r":case" ":return!0;default:return!1}}const wg=new Set("0123456789ABCDEFabcdef"),Rb=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),iu=new Set(",[]{}"),jb=new Set(` ,[]{} \r `),vf=u=>!u||jb.has(u);class Kp{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(l,i=!1){if(l){if(typeof l!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+l:l,this.lineEndPos=null}this.atEnd=!i;let s=this.next??"stream";for(;s&&(i||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let l=this.pos,i=this.buffer[l];for(;i===" "||i===" ";)i=this.buffer[++l];return!i||i==="#"||i===` `?!0:i==="\r"?this.buffer[l+1]===` `:!1}charAt(l){return this.buffer[this.pos+l]}continueScalar(l){let i=this.buffer[l];if(this.indentNext>0){let s=0;for(;i===" ";)i=this.buffer[++s+l];if(i==="\r"){const c=this.buffer[s+l+1];if(c===` `||!c&&!this.atEnd)return l+s+1}return i===` `||s>=this.indentNext||!i&&!this.atEnd?l+s:-1}if(i==="-"||i==="."){const s=this.buffer.substr(l,3);if((s==="---"||s==="...")&&Jt(this.buffer[l+3]))return-1}return l}getLine(){let l=this.lineEndPos;return(typeof l!="number"||l!==-1&&lthis.indentValue&&!Jt(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[l,i]=this.peek(2);if(!i&&!this.atEnd)return this.setNext("block-start");if((l==="-"||l==="?"||l===":")&&Jt(i)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const l=this.getLine();if(l===null)return this.setNext("doc");let i=yield*this.pushIndicators();switch(l[i]){case"#":yield*this.pushCount(l.length-i);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(vf),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return i+=yield*this.parseBlockScalarHeader(),i+=yield*this.pushSpaces(!0),yield*this.pushCount(l.length-i),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let l,i,s=-1;do l=yield*this.pushNewline(),l>0?(i=yield*this.pushSpaces(!1),this.indentValue=s=i):i=0,i+=yield*this.pushSpaces(!0);while(l+i>0);const c=this.getLine();if(c===null)return this.setNext("flow");if((s!==-1&&s"0"&&i<="9")this.blockScalarIndent=Number(i)-1;else if(i!=="-")break}return yield*this.pushUntil(i=>Jt(i)||i==="#")}*parseBlockScalar(){let l=this.pos-1,i=0,s;e:for(let o=this.pos;s=this.buffer[o];++o)switch(s){case" ":i+=1;break;case` `:l=o,i=0;break;case"\r":{const h=this.buffer[o+1];if(!h&&!this.atEnd)return this.setNext("block-scalar");if(h===` `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(i>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=i:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const o=this.continueScalar(l+1);if(o===-1)break;l=this.buffer.indexOf(` `,o)}while(l!==-1);if(l===-1){if(!this.atEnd)return this.setNext("block-scalar");l=this.buffer.length}}let c=l+1;for(s=this.buffer[c];s===" ";)s=this.buffer[++c];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===` `;)s=this.buffer[++c];l=c-1}else if(!this.blockScalarKeep)do{let o=l-1,h=this.buffer[o];h==="\r"&&(h=this.buffer[--o]);const m=o;for(;h===" ";)h=this.buffer[--o];if(h===` `&&o>=this.pos&&o+1+i>m)l=o;else break}while(!0);return yield Li,yield*this.pushToIndex(l+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const l=this.flowLevel>0;let i=this.pos-1,s=this.pos-1,c;for(;c=this.buffer[++s];)if(c===":"){const o=this.buffer[s+1];if(Jt(o)||l&&iu.has(o))break;i=s}else if(Jt(c)){let o=this.buffer[s+1];if(c==="\r"&&(o===` `?(s+=1,c=` `,o=this.buffer[s+1]):i=s),o==="#"||l&&iu.has(o))break;if(c===` `){const h=this.continueScalar(s+1);if(h===-1)break;s=Math.max(s,h-2)}}else{if(l&&iu.has(c))break;i=s}return!c&&!this.atEnd?this.setNext("plain-scalar"):(yield Li,yield*this.pushToIndex(i+1,!0),l?"flow":"doc")}*pushCount(l){return l>0?(yield this.buffer.substr(this.pos,l),this.pos+=l,l):0}*pushToIndex(l,i){const s=this.buffer.slice(this.pos,l);return s?(yield s,this.pos+=s.length,s.length):(i&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(vf))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const l=this.flowLevel>0,i=this.charAt(1);if(Jt(i)||l&&iu.has(i))return l?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let l=this.pos+2,i=this.buffer[l];for(;!Jt(i)&&i!==">";)i=this.buffer[++l];return yield*this.pushToIndex(i===">"?l+1:l,!1)}else{let l=this.pos+1,i=this.buffer[l];for(;i;)if(Rb.has(i))i=this.buffer[++l];else if(i==="%"&&wg.has(this.buffer[l+1])&&wg.has(this.buffer[l+2]))i=this.buffer[l+=3];else break;return yield*this.pushToIndex(l,!1)}}*pushNewline(){const l=this.buffer[this.pos];return l===` `?yield*this.pushCount(1):l==="\r"&&this.charAt(1)===` `?yield*this.pushCount(2):0}*pushSpaces(l){let i=this.pos-1,s;do s=this.buffer[++i];while(s===" "||l&&s===" ");const c=i-this.pos;return c>0&&(yield this.buffer.substr(this.pos,c),this.pos=i),c}*pushUntil(l){let i=this.pos,s=this.buffer[i];for(;!l(s);)s=this.buffer[++i];return yield*this.pushToIndex(i,!1)}}class Vp{constructor(){this.lineStarts=[],this.addNewLine=l=>this.lineStarts.push(l),this.linePos=l=>{let i=0,s=this.lineStarts.length;for(;i>1;this.lineStarts[o]=0;)switch(u[l].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((i=u[++l])==null?void 0:i.type)==="space";);return u.splice(l,u.length)}function _g(u){if(u.start.type==="flow-seq-start")for(const l of u.items)l.sep&&!l.value&&!Fn(l.start,"explicit-key-ind")&&!Fn(l.sep,"map-value-ind")&&(l.key&&(l.value=l.key),delete l.key,Qp(l.value)?l.value.end?Array.prototype.push.apply(l.value.end,l.sep):l.value.end=l.sep:Array.prototype.push.apply(l.start,l.sep),delete l.sep)}class Xf{constructor(l){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Kp,this.onNewLine=l}*parse(l,i=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(l,i))yield*this.next(s);i||(yield*this.end())}*next(l){if(this.source=l,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=l.length;return}const i=Gp(l);if(i)if(i==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=i,yield*this.step(),i){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+l.length);break;case"space":this.atNewLine&&l[0]===" "&&(this.indent+=l.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=l.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=l.length}else{const s=`Not a YAML token: ${l}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:l}),this.offset+=l.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const l=this.peek(1);if(this.type==="doc-end"&&(l==null?void 0:l.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!l)return yield*this.stream();switch(l.type){case"document":return yield*this.document(l);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(l);case"block-scalar":return yield*this.blockScalar(l);case"block-map":return yield*this.blockMap(l);case"block-seq":return yield*this.blockSequence(l);case"flow-collection":return yield*this.flowCollection(l);case"doc-end":return yield*this.documentEnd(l)}yield*this.pop()}peek(l){return this.stack[this.stack.length-l]}*pop(l){const i=l??this.stack.pop();if(!i)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield i;else{const s=this.peek(1);switch(i.type==="block-scalar"?i.indent="indent"in s?s.indent:0:i.type==="flow-collection"&&s.type==="document"&&(i.indent=0),i.type==="flow-collection"&&_g(i),s.type){case"document":s.value=i;break;case"block-scalar":s.props.push(i);break;case"block-map":{const c=s.items[s.items.length-1];if(c.value){s.items.push({start:[],key:i,sep:[]}),this.onKeyLine=!0;return}else if(c.sep)c.value=i;else{Object.assign(c,{key:i,sep:[]}),this.onKeyLine=!c.explicitKey;return}break}case"block-seq":{const c=s.items[s.items.length-1];c.value?s.items.push({start:[],value:i}):c.value=i;break}case"flow-collection":{const c=s.items[s.items.length-1];!c||c.value?s.items.push({start:[],key:i,sep:[]}):c.sep?c.value=i:Object.assign(c,{key:i,sep:[]});return}default:yield*this.pop(),yield*this.pop(i)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(i.type==="block-map"||i.type==="block-seq")){const c=i.items[i.items.length-1];c&&!c.sep&&!c.value&&c.start.length>0&&Og(c.start)===-1&&(i.indent===0||c.start.every(o=>o.type!=="comment"||o.indent=l.indent){const c=!this.onKeyLine&&this.indent===l.indent,o=c&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind";let h=[];if(o&&i.sep&&!i.value){const m=[];for(let g=0;gl.indent&&(m.length=0);break;default:m.length=0}}m.length>=2&&(h=i.sep.splice(m[1]))}switch(this.type){case"anchor":case"tag":o||i.value?(h.push(this.sourceToken),l.items.push({start:h}),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?(h.push(this.sourceToken),l.items.push({start:h,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)l.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Fn(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:h,key:null,sep:[this.sourceToken]}]});else if(Qp(i.key)&&!Fn(i.sep,"newline")){const m=da(i.start),g=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:m,key:g,sep:p}]})}else h.length>0?i.sep=i.sep.concat(h,this.sourceToken):i.sep.push(this.sourceToken);else if(Fn(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{const m=da(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:m,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||o?l.items.push({start:h,key:null,sep:[this.sourceToken]}):Fn(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 m=this.flowScalar(this.type);o||i.value?(l.items.push({start:h,key:m,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(m):(Object.assign(i,{key:m,sep:[]}),this.onKeyLine=!0);return}default:{const m=this.startBlockValue(l);if(m){if(m.type==="block-seq"){if(!i.explicitKey&&i.sep&&!Fn(i.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else c&&l.items.push({start:h});this.stack.push(m);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(l){var s;const i=l.items[l.items.length-1];switch(this.type){case"newline":if(i.value){const c="end"in i.value?i.value.end:void 0,o=Array.isArray(c)?c[c.length-1]:void 0;(o==null?void 0:o.type)==="comment"?c==null||c.push(this.sourceToken):l.items.push({start:[this.sourceToken]})}else i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)l.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,l.indent)){const c=l.items[l.items.length-2],o=(s=c==null?void 0:c.value)==null?void 0:s.end;if(Array.isArray(o)){Array.prototype.push.apply(o,i.start),o.push(this.sourceToken),l.items.pop();return}}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=l.indent)break;i.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==l.indent)break;i.value||Fn(i.start,"seq-item-ind")?l.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return}if(this.indent>l.indent){const c=this.startBlockValue(l);if(c){this.stack.push(c);return}}yield*this.pop(),yield*this.step()}*flowCollection(l){const i=l.items[l.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while((s==null?void 0:s.type)==="flow-collection")}else if(l.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!i||i.sep?l.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return;case"map-value-ind":!i||i.value?l.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?l.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 c=this.flowScalar(this.type);!i||i.value?l.items.push({start:[],key:c,sep:[]}):i.sep?this.stack.push(c):Object.assign(i,{key:c,sep:[]});return}case"flow-map-end":case"flow-seq-end":l.end.push(this.sourceToken);return}const s=this.startBlockValue(l);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===l.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 c=su(s),o=da(c);_g(l);const h=l.end.splice(1,l.end.length);h.push(this.sourceToken);const m={type:"block-map",offset:l.offset,indent:l.indent,items:[{start:o,key:l,sep:h}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=m}else yield*this.lineEnd(l)}}flowScalar(l){if(this.onNewLine){let i=this.source.indexOf(` `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(` `,i)+1}return{type:l,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(l){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=su(l),s=da(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=su(l),s=da(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(l,i){return this.type!=="comment"||this.indent<=i?!1:l.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(l){this.type!=="doc-mode"&&(l.end?l.end.push(this.sourceToken):l.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(l){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:l.end?l.end.push(this.sourceToken):l.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Xp(u){const l=u.prettyErrors!==!1;return{lineCounter:u.lineCounter||l&&new Vp||null,prettyErrors:l}}function Bb(u,l={}){const{lineCounter:i,prettyErrors:s}=Xp(l),c=new Xf(i==null?void 0:i.addNewLine),o=new Qf(l),h=Array.from(o.compose(c.parse(u)));if(s&&i)for(const m of h)m.errors.forEach(Su(u,i)),m.warnings.forEach(Su(u,i));return h.length>0?h:Object.assign([],{empty:!0},o.streamInfo())}function Zp(u,l={}){const{lineCounter:i,prettyErrors:s}=Xp(l),c=new Xf(i==null?void 0:i.addNewLine),o=new Qf(l);let h=null;for(const m of o.compose(c.parse(u),!0,u.length))if(!h)h=m;else if(h.options.logLevel!=="silent"){h.errors.push(new Al(m.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&i&&(h.errors.forEach(Su(u,i)),h.warnings.forEach(Su(u,i))),h}function kb(u,l,i){let s;typeof l=="function"?s=l:i===void 0&&l&&typeof l=="object"&&(i=l);const c=Zp(u,i);if(!c)return null;if(c.warnings.forEach(o=>mp(c.options.logLevel,o)),c.errors.length>0){if(c.options.logLevel!=="silent")throw c.errors[0];c.errors=[]}return c.toJS(Object.assign({reviver:s},i))}function qb(u,l,i){let s=null;if(typeof l=="function"||Array.isArray(l)?s=l:i===void 0&&l&&(i=l),typeof i=="string"&&(i=i.length),typeof i=="number"){const c=Math.round(i);i=c<1?void 0:c>8?{indent:8}:{indent:c}}if(u===void 0){const{keepUndefined:c}=i??l??{};if(!c)return}return _l(u)&&!s?u.toString(i):new xa(u,s,i).toString(i)}const Hb=Object.freeze(Object.defineProperty({__proto__:null,Alias:_u,CST:Ub,Composer:Qf,Document:xa,Lexer:Kp,LineCounter:Vp,Pair:ct,Parser:Xf,Scalar:ce,Schema:Ru,YAMLError:Kf,YAMLMap:Lt,YAMLParseError:Al,YAMLSeq:Pn,YAMLWarning:Lp,isAlias:el,isCollection:Be,isDocument:_l,isMap:Na,isNode:ke,isPair:je,isScalar:De,isSeq:Ma,parse:kb,parseAllDocuments:Bb,parseDocument:Zp,stringify:qb,visit:Nl,visitAsync:Ou},Symbol.toStringTag,{value:"Module"}));function Yb(u,l,i={}){var _;const s=new u.LineCounter,c={keepSourceTokens:!0,lineCounter:s,...i},o=u.parseDocument(l,c),h=[],m=E=>[s.linePos(E[0]),s.linePos(E[1])],g=E=>{h.push({message:E.message,range:[s.linePos(E.pos[0]),s.linePos(E.pos[1])]})},p=(E,x)=>{for(const S of x.items){if(S instanceof u.Scalar&&typeof S.value=="string"){const R=Eu.parse(S,c,h);R&&(E.children=E.children||[],E.children.push(R));continue}if(S instanceof u.YAMLMap){T(E,S);continue}h.push({message:"Sequence items should be strings or maps",range:m(S.range||x.range)})}},T=(E,x)=>{for(const S of x.items){if(E.children=E.children||[],!(S.key instanceof u.Scalar&&typeof S.key.value=="string")){h.push({message:"Only string keys are supported",range:m(S.key.range||x.range)});continue}const M=S.key,R=S.value;if(M.value==="text"){if(!(R instanceof u.Scalar&&typeof R.value=="string")){h.push({message:"Text value should be a string",range:m(S.value.range||x.range)});continue}E.children.push({kind:"text",text:bf(R.value)});continue}if(M.value==="/children"){if(!(R instanceof u.Scalar&&typeof R.value=="string")||R.value!=="contain"&&R.value!=="equal"&&R.value!=="deep-equal"){h.push({message:'Strict value should be "contain", "equal" or "deep-equal"',range:m(S.value.range||x.range)});continue}E.containerMode=R.value;continue}if(M.value.startsWith("/")){if(!(R instanceof u.Scalar&&typeof R.value=="string")){h.push({message:"Property value should be a string",range:m(S.value.range||x.range)});continue}E.props=E.props??{},E.props[M.value.slice(1)]=bf(R.value);continue}const G=Eu.parse(M,c,h);if(!G)continue;if(R instanceof u.Scalar){const W=typeof R.value;if(W!=="string"&&W!=="number"&&W!=="boolean"){h.push({message:"Node value should be a string or a sequence",range:m(S.value.range||x.range)});continue}E.children.push({...G,children:[{kind:"text",text:bf(String(R.value))}]});continue}if(R instanceof u.YAMLSeq){E.children.push(G),p(G,R);continue}h.push({message:"Map values should be strings or sequences",range:m(S.value.range||x.range)})}},v={kind:"role",role:"fragment"};return o.errors.forEach(g),h.length?{errors:h,fragment:v}:(o.contents instanceof u.YAMLSeq||h.push({message:'Aria snapshot must be a YAML sequence, elements starting with " -"',range:o.contents?m(o.contents.range):[{line:0,col:0},{line:0,col:0}]}),h.length?{errors:h,fragment:v}:(p(v,o.contents),h.length?{errors:h,fragment:$b}:((_=v.children)==null?void 0:_.length)===1&&(!v.containerMode||v.containerMode==="contain")?{fragment:v.children[0],errors:[]}:{fragment:v,errors:[]}))}const $b={kind:"role",role:"fragment"};function Jp(u){return u.replace(/[\u200b\u00ad]/g,"").replace(/[\r\n\s\t]+/g," ").trim()}function bf(u){return{raw:u,normalized:Jp(u)}}class Eu{static parse(l,i,s){try{return new Eu(l.value)._parse()}catch(c){if(c instanceof Ng){const o=i.prettyErrors===!1?c.message:c.message+`: `+l.value+` `+" ".repeat(c.pos)+`^ `;return s.push({message:o,range:[i.lineCounter.linePos(l.range[0]),i.lineCounter.linePos(l.range[0]+c.pos)]}),null}throw c}}constructor(l){this._input=l,this._pos=0,this._length=l.length}_peek(){return this._input[this._pos]||""}_next(){return this._pos=this._length}_isWhitespace(){return!this._eof()&&/\s/.test(this._peek())}_skipWhitespace(){for(;this._isWhitespace();)this._pos++}_readIdentifier(l){this._eof()&&this._throwError(`Unexpected end of input when expecting ${l}`);const i=this._pos;for(;!this._eof()&&/[a-zA-Z]/.test(this._peek());)this._pos++;return this._input.slice(i,this._pos)}_readString(){let l="",i=!1;for(;!this._eof();){const s=this._next();if(i)l+=s,i=!1;else if(s==="\\")i=!0;else{if(s==='"')return l;l+=s}}this._throwError("Unterminated string")}_throwError(l,i=0){throw new Ng(l,i||this._pos)}_readRegex(){let l="",i=!1,s=!1;for(;!this._eof();){const c=this._next();if(i)l+=c,i=!1;else if(c==="\\")i=!0,l+=c;else{if(c==="/"&&!s)return{pattern:l};c==="["?(s=!0,l+=c):c==="]"&&s?(l+=c,s=!1):l+=c}}this._throwError("Unterminated regex")}_readStringOrRegex(){const l=this._peek();return l==='"'?(this._next(),Jp(this._readString())):l==="/"?(this._next(),this._readRegex()):null}_readAttributes(l){let i=this._pos;for(;this._skipWhitespace(),this._peek()==="[";){this._next(),this._skipWhitespace(),i=this._pos;const s=this._readIdentifier("attribute");this._skipWhitespace();let c="";if(this._peek()==="=")for(this._next(),this._skipWhitespace(),i=this._pos;this._peek()!=="]"&&!this._isWhitespace()&&!this._eof();)c+=this._next();this._skipWhitespace(),this._peek()!=="]"&&this._throwError("Expected ]"),this._next(),this._applyAttribute(l,s,c||"true",i)}}_parse(){this._skipWhitespace();const l=this._readIdentifier("role");this._skipWhitespace();const i=this._readStringOrRegex()||"",s={kind:"role",role:l,name:i};return this._readAttributes(s),this._skipWhitespace(),this._eof()||this._throwError("Unexpected input"),s}_applyAttribute(l,i,s,c){if(i==="checked"){this._assert(s==="true"||s==="false"||s==="mixed",'Value of "checked" attribute must be a boolean or "mixed"',c),l.checked=s==="true"?!0:s==="false"?!1:"mixed";return}if(i==="disabled"){this._assert(s==="true"||s==="false",'Value of "disabled" attribute must be a boolean',c),l.disabled=s==="true";return}if(i==="expanded"){this._assert(s==="true"||s==="false",'Value of "expanded" attribute must be a boolean',c),l.expanded=s==="true";return}if(i==="active"){this._assert(s==="true"||s==="false",'Value of "active" attribute must be a boolean',c),l.active=s==="true";return}if(i==="level"){this._assert(!isNaN(Number(s)),'Value of "level" attribute must be a number',c),l.level=Number(s);return}if(i==="pressed"){this._assert(s==="true"||s==="false"||s==="mixed",'Value of "pressed" attribute must be a boolean or "mixed"',c),l.pressed=s==="true"?!0:s==="false"?!1:"mixed";return}if(i==="selected"){this._assert(s==="true"||s==="false",'Value of "selected" attribute must be a boolean',c),l.selected=s==="true";return}this._assert(!1,`Unsupported attribute [${i}]`,c)}_assert(l,i,s){l||this._throwError(i||"Assertion error",s)}}class Ng extends Error{constructor(l,i){super(l),this.pos=i}}const Gb=({className:u,style:l,open:i,isModal:s,minWidth:c,verticalOffset:o,requestClose:h,anchor:m,dataTestId:g,children:p})=>{const T=he.useRef(null),[v,_]=he.useState(0),[E]=Sf(T),[x,S]=Sf(m),w=m?Kb(E,x,o):void 0;return he.useEffect(()=>{const M=G=>{!T.current||!(G.target instanceof Node)||T.current.contains(G.target)||h==null||h()},R=G=>{G.key==="Escape"&&(h==null||h())};return i?(document.addEventListener("mousedown",M),document.addEventListener("keydown",R),()=>{document.removeEventListener("mousedown",M),document.removeEventListener("keydown",R)}):()=>{}},[i,h]),he.useLayoutEffect(()=>S(),[i,S]),he.useEffect(()=>{const M=()=>_(R=>R+1);return window.addEventListener("resize",M),()=>{window.removeEventListener("resize",M)}},[]),he.useLayoutEffect(()=>{T.current&&(i?s?T.current.showModal():T.current.show():T.current.close())},[i,s]),X.jsx("dialog",{ref:T,style:{position:"fixed",margin:w?0:void 0,zIndex:110,top:w==null?void 0:w.top,left:w==null?void 0:w.left,minWidth:c||0,...l},className:u,"data-testid":g,children:p})};function Kb(u,l,i=4,s=4){let c=Math.max(s,l.left);c+u.width>window.innerWidth-s&&(c=window.innerWidth-u.width-s);let o=Math.max(0,l.bottom)+i;return o+u.height>window.innerHeight-i&&(Math.max(0,l.top)>u.height+i?o=Math.max(0,l.top)-u.height-i:o=window.innerHeight-i-u.height),{left:c,top:o}}const Vb=({})=>{const[u,l]=he.useState([]),[i,s]=he.useState(!1),[c,o]=he.useState(new Map),[h,m]=he.useState("none"),[g,p]=he.useState(),[T,v]=pu("recorderPropertiesTab","log"),[_,E]=he.useState(),[x,S]=he.useState(),[w,M]=he.useState(!1),[R,G]=z1(),[Q,Z]=pu("autoExpect",!1),W=he.useRef(null),k=he.useMemo(Qb,[]),[V,U]=he.useState(""),ie=he.useRef(null),te=he.useMemo(()=>u.find(D=>D.id===g)??ev(),[u,g]);he.useLayoutEffect(()=>{const se={modeChanged:({mode:D})=>m(D),sourcesUpdated:({sources:D})=>{l(D),window.playwrightSourcesEchoForTest=D},pageNavigated:({url:D})=>{document.title=D?`Playwright Inspector - ${D}`:"Playwright Inspector"},pauseStateChanged:({paused:D})=>s(D),callLogsUpdated:({callLogs:D})=>{o(K=>{const ne=new Map(K);for(const de of D)de.reveal=!K.has(de.id),ne.set(de.id,de);return ne})},sourceRevealRequested:({sourceId:D})=>p(D),elementPicked:({elementInfo:D,userGesture:K})=>{const ne=te.language;U(ep(ne,D.selector)),E(D.ariaSnapshot),S([]),K&&T!=="locator"&&T!=="aria"&&v("locator"),h==="inspecting"&&T==="aria"||k.setMode({mode:h==="inspecting"?"standby":"recording"}).catch(()=>{})}};window.dispatch=D=>{se[D.method].call(se,D.params)}},[k,h,T,v,te]),he.useEffect(()=>{k.setAutoExpect({autoExpect:Q})},[Q,k]),he.useLayoutEffect(()=>{var se;(se=ie.current)==null||se.scrollIntoView({block:"center",inline:"nearest"})},[ie]),he.useLayoutEffect(()=>{const se=D=>{switch(D.key){case"F8":D.preventDefault(),i?k.resume():k.pause();break;case"F10":D.preventDefault(),i&&k.step();break}};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[i,k]);const $=he.useCallback(se=>{(h==="none"||h==="inspecting")&&k.setMode({mode:"standby"}),U(se),k.highlightRequested({selector:se})},[h,k]),ee=he.useCallback(se=>{(h==="none"||h==="inspecting")&&k.setMode({mode:"standby"});const{fragment:D,errors:K}=Yb(Hb,se,{prettyErrors:!1}),ne=K.map(de=>({message:de.message,line:de.range[1].line,column:de.range[1].col,type:"subtle-error"}));S(ne),E(se),K.length||k.highlightRequested({ariaTemplate:D})},[h,k]),Ae=h==="recording"||h==="recording-inspecting"||h==="assertingText"||h==="assertingVisibility";return X.jsxs("div",{className:"recorder",children:[X.jsxs(xg,{children:[X.jsx(Dt,{icon:Ae?"stop-circle":"circle-large-filled",title:Ae?"Stop Recording":"Start Recording",toggled:Ae,onClick:()=>{k.setMode({mode:h==="none"||h==="standby"||h==="inspecting"?"recording":"standby"})},children:"Record"}),X.jsx(hg,{}),X.jsx(Dt,{icon:"inspect",title:"Pick locator",toggled:h==="inspecting"||h==="recording-inspecting",onClick:()=>{const se={inspecting:"standby",none:"inspecting",standby:"inspecting",recording:"recording-inspecting","recording-inspecting":"recording",assertingText:"recording-inspecting",assertingVisibility:"recording-inspecting",assertingValue:"recording-inspecting",assertingSnapshot:"recording-inspecting"}[h];k.setMode({mode:se}).catch(()=>{})}}),X.jsx(Dt,{icon:"eye",title:"Assert visibility",toggled:h==="assertingVisibility",disabled:h==="none"||h==="standby"||h==="inspecting",onClick:()=>{k.setMode({mode:h==="assertingVisibility"?"recording":"assertingVisibility"})}}),X.jsx(Dt,{icon:"whole-word",title:"Assert text",toggled:h==="assertingText",disabled:h==="none"||h==="standby"||h==="inspecting",onClick:()=>{k.setMode({mode:h==="assertingText"?"recording":"assertingText"})}}),X.jsx(Dt,{icon:"symbol-constant",title:"Assert value",toggled:h==="assertingValue",disabled:h==="none"||h==="standby"||h==="inspecting",onClick:()=>{k.setMode({mode:h==="assertingValue"?"recording":"assertingValue"})}}),X.jsx(Dt,{icon:"gist",title:"Assert snapshot",toggled:h==="assertingSnapshot",disabled:h==="none"||h==="standby"||h==="inspecting",onClick:()=>{k.setMode({mode:h==="assertingSnapshot"?"recording":"assertingSnapshot"})}}),X.jsx(hg,{}),X.jsx(Dt,{icon:"files",title:"Copy",disabled:!te||!te.text,onClick:()=>{eg(te.text)}}),X.jsx(Dt,{icon:"debug-continue",title:"Resume (F8)",ariaLabel:"Resume",disabled:!i,onClick:()=>{k.resume()}}),X.jsx(Dt,{icon:"debug-pause",title:"Pause (F8)",ariaLabel:"Pause",disabled:i,onClick:()=>{k.pause()}}),X.jsx(Dt,{icon:"debug-step-over",title:"Step over (F10)",ariaLabel:"Step over",disabled:!i,onClick:()=>{k.step()}}),X.jsx("div",{style:{flex:"auto"}}),X.jsx("div",{children:"Target:"}),X.jsx(I1,{fileId:te.id,sources:u,setFileId:se=>{p(se),k.fileChanged({fileId:se})}}),X.jsx(Dt,{icon:"clear-all",title:"Clear",disabled:!te||!te.text,onClick:()=>{k.clear()}}),X.jsx(Dt,{ref:W,icon:"settings-gear",title:"Settings",onClick:()=>M(se=>!se)}),X.jsxs(Gb,{style:{padding:"4px 8px"},open:w,verticalOffset:8,requestClose:()=>M(!1),anchor:W,dataTestId:"settings-dialog",children:[X.jsxs("div",{className:"setting setting-theme",children:[X.jsx("label",{htmlFor:"dark-mode-setting",children:"Theme:"}),X.jsx("select",{id:"dark-mode-setting",value:R,onChange:se=>G(se.target.value),children:_1.map(se=>X.jsx("option",{value:se.value,children:se.label},se.value))})]},"dark-mode-setting"),X.jsxs("div",{className:"setting",title:"Automatically generate assertions while recording",children:[X.jsx("input",{type:"checkbox",id:"auto-expect-setting",checked:Q,onChange:()=>{k.setAutoExpect({autoExpect:!Q}),Z(!Q)}}),X.jsx("label",{htmlFor:"auto-expect-setting",children:"Generate assertions"})]},"auto-expect-setting")]})]}),X.jsx(J1,{sidebarSize:200,main:X.jsx(ff,{text:te.text,highlighter:te.language,highlight:te.highlight,revealLine:te.revealLine,readOnly:!0,lineNumbers:!0}),sidebar:X.jsx(W1,{rightToolbar:T==="locator"||T==="aria"?[X.jsx(Dt,{icon:"files",title:"Copy",onClick:()=>eg((T==="locator"?V:_)||"")},1)]:[],tabs:[{id:"locator",title:"Locator",render:()=>X.jsx(ff,{text:V,placeholder:"Type locator to inspect",highlighter:te.language,focusOnChange:!0,onChange:$,wrapLines:!0})},{id:"log",title:"Log",render:()=>X.jsx(zv,{language:te.language,log:Array.from(c.values())})},{id:"aria",title:"Aria",render:()=>X.jsx(ff,{text:_||"",placeholder:"Type aria template to match",highlighter:"yaml",onChange:ee,highlight:x,wrapLines:!0})}],selectedTab:T,setSelectedTab:v})})]})};function Qb(){return new Proxy({},{get:(u,l)=>{if(typeof l=="string")return i=>window.sendCommand({method:l,params:i})}})}(async()=>(N1(),B1.createRoot(document.querySelector("#root")).render(X.jsx(Vb,{}))))();export{b1 as g};