const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/codeMirrorModule-DeBYQozu.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 a(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=a(c);fetch(c.href,o)}})();function b1(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var lf={exports:{}},Oa={};/** * @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 Oa;Wm=1;var u=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function a(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 Oa.Fragment=l,Oa.jsx=a,Oa.jsxs=a,Oa}var Im;function T1(){return Im||(Im=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 Fm;function E1(){if(Fm)return ue;Fm=1;var u=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),a=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"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),O=Symbol.iterator;function E(_){return _===null||typeof _!="object"?null:(_=O&&_[O]||_["@@iterator"],typeof _=="function"?_:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function M(_,Y,J){this.props=_,this.context=Y,this.refs=w,this.updater=J||x}M.prototype.isReactComponent={},M.prototype.setState=function(_,Y){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,Y,"setState")},M.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function R(){}R.prototype=M.prototype;function K(_,Y,J){this.props=_,this.context=Y,this.refs=w,this.updater=J||x}var Q=K.prototype=new R;Q.constructor=K,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(_,Y,J){var F=J.ref;return{$$typeof:u,type:_,key:Y,ref:F!==void 0?F:null,props:J}}function ae(_,Y){return U(_.type,Y,_.props)}function te(_){return typeof _=="object"&&_!==null&&_.$$typeof===u}function $(_){var Y={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(J){return Y[J]})}var ee=/\/+/g;function we(_,Y){return typeof _=="object"&&_!==null&&_.key!=null?$(""+_.key):Y.toString(36)}function se(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(W,W):(_.status="pending",_.then(function(Y){_.status==="pending"&&(_.status="fulfilled",_.value=Y)},function(Y){_.status==="pending"&&(_.status="rejected",_.reason=Y)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function D(_,Y,J,F,re){var me=typeof _;(me==="undefined"||me==="boolean")&&(_=null);var Ae=!1;if(_===null)Ae=!0;else switch(me){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(_.$$typeof){case u:case l:Ae=!0;break;case b:return Ae=_._init,D(Ae(_._payload),Y,J,F,re)}}if(Ae)return re=re(_),Ae=F===""?"."+we(_,0):F,Z(re)?(J="",Ae!=null&&(J=Ae.replace(ee,"$&/")+"/"),D(re,Y,J,"",function(Di){return Di})):re!=null&&(te(re)&&(re=ae(re,J+(re.key==null||_&&_.key===re.key?"":(""+re.key).replace(ee,"$&/")+"/")+Ae)),Y.push(re)),1;Ae=0;var rt=F===""?".":F+":";if(Z(_))for(var Ye=0;Ye<_.length;Ye++)F=_[Ye],me=rt+we(F,Ye),Ae+=D(F,Y,J,me,re);else if(Ye=E(_),typeof Ye=="function")for(_=Ye.call(_),Ye=0;!(F=_.next()).done;)F=F.value,me=rt+we(F,Ye++),Ae+=D(F,Y,J,me,re);else if(me==="object"){if(typeof _.then=="function")return D(se(_),Y,J,F,re);throw Y=String(_),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function G(_,Y,J){if(_==null)return _;var F=[],re=0;return D(_,F,"","",function(me){return Y.call(J,me,re++)}),F}function ne(_){if(_._status===-1){var Y=_._result;Y=Y(),Y.then(function(J){(_._status===0||_._status===-1)&&(_._status=1,_._result=J)},function(J){(_._status===0||_._status===-1)&&(_._status=2,_._result=J)}),_._status===-1&&(_._status=0,_._result=Y)}if(_._status===1)return _._result.default;throw _._result}var de=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},Ne={map:G,forEach:function(_,Y,J){G(_,function(){Y.apply(this,arguments)},J)},count:function(_){var Y=0;return G(_,function(){Y++}),Y},toArray:function(_){return G(_,function(Y){return Y})||[]},only:function(_){if(!te(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return ue.Activity=v,ue.Children=Ne,ue.Component=M,ue.Fragment=a,ue.Profiler=c,ue.PureComponent=K,ue.StrictMode=s,ue.Suspense=p,ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,ue.__COMPILER_RUNTIME={__proto__:null,c:function(_){return k.H.useMemoCache(_)}},ue.cache=function(_){return function(){return _.apply(null,arguments)}},ue.cacheSignal=function(){return null},ue.cloneElement=function(_,Y,J){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var F=S({},_.props),re=_.key;if(Y!=null)for(me in Y.key!==void 0&&(re=""+Y.key),Y)!V.call(Y,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&Y.ref===void 0||(F[me]=Y[me]);var me=arguments.length-2;if(me===1)F.children=J;else if(1{const c=u==null?void 0:u.current;c&&a(c.getBoundingClientRect())},[u]);return An.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=Tl.getObject(u,l));const[a,s]=An.useState(l),c=An.useCallback(o=>{u?Tl.setObject(u,o):s(o)},[u,s]);return An.useEffect(()=>{if(u){const o=()=>s(Tl.getObject(u,l));return Tl.onChangeEmitter.addEventListener(u,o),()=>Tl.onChangeEmitter.removeEventListener(u,o)}},[l,u]),[a,c]}class w1{constructor(){this.onChangeEmitter=new EventTarget}getString(l,a){return localStorage[l]||a}setString(l,a){var s;localStorage[l]=a,this.onChangeEmitter.dispatchEvent(new Event(l)),(s=window.saveSettings)==null||s.call(window)}getObject(l,a){if(!localStorage[l])return a;try{return JSON.parse(localStorage[l])}catch{return a}}setObject(l,a){var s;localStorage[l]=JSON.stringify(a),this.onChangeEmitter.dispatchEvent(new Event(l)),(s=window.saveSettings)==null||s.call(window)}}const Tl=new w1;function Ol(...u){return u.filter(Boolean).join(" ")}const tg="\\u0000-\\u0020\\u007f-\\u009f",A1=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(),a=u==="system"?zg.matches?"dark-mode":"light-mode":u;if(l!==a){l&&document.documentElement.classList.remove(l),document.documentElement.classList.add(a);for(const s of M1)s(a)}}function Ef(){return Tl.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]=An.useState(Ef());return An.useEffect(()=>{Tl.setString(Cg,u),Tf(u)},[u]),[u,l]}var sf={exports:{}},_a={},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,G){var ne=D.length;D.push(G);e:for(;0>>1,Ne=D[de];if(0>>1;de<_;){var Y=2*(de+1)-1,J=D[Y],F=Y+1,re=D[F];if(0>c(J,ne))Fc(re,J)?(D[de]=re,D[F]=ne,de=F):(D[de]=J,D[Y]=ne,de=Y);else if(Fc(re,ne))D[de]=re,D[F]=ne,de=F;else break e}}return G}function c(D,G){var ne=D.sortIndex-G.sortIndex;return ne!==0?ne:D.id-G.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 p=[],g=[],b=1,v=null,O=3,E=!1,x=!1,S=!1,w=!1,M=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function Q(D){for(var G=a(g);G!==null;){if(G.callback===null)s(g);else if(G.startTime<=D)s(g),G.sortIndex=G.expirationTime,l(p,G);else break;G=a(g)}}function Z(D){if(S=!1,Q(D),!x)if(a(p)!==null)x=!0,W||(W=!0,$());else{var G=a(g);G!==null&&se(Z,G.startTime-D)}}var W=!1,k=-1,V=5,U=-1;function ae(){return w?!0:!(u.unstable_now()-UD&&ae());){var de=v.callback;if(typeof de=="function"){v.callback=null,O=v.priorityLevel;var Ne=de(v.expirationTime<=D);if(D=u.unstable_now(),typeof Ne=="function"){v.callback=Ne,Q(D),G=!0;break t}v===a(p)&&s(p),Q(D)}else s(p);v=a(p)}if(v!==null)G=!0;else{var _=a(g);_!==null&&se(Z,_.startTime-D),G=!1}}break e}finally{v=null,O=ne,E=!1}G=void 0}}finally{G?$():W=!1}}}var $;if(typeof K=="function")$=function(){K(te)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,we=ee.port2;ee.port1.onmessage=te,$=function(){we.postMessage(null)}}else $=function(){M(te,0)};function se(D,G){k=M(function(){D(u.unstable_now())},G)}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(g,D),a(p)===null&&D===a(g)&&(S?(R(k),k=-1):S=!0,se(Z,ne-de))):(D.sortIndex=Ne,l(p,D),x||E||(x=!0,W||(W=!0,$()))),D},u.unstable_shouldYield=ae,u.unstable_wrapCallback=function(D){var G=O;return function(){var ne=O;O=G;try{return D.apply(this,arguments)}finally{O=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 ig;function L1(){if(ig)return st;ig=1;var u=xf();function l(p){var g="https://react.dev/errors/"+p;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 _a;sg=1;var u=D1(),l=xf(),a=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 F=_(null),re=_(null),me=_(null),Ae=_(null);function rt(e,t){switch(J(me,t),J(re,e),J(F,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(F),J(F,e)}function Ye(){Y(F),Y(re),Y(me)}function Di(e){e.memoizedState!==null&&J(Ae,e);var t=F.current,n=Sm(t,e.type);t!==n&&(J(re,e),J(F,n))}function ka(e){re.current===e&&(Y(F),Y(re)),Ae.current===e&&(Y(Ae),Ta._currentValue=ne)}var qu,Zf;function nl(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||T[i]!==z[r]){var B=` `+T[i].replace(" at new "," at ");return e.displayName&&B.includes("")&&(B=B.replace("",e.displayName)),B}while(1<=i&&0<=r);break}}}finally{Hu=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?nl(n):""}function Wp(e,t){switch(e.tag){case 26:case 27:case 5:return nl(e.type);case 16:return nl("Lazy");case 13:return e.child!==t&&t!==null?nl("Suspense Fallback"):nl("Suspense");case 19:return nl("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 nl("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(i){return` Error generating stack: `+i.message+` `+i.stack}}var $u=Object.prototype.hasOwnProperty,Ku=u.unstable_scheduleCallback,Gu=u.unstable_cancelCallback,Ip=u.unstable_shouldYield,Fp=u.unstable_requestPaint,Et=u.unstable_now,Pp=u.unstable_getCurrentPriorityLevel,Wf=u.unstable_ImmediatePriority,If=u.unstable_UserBlockingPriority,qa=u.unstable_NormalPriority,ey=u.unstable_LowPriority,Ff=u.unstable_IdlePriority,ty=u.log,ny=u.unstable_setDisableYieldValue,Li=null,wt=null;function _n(e){if(typeof ty=="function"&&ny(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(Li,e)}catch{}}var At=Math.clz32?Math.clz32:ay,ly=Math.log,iy=Math.LN2;function ay(e){return e>>>=0,e===0?32:31-(ly(e)/iy|0)|0}var Ha=256,Ya=262144,$a=4194304;function ll(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 Ka(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,f=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var y=i&134217727;return y!==0?(i=y&~f,i!==0?r=ll(i):(d&=y,d!==0?r=ll(d):n||(n=y&~e,n!==0&&(r=ll(n))))):(y=i&~f,y!==0?r=ll(y):d!==0?r=ll(d):n||(n=i&~e,n!==0&&(r=ll(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 Ui(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=$a;return $a<<=1,($a&62914560)===0&&($a=4194304),e}function Vu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ri(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function uy(e,t,n,i,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,T=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 Iu(e,t,n,i,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?Fu(e,d,Ut(t)):n!=null?Fu(e,d,Ut(n)):i!=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,i,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}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=y?e.checked:!!i,e.defaultChecked=!!i,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Wu(e)}function Fu(e,t,n){t==="number"&&Qa(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ul(e,t,n,i){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 qi={};Object.defineProperty(qi,"passive",{get:function(){lc=!0}}),window.addEventListener("test",qi,qi),window.removeEventListener("test",qi,qi)}catch{lc=!1}var Mn=null,ic=null,Za=null;function So(){if(Za)return Za;var e,t=ic,n=t.length,i,r="value"in Mn?Mn.value:Mn.textContent,f=r.length;for(e=0;e=$i),_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 kl=!1;function Ky(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 Gy(e,t){if(kl)return e==="compositionend"||!rc&&Mo(e,t)?(e=So(),Za=ic=Mn=null,kl=!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=i}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=Qa(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=Qa(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 Fy=sn&&"documentMode"in document&&11>=document.documentMode,ql=null,dc=null,Qi=null,mc=!1;function Yo(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mc||ql==null||ql!==Qa(i)||(i=ql,"selectionStart"in i&&hc(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Qi&&Vi(Qi,i)||(Qi=i,i=Ys(dc,"onSelect"),0>=d,r-=d,It=1<<32-At(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=i(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&&ml(le)===A.type){n(N,A.sibling),q=r(A,C.props),Fi(q,C),q.return=N,N=q;break e}n(N,A);break}else t(N,A);A=A.sibling}C.type===S?(q=rl(C.props.children,N.mode,q,C.key),q.return=N,N=q):(q=is(C.type,C.key,C.props,null,N.mode,q),Fi(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=ml(C),ze(N,A,C,q)}if(se(C))return I(N,A,C,q);if($(C)){if(le=$(C),typeof le!="function")throw Error(s(150));return C=le.call(C),ie(N,A,C,q)}if(typeof C.then=="function")return ze(N,A,os(C),q);if(C.$$typeof===K)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{Ii=0;var le=ze(N,A,C,q);return Wl=null,le}catch(P){if(P===Jl||P===rs)throw P;var Se=_t(29,P,null,N.mode);return Se.lanes=q,Se.return=N,Se}finally{}}}var pl=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 i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ee&2)!==0){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=ls(e),Zo(e,null,n),t}return ns(e,i,t,n),ls(e)}function Pi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,to(e,n)}}function Rc(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){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:i.baseState,firstBaseUpdate:r,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var jc=!1;function ea(){if(jc){var e=Zl;if(e!==null)throw e}}function ta(e,t,n,i){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 T=y,z=T.next;T.next=null,d===null?f=z:d.next=z,d=T;var B=e.alternate;B!==null&&(B=B.updateQueue,y=B.lastBaseUpdate,y!==d&&(y===null?B.firstBaseUpdate=z:y.next=z,B.lastBaseUpdate=T))}if(f!==null){var H=r.baseState;d=0,B=z=T=null,y=f;do{var L=y.lane&-536870913,j=L!==y.lane;if(j?(ye&L)===L:(i&L)===L){L!==0&&L===Xl&&(jc=!0),B!==null&&(B=B.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var I=e,ie=y;L=t;var ze=n;switch(ie.tag){case 1:if(I=ie.payload,typeof I=="function"){H=I.call(ze,H,L);break e}H=I;break e;case 3:I.flags=I.flags&-65537|128;case 0:if(I=ie.payload,L=typeof I=="function"?I.call(ze,H,L):I,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,T=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&&(T=H),r.baseState=T,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 T=r(),z=D.S;if(z!==null&&z(y,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var B=u0(T,i);ia(e,t,B,xt(e))}else ia(e,t,i,xt(e))}catch(H){ia(e,t,{then:function(){},status:"rejected",reason:H},xt())}finally{G.p=f,d!==null&&y.types!==null&&(d.types=y.types),D.T=d}}function d0(){}function Pc(e,t,n,i){if(e.tag!==5)throw Error(s(476));var r=Vh(e).queue;Gh(e,r,t,ne,n===null?d0:function(){return Qh(e),n(i)})}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),ia(e,t.next.queue,{},xt())}function er(){return lt(Ta)}function Xh(){return Ke().memoizedState}function Zh(){return Ke().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 i=Rn(t,e,n);i!==null&&(vt(i,t,n),Pi(i,t,n)),t={cache:Cc()},e.payload=t;return}t=t.return}}function g0(e,t,n){var i=xt();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Es(e)?Wh(t,n):(n=vc(e,t,n,i),n!==null&&(vt(n,e,i),Ih(n,t,i)))}function Jh(e,t,n){var i=xt();ia(e,t,n,i)}function ia(e,t,n,i){var r={lane:i,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,i),n!==null)return vt(n,e,i),Ih(n,t,i),!0}return!1}function tr(e,t,n,i){if(i={lane:2,revertLane:Lr(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Es(e)){if(t)throw Error(s(479))}else t=vc(e,n,i,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 Ih(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,to(e,n)}}var aa={readContext:lt,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};aa.useEffectEvent=qe;var Fh={readContext:lt,use:vs,useCallback:function(e,t){return ft().memoizedState=[e,t===void 0?null:t],e},useContext:lt,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 i=e();if(yl){_n(!0);try{e()}finally{_n(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=ft();if(n!==void 0){var r=n(t);if(yl){_n(!0);try{n(t)}finally{_n(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=g0.bind(null,fe,e),[i.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:Ic,useDeferredValue:function(e,t){var n=ft();return Fc(n,e,t)},useTransition:function(){var e=Zc(!1);return e=Gh.bind(null,fe,e.queue,!0,!1),ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=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(i,t,n)}r.memoizedState=n;var f={value:n,getSnapshot:t};return r.queue=f,Rh(Th.bind(null,i,f,e),[e]),i.flags|=2048,ei(9,{destroy:void 0},Sh.bind(null,i,f,n,t),null),n},useId:function(){var e=ft(),t=xe.identifierPrefix;if(be){var n=Ft,i=It;n=(i&~(1<<32-At(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ps++,0<\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?d.createElement("select",{is:i.is}):d.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?d.createElement(r,{is:i.is}):d.createElement(r)}}f[tt]=t,f[ht]=i;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,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&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!==i&&mn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(s(166));if(e=me.current,Vl(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=nt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[tt]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||ym(e.nodeValue,n)),e||xn(t,!0)}else e=$s(e).createTextNode(i),e[tt]=t,t.stateNode=e}return Ue(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=Vl(t),n!==null){if(e===null){if(!i)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[tt]=t}else fl(),(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(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Vl(t),i!==null&&i.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[tt]=t}else fl(),(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=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==r&&(i.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),i=t.memoizedState,i===null)return Ue(t),null;if(r=(t.flags&128)!==0,f=i.rendering,f===null)if(r)ua(i,!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,ua(i,!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,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Et()>Ds&&(t.flags|=128,r=!0,ua(i,!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),ua(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!be)return Ue(t),null}else 2*Et()-i.renderingStartTime>Ds&&n!==536870912&&(t.flags|=128,r=!0,ua(i,!1),t.lanes=4194304);i.isBackwards?(f.sibling=t.child,t.child=f):(e=i.last,e!==null?e.sibling=f:t.child=f,i.last=f)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Et(),e.sibling=null,n=$e.current,J($e,r?n&1|2:n&1),be&&cn(t,i.treeForkCount),e):(Ue(t),null);case 22:case 23:return Mt(t),kc(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(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),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Y(dl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),fn(Qe),Ue(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function S0(e,t){switch(wc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fn(Qe),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ka(t),null;case 31:if(t.memoizedState!==null){if(Mt(t),t.alternate===null)throw Error(s(340));fl()}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));fl()}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(dl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return fn(Qe),null;case 25:return null;default:return null}}function Ed(e,t){switch(wc(t),t.tag){case 3:fn(Qe),Ye();break;case 26:case 27:case 5:ka(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(dl);break;case 24:fn(Qe)}}function ca(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var f=n.create,d=n.inst;i=f(),d.destroy=i}n=n.next}while(n!==r)}}catch(y){_e(t,t.return,y)}}function kn(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var f=r.next;i=f;do{if((i.tag&e)===e){var d=i.inst,y=d.destroy;if(y!==void 0){d.destroy=void 0,r=t;var T=n,z=y;try{z()}catch(B){_e(r,T,B)}}}i=i.next}while(i!==f)}}catch(B){_e(t,t.return,B)}}function wd(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{dh(t,n)}catch(i){_e(e,e.return,i)}}}function Ad(e,t,n){n.props=vl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){_e(e,t,i)}}function ra(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(r){_e(e,t,r)}}function Pt(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}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,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){_e(e,e.return,r)}}function pr(e,t,n){try{var i=e.stateNode;$0(i,e.type,n,t),i[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 i=e.tag;if(i===5||i===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(i!==4&&(i===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 i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===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 i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);at(t,i,n),t[tt]=e,t[ht]=n}catch(f){_e(e,e.return,f)}}var gn=!1,Je=!1,br=!1,Md=typeof WeakSet=="function"?WeakSet:Set,et=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 i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var d=0,y=-1,T=-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||i!==0&&H.nodeType!==3||(T=d+i),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===i&&(T=d),(j=H.nextSibling)!==null)break;H=L,L=H.parentNode}H=j}n=y===-1||T===-1?null:{start:y,end:T}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yr={focusedElem:e,selectionRange:n},Js=!1,et=t;et!==null;)if(t=et,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,et=e;else for(;et!==null;){switch(t=et,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,i,n),f[tt]=e,Pe(f),i=f;break e;case"link":var d=Um("link","href",r).get(i+(n.href||""));if(d){for(var y=0;yze&&(d=ze,ze=ie,ie=d);var N=ko(y,ie),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(),ie>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(Ie=0,ai=$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,ga(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(Li,f)}catch{}return!0}finally{G.p=r,D.T=i,lm(e,t)}}function am(e,t,n){t=Bt(n,t),t=ar(e.stateNode,t,2),e=Rn(e,t,2),e!==null&&(Ri(e,2),en(e))}function _e(e,t,n){if(e.tag===3)am(e,e,n);else for(;t!==null;){if(t.tag===3){am(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Yn===null||!Yn.has(i))){e=Bt(n,e),n=sd(2),i=Rn(t,n,2),i!==null&&(ud(n,i,t,e),Ri(i,2),en(i));break}}t=t.return}}function zr(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new A0;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.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 i=e.pingCache;i!==null&&i.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&&si(e,0):wr|=n,ii===ye&&(ii=0)),en(e)}function sm(e,t){t===0&&(t=Pf()),e=cl(e,t),e!==null&&(Ri(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 i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(t),sm(e,n)}function D0(e,t){return Ku(e,t)}var ks=null,ci=null,xr=!1,qs=!1,Dr=!1,Gn=0;function en(e){e!==ci&&e.next===null&&(ci===null?ks=ci=e:ci=ci.next=e),qs=!0,xr||(xr=!0,U0())}function ga(e,t){if(!Dr&&qs){Dr=!0;do for(var n=!1,i=ks;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var f=0;else{var d=i.suspendedLanes,y=i.pingedLanes;f=(1<<31-At(42|e)+1)-1,f&=r&~(d&~y),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,fm(i,f))}else f=ye,f=Ka(i,i===xe?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||Ui(i,f)||(n=!0,fm(i,f));i=i.next}while(n);Dr=!1}}function L0(){um()}function um(){qs=xr=!1;var e=0;Gn!==0&&G0()&&(e=Gn);for(var t=Et(),n=null,i=ks;i!==null;){var r=i.next,f=cm(i,t);f===0?(i.next=null,n===null?ks=r:n.next=r,r===null&&(ci=n)):(n=i,(e!==0||(f&3)!==0)&&(qs=!0)),i=r}Ie!==0&&Ie!==5||ga(e),Gn!==0&&(Gn=0)}function cm(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,f=e.pendingLanes&-62914561;0y)break;var B=T.transferSize,H=T.initiatorType;B&&vm(H)&&(T=T.responseEnd,d+=B*(T"u"?null:document;function zm(e,t,n){var i=ri;if(i&&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},i.querySelector(r)===null&&(t=i.createElement("link"),at(t,"link",e),Pe(t),i.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 i=ri;if(i&&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=fi(e);break;case"script":f=oi(e)}Kt.has(f)||(e=v({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Kt.set(f,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(ba(f))||t==="script"&&i.querySelector(Sa(f))||(t=i.createElement("link"),at(t,"link",e),Pe(t),i.head.appendChild(t)))}}function n1(e,t){Tn.m(e,t);var n=ri;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Rt(i)+'"][href="'+Rt(e)+'"]',f=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=oi(e)}if(!Kt.has(f)&&(e=v({rel:"modulepreload",href:e},t),Kt.set(f,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Sa(f)))return}i=n.createElement("link"),at(i,"link",e),Pe(i),n.head.appendChild(i)}}}function l1(e,t,n){Tn.S(e,t,n);var i=ri;if(i&&e){var r=Dl(i).hoistableStyles,f=fi(e);t=t||"default";var d=r.get(f);if(!d){var y={loading:0,preload:null};if(d=i.querySelector(ba(f)))y.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Kt.get(f))&&Zr(e,n);var T=d=i.createElement("link");Pe(T),at(T,"link",e),T._p=new Promise(function(z,B){T.onload=z,T.onerror=B}),T.addEventListener("load",function(){y.loading|=1}),T.addEventListener("error",function(){y.loading|=2}),y.loading|=4,Gs(d,t,i)}d={type:"stylesheet",instance:d,count:1,state:y},r.set(f,d)}}}function i1(e,t){Tn.X(e,t);var n=ri;if(n&&e){var i=Dl(n).hoistableScripts,r=oi(e),f=i.get(r);f||(f=n.querySelector(Sa(r)),f||(e=v({src:e,async:!0},t),(t=Kt.get(r))&&Jr(e,t),f=n.createElement("script"),Pe(f),at(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(r,f))}}function a1(e,t){Tn.M(e,t);var n=ri;if(n&&e){var i=Dl(n).hoistableScripts,r=oi(e),f=i.get(r);f||(f=n.querySelector(Sa(r)),f||(e=v({src:e,async:!0,type:"module"},t),(t=Kt.get(r))&&Jr(e,t),f=n.createElement("script"),Pe(f),at(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(r,f))}}function xm(e,t,n,i){var r=(r=me.current)?Ks(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=fi(n.href),n=Dl(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=fi(n.href);var f=Dl(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(ba(e)))&&!f._p&&(d.instance=f,d.state.loading=5),Kt.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},Kt.set(e,n),f||s1(r,e,n,d.state))),t&&i===null)throw Error(s(528,""));return d}if(t&&i!==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=oi(n),n=Dl(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function fi(e){return'href="'+Rt(e)+'"'}function ba(e){return'link[rel="stylesheet"]['+e+"]"}function Dm(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function s1(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),at(t,"link",n),Pe(t),e.head.appendChild(t))}function oi(e){return'[src="'+Rt(e)+'"]'}function Sa(e){return"script[async]"+e}function Lm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Rt(n.href)+'"]');if(i)return t.instance=i,Pe(i),i;var r=v({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Pe(i),at(i,"style",r),Gs(i,n.precedence,e),t.instance=i;case"stylesheet":r=fi(n.href);var f=e.querySelector(ba(r));if(f)return t.state.loading|=4,t.instance=f,Pe(f),f;i=Dm(n),(r=Kt.get(r))&&Zr(i,r),f=(e.ownerDocument||e).createElement("link"),Pe(f);var d=f;return d._p=new Promise(function(y,T){d.onload=y,d.onerror=T}),at(f,"link",i),t.state.loading|=4,Gs(f,n.precedence,e),t.instance=f;case"script":return f=oi(n.src),(r=e.querySelector(Sa(f)))?(t.instance=r,Pe(r),r):(i=n,(r=Kt.get(f))&&(i=v({},n),Jr(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Pe(r),at(r,"link",i),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&&(i=t.instance,t.state.loading|=4,Gs(i,n.precedence,e));return t.instance}function Gs(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.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,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=fi(i.href),f=t.querySelector(ba(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,Pe(f);return}f=t.ownerDocument||t,i=Dm(i),(r=Kt.get(r))&&Zr(i,r),f=f.createElement("link"),Pe(f);var d=f;d._p=new Promise(function(y,T){d.onload=y,d.onerror=T}),at(f,"link",i),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(i),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 i=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,a,s){let c=Promise.resolve();if(a&&a.length>0){let h=function(g){return Promise.all(g.map(b=>Promise.resolve(b).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),p=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));c=h(a.map(g=>{if(g=q1(g),g in cg)return;cg[g]=!0;const b=g.endsWith(".css"),v=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${v}`))return;const O=document.createElement("link");if(O.rel=b?"stylesheet":k1,b||(O.as="script"),O.crossOrigin="",O.href=g,p&&O.setAttribute("nonce",p),document.head.appendChild(O),b)return new Promise((E,x)=>{O.addEventListener("load",E),O.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${g}`)))})}))}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 a=/(\x1b\[(\d+(;\d+)*)m)|([^\x1b]+)/g,s=[];let c,o={},h=!1,m=l==null?void 0:l.fg,p=l==null?void 0:l.bg;for(;(c=a.exec(u))!==null;){const[,,g,,b]=c;if(g)for(const v of g.split(";")){const O=+v;switch(O){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[O-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:p=rg[O-40];break;case 49:p=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[O-90];break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:p=fg[O-100];break}}else if(b){const v={...o},O=h?p:m;O!==void 0&&(v.color=O),h&&m&&(v["background-color"]=m),s.push(`${$1(b)}`)}}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 K1(u){return Object.entries(u).map(([l,a])=>`${l}: ${a}`).join("; ")}const ff=({text:u,highlighter:l,mimeType:a,linkify:s,readOnly:c,highlight:o,revealLine:h,lineNumbers:m,isFocused:p,focusOnChange:g,wrapLines:b,onChange:v,dataTestId:O,placeholder:E})=>{const[x,S]=Mg(),[w]=he.useState(H1(()=>import("./codeMirrorModule-DeBYQozu.js"),__vite__mapDeps([0,1])).then(Q=>Q.default)),M=he.useRef(null),[R,K]=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(a)||(s?"text/linkified":"");if(M.current&&W===M.current.cm.getOption("mode")&&!!c===M.current.cm.getOption("readOnly")&&m===M.current.cm.getOption("lineNumbers")&&b===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:b,placeholder:E,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-F":"findPersistent","Cmd-F":"findPersistent"}});return M.current={cm:k},p&&k.focus(),K(k),k})()},[w,R,S,l,a,s,m,b,c,p,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,g&&(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 ae=(W=M.current)==null?void 0:W.cm.getLine(U.line-1);if(ae){const te={};te.title=U.message||"",V.push(R.markText({line:U.line-1,ch:0},{line:U.line-1,ch:U.column||ae.length},{className:"source-line-error-underline",attributes:te}))}if(U.type==="error"){const te=document.createElement("div");te.innerHTML=Y1(U.message||"",{bg:"var(--vscode-inputValidation-errorBackground)",fg:"var(--vscode-editor-foreground)"}),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,g,v]),X.jsx("div",{"data-testid":O,className:"cm-wrapper",ref:S,onClick:G1})};function G1(u){var a;if(!(u.target instanceof HTMLElement))return;let l;u.target.classList.contains("cm-linkified")?l=u.target.textContent:u.target.classList.contains("cm-link")&&((a=u.target.nextElementSibling)!=null&&a.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:A1,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:a=!1,orientation:s="vertical",minSidebarSize:c=Z1,settingName:o,sidebar:h,main:m})=>{const p=Math.max(c,u)*window.devicePixelRatio,[g,b]=pu(o?o+"."+s+":size":void 0,p),[v,O]=pu(o?o+"."+s+":size":void 0,p),[E,x]=he.useState(null),[S,w]=Mg();let M;s==="vertical"?(M=v/window.devicePixelRatio,S&&S.heightx({offset:s==="vertical"?K.clientY:K.clientX,size:M}),onMouseUp:()=>x(null),onMouseMove:K=>{if(!K.buttons)x(null);else if(E){const Z=(s==="vertical"?K.clientY:K.clientX)-E.offset,W=a?E.size+Z:E.size-Z,V=K.target.parentElement.getBoundingClientRect(),U=Math.min(Math.max(c,W),(s==="vertical"?V.height:V.width)-c);s==="vertical"?O(U*window.devicePixelRatio):b(U*window.devicePixelRatio)}}})]})},xg=({noShadow:u,children:l,noMinHeight:a,className:s,sidebarBackground:c,onClick:o})=>X.jsx("div",{className:Ol("toolbar",u&&"no-shadow",a&&"no-min-height",s,c&&"toolbar-sidebar-background"),onClick:o,children:l}),W1=({tabs:u,selectedTab:l,setSelectedTab:a,leftToolbar:s,rightToolbar:c,dataTestId:o,mode:h})=>{const m=he.useId(),p=he.useRef(null);l||(l=u[0].id),h||(h="default");const g=b=>{var x;const v=Array.from(((x=p.current)==null?void 0:x.querySelectorAll('[role="tab"]'))??[]),O=v.findIndex(S=>S===document.activeElement);if(O===-1)return;let E=O;if(b.key==="ArrowRight")E=(O+1)%v.length;else if(b.key==="ArrowLeft")E=(O-1+v.length)%v.length;else if(b.key==="Home")E=0;else if(b.key==="End")E=v.length-1;else return;b.preventDefault(),v[E].focus(),a==null||a(u[E].id)};return 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",onKeyDown:g,ref:p,children:[...u.map(b=>X.jsx(I1,{id:b.id,ariaControls:`${m}-${b.id}`,title:b.title,count:b.count,errorCount:b.errorCount,selected:l===b.id,onSelect:a,tabIndex:l===b.id?0:-1},b.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:b=>{a==null||a(u[b.currentTarget.selectedIndex].id)},children:u.map(b=>{let v="";return b.count&&(v=` (${b.count})`),b.errorCount&&(v=` (${b.errorCount})`),X.jsxs("option",{value:b.id,role:"tab","aria-controls":`${m}-${b.id}`,children:[b.title,v]},b.id)})})}),c&&X.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:[...c]})]}),u.map(b=>{const v="tab-content tab-"+b.id;if(b.component)return X.jsx("div",{id:`${m}-${b.id}`,role:"tabpanel","aria-label":b.title,className:v,style:{display:l===b.id?"inherit":"none"},children:b.component},b.id);if(l===b.id)return X.jsx("div",{id:`${m}-${b.id}`,role:"tabpanel","aria-label":b.title,className:v,children:b.render()},b.id)})]})})},I1=({id:u,title:l,count:a,errorCount:s,selected:c,onSelect:o,ariaControls:h,tabIndex:m})=>X.jsxs("div",{className:Ol("tabbed-pane-tab",c&&"selected"),onClick:()=>o==null?void 0:o(u),role:"tab",title:l,tabIndex:m??(c?0:-1),"aria-controls":h,"aria-selected":c,children:[X.jsx("div",{className:"tabbed-pane-tab-label",children:l}),!!a&&X.jsx("div",{className:"tabbed-pane-tab-counter",children:a}),!!s&&X.jsx("div",{className:"tabbed-pane-tab-counter error",children:s})]}),F1=({sources:u,fileId:l,setFileId:a})=>X.jsx("select",{className:"source-chooser",hidden:!u.length,title:"Source chooser",value:l,onChange:s=>{a(s.target.selectedOptions[0].value)},children:P1(u)});function P1(u){const l=c=>c.replace(/.*[/\\]([^/\\]+)/,"$1"),a=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=>a(h))},c))}function ev(){return{id:"default",isRecorded:!1,text:"",language:"javascript",label:"",highlight:[]}}const Dt=he.forwardRef(function({children:l,title:a="",icon:s,disabled:c=!1,toggled:o=!1,onClick:h=()=>{},style:m,testId:p,className:g,ariaLabel:b,errorBadge:v},O){const E=he.useId();return X.jsxs("button",{ref:O,className:Ol(g,"toolbar-button",s,o&&"toggled"),onMouseDown:dg,onClick:h,onDoubleClick:dg,title:a,disabled:!!c,style:m,"data-testid":p,"aria-label":b||a,"aria-describedby":v?E:void 0,children:[s&&X.jsx("span",{className:`codicon codicon-${s}`,style:l?{marginRight:5}:{}}),l,v&&X.jsx("span",{id:E,className:"toolbar-button-error-badge",title:v,"aria-label":v})]})}),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 a=l/60;if(a<60)return a.toFixed(1)+"m";const s=a/60;return s<24?s.toFixed(1)+"h":(s/24).toFixed(1)+"d"}const We=function(u,l,a){return u>=l&&u<=a};function bt(u){return We(u,48,57)}function mg(u){return bt(u)||We(u,65,70)||We(u,97,102)}function nv(u){return We(u,65,90)}function lv(u){return We(u,97,122)}function iv(u){return nv(u)||lv(u)}function av(u){return u>=128}function uu(u){return iv(u)||av(u)||u===95}function gg(u){return uu(u)||bt(u)||u===45}function sv(u){return We(u,0,8)||u===11||We(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 a=0;a=l.length?-1:l[$]},h=function($){if($===void 0&&($=1),$>3)throw"Spec Error: no more than three codepoints of lookahead.";return o(a+$)},m=function($){return $===void 0&&($=1),a+=$,c=o(a),!0},p=function(){return a-=1,!0},g=function($){return $===void 0&&($=c),$===-1},b=function(){if(v(),m(),En(c)){for(;En(h());)m();return new wf}else{if(c===34)return x();if(c===35)if(gg(h())||M(h(1),h(2))){const $=new Qg("");return K(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()?(p(),O()):new ut(c):c===44?new Bg:c===45?W()?(p(),O()):h(1)===45&&h(2)===62?(m(2),new Ug):Q()?(p(),E()):new ut(c):c===46?W()?(p(),O()):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?K(h(1),h(2),h(3))?new Vg(k()):new ut(c):c===91?new Hg:c===92?R()?(p(),E()):new ut(c):c===93?new Af: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 Kg):new ut(c):c===125?new qg:c===126?h()===61?(m(),new fv):new ut(c):bt(c)?(p(),O()):uu(c)?(p(),E()):g()?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(g())return},O=function(){const $=V();if(K(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 Gg($)},x=function($){$===void 0&&($=c);let ee="";for(;m();){if(c===$||g())return new Xg(ee);if(cu(c))return p(),new Dg;c===92?g(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(g(h()))return $;for(;m();){if(c===41||g())return $;if(En(c)){for(;En(h());)m();return h()===41||g(h())?(m(),$):(ae(),new ru)}else{if(c===34||c===39||c===40||sv(c))return ae(),new ru;if(c===92)if(R())$.value+=Fe(w());else return ae(),new ru;else $.value+=Fe(c)}}throw new Error("Internal error")},w=function(){if(m(),mg(c)){const $=[c];for(let we=0;we<5&&mg(h());we++)m(),$.push(c);En(h())&&m();let ee=parseInt($.map(function(we){return String.fromCharCode(we)}).join(""),16);return ee>uv&&(ee=65533),ee}else return g()?65533:c},M=function($,ee){return!($!==92||cu(ee))},R=function(){return M(c,h())},K=function($,ee,we){return $===45?uu(ee)||ee===45||M(ee,we):uu($)?!0:$===92?M($,ee):!1},Q=function(){return K(c,h(1),h(2))},Z=function($,ee,we){return $===43||$===45?!!(bt(ee)||ee===46&&bt(we)):$===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 p(),$;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 we=h(1),se=h(2),D=h(3);if((we===69||we===101)&&bt(se))for(m(),$+=Fe(c),m(),$+=Fe(c),ee="number";bt(h());)m(),$+=Fe(c);else if((we===69||we===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 G=U($);return{type:ee,value:G,repr:$}},U=function($){return+$},ae=function(){for(;m();){if(c===41||g())return;R()&&w()}};let te=0;for(;!g(h());)if(s.push(b()),te++,te>l.length*2)throw new Error("I'm infinite-looping!");return s}class Ve{constructor(){this.tokenType=""}toJSON(){return{token:this.tokenType}}toString(){return this.tokenType}toSource(){return""+this}}class Dg extends Ve{constructor(){super(...arguments),this.tokenType="BADSTRING"}}class ru extends Ve{constructor(){super(...arguments),this.tokenType="BADURL"}}class wf extends Ve{constructor(){super(...arguments),this.tokenType="WHITESPACE"}toString(){return"WS"}toSource(){return" "}}class Lg extends Ve{constructor(){super(...arguments),this.tokenType="CDO"}toSource(){return""}}class Rg extends Ve{constructor(){super(...arguments),this.tokenType=":"}}class jg extends Ve{constructor(){super(...arguments),this.tokenType=";"}}class Bg extends Ve{constructor(){super(...arguments),this.tokenType=","}}class Ai extends Ve{constructor(){super(...arguments),this.value="",this.mirror=""}}class kg extends Ai{constructor(){super(),this.tokenType="{",this.value="{",this.mirror="}"}}class qg extends Ai{constructor(){super(),this.tokenType="}",this.value="}",this.mirror="{"}}class Hg extends Ai{constructor(){super(),this.tokenType="[",this.value="[",this.mirror="]"}}class Af extends Ai{constructor(){super(),this.tokenType="]",this.value="]",this.mirror="["}}class Yg extends Ai{constructor(){super(),this.tokenType="(",this.value="(",this.mirror=")"}}class $g extends Ai{constructor(){super(),this.tokenType=")",this.value=")",this.mirror="("}}class fv extends Ve{constructor(){super(...arguments),this.tokenType="~="}}class ov extends Ve{constructor(){super(...arguments),this.tokenType="|="}}class hv extends Ve{constructor(){super(...arguments),this.tokenType="^="}}class dv extends Ve{constructor(){super(...arguments),this.tokenType="$="}}class mv extends Ve{constructor(){super(...arguments),this.tokenType="*="}}class Kg extends Ve{constructor(){super(...arguments),this.tokenType="||"}}class fu extends Ve{constructor(){super(...arguments),this.tokenType="EOF"}toSource(){return""}}class ut extends Ve{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 Oi extends Ve{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 Gg extends Oi{constructor(l){super(),this.tokenType="IDENT",this.value=l}toString(){return"IDENT("+this.value+")"}toSource(){return Ua(this.value)}}class ou extends Oi{constructor(l){super(),this.tokenType="FUNCTION",this.value=l,this.mirror=")"}toString(){return"FUNCTION("+this.value+")"}toSource(){return Ua(this.value)+"("}}class Vg extends Oi{constructor(l){super(),this.tokenType="AT-KEYWORD",this.value=l}toString(){return"AT("+this.value+")"}toSource(){return"@"+Ua(this.value)}}class Qg extends Oi{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"?"#"+Ua(this.value):"#"+pv(this.value)}}class Xg extends Oi{constructor(l){super(),this.tokenType="STRING",this.value=l}toString(){return'"'+Ig(this.value)+'"'}}class Zg extends Oi{constructor(l){super(),this.tokenType="URL",this.value=l}toString(){return"URL("+this.value+")"}toSource(){return'url("'+Ig(this.value)+'")'}}class Jg extends Ve{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 Ve{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 Ve{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 a=Ua(this.unit);return a[0].toLowerCase()==="e"&&(a[1]==="-"||We(a.charCodeAt(1),48,57))&&(a="\\65 "+a.slice(1,a.length)),l+a}}function Ua(u){u=""+u;let l="";const a=u.charCodeAt(0);for(let s=0;s=128||c===45||c===95||We(c,48,57)||We(c,65,90)||We(c,97,122)?l+=u[s]:l+="\\"+u[s]}return l}function pv(u){u=""+u;let l="";for(let a=0;a=128||s===45||s===95||We(s,48,57)||We(s,65,90)||We(s,97,122)?l+=u[a]:l+="\\"+s.toString(16)+" "}return l}function Ig(u){u=""+u;let l="";for(let a=0;aU instanceof Vg||U instanceof Dg||U instanceof ru||U instanceof Kg||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 "${a[c].toSource()}" while parsing css selector "${u}". Did you mean to CSS.escape it?`)}function m(){for(;a[c]instanceof wf;)c++}function p(U=c){return a[U]instanceof Gg}function g(U=c){return a[U]instanceof Xg}function b(U=c){return a[U]instanceof Jg}function v(U=c){return a[U]instanceof Bg}function O(U=c){return a[U]instanceof Yg}function E(U=c){return a[U]instanceof $g}function x(U=c){return a[U]instanceof ou}function S(U=c){return a[U]instanceof ut&&a[U].value==="*"}function w(U=c){return a[U]instanceof fu}function M(U=c){return a[U]instanceof ut&&[">","+","~"].includes(a[U].value)}function R(U=c){return v(U)||E(U)||w(U)||M(U)||a[U]instanceof wf}function K(){const U=[Q()];for(;m(),!!v();)c++,U.push(Q());return U}function Q(){return m(),b()||g()?a[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=a[c++].value,m();else if(R())break;U.simples.push({combinator:"",selector:W()})}return U}function W(){let U="";const ae=[];for(;!R();)if(p()||S())U+=a[c++].toSource();else if(a[c]instanceof Qg)U+=a[c++].toSource();else if(a[c]instanceof ut&&a[c].value===".")if(c++,p())U+="."+a[c++].toSource();else throw h();else if(a[c]instanceof Rg)if(c++,p())if(!l.has(a[c].value.toLowerCase()))U+=":"+a[c++].toSource();else{const te=a[c++].value.toLowerCase();ae.push({name:te,args:[]}),o.add(te)}else if(x()){const te=a[c++].value.toLowerCase();if(l.has(te)?(ae.push({name:te,args:K()}),o.add(te)):U+=`:${te}(${k()})`,m(),!E())throw h();c++}else throw h();else if(a[c]instanceof Hg){for(U+="[",c++;!(a[c]instanceof Af)&&!w();)U+=a[c++].toSource();if(!(a[c]instanceof Af))throw h();U+="]",c++}else throw h();if(!U&&!ae.length)throw h();return{css:U||void 0,functions:ae}}function k(){let U="",ae=1;for(;!w()&&((O()||x())&&ae++,E()&&ae--,!!ae);)U+=a[c++].toSource();return U}const V=K();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 Fg(u){const l=Tv(u),a=[];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);a.push({name:"css",body:c.selector,source:s.body});continue}if(pg.has(s.name)){let c,o;try{const g=JSON.parse("["+s.body+"]");if(!Array.isArray(g)||g.length<1||g.length>2||typeof g[0]!="string")throw new St(`Malformed selector: ${s.name}=`+s.body);if(c=g[0],g.length===2){if(typeof g[1]!="number"||!vv.has(s.name))throw new St(`Malformed selector: ${s.name}=`+s.body);o=g[1]}}catch{throw new St(`Malformed selector: ${s.name}=`+s.body)}const h={name:s.name,source:s.body,body:{parsed:Fg(c),distance:o}},m=[...h.body.parsed.parts].reverse().find(g=>g.name==="internal:control"&&g.body==="enter-frame"),p=m?h.body.parsed.parts.indexOf(m):-1;p!==-1&&Sv(h.body.parsed.parts.slice(0,p+1),a.slice(0,p+1))&&h.body.parsed.parts.splice(0,p+1),a.push(h);continue}a.push({...s,source:s.body})}if(pg.has(a[0].name))throw new St(`"${a[0].name}" selector cannot be first`);return{capture:l.capture,parts:a}}function Sv(u,l){return In({parts:u})===In({parts:l})}function In(u,l){return typeof u=="string"?u:u.parts.map((a,s)=>{let c=!0;!l&&s!==u.capture&&(a.name==="css"||a.name==="xpath"&&a.source.startsWith("//")||a.source.startsWith(".."))&&(c=!1);const o=c?a.name+"=":"";return`${s===u.capture?"*":""}${o}${a.source}`}).join(" >> ")}function Tv(u){let l=0,a,s=0;const c={parts:[]},o=()=>{const m=u.substring(s,l).trim(),p=m.indexOf("=");let g,b;p!==-1&&m.substring(0,p).trim().match(/^[a-zA-Z_0-9-+:*]+$/)?(g=m.substring(0,p).trim(),b=m.substring(p+1)):m.length>1&&m[0]==='"'&&m[m.length-1]==='"'||m.length>1&&m[0]==="'"&&m[m.length-1]==="'"?(g="text",b=m):/^\(*\/\//.test(m)||m.startsWith("..")?(g="xpath",b=m):(g="css",b=m);let v=!1;if(g[0]==="*"&&(v=!0,g=g.substring(1)),c.parts.push({name:g,body:b}),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 p=u.substring(s,l).match(/^\s*text\s*=(.*)$/);return!!p&&!!p[1]};for(;l"&&u[l+1]===">"?(o(),l+=2,s=l):l++}return o(),c}function of(u,l){let a=0,s=u.length===0;const c=()=>u[a]||"",o=()=>{const w=c();return++a,s=a>=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 ${a}`+(w?" during "+w:""))};function m(){for(;!s&&/\s/.test(c());)o()}function p(w){return w>="€"||w>="0"&&w<="9"||w>="A"&&w<="Z"||w>="a"&&w<="z"||w>="0"&&w<="9"||w==="_"||w==="-"}function g(){let w="";for(m();!s&&p(c());)w+=o();return w}function b(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(K){throw new St(`Error while parsing selector \`${u}\`: ${K.message}`)}}function O(){let w="";return m(),c()==="'"||c()==='"'?w=b(c()).slice(1,-1):w=g(),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(O()),m();c()===".";)o(),w.push(O()),m();if(c()==="]")return o(),{name:w.join("."),jsonPath:w,op:"",value:null,caseSensitive:!1};const M=E();let R,K=!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=b(c()).slice(1,-1),m(),c()==="i"||c()==="I"?(K=!1,o()):(c()==="s"||c()==="S")&&(K=!0,o());else{for(R="";!s&&(p(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:K}}const S={name:"",attributes:[]};for(S.name=g(),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 wu(u,l="'"){const a=JSON.stringify(u),s=a.substring(1,a.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 Au(u){return u.replace(/(^|[^\\])(\\\\)*\\(['"`])/g,"$1$2$3")}function ep(u,l,a=!1){return Ev(u,l,a,1)[0]}function Ev(u,l,a=!1,s=20,c){try{return gi(new Cv[u](c),Fg(l),a,s)}catch{return[l]}}function gi(u,l,a=!1,s=20){const c=[...l.parts],o=[];let h=a?"frame-locator":"page";for(let m=0;mu.generateLocator(g,"has",S)));continue}if(p.name==="internal:has-not"){const x=gi(u,p.body.parsed,!1,s);o.push(x.map(S=>u.generateLocator(g,"hasNot",S)));continue}if(p.name==="internal:and"){const x=gi(u,p.body.parsed,!1,s);o.push(x.map(S=>u.generateLocator(g,"and",S)));continue}if(p.name==="internal:or"){const x=gi(u,p.body.parsed,!1,s);o.push(x.map(S=>u.generateLocator(g,"or",S)));continue}if(p.name==="internal:chain"){const x=gi(u,p.body.parsed,!1,s);o.push(x.map(S=>u.generateLocator(g,"chain",S)));continue}if(p.name==="internal:label"){const{exact:x,text:S}=Na(p.body);o.push([u.generateLocator(g,"label",S,{exact:x})]);continue}if(p.name==="internal:role"){const x=of(p.body),S={attrs:[]};for(const w of x.attributes)if(w.name==="name"){if(S.exact!==void 0&&S.exact!==w.caseSensitive)throw new Error(`Conflicting exactness in internal:role selector: ${In({parts:[p]})}`);S.exact=w.caseSensitive,S.name=w.value}else if(w.name==="description"){if(S.exact!==void 0&&S.exact!==w.caseSensitive)throw new Error(`Conflicting exactness in internal:role selector: ${In({parts:[p]})}`);S.exact=w.caseSensitive,S.description=w.value}else 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(g,"role",x.name,S)]);continue}if(p.name==="internal:testid"){const x=of(p.body),{value:S}=x.attributes[0];o.push([u.generateLocator(g,"test-id",S)]);continue}if(p.name==="internal:attr"){const x=of(p.body),{name:S,value:w,caseSensitive:M}=x.attributes[0],R=w,K=!!M;if(S==="placeholder"){o.push([u.generateLocator(g,"placeholder",R,{exact:K})]);continue}if(S==="alt"){o.push([u.generateLocator(g,"alt",R,{exact:K})]);continue}if(S==="title"){o.push([u.generateLocator(g,"title",R,{exact:K})]);continue}}if(p.name==="internal:control"&&p.body==="enter-frame"){const x=o[o.length-1],S=c[m-1],w=x.map(M=>u.chainLocators([M,u.generateLocator(g,"frame","")]));["xpath","css"].includes(S.name)&&w.push(u.generateLocator(g,"frame-locator",In({parts:[S]})),u.generateLocator(g,"frame-locator",In({parts:[S]},!0))),x.splice(0,x.length,...w),h="frame-locator";continue}const b=c[m+1],v=In({parts:[p]}),O=u.generateLocator(g,"default",v);if(b&&["internal:has-text","internal:has-not-text"].includes(b.name)){const{exact:x,text:S}=Na(b.body);if(!x){const w=u.generateLocator("locator",b.name==="internal:has-text"?"has-text":"has-not-text",S,{exact:x}),M={};b.name==="internal:has-text"?M.hasText=S:M.hasNotText=S;const R=u.generateLocator(g,"default",v,M);o.push([u.chainLocators([O,w]),R]),m++;continue}}let E;if(["xpath","css"].includes(p.name)){const x=In({parts:[p]},!0);E=u.generateLocator(g,"default",x)}o.push([O,E].filter(Boolean))}return wv(u,o,s)}function wv(u,l,a){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 a=he.useRef(null),[s,c]=he.useState(new Map);return he.useLayoutEffect(()=>{var o;l.find(h=>h.reveal)&&((o=a.current)==null||o.scrollIntoView({block:"center",inline:"nearest"}))},[a,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",p=o.params.selector?ep(u,o.params.selector):null;let g=o.title,b="";return o.title.startsWith("expect.to")||o.title.startsWith("expect.not.to")?(g="expect(",b=`).${o.title.substring(7)}()`):o.title.startsWith("locator.")?(g="",b=`.${o.title.substring(8)}()`):(p||o.params.url)&&(g=o.title+"(",b=")"),X.jsxs("div",{className:Ol("call-log-call",o.status),children:[X.jsxs("div",{className:"call-log-call-header",children:[X.jsx("span",{className:Ol("codicon",`codicon-chevron-${m?"down":"right"}`),style:{cursor:"pointer"},onClick:()=>{const v=new Map(s);v.set(o.id,!m),c(v)}}),g,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,p?X.jsx("span",{className:"call-log-details",children:X.jsx("span",{className:"call-log-selector",title:`page.${p}`,children:`page.${p}`})}):void 0,b,X.jsx("span",{className:Ol("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,O)=>X.jsx("div",{className:"call-log-message",children:v.trim()},O)),!!o.error&&X.jsx("div",{className:"call-log-message error",hidden:!m,children:o.error})]},o.id)}),X.jsx("div",{ref:a})]})};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"),Pn=Symbol.for("yaml.map"),tp=Symbol.for("yaml.pair"),nn=Symbol.for("yaml.scalar"),_i=Symbol.for("yaml.seq"),Vt=Symbol.for("yaml.node.type"),tl=u=>!!u&&typeof u=="object"&&u[Vt]===Lf,Nl=u=>!!u&&typeof u=="object"&&u[Vt]===Of,Ni=u=>!!u&&typeof u=="object"&&u[Vt]===Pn,je=u=>!!u&&typeof u=="object"&&u[Vt]===tp,De=u=>!!u&&typeof u=="object"&&u[Vt]===nn,Mi=u=>!!u&&typeof u=="object"&&u[Vt]===_i;function Be(u){if(u&&typeof u=="object")switch(u[Vt]){case Pn:case _i:return!0}return!1}function ke(u){if(u&&typeof u=="object")switch(u[Vt]){case Lf:case Pn:case nn:case _i: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 Ml(u,l){const a=ip(l);Nl(u)?pi(null,u.contents,a,Object.freeze([u]))===tn&&(u.contents=null):pi(null,u,a,Object.freeze([]))}Ml.BREAK=Tt;Ml.SKIP=lp;Ml.REMOVE=tn;function pi(u,l,a,s){const c=ap(u,l,a,s);if(ke(c)||je(c))return sp(u,s,c),pi(u,c,a,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,a){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ot.defaultYaml,l),this.tags=Object.assign({},ot.defaultTags,a)}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,a){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&&(a(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 a(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 a(6,`Unsupported YAML version ${o}`,h),!1}}default:return a(0,`Unknown directive ${c}`,!0),!1}}tagName(l,a){if(l==="!")return"!";if(l[0]!=="!")return a(`Not a valid tag: ${l}`),null;if(l[1]==="<"){const h=l.slice(2,-1);return h==="!"||h==="!!"?(a(`Verbatim tags aren't resolved, so ${l} is invalid.`),null):(l[l.length-1]!==">"&&a("Verbatim tags must end with a >"),h)}const[,s,c]=l.match(/^(.*!)([^!]*)$/s);c||a(`The ${l} tag has no suffix`);const o=this.tags[s];if(o)try{return o+decodeURIComponent(c)}catch(h){return a(String(h)),null}return s==="!"?l:(a(`Could not resolve tag: ${l}`),null)}tagString(l){for(const[a,s]of Object.entries(this.tags))if(l.startsWith(s))return a+Lv(l.substring(s.length));return l[0]==="!"?l:`!<${l}>`}toString(l){const a=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={};Ml(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)))&&a.push(`%TAG ${o} ${h}`);return a.join(` `)}}ot.defaultYaml={explicit:!1,version:"1.2"};ot.defaultTags={"!!":"tag:yaml.org,2002:"};function up(u){if(/[\x00-\x19\s,[\]{}]/.test(u)){const a=`Anchor must not contain whitespace or control characters: ${JSON.stringify(u)}`;throw new Error(a)}return!0}function cp(u){const l=new Set;return Ml(u,{Value(a,s){s.anchor&&l.add(s.anchor)}}),l}function rp(u,l){for(let a=1;;++a){const s=`${u}${a}`;if(!l.has(s))return s}}function Uv(u,l){const a=[],s=new Map;let c=null;return{onAnchor:o=>{a.push(o),c??(c=cp(u));const h=rp(l,c);return c.add(h),h},setAnchors:()=>{for(const o of a){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 vi(u,l,a,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let c=0,o=s.length;cGt(s,String(c),a));if(u&&typeof u.toJSON=="function"){if(!a||!np(u))return u.toJSON(l,a);const s={aliasCount:0,count:1,res:void 0};a.anchors.set(u,s),a.onCreate=o=>{s.res=o,delete a.onCreate};const c=u.toJSON(l,a);return a.onCreate&&a.onCreate(c),c}return typeof u=="bigint"&&!(a!=null&&a.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:a,maxAliasCount:s,onAnchor:c,reviver:o}={}){if(!Nl(l))throw new TypeError("A document argument is required");const h={anchors:new Map,doc:l,keep:!0,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},m=Gt(this,"",h);if(typeof c=="function")for(const{count:p,res:g}of h.anchors.values())c(g,p);return typeof o=="function"?vi(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,a){let s;a!=null&&a.aliasResolveCache?s=a.aliasResolveCache:(s=[],Ml(l,{Node:(o,h)=>{(tl(h)||np(h))&&s.push(h)}}),a&&(a.aliasResolveCache=s));let c;for(const o of s){if(o===this)break;o.anchor===this.source&&(c=o)}return c}toJSON(l,a){if(!a)return{source:this.source};const{anchors:s,doc:c,maxAliasCount:o}=a,h=this.resolve(c,a);if(!h){const p=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(p)}let m=s.get(h);if(m||(Gt(h,null,a),m=s.get(h)),(m==null?void 0:m.res)===void 0){const p="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(p)}if(o>=0&&(m.count+=1,m.aliasCount===0&&(m.aliasCount=hu(c,h,s)),m.count*m.aliasCount>o)){const p="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(p)}return m.res}toString(l,a,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,a){if(tl(l)){const s=l.resolve(u),c=a&&s&&a.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,a);o>s&&(s=o)}return s}else if(je(l)){const s=hu(u,l.key,a),c=hu(u,l.value,a);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,a){return a!=null&&a.keep?this.value:Gt(this.value,l,a)}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,a){if(l){const s=a.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 a.find(s=>{var c;return((c=s.identify)==null?void 0:c.call(s,u))&&!s.format})}function xa(u,l,a){var v,O,E;if(Nl(u)&&(u=u.contents),ke(u))return u;if(je(u)){const x=(O=(v=a.schema[Pn]).createNode)==null?void 0:O.call(v,a.schema,null,a);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}=a;let p;if(s&&u&&typeof u=="object"){if(p=m.get(u),p)return p.anchor??(p.anchor=c(u)),new _u(p.anchor);p={anchor:null,node:null},m.set(u,p)}l!=null&&l.startsWith("!!")&&(l=Rv+l.slice(2));let g=jv(u,l,h.tags);if(!g){if(u&&typeof u.toJSON=="function"&&(u=u.toJSON()),!u||typeof u!="object"){const x=new ce(u);return p&&(p.node=x),x}g=u instanceof Map?h[Pn]:Symbol.iterator in Object(u)?h[_i]:h[Pn]}o&&(o(g),delete a.onTagObj);const b=g!=null&&g.createNode?g.createNode(a.schema,u,a):typeof((E=g==null?void 0:g.nodeClass)==null?void 0:E.from)=="function"?g.nodeClass.from(a.schema,u,a):new ce(u);return l?b.tag=l:g.default||(b.tag=g.tag),p&&(p.node=b),b}function vu(u,l,a){let s=a;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 xa(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 Ca=u=>u==null||typeof u=="object"&&!!u[Symbol.iterator]().next().done;class op extends Uf{constructor(l,a){super(l),Object.defineProperty(this,"schema",{value:a,configurable:!0,enumerable:!1,writable:!0})}clone(l){const a=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return l&&(a.schema=l),a.items=a.items.map(s=>ke(s)||je(s)?s.clone(l):s),this.range&&(a.range=this.range.slice()),a}addIn(l,a){if(Ca(l))this.add(a);else{const[s,...c]=l,o=this.get(s,!0);if(Be(o))o.addIn(c,a);else if(o===void 0&&this.schema)this.set(s,vu(this.schema,c,a));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${c}`)}}deleteIn(l){const[a,...s]=l;if(s.length===0)return this.delete(a);const c=this.get(a,!0);if(Be(c))return c.deleteIn(s);throw new Error(`Expected YAML collection at ${a}. Remaining path: ${s}`)}getIn(l,a){const[s,...c]=l,o=this.get(s,!0);return c.length===0?!a&&De(o)?o.value:o:Be(o)?o.getIn(c,a):void 0}hasAllNullValues(l){return this.items.every(a=>{if(!je(a))return!1;const s=a.value;return s==null||l&&De(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(l){const[a,...s]=l;if(s.length===0)return this.has(a);const c=this.get(a,!0);return Be(c)?c.hasIn(s):!1}setIn(l,a){const[s,...c]=l;if(c.length===0)this.set(s,a);else{const o=this.get(s,!0);if(Be(o))o.setIn(c,a);else if(o===void 0&&this.schema)this.set(s,vu(this.schema,c,a));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${c}`)}}}const Bv=u=>u.replace(/^(?!$)(?: $)?/gm,"#");function wn(u,l){return/^\n+$/.test(u)?u.substring(1):l?u.replace(/^(?! *$)/gm,l):u}const El=(u,l,a)=>u.endsWith(` `)?wn(a,l):a.includes(` `)?` `+wn(a,l):(u.endsWith(" ")?"":" ")+a,hp="flow",_f="block",du="quoted";function Nu(u,l,a="flow",{indentAtStart:s,lineWidth:c=80,minContentWidth:o=20,onFold:h,onOverflow:m}={}){if(!c||c<0)return u;cc-Math.max(2,o)?g.push(0):v=c-s);let O,E,x=!1,S=-1,w=-1,M=-1;a===_f&&(S=yg(u,S,l.length),S!==-1&&(v=S+p));for(let K;K=u[S+=1];){if(a===du&&K==="\\"){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(K===` `)a===_f&&(S=yg(u,S,l.length)),v=S+l.length+p,O=void 0;else{if(K===" "&&E&&E!==" "&&E!==` `&&E!==" "){const Q=u[S+1];Q&&Q!==" "&&Q!==` `&&Q!==" "&&(O=S)}if(S>=v)if(O)g.push(O),v=O+p,O=void 0;else if(a===du){for(;E===" "||E===" ";)E=K,K=u[S+=1],x=!0;const Q=S>M+1?S-2:w-1;if(b[Q])return u;g.push(Q),b[Q]=!0,v=Q+p,O=void 0}else x=!0}E=K}if(x&&m&&m(),g.length===0)return u;h&&h();let R=u.slice(0,g[0]);for(let K=0;K({indentAtStart:l?u.indent.length:u.indentAtStart,lineWidth:u.options.lineWidth,minContentWidth:u.options.minContentWidth}),Cu=u=>/^(%|---|\.\.\.)/m.test(u);function kv(u,l,a){if(!l||l<0)return!1;const s=l-a,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 za(u,l){const a=JSON.stringify(u);if(l.options.doubleQuotedAsJSON)return a;const{implicitKey:s}=l,c=l.options.doubleQuotedMinMultiLineLength,o=l.indent||(Cu(u)?" ":"");let h="",m=0;for(let p=0,g=a[p];g;g=a[++p])if(g===" "&&a[p+1]==="\\"&&a[p+2]==="n"&&(h+=a.slice(m,p)+"\\ ",p+=1,m=p,g="\\"),g==="\\")switch(a[p+1]){case"u":{h+=a.slice(m,p);const b=a.substr(p+2,4);switch(b){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:b.substr(0,2)==="00"?h+="\\x"+b.substr(2):h+=a.substr(p,6)}p+=5,m=p+1}break;case"n":if(s||a[p+2]==='"'||a.length `;let v,O;for(O=a.length;O>0;--O){const Z=a[O-1];if(Z!==` `&&Z!==" "&&Z!==" ")break}let E=a.substring(O);const x=E.indexOf(` `);x===-1?v="-":a===E||x!==E.length-1?(v="+",o&&o()):v="",E&&(a=a.slice(0,-E.length),E[E.length-1]===` `&&(E=E.slice(0,-1)),E=E.replace(Mf,`$&${g}`));let S=!1,w,M=-1;for(w=0;w{W=!0});const V=Nu(`${R}${Z}${E}`,g,_f,k);if(!W)return`>${Q} ${g}${V}`}return a=a.replace(/\n+/g,`$&${g}`),`|${Q} ${g}${R}${a}${E}`}function qv(u,l,a,s){const{type:c,value:o}=u,{actualString:h,implicitKey:m,indent:p,indentStep:g,inFlow:b}=l;if(m&&o.includes(` `)||b&&/[[\]{},]/.test(o))return bi(o,l);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return m||b||!o.includes(` `)?bi(o,l):mu(u,l,a,s);if(!m&&!b&&c!==ce.PLAIN&&o.includes(` `))return mu(u,l,a,s);if(Cu(o)){if(p==="")return l.forceBlockIndent=!0,mu(u,l,a,s);if(m&&p===g)return bi(o,l)}const v=o.replace(/\n+/g,`$& ${p}`);if(h){const O=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(O)||E!=null&&E.some(O))return bi(o,l)}return m?v:Nu(v,p,hp,Mu(l,!1))}function Ra(u,l,a,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 p=b=>{switch(b){case ce.BLOCK_FOLDED:case ce.BLOCK_LITERAL:return c||o?bi(h.value,l):mu(h,l,a,s);case ce.QUOTE_DOUBLE:return za(h.value,l);case ce.QUOTE_SINGLE:return Nf(h.value,l);case ce.PLAIN:return qv(h,l,a,s);default:return null}};let g=p(m);if(g===null){const{defaultKeyType:b,defaultStringType:v}=l.options,O=c&&b||v;if(g=p(O),g===null)throw new Error(`Unsupported default string type ${O}`)}return g}function dp(u,l){const a=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(a.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:u,flowCollectionPadding:a.flowCollectionPadding?" ":"",indent:"",indentStep:typeof a.indent=="number"?" ".repeat(a.indent):" ",inFlow:s,options:a}}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 a,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)}a=o.find(h=>h.format===l.format)??o.find(h=>!h.format)}else s=l,a=u.find(o=>o.nodeClass&&s instanceof o.nodeClass);if(!a){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 a}function Yv(u,l,{anchors:a,doc:s}){if(!s.directives)return"";const c=[],o=(De(u)||Be(u))&&u.anchor;o&&up(o)&&(a.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 Ei(u,l,a,s){var p;if(je(u))return u.toString(l,a,s);if(tl(u)){if(l.doc.directives)return u.toString(l);if((p=l.resolvedAliases)!=null&&p.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:g=>c=g});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,a,s):De(o)?Ra(o,l,a,s):o.toString(l,a,s);return h?De(o)||m[0]==="{"||m[0]==="["?`${h} ${m}`:`${h} ${l.indent}${m}`:m}function $v({key:u,value:l},a,s,c){const{allNullValues:o,doc:h,indent:m,indentStep:p,options:{commentString:g,indentSeq:b,simpleKeys:v}}=a;let O=ke(u)&&u.comment||null;if(v){if(O)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||O&&l==null&&!a.inFlow||Be(u)||(De(u)?u.type===ce.BLOCK_FOLDED||u.type===ce.BLOCK_LITERAL:typeof u=="object"));a=Object.assign({},a,{allNullValues:!1,implicitKey:!E&&(v||!o),indent:m+p});let x=!1,S=!1,w=Ei(u,a,()=>x=!0,()=>S=!0);if(!E&&!a.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(a.inFlow){if(o||l==null)return x&&s&&s(),w===""?"?":E?`? ${w}`:w}else if(o&&!v||l==null&&E)return w=`? ${w}`,O&&!x?w+=El(w,a.indent,g(O)):S&&c&&c(),w;x&&(O=null),E?(O&&(w+=El(w,a.indent,g(O))),w=`? ${w} ${m}:`):(w=`${w}:`,O&&(w+=El(w,a.indent,g(O))));let M,R,K;ke(l)?(M=!!l.spaceBefore,R=l.commentBefore,K=l.comment):(M=!1,R=null,K=null,l&&typeof l=="object"&&(l=h.createNode(l))),a.implicitKey=!1,!E&&!O&&De(l)&&(a.indentAtStart=w.length+1),S=!1,!b&&p.length>=2&&!a.inFlow&&!E&&Mi(l)&&!l.flow&&!l.tag&&!l.anchor&&(a.indent=a.indent.substring(2));let Q=!1;const Z=Ei(l,a,()=>Q=!0,()=>S=!0);let W=" ";if(O||M||R){if(W=M?` `:"",R){const k=g(R);W+=` ${wn(k,a.indent)}`}Z===""&&!a.inFlow?W===` `&&K&&(W=` `):W+=` ${a.indent}`}else if(!E&&Be(l)){const k=Z[0],V=Z.indexOf(` `),U=V!==-1,ae=a.inFlow??l.flow??l.items.length===0;if(U||!ae){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},Kv=(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(a=>a.tag===On.tag&&a.default));function gp(u,l,a){if(a=u&&tl(a)?a.resolve(u.doc):a,Mi(a))for(const s of a.items)hf(u,l,s);else if(Array.isArray(a))for(const s of a)hf(u,l,s);else hf(u,l,a)}function hf(u,l,a){const s=u&&tl(a)?a.resolve(u.doc):a;if(!Ni(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:a,value:s}){if(ke(a)&&a.addToJSMap)a.addToJSMap(u,l,s);else if(Kv(u,a))gp(u,l,s);else{const c=Gt(a,"",u);if(l instanceof Map)l.set(c,Gt(s,c,u));else if(l instanceof Set)l.add(c);else{const o=Gv(a,c,u),h=Gt(s,o,u);o in l?Object.defineProperty(l,o,{value:h,writable:!0,enumerable:!0,configurable:!0}):l[o]=h}}return l}function Gv(u,l,a){if(l===null)return"";if(typeof l!="object")return String(l);if(ke(u)&&(a!=null&&a.doc)){const s=dp(a.doc,{});s.anchors=new Set;for(const o of a.anchors.keys())s.anchors.add(o.anchor);s.inFlow=!0,s.inStringifyKey=!0;const c=u.toString(s);if(!a.mapKeyWarned){let o=JSON.stringify(c);o.length>40&&(o=o.substring(0,36)+'..."'),mp(a.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),a.mapKeyWarned=!0}return c}return JSON.stringify(l)}function Rf(u,l,a){const s=xa(u,void 0,a),c=xa(l,void 0,a);return new ct(s,c)}class ct{constructor(l,a=null){Object.defineProperty(this,Vt,{value:tp}),this.key=l,this.value=a}clone(l){let{key:a,value:s}=this;return ke(a)&&(a=a.clone(l)),ke(s)&&(s=s.clone(l)),new ct(a,s)}toJSON(l,a){const s=a!=null&&a.mapAsMap?new Map:{};return pp(a,s,this)}toString(l,a,s){return l!=null&&l.doc?$v(this,l,a,s):JSON.stringify(this)}}function yp(u,l,a){return(l.inFlow??u.flow?Qv:Vv)(u,l,a)}function Vv({comment:u,items:l},a,{blockItemPrefix:s,flowChars:c,itemIndent:o,onChompKeep:h,onComment:m}){const{indent:p,options:{commentString:g}}=a,b=Object.assign({},a,{indent:o,type:null});let v=!1;const O=[];for(let x=0;xw=null,()=>v=!0);w&&(M+=El(M,o,g(w))),v&&w&&(v=!1),O.push(s+M)}let E;if(O.length===0)E=c.start+c.end;else{E=O[0];for(let x=1;xw=null);g||(g=v.length>b||M.includes(` `)),x0&&(g||(g=v.reduce((R,K)=>R+K.length+2,2)+(M.length+2)>l.options.lineWidth)),g&&(M+=",")),w&&(M+=El(M,s,m(w))),v.push(M),b=v.length}const{start:O,end:E}=a;if(v.length===0)return O+E;if(!g){const x=v.reduce((S,w)=>S+w.length+2,2);g=l.options.lineWidth>0&&x>l.options.lineWidth}if(g){let x=O;for(const S of v)x+=S?` ${o}${c}${S}`:` `;return`${x} ${c}${E}`}else return`${O}${h}${v.join(" ")}${h}${E}`}function bu({indent:u,options:{commentString:l}},a,s,c){if(s&&c&&(s=s.replace(/^\n+/,"")),s){const o=wn(l(s),u);a.push(o.trimStart())}}function wl(u,l){const a=De(l)?l.value:l;for(const s of u)if(je(s)&&(s.key===l||s.key===a||De(s.key)&&s.key.value===a))return s}class Lt extends op{static get tagName(){return"tag:yaml.org,2002:map"}constructor(l){super(Pn,l),this.items=[]}static from(l,a,s){const{keepUndefined:c,replacer:o}=s,h=new this(l),m=(p,g)=>{if(typeof o=="function")g=o.call(a,p,g);else if(Array.isArray(o)&&!o.includes(p))return;(g!==void 0||c)&&h.items.push(Rf(p,g,s))};if(a instanceof Map)for(const[p,g]of a)m(p,g);else if(a&&typeof a=="object")for(const p of Object.keys(a))m(p,a[p]);return typeof l.sortMapEntries=="function"&&h.items.sort(l.sortMapEntries),h}add(l,a){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=wl(this.items,s.key),o=(h=this.schema)==null?void 0:h.sortMapEntries;if(c){if(!a)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(p=>o(s,p)<0);m===-1?this.items.push(s):this.items.splice(m,0,s)}else this.items.push(s)}delete(l){const a=wl(this.items,l);return a?this.items.splice(this.items.indexOf(a),1).length>0:!1}get(l,a){const s=wl(this.items,l),c=s==null?void 0:s.value;return(!a&&De(c)?c.value:c)??void 0}has(l){return!!wl(this.items,l)}set(l,a){this.add(new ct(l,a),!0)}toJSON(l,a,s){const c=s?new s:a!=null&&a.mapAsMap?new Map:{};a!=null&&a.onCreate&&a.onCreate(c);for(const o of this.items)pp(a,c,o);return c}toString(l,a,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:a})}}const Ci={collection:"map",default:!0,nodeClass:Lt,tag:"tag:yaml.org,2002:map",resolve(u,l){return Ni(u)||l("Expected a mapping for this tag"),u},createNode:(u,l,a)=>Lt.from(u,l,a)};class el extends op{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(l){super(_i,l),this.items=[]}add(l){this.items.push(l)}delete(l){const a=lu(l);return typeof a!="number"?!1:this.items.splice(a,1).length>0}get(l,a){const s=lu(l);if(typeof s!="number")return;const c=this.items[s];return!a&&De(c)?c.value:c}has(l){const a=lu(l);return typeof a=="number"&&a=0?l:null}const zi={collection:"seq",default:!0,nodeClass:el,tag:"tag:yaml.org,2002:seq",resolve(u,l){return Mi(u)||l("Expected a sequence for this tag"),u},createNode:(u,l,a)=>el.from(u,l,a)},zu={identify:u=>typeof u=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:u=>u,stringify(u,l,a,s){return l=Object.assign({actualString:!0},l),Ra(u,l,a,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},a){if(u&&jf.test.test(u)){const s=u[0]==="t"||u[0]==="T";if(l===s)return u}return l?a.options.trueStr:a.options.falseStr}};function Wt({format:u,minFractionDigits:l,tag:a,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&&(!a||a==="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)),a=u.indexOf(".");return a!==-1&&u[u.length-1]==="0"&&(l.minFractionDigits=u.length-a-1),l},stringify:Wt},Du=u=>typeof u=="bigint"||Number.isInteger(u),Bf=(u,l,a,{intAsBigInt:s})=>s?BigInt(u):parseInt(u.substring(l),a);function Tp(u,l,a){const{value:s}=u;return Du(s)&&s>=0?a+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,a)=>Bf(u,2,8,a),stringify:u=>Tp(u,8,"0o")},wp={identify:Du,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(u,l,a)=>Bf(u,0,10,a),stringify:Wt},Ap={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,a)=>Bf(u,2,16,a),stringify:u=>Tp(u,16,"0x")},Xv=[Ci,zi,zu,xu,jf,Ep,wp,Ap,vp,bp,Sp];function vg(u){return typeof u=="bigint"||Number.isInteger(u)}const iu=({value:u})=>JSON.stringify(u),Zv=[{identify:u=>typeof u=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:u=>u,stringify:iu},{identify:u=>u==null,createNode:()=>new ce(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:iu},{identify:u=>typeof u=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:u=>u==="true",stringify:iu},{identify:vg,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(u,l,{intAsBigInt:a})=>a?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:iu}],Jv={default:!0,tag:"",test:/^/,resolve(u,l){return l(`Unresolved plain scalar ${JSON.stringify(u)}`),u}},Wv=[Ci,zi].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 a=atob(u.replace(/[\n\r]/g,"")),s=new Uint8Array(a.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[a]=je(s)?s:new ct(s)}}else l("Expected a sequence for this tag");return u}function _p(u,l,a){const{replacer:s}=a,c=new el(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,p;if(Array.isArray(h))if(h.length===2)m=h[0],p=h[1];else throw new TypeError(`Expected [key, value] tuple: ${h}`);else if(h&&h instanceof Object){const g=Object.keys(h);if(g.length===1)m=g[0],p=h[m];else throw new TypeError(`Expected tuple with one key, not ${g.length} keys`)}else m=h;c.items.push(Rf(m,p,a))}return c}const qf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Op,createNode:_p};class Si extends el{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=Si.tag}toJSON(l,a){if(!a)return super.toJSON(l);const s=new Map;a!=null&&a.onCreate&&a.onCreate(s);for(const c of this.items){let o,h;if(je(c)?(o=Gt(c.key,"",a),h=Gt(c.value,o,a)):o=Gt(c,"",a),s.has(o))throw new Error("Ordered maps must not include duplicate keys");s.set(o,h)}return s}static from(l,a,s){const c=_p(l,a,s),o=new this;return o.items=c.items,o}}Si.tag="tag:yaml.org,2002:omap";const Hf={collection:"seq",identify:u=>u instanceof Map,nodeClass:Si,default:!1,tag:"tag:yaml.org,2002:omap",resolve(u,l){const a=Op(u,l),s=[];for(const{key:c}of a.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 Si,a)},createNode:(u,l,a)=>Si.from(u,l,a)};function Np({value:u,source:l},a){return l&&(u?Mp:Cp).test.test(l)?l:u?a.options.trueStr:a.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},Iv={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},Fv={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,""))),a=u.indexOf(".");if(a!==-1){const s=u.substring(a+1).replace(/_/g,"");s[s.length-1]==="0"&&(l.minFractionDigits=s.length)}return l},stringify:Wt},ja=u=>typeof u=="bigint"||Number.isInteger(u);function Lu(u,l,a,{intAsBigInt:s}){const c=u[0];if((c==="-"||c==="+")&&(l+=1),u=u.substring(l).replace(/_/g,""),s){switch(a){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,a);return c==="-"?-1*o:o}function Yf(u,l,a){const{value:s}=u;if(ja(s)){const c=s.toString(l);return s<0?"-"+a+c.substr(1):a+c}return Wt(u)}const eb={identify:ja,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(u,l,a)=>Lu(u,2,2,a),stringify:u=>Yf(u,2,"0b")},tb={identify:ja,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(u,l,a)=>Lu(u,1,8,a),stringify:u=>Yf(u,8,"0")},nb={identify:ja,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(u,l,a)=>Lu(u,0,10,a),stringify:Wt},lb={identify:ja,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(u,l,a)=>Lu(u,2,16,a),stringify:u=>Yf(u,16,"0x")};class Ti extends Lt{constructor(l){super(l),this.tag=Ti.tag}add(l){let a;je(l)?a=l:l&&typeof l=="object"&&"key"in l&&"value"in l&&l.value===null?a=new ct(l.key,null):a=new ct(l,null),wl(this.items,a.key)||this.items.push(a)}get(l,a){const s=wl(this.items,l);return!a&&je(s)?De(s.key)?s.key.value:s.key:s}set(l,a){if(typeof a!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof a}`);const s=wl(this.items,l);s&&!a?this.items.splice(this.items.indexOf(s),1):!s&&a&&this.items.push(new ct(l))}toJSON(l,a){return super.toJSON(l,a,Set)}toString(l,a,s){if(!l)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},l,{allNullValues:!0}),a,s);throw new Error("Set items must all have null values")}static from(l,a,s){const{replacer:c}=s,o=new this(l);if(a&&Symbol.iterator in Object(a))for(let h of a)typeof c=="function"&&(h=c.call(a,h,h)),o.items.push(Rf(h,null,s));return o}}Ti.tag="tag:yaml.org,2002:set";const $f={collection:"map",identify:u=>u instanceof Set,nodeClass:Ti,default:!1,tag:"tag:yaml.org,2002:set",createNode:(u,l,a)=>Ti.from(u,l,a),resolve(u,l){if(Ni(u)){if(u.hasAllNullValues(!0))return Object.assign(new Ti,u);l("Set items must all have null values")}else l("Expected a mapping for this tag");return u}};function Kf(u,l){const a=u[0],s=a==="-"||a==="+"?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 a==="-"?c(-1)*o:o}function zp(u){let{value:l}=u,a=h=>h;if(typeof l=="bigint")a=h=>BigInt(h);else if(isNaN(l)||!isFinite(l))return Wt(u);let s="";l<0&&(s="-",l*=a(-1));const c=a(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:a})=>Kf(u,a),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=>Kf(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[,a,s,c,o,h,m]=l.map(Number),p=l[7]?Number((l[7]+"00").substr(1,3)):0;let g=Date.UTC(a,s-1,c,o||0,h||0,m||0,p);const b=l[8];if(b&&b!=="Z"){let v=Kf(b,!1);Math.abs(v)<30&&(v*=60),g-=6e4*v}return new Date(g)},stringify:({value:u})=>(u==null?void 0:u.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},bg=[Ci,zi,zu,xu,Mp,Cp,eb,tb,nb,lb,Iv,Fv,Pv,kf,On,Hf,qf,$f,xp,Dp,Uu],Sg=new Map([["core",Xv],["failsafe",[Ci,zi,zu]],["json",Wv],["yaml11",bg],["yaml-1.1",bg]]),Tg={binary:kf,bool:jf,float:Sp,floatExp:bp,floatNaN:vp,floatTime:Dp,int:wp,intHex:Ap,intOct:Ep,intTime:xp,map:Ci,merge:On,null:xu,omap:Hf,pairs:qf,seq:zi,set:$f,timestamp:Uu},ib={"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,a){const s=Sg.get(l);if(s&&!u)return a&&!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 a&&(c=c.concat(On)),c.reduce((o,h)=>{const m=typeof h=="string"?Tg[h]:h;if(!m){const p=JSON.stringify(h),g=Object.keys(Tg).map(b=>JSON.stringify(b)).join(", ");throw new Error(`Unknown custom tag ${p}; use one of ${g}`)}return o.includes(m)||o.push(m),o},[])}const ab=(u,l)=>u.keyl.key?1:0;class Ru{constructor({compat:l,customTags:a,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?ib:{},this.tags=df(a,this.name,s),this.toStringOptions=m??null,Object.defineProperty(this,Pn,{value:Ci}),Object.defineProperty(this,nn,{value:zu}),Object.defineProperty(this,_i,{value:zi}),this.sortMapEntries=typeof h=="function"?h:h===!0?ab:null}clone(){const l=Object.create(Ru.prototype,Object.getOwnPropertyDescriptors(this));return l.tags=this.tags.slice(),l}}function sb(u,l){var p;const a=[];let s=l.directives===!0;if(l.directives!==!1&&u.directives){const g=u.directives.toString(u);g?(a.push(g),s=!0):u.directives.docStart&&(s=!0)}s&&a.push("---");const c=dp(u,l),{commentString:o}=c.options;if(u.commentBefore){a.length!==1&&a.unshift("");const g=o(u.commentBefore);a.unshift(wn(g,""))}let h=!1,m=null;if(u.contents){if(ke(u.contents)){if(u.contents.spaceBefore&&s&&a.push(""),u.contents.commentBefore){const v=o(u.contents.commentBefore);a.push(wn(v,""))}c.forceBlockIndent=!!u.comment,m=u.contents.comment}const g=m?void 0:()=>h=!0;let b=Ei(u.contents,c,()=>m=null,g);m&&(b+=El(b,"",o(m))),(b[0]==="|"||b[0]===">")&&a[a.length-1]==="---"?a[a.length-1]=`--- ${b}`:a.push(b)}else a.push(Ei(u.contents,c));if((p=u.directives)!=null&&p.docEnd)if(u.comment){const g=o(u.comment);g.includes(` `)?(a.push("..."),a.push(wn(g,""))):a.push(`... ${g}`)}else a.push("...");else{let g=u.comment;g&&h&&(g=g.replace(/^\n+/,"")),g&&((!h||m)&&a[a.length-1]!==""&&a.push(""),a.push(wn(o(g),"")))}return a.join(` `)+` `}class xi{constructor(l,a,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Vt,{value:Of});let c=null;typeof a=="function"||Array.isArray(a)?c=a:s===void 0&&a&&(s=a,a=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(xi.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){di(this.contents)&&this.contents.add(l)}addIn(l,a){di(this.contents)&&this.contents.addIn(l,a)}createAlias(l,a){if(!l.anchor){const s=cp(this);l.anchor=!a||s.has(a)?rp(a||"a",s):a}return new _u(l.anchor)}createNode(l,a,s){let c;if(typeof a=="function")l=a.call({"":l},"",l),c=a;else if(Array.isArray(a)){const w=R=>typeof R=="number"||R instanceof String||R instanceof Number,M=a.filter(w).map(String);M.length>0&&(a=a.concat(M)),c=a}else s===void 0&&a&&(s=a,a=void 0);const{aliasDuplicateObjects:o,anchorPrefix:h,flow:m,keepUndefined:p,onTagObj:g,tag:b}=s??{},{onAnchor:v,setAnchors:O,sourceObjects:E}=Uv(this,h||"a"),x={aliasDuplicateObjects:o??!0,keepUndefined:p??!1,onAnchor:v,onTagObj:g,replacer:c,schema:this.schema,sourceObjects:E},S=xa(l,b,x);return m&&Be(S)&&(S.flow=!0),O(),S}createPair(l,a,s={}){const c=this.createNode(l,null,s),o=this.createNode(a,null,s);return new ct(c,o)}delete(l){return di(this.contents)?this.contents.delete(l):!1}deleteIn(l){return Ca(l)?this.contents==null?!1:(this.contents=null,!0):di(this.contents)?this.contents.deleteIn(l):!1}get(l,a){return Be(this.contents)?this.contents.get(l,a):void 0}getIn(l,a){return Ca(l)?!a&&De(this.contents)?this.contents.value:this.contents:Be(this.contents)?this.contents.getIn(l,a):void 0}has(l){return Be(this.contents)?this.contents.has(l):!1}hasIn(l){return Ca(l)?this.contents!==void 0:Be(this.contents)?this.contents.hasIn(l):!1}set(l,a){this.contents==null?this.contents=vu(this.schema,[l],a):di(this.contents)&&this.contents.set(l,a)}setIn(l,a){Ca(l)?this.contents=a:this.contents==null?this.contents=vu(this.schema,Array.from(l),a):di(this.contents)&&this.contents.setIn(l,a)}setSchema(l,a={}){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(a.schema instanceof Object)this.schema=a.schema;else if(s)this.schema=new Ru(Object.assign(s,a));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:l,jsonArg:a,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},p=Gt(this.contents,a??"",m);if(typeof o=="function")for(const{count:g,res:b}of m.anchors.values())o(b,g);return typeof h=="function"?vi(h,{"":p},"",p):p}toJSON(l,a){return this.toJS({json:!0,jsonArg:l,mapAsMap:!1,onAnchor:a})}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 a=JSON.stringify(l.indent);throw new Error(`"indent" option must be a positive integer, not ${a}`)}return sb(this,l)}}function di(u){if(Be(u))return!0;throw new Error("Expected a YAML collection as document contents")}class Gf extends Error{constructor(l,a,s,c){super(),this.name=l,this.code=s,this.message=c,this.pos=a}}class Al extends Gf{constructor(l,a,s){super("YAMLParseError",l,a,s)}}class Lp extends Gf{constructor(l,a,s){super("YAMLWarning",l,a,s)}}const Su=(u,l)=>a=>{if(a.pos[0]===-1)return;a.linePos=a.pos.map(m=>l.linePos(m));const{line:s,col:c}=a.linePos[0];a.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 p=a.linePos[1];(p==null?void 0:p.line)===s&&p.col>c&&(m=Math.max(1,Math.min(p.col-c,80-o)));const g=" ".repeat(o)+"^".repeat(m);a.message+=`: ${h} ${g} `}};function wi(u,{flow:l,indicator:a,next:s,offset:c,onError:o,parentIndent:h,startOnNewline:m}){let p=!1,g=m,b=m,v="",O="",E=!1,x=!1,S=null,w=null,M=null,R=null,K=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&&(g&&V.type!=="comment"&&V.type!=="newline"&&o(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),V.type){case"space":!l&&(a!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&V.source.includes(" ")&&(S=V),b=!0;break;case"comment":{b||o(V,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const U=V.source.substring(1)||" ";v?v+=O+U:v=U,O="",g=!1;break}case"newline":g?v?v+=V.source:(!Q||a!=="seq-item-ind")&&(p=!0):O+=V.source,g=!0,E=!0,(w||M)&&(R=V),b=!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),g=!1,b=!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),g=!1,b=!1,x=!0;break}case a:(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,g=a==="seq-item-ind"||a==="explicit-key-ind",b=!1;break;case"comma":if(l){K&&o(V,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`),K=V,g=!1,b=!1;break}default:o(V,"UNEXPECTED_TOKEN",`Unexpected ${V.type} token`),g=!1,b=!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&&(g&&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:K,found:Q,spaceBefore:p,comment:v,hasNewline:E,anchor:w,tag:M,newlineAfterProp:R,end:k,start:Z??k}}function Da(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 a of l.start)if(a.type==="newline")return!0;if(l.sep){for(const a of l.sep)if(a.type==="newline")return!0}if(Da(l.key)||Da(l.value))return!0}return!1;default:return!0}}function Cf(u,l,a){if((l==null?void 0:l.type)==="flow-collection"){const s=l.end[0];s.indent===u&&(s.source==="]"||s.source==="}")&&Da(l)&&a(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Up(u,l,a){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,a))}const Eg="All mapping items must start at the same column";function ub({composeNode:u,composeEmptyNode:l},a,s,c,o){var b;const h=(o==null?void 0:o.nodeClass)??Lt,m=new h(a.schema);a.atRoot&&(a.atRoot=!1);let p=s.offset,g=null;for(const v of s.items){const{start:O,key:E,sep:x,value:S}=v,w=wi(O,{indicator:"explicit-key-ind",next:E??(x==null?void 0:x[0]),offset:p,onError:c,parentIndent:s.indent,startOnNewline:!0}),M=!w.found;if(M){if(E&&(E.type==="block-seq"?c(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in E&&E.indent!==s.indent&&c(p,"BAD_INDENT",Eg)),!w.anchor&&!w.tag&&!x){g=w.end,w.comment&&(m.comment?m.comment+=` `+w.comment:m.comment=w.comment);continue}(w.newlineAfterProp||Da(E))&&c(E??O[O.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((b=w.found)==null?void 0:b.indent)!==s.indent&&c(p,"BAD_INDENT",Eg);a.atKey=!0;const R=w.end,K=E?u(a,E,w,c):l(a,R,O,null,w,c);a.schema.compat&&Cf(s.indent,E,c),a.atKey=!1,Up(a,m.items,K)&&c(R,"DUPLICATE_KEY","Map keys must be unique");const Q=wi(x??[],{indicator:"map-value-ind",next:S,offset:K.range[2],onError:c,parentIndent:s.indent,startOnNewline:!E||E.type==="block-scalar"});if(p=Q.end,Q.found){M&&((S==null?void 0:S.type)==="block-map"&&!Q.hasNewline&&c(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),a.options.strict&&w.startu&&(u.type==="block-map"||u.type==="block-seq");function rb({composeNode:u,composeEmptyNode:l},a,s,c,o){var w;const h=s.start.source==="{",m=h?"flow map":"flow sequence",p=(o==null?void 0:o.nodeClass)??(h?Lt:el),g=new p(a.schema);g.flow=!0;const b=a.atRoot;b&&(a.atRoot=!1),a.atKey&&(a.atKey=!1);let v=s.offset+s.start.source.length;for(let M=0;M0){const M=Ba(x,S,a.options.strict,c);M.comment&&(g.comment?g.comment+=` `+M.comment:g.comment=M.comment),g.range=[s.offset,S,M.offset]}else g.range=[s.offset,S,S];return g}function pf(u,l,a,s,c,o){const h=a.type==="block-map"?ub(u,l,a,s,o):a.type==="block-seq"?cb(u,l,a,s,o):rb(u,l,a,s,o),m=h.constructor;return c==="!"||c===m.tagName?(h.tag=m.tagName,h):(c&&(h.tag=c),h)}function fb(u,l,a,s,c){var O;const o=s.tag,h=o?l.directives.tagName(o.source,E=>c(o,"TAG_RESOLVE_FAILED",E)):null;if(a.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(!p){const E=l.schema.knownTags[h];if((E==null?void 0:E.collection)===m)l.schema.tags.push(Object.assign({},E,{default:!1})),p=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,a,c,h)}const g=pf(u,l,a,c,h,p),b=((O=p.resolve)==null?void 0:O.call(p,g,E=>c(o,"TAG_RESOLVE_FAILED",E),l.options))??g,v=ke(b)?b:new ce(b);return v.range=g.range,v.tag=h,p!=null&&p.format&&(v.format=p.format),v}function Rp(u,l,a){const s=l.offset,c=ob(l,u.options.strict,a);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 p=l.indent+c.indent,g=l.offset+c.length,b=0;for(let S=0;Sp&&(p=w.length);else{w.length=m;--S)h[S][0].length>p&&(m=S+1);let v="",O="",E=!1;for(let S=0;Sp||M[0]===" "?(O===" "?O=` `:!E&&O===` `&&(O=` `),v+=O+w.slice(p)+M,O=` `,E=!0):M===""?O===` `?v+=` `:O=` `:(v+=O+M,O=" ",E=!1)}switch(c.chomp){case"-":break;case"+":for(let S=m;Sa(s+O,E,x);switch(c){case"scalar":m=ce.PLAIN,p=db(o,g);break;case"single-quoted-scalar":m=ce.QUOTE_SINGLE,p=mb(o,g);break;case"double-quoted-scalar":m=ce.QUOTE_DOUBLE,p=gb(o,g);break;default:return a(u,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${c}`),{value:"",type:null,comment:"",range:[s,s+o.length,s+o.length]}}const b=s+o.length,v=Ba(h,b,l,a);return{value:p,type:m,comment:v.comment,range:[s,b,v.offset]}}function db(u,l){let a="";switch(u[0]){case" ":a="a tab character";break;case",":a="flow indicator character ,";break;case"%":a="directive indicator character %";break;case"|":case">":{a=`block scalar indicator ${u[0]}`;break}case"@":case"`":{a=`reserved character ${u[0]}`;break}}return a&&l(0,"BAD_SCALAR_START",`Plain value cannot start with ${a}`),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,a;try{l=new RegExp(`(.*?)(?o?u.slice(o,s+1):c)}else a+=c}return(u[u.length-1]!=='"'||u.length===1)&&l(u.length,"MISSING_CHAR",'Missing closing "quote'),a}function pb(u,l){let a="",s=u[l+1];for(;(s===" "||s===" "||s===` `||s==="\r")&&!(s==="\r"&&u[l+2]!==` `);)s===` `&&(a+=` `),l+=1,s=u[l+1];return a||(a=" "),{fold:a,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,a,s){const c=u.substr(l,a),h=c.length===a&&/^[0-9a-fA-F]+$/.test(c)?parseInt(c,16):NaN;if(isNaN(h)){const m=u.substr(l-2,a+2);return s(l-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${m}`),m}return String.fromCodePoint(h)}function kp(u,l,a,s){const{value:c,type:o,comment:h,range:m}=l.type==="block-scalar"?Rp(u,l,s):jp(l,u.options.strict,s),p=a?u.directives.tagName(a.source,v=>s(a,"TAG_RESOLVE_FAILED",v)):null;let g;u.options.stringKeys&&u.atKey?g=u.schema[nn]:p?g=bb(u.schema,c,p,a,s):l.type==="scalar"?g=Sb(u,c,l,s):g=u.schema[nn];let b;try{const v=g.resolve(c,O=>s(a??l,"TAG_RESOLVE_FAILED",O),u.options);b=De(v)?v:new ce(v)}catch(v){const O=v instanceof Error?v.message:String(v);s(a??l,"TAG_RESOLVE_FAILED",O),b=new ce(c)}return b.range=m,b.source=c,o&&(b.type=o),p&&(b.tag=p),g.format&&(b.format=g.format),h&&(b.comment=h),b}function bb(u,l,a,s,c){var m;if(a==="!")return u[nn];const o=[];for(const p of u.tags)if(!p.collection&&p.tag===a)if(p.default&&p.test)o.push(p);else return p;for(const p of o)if((m=p.test)!=null&&m.test(l))return p;const h=u.knownTags[a];return h&&!h.collection?(u.tags.push(Object.assign({},h,{default:!1,test:void 0})),h):(c(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,a!=="tag:yaml.org,2002:str"),u[nn])}function Sb({atKey:u,directives:l,schema:a},s,c,o){const h=a.tags.find(m=>{var p;return(m.default===!0||u&&m.default==="key")&&((p=m.test)==null?void 0:p.test(s))})||a[nn];if(a.compat){const m=a.compat.find(p=>{var g;return p.default&&((g=p.test)==null?void 0:g.test(s))})??a[nn];if(h.tag!==m.tag){const p=l.tagString(h.tag),g=l.tagString(m.tag),b=`Value may be parsed as either ${p} or ${g}`;o(c,"TAG_RESOLVE_FAILED",b,!0)}}return h}function Tb(u,l,a){if(l){a??(a=l.length);for(let s=a-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,a,s){const c=u.atKey,{spaceBefore:o,comment:h,anchor:m,tag:p}=a;let g,b=!0;switch(l.type){case"alias":g=wb(u,l,s),(m||p)&&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":g=kp(u,l,p,s),m&&(g.anchor=m.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{g=fb(Eb,u,l,a,s),m&&(g.anchor=m.source.substring(1))}catch(v){const O=v instanceof Error?v.message:String(v);s(l,"RESOURCE_EXHAUSTION",O)}break;default:{const v=l.type==="error"?l.message:`Unsupported token (type: ${l.type})`;s(l,"UNEXPECTED_TOKEN",v),b=!1}}return g??(g=Vf(u,l.offset,void 0,null,a,s)),m&&g.anchor===""&&s(m,"BAD_ALIAS","Anchor cannot be an empty string"),c&&u.options.stringKeys&&(!De(g)||typeof g.value!="string"||g.tag&&g.tag!=="tag:yaml.org,2002:str")&&s(p??l,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(g.spaceBefore=!0),h&&(l.type==="scalar"&&l.source===""?g.comment=h:g.commentBefore=h),u.options.keepSourceTokens&&b&&(g.srcToken=l),g}function Vf(u,l,a,s,{spaceBefore:c,comment:o,anchor:h,tag:m,end:p},g){const b={type:"scalar",offset:Tb(l,a,s),indent:-1,source:""},v=kp(u,b,m,g);return h&&(v.anchor=h.source.substring(1),v.anchor===""&&g(h,"BAD_ALIAS","Anchor cannot be an empty string")),c&&(v.spaceBefore=!0),o&&(v.comment=o,v.range[2]=p),v}function wb({options:u},{offset:l,source:a,end:s},c){const o=new _u(a.substring(1));o.source===""&&c(l,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&c(l+a.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const h=l+a.length,m=Ba(s,h,u.strict,c);return o.range=[l,h,m.offset],m.comment&&(o.comment=m.comment),o}function Ab(u,l,{offset:a,start:s,value:c,end:o},h){const m=Object.assign({_directives:l},u),p=new xi(void 0,m),g={atKey:!1,atRoot:!0,directives:p.directives,options:p.options,schema:p.schema},b=wi(s,{indicator:"doc-start",next:c??(o==null?void 0:o[0]),offset:a,onError:h,parentIndent:0,startOnNewline:!0});b.found&&(p.directives.docStart=!0,c&&(c.type==="block-map"||c.type==="block-seq")&&!b.hasNewline&&h(b.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=c?qp(g,c,b,h):Vf(g,b.end,s,null,b,h);const v=p.contents.range[2],O=Ba(o,v,!1,h);return O.comment&&(p.comment=O.comment),p.range=[a,v,O.offset],p}function Ma(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:a}=u;return[l,l+(typeof a=="string"?a.length:1)]}function wg(u){var c;let l="",a=!1,s=!1;for(let o=0;o{const h=Ma(a);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,a){const{comment:s,afterEmptyLine:c}=wg(this.prelude);if(s){const o=l.contents;if(a)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}}a?(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:wg(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(l,a=!1,s=-1){for(const c of l)yield*this.next(c);yield*this.end(a,s)}*next(l){switch(l.type){case"directive":this.directives.add(l.source,(a,s,c)=>{const o=Ma(l);o[0]+=a,this.onError(o,"BAD_DIRECTIVE",s,c)}),this.prelude.push(l.source),this.atDirectives=!0;break;case"document":{const a=Ab(this.options,this.directives,l,this.onError);this.atDirectives&&!a.directives.docStart&&this.onError(l,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(a,!1),this.doc&&(yield this.doc),this.doc=a,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(l.source);break;case"error":{const a=l.source?`${l.message}: ${JSON.stringify(l.source)}`:l.message,s=new Al(Ma(l),"UNEXPECTED_TOKEN",a);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(Ma(l),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const a=Ba(l.end,l.offset+l.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),a.comment){const s=this.doc.comment;this.doc.comment=s?`${s} ${a.comment}`:a.comment}this.doc.range[2]=a.offset;break}default:this.errors.push(new Al(Ma(l),"UNEXPECTED_TOKEN",`Unsupported token ${l.type}`))}}*end(l=!1,a=-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 xi(void 0,s);this.atDirectives&&this.onError(a,"MISSING_CHAR","Missing directives-end indicator line"),c.range=[0,a,a],this.decorate(c,!1),yield c}}}function Ob(u,l=!0,a){if(u){const s=(c,o,h)=>{const m=typeof c=="number"?c:Array.isArray(c)?c[0]:c.offset;if(a)a(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:a=!1,indent:s,inFlow:c=!1,offset:o=-1,type:h="PLAIN"}=l,m=Ra({type:h,value:u},{implicitKey:a,indent:s>0?" ".repeat(s):"",inFlow:c,options:{blockQuote:!0,lineWidth:-1}}),p=l.end??[{type:"newline",offset:-1,indent:s,source:` `}];switch(m[0]){case"|":case">":{const g=m.indexOf(` `),b=m.substring(0,g),v=m.substring(g+1)+` `,O=[{type:"block-scalar-header",offset:o,indent:s,source:b}];return Hp(O,p)||O.push({type:"newline",offset:-1,indent:s,source:` `}),{type:"block-scalar",offset:o,indent:s,props:O,source:v}}case'"':return{type:"double-quoted-scalar",offset:o,indent:s,source:m,end:p};case"'":return{type:"single-quoted-scalar",offset:o,indent:s,source:m,end:p};default:return{type:"scalar",offset:o,indent:s,source:m,end:p}}}function Nb(u,l,a={}){let{afterKey:s=!1,implicitKey:c=!1,inFlow:o=!1,type:h}=a,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 g=u.props[0];if(g.type!=="block-scalar-header")throw new Error("Invalid block scalar header");h=g.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:h="PLAIN"}const p=Ra({type:h,value:l},{implicitKey:c||m===null,indent:m!==null&&m>0?" ".repeat(m):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(p[0]){case"|":case">":Mb(u,p);break;case'"':yf(u,p,"double-quoted-scalar");break;case"'":yf(u,p,"single-quoted-scalar");break;default:yf(u,p,"scalar")}}function Mb(u,l){const a=l.indexOf(` `),s=l.substring(0,a),c=l.substring(a+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 p of Object.keys(u))p!=="type"&&p!=="offset"&&delete u[p];Object.assign(u,{type:"block-scalar",indent:h,props:m,source:c})}}function Hp(u,l){if(l)for(const a of l)switch(a.type){case"space":case"comment":u.push(a);break;case"newline":return u.push(a),!0}return!1}function yf(u,l,a){switch(u.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":u.type=a,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:a,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:a,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:a,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 a of u.props)l+=Tu(a);return l+u.source}case"block-map":case"block-seq":{let l="";for(const a of u.items)l+=gu(a);return l}case"flow-collection":{let l=u.start.source;for(const a of u.items)l+=gu(a);for(const a of u.end)l+=a.source;return l}case"document":{let l=gu(u);if(u.end)for(const a of u.end)l+=a.source;return l}default:{let l=u.source;if("end"in u&&u.end)for(const a of u.end)l+=a.source;return l}}}function gu({start:u,key:l,sep:a,value:s}){let c="";for(const o of u)c+=o.source;if(l&&(c+=Tu(l)),a)for(const o of a)c+=o.source;return s&&(c+=Tu(s)),c}const zf=Symbol("break visit"),zb=Symbol("skip children"),Yp=Symbol("remove item");function _l(u,l){"type"in u&&u.type==="document"&&(u={start:u.start,value:u.value}),$p(Object.freeze([]),u,l)}_l.BREAK=zf;_l.SKIP=zb;_l.REMOVE=Yp;_l.itemAtPath=(u,l)=>{let a=u;for(const[s,c]of l){const o=a==null?void 0:a[s];if(o&&"items"in o)a=o.items[c];else return}return a};_l.parentCollection=(u,l)=>{const a=_l.itemAtPath(u,l.slice(0,-1)),s=l[l.length-1][0],c=a==null?void 0:a[s];if(c&&"items"in c)return c;throw new Error("Parent collection not found")};function $p(u,l,a){let s=a(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 La:return"";default:return JSON.stringify(u)}}function Kp(u){switch(u){case ju:return"byte-order-mark";case Bu:return"doc-mode";case ku:return"flow-error-end";case La: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:La,createScalarToken:_b,isCollection:xb,isScalar:Db,prettyToken:Lb,resolveAsScalar:Ob,setScalarValue:Nb,stringify:Cb,tokenType:Kp,visit:_l},Symbol.toStringTag,{value:"Module"}));function Jt(u){switch(u){case void 0:case" ":case` `:case"\r":case" ":return!0;default:return!1}}const Ag=new Set("0123456789ABCDEFabcdef"),Rb=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),au=new Set(",[]{}"),jb=new Set(` ,[]{} \r `),vf=u=>!u||jb.has(u);class Gp{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,a=!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=!a;let s=this.next??"stream";for(;s&&(a||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let l=this.pos,a=this.buffer[l];for(;a===" "||a===" ";)a=this.buffer[++l];return!a||a==="#"||a===` `?!0:a==="\r"?this.buffer[l+1]===` `:!1}charAt(l){return this.buffer[this.pos+l]}continueScalar(l){let a=this.buffer[l];if(this.indentNext>0){let s=0;for(;a===" ";)a=this.buffer[++s+l];if(a==="\r"){const c=this.buffer[s+l+1];if(c===` `||!c&&!this.atEnd)return l+s+1}return a===` `||s>=this.indentNext||!a&&!this.atEnd?l+s:-1}if(a==="-"||a==="."){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,a]=this.peek(2);if(!a&&!this.atEnd)return this.setNext("block-start");if((l==="-"||l==="?"||l===":")&&Jt(a)){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 a=yield*this.pushIndicators();switch(l[a]){case"#":yield*this.pushCount(l.length-a);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 a+=yield*this.parseBlockScalarHeader(),a+=yield*this.pushSpaces(!0),yield*this.pushCount(l.length-a),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let l,a,s=-1;do l=yield*this.pushNewline(),l>0?(a=yield*this.pushSpaces(!1),this.indentValue=s=a):a=0,a+=yield*this.pushSpaces(!0);while(l+a>0);const c=this.getLine();if(c===null)return this.setNext("flow");if((s!==-1&&s"0"&&a<="9")this.blockScalarIndent=Number(a)-1;else if(a!=="-")break}return yield*this.pushUntil(a=>Jt(a)||a==="#")}*parseBlockScalar(){let l=this.pos-1,a=0,s;e:for(let o=this.pos;s=this.buffer[o];++o)switch(s){case" ":a+=1;break;case` `:l=o,a=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(a>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=a: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+a>m)l=o;else break}while(!0);return yield La,yield*this.pushToIndex(l+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const l=this.flowLevel>0;let a=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&&au.has(o))break;a=s}else if(Jt(c)){let o=this.buffer[s+1];if(c==="\r"&&(o===` `?(s+=1,c=` `,o=this.buffer[s+1]):a=s),o==="#"||l&&au.has(o))break;if(c===` `){const h=this.continueScalar(s+1);if(h===-1)break;s=Math.max(s,h-2)}}else{if(l&&au.has(c))break;a=s}return!c&&!this.atEnd?this.setNext("plain-scalar"):(yield La,yield*this.pushToIndex(a+1,!0),l?"flow":"doc")}*pushCount(l){return l>0?(yield this.buffer.substr(this.pos,l),this.pos+=l,l):0}*pushToIndex(l,a){const s=this.buffer.slice(this.pos,l);return s?(yield s,this.pos+=s.length,s.length):(a&&(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,a=this.charAt(1);if(Jt(a)||l&&au.has(a))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,a=this.buffer[l];for(;!Jt(a)&&a!==">";)a=this.buffer[++l];return yield*this.pushToIndex(a===">"?l+1:l,!1)}else{let l=this.pos+1,a=this.buffer[l];for(;a;)if(Rb.has(a))a=this.buffer[++l];else if(a==="%"&&Ag.has(this.buffer[l+1])&&Ag.has(this.buffer[l+2]))a=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 a=this.pos-1,s;do s=this.buffer[++a];while(s===" "||l&&s===" ");const c=a-this.pos;return c>0&&(yield this.buffer.substr(this.pos,c),this.pos=a),c}*pushUntil(l){let a=this.pos,s=this.buffer[a];for(;!l(s);)s=this.buffer[++a];return yield*this.pushToIndex(a,!1)}}class Vp{constructor(){this.lineStarts=[],this.addNewLine=l=>this.lineStarts.push(l),this.linePos=l=>{let a=0,s=this.lineStarts.length;for(;a>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(;((a=u[++l])==null?void 0:a.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 Gp,this.onNewLine=l}*parse(l,a=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(l,a))yield*this.next(s);a||(yield*this.end())}*next(l){if(this.source=l,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=l.length;return}const a=Kp(l);if(a)if(a==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=a,yield*this.step(),a){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 a=l??this.stack.pop();if(!a)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield a;else{const s=this.peek(1);switch(a.type==="block-scalar"?a.indent="indent"in s?s.indent:0:a.type==="flow-collection"&&s.type==="document"&&(a.indent=0),a.type==="flow-collection"&&_g(a),s.type){case"document":s.value=a;break;case"block-scalar":s.props.push(a);break;case"block-map":{const c=s.items[s.items.length-1];if(c.value){s.items.push({start:[],key:a,sep:[]}),this.onKeyLine=!0;return}else if(c.sep)c.value=a;else{Object.assign(c,{key:a,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:a}):c.value=a;break}case"flow-collection":{const c=s.items[s.items.length-1];!c||c.value?s.items.push({start:[],key:a,sep:[]}):c.sep?c.value=a:Object.assign(c,{key:a,sep:[]});return}default:yield*this.pop(),yield*this.pop(a)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(a.type==="block-map"||a.type==="block-seq")){const c=a.items[a.items.length-1];c&&!c.sep&&!c.value&&c.start.length>0&&Og(c.start)===-1&&(a.indent===0||c.start.every(o=>o.type!=="comment"||o.indent=l.indent){const c=!this.onKeyLine&&this.indent===l.indent,o=c&&(a.sep||a.explicitKey)&&this.type!=="seq-item-ind";let h=[];if(o&&a.sep&&!a.value){const m=[];for(let p=0;pl.indent&&(m.length=0);break;default:m.length=0}}m.length>=2&&(h=a.sep.splice(m[1]))}switch(this.type){case"anchor":case"tag":o||a.value?(h.push(this.sourceToken),l.items.push({start:h}),this.onKeyLine=!0):a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"explicit-key-ind":!a.sep&&!a.explicitKey?(a.start.push(this.sourceToken),a.explicitKey=!0):o||a.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(a.explicitKey)if(a.sep)if(a.value)l.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Fn(a.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(a.key)&&!Fn(a.sep,"newline")){const m=mi(a.start),p=a.key,g=a.sep;g.push(this.sourceToken),delete a.key,delete a.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:m,key:p,sep:g}]})}else h.length>0?a.sep=a.sep.concat(h,this.sourceToken):a.sep.push(this.sourceToken);else if(Fn(a.start,"newline"))Object.assign(a,{key:null,sep:[this.sourceToken]});else{const m=mi(a.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:m,key:null,sep:[this.sourceToken]}]})}else a.sep?a.value||o?l.items.push({start:h,key:null,sep:[this.sourceToken]}):Fn(a.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):a.sep.push(this.sourceToken):Object.assign(a,{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||a.value?(l.items.push({start:h,key:m,sep:[]}),this.onKeyLine=!0):a.sep?this.stack.push(m):(Object.assign(a,{key:m,sep:[]}),this.onKeyLine=!0);return}default:{const m=this.startBlockValue(l);if(m){if(m.type==="block-seq"){if(!a.explicitKey&&a.sep&&!Fn(a.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 a=l.items[l.items.length-1];switch(this.type){case"newline":if(a.value){const c="end"in a.value?a.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 a.start.push(this.sourceToken);return;case"space":case"comment":if(a.value)l.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(a.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,a.start),o.push(this.sourceToken),l.items.pop();return}}a.start.push(this.sourceToken)}return;case"anchor":case"tag":if(a.value||this.indent<=l.indent)break;a.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==l.indent)break;a.value||Fn(a.start,"seq-item-ind")?l.items.push({start:[this.sourceToken]}):a.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 a=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":!a||a.sep?l.items.push({start:[this.sourceToken]}):a.start.push(this.sourceToken);return;case"map-value-ind":!a||a.value?l.items.push({start:[],key:null,sep:[this.sourceToken]}):a.sep?a.sep.push(this.sourceToken):Object.assign(a,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!a||a.value?l.items.push({start:[this.sourceToken]}):a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const c=this.flowScalar(this.type);!a||a.value?l.items.push({start:[],key:c,sep:[]}):a.sep?this.stack.push(c):Object.assign(a,{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=mi(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 a=this.source.indexOf(` `)+1;for(;a!==0;)this.onNewLine(this.offset+a),a=this.source.indexOf(` `,a)+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 a=su(l),s=mi(a);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 a=su(l),s=mi(a);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(l,a){return this.type!=="comment"||this.indent<=a?!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:a,prettyErrors:s}=Xp(l),c=new Xf(a==null?void 0:a.addNewLine),o=new Qf(l),h=Array.from(o.compose(c.parse(u)));if(s&&a)for(const m of h)m.errors.forEach(Su(u,a)),m.warnings.forEach(Su(u,a));return h.length>0?h:Object.assign([],{empty:!0},o.streamInfo())}function Zp(u,l={}){const{lineCounter:a,prettyErrors:s}=Xp(l),c=new Xf(a==null?void 0:a.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&&a&&(h.errors.forEach(Su(u,a)),h.warnings.forEach(Su(u,a))),h}function kb(u,l,a){let s;typeof l=="function"?s=l:a===void 0&&l&&typeof l=="object"&&(a=l);const c=Zp(u,a);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},a))}function qb(u,l,a){let s=null;if(typeof l=="function"||Array.isArray(l)?s=l:a===void 0&&l&&(a=l),typeof a=="string"&&(a=a.length),typeof a=="number"){const c=Math.round(a);a=c<1?void 0:c>8?{indent:8}:{indent:c}}if(u===void 0){const{keepUndefined:c}=a??l??{};if(!c)return}return Nl(u)&&!s?u.toString(a):new xi(u,s,a).toString(a)}const Hb=Object.freeze(Object.defineProperty({__proto__:null,Alias:_u,CST:Ub,Composer:Qf,Document:xi,Lexer:Gp,LineCounter:Vp,Pair:ct,Parser:Xf,Scalar:ce,Schema:Ru,YAMLError:Gf,YAMLMap:Lt,YAMLParseError:Al,YAMLSeq:el,YAMLWarning:Lp,isAlias:tl,isCollection:Be,isDocument:Nl,isMap:Ni,isNode:ke,isPair:je,isScalar:De,isSeq:Mi,parse:kb,parseAllDocuments:Bb,parseDocument:Zp,stringify:qb,visit:Ml,visitAsync:Ou},Symbol.toStringTag,{value:"Module"}));function Yb(u,l,a={}){var O;const s=new u.LineCounter,c={keepSourceTokens:!0,lineCounter:s,...a},o=u.parseDocument(l,c),h=[],m=E=>[s.linePos(E[0]),s.linePos(E[1])],p=E=>{h.push({message:E.message,range:[s.linePos(E.pos[0]),s.linePos(E.pos[1])]})},g=(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){b(E,S);continue}h.push({message:"Sequence items should be strings or maps",range:m(S.range||x.range)})}},b=(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 K=Eu.parse(M,c,h);if(!K)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({...K,children:[{kind:"text",text:bf(String(R.value))}]});continue}if(R instanceof u.YAMLSeq){E.children.push(K),g(K,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(p),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}:(g(v,o.contents),h.length?{errors:h,fragment:$b}:((O=v.children)==null?void 0:O.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,a,s){try{return new Eu(l.value)._parse()}catch(c){if(c instanceof Ng){const o=a.prettyErrors===!1?c.message:c.message+`: `+l.value+` `+" ".repeat(c.pos)+`^ `;return s.push({message:o,range:[a.lineCounter.linePos(l.range[0]),a.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 a=this._pos;for(;!this._eof()&&/[a-zA-Z]/.test(this._peek());)this._pos++;return this._input.slice(a,this._pos)}_readString(){let l="",a=!1;for(;!this._eof();){const s=this._next();if(a)l+=s,a=!1;else if(s==="\\")a=!0;else{if(s==='"')return l;l+=s}}this._throwError("Unterminated string")}_throwError(l,a=0){throw new Ng(l,a||this._pos)}_readRegex(){let l="",a=!1,s=!1;for(;!this._eof();){const c=this._next();if(a)l+=c,a=!1;else if(c==="\\")a=!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 a=this._pos;for(;this._skipWhitespace(),this._peek()==="[";){this._next(),this._skipWhitespace(),a=this._pos;const s=this._readIdentifier("attribute");this._skipWhitespace();let c="";if(this._peek()==="=")for(this._next(),this._skipWhitespace(),a=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",a)}}_parse(){this._skipWhitespace();const l=this._readIdentifier("role");this._skipWhitespace();const a=this._readStringOrRegex()||"",s={kind:"role",role:l,name:a};return this._readAttributes(s),this._skipWhitespace(),this._eof()||this._throwError("Unexpected input"),s}_applyAttribute(l,a,s,c){if(a==="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(a==="disabled"){this._assert(s==="true"||s==="false",'Value of "disabled" attribute must be a boolean',c),l.disabled=s==="true";return}if(a==="expanded"){this._assert(s==="true"||s==="false",'Value of "expanded" attribute must be a boolean',c),l.expanded=s==="true";return}if(a==="active"){this._assert(s==="true"||s==="false",'Value of "active" attribute must be a boolean',c),l.active=s==="true";return}if(a==="invalid"){this._assert(s==="true"||s==="false"||s==="grammar"||s==="spelling",'Value of "invalid" attribute must be a boolean, "grammar" or "spelling"',c),l.invalid=s==="true"?!0:s==="false"?!1:s;return}if(a==="level"){this._assert(!isNaN(Number(s)),'Value of "level" attribute must be a number',c),l.level=Number(s);return}if(a==="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(a==="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 [${a}]`,c)}_assert(l,a,s){l||this._throwError(a||"Assertion error",s)}}class Ng extends Error{constructor(l,a){super(l),this.pos=a}}const Kb=({className:u,style:l,open:a,isModal:s,minWidth:c,verticalOffset:o,requestClose:h,anchor:m,dataTestId:p,children:g})=>{const b=he.useRef(null),[v,O]=he.useState(0),[E]=Sf(b),[x,S]=Sf(m),w=m?Gb(E,x,o):void 0;return he.useEffect(()=>{const M=K=>{!b.current||!(K.target instanceof Node)||b.current.contains(K.target)||h==null||h()},R=K=>{K.key==="Escape"&&(h==null||h())};return a?(document.addEventListener("mousedown",M),document.addEventListener("keydown",R),()=>{document.removeEventListener("mousedown",M),document.removeEventListener("keydown",R)}):()=>{}},[a,h]),he.useLayoutEffect(()=>S(),[a,S]),he.useEffect(()=>{const M=()=>O(R=>R+1);return window.addEventListener("resize",M),()=>{window.removeEventListener("resize",M)}},[]),he.useLayoutEffect(()=>{b.current&&(a?s?b.current.showModal():b.current.show():b.current.close())},[a,s]),X.jsx("dialog",{ref:b,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":p,children:g})};function Gb(u,l,a=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)+a;return o+u.height>window.innerHeight-a&&(Math.max(0,l.top)>u.height+a?o=Math.max(0,l.top)-u.height-a:o=window.innerHeight-a-u.height),{left:c,top:o}}const Vb=({})=>{const[u,l]=he.useState([]),[a,s]=he.useState(!1),[c,o]=he.useState(new Map),[h,m]=he.useState("none"),[p,g]=he.useState(),[b,v]=pu("recorderPropertiesTab","log"),[O,E]=he.useState(),[x,S]=he.useState(),[w,M]=he.useState(!1),[R,K]=z1(),[Q,Z]=pu("autoExpect",!1),W=he.useRef(null),k=he.useMemo(Qb,[]),[V,U]=he.useState(""),ae=he.useRef(null),te=he.useMemo(()=>u.find(D=>D.id===p)??ev(),[u,p]);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(G=>{const ne=new Map(G);for(const de of D)de.reveal=!G.has(de.id),ne.set(de.id,de);return ne})},sourceRevealRequested:({sourceId:D})=>g(D),elementPicked:({elementInfo:D,userGesture:G})=>{const ne=te.language;U(ep(ne,D.selector)),E(D.ariaSnapshot),S([]),G&&b!=="locator"&&b!=="aria"&&v("locator"),h==="inspecting"&&b==="aria"||k.setMode({mode:h==="inspecting"?"standby":"recording"}).catch(()=>{})}};window.dispatch=D=>{se[D.method].call(se,D.params)}},[k,h,b,v,te]),he.useEffect(()=>{k.setAutoExpect({autoExpect:Q})},[Q,k]),he.useLayoutEffect(()=>{var se;(se=ae.current)==null||se.scrollIntoView({block:"center",inline:"nearest"})},[ae]),he.useLayoutEffect(()=>{const se=D=>{switch(D.key){case"F8":D.preventDefault(),a?k.resume():k.pause();break;case"F10":D.preventDefault(),a&&k.step();break}};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[a,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:G}=Yb(Hb,se,{prettyErrors:!1}),ne=G.map(de=>({message:de.message,line:de.range[1].line,column:de.range[1].col,type:"subtle-error"}));S(ne),E(se),G.length||k.highlightRequested({ariaTemplate:D})},[h,k]),we=h==="recording"||h==="recording-inspecting"||h==="assertingText"||h==="assertingVisibility";return X.jsxs("div",{className:"recorder",children:[X.jsxs(xg,{children:[X.jsx(Dt,{icon:we?"stop-circle":"circle-large-filled",title:we?"Stop Recording":"Start Recording",toggled:we,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:!a,onClick:()=>{k.resume()}}),X.jsx(Dt,{icon:"debug-pause",title:"Pause (F8)",ariaLabel:"Pause",disabled:a,onClick:()=>{k.pause()}}),X.jsx(Dt,{icon:"debug-step-over",title:"Step over (F10)",ariaLabel:"Step over",disabled:!a,onClick:()=>{k.step()}}),X.jsx("div",{style:{flex:"auto"}}),X.jsx("div",{children:"Target:"}),X.jsx(F1,{fileId:te.id,sources:u,setFileId:se=>{g(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(Kb,{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=>K(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:b==="locator"||b==="aria"?[X.jsx(Dt,{icon:"files",title:"Copy",onClick:()=>eg((b==="locator"?V:O)||"")},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:O||"",placeholder:"Type aria template to match",highlighter:"yaml",onChange:ee,highlight:x,wrapLines:!0})}],selectedTab:b,setSelectedTab:v})})]})};function Qb(){return new Proxy({},{get:(u,l)=>{if(typeof l=="string")return a=>window.sendCommand({method:l,params:a})}})}(async()=>(N1(),B1.createRoot(document.querySelector("#root")).render(X.jsx(Vb,{}))))();export{b1 as g};