UNPKG

paqad-ai

Version:

Spec-driven development framework — AI agents that think before they type

659 lines • 1.5 MB
function qX(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function Dc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Kv={exports:{}},rf={};/**
 * @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 SC;function WX(){if(SC)return rf;SC=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,r,s){var o=null;if(s!==void 0&&(o=""+s),r.key!==void 0&&(o=""+r.key),"key"in r){s={};for(var l in r)l!=="key"&&(s[l]=r[l])}else s=r;return r=s.ref,{$$typeof:t,type:i,key:o,ref:r!==void 0?r:null,props:s}}return rf.Fragment=e,rf.jsx=n,rf.jsxs=n,rf}var kC;function FX(){return kC||(kC=1,Kv.exports=WX()),Kv.exports}var y=FX(),Jv={exports:{}},Le={};/**
 * @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 EC;function HX(){if(EC)return Le;EC=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function O(P){return P===null||typeof P!="object"?null:(P=g&&P[g]||P["@@iterator"],typeof P=="function"?P:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,S={};function k(P,j,Y){this.props=P,this.context=j,this.refs=S,this.updater=Y||v}k.prototype.isReactComponent={},k.prototype.setState=function(P,j){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,j,"setState")},k.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function $(){}$.prototype=k.prototype;function E(P,j,Y){this.props=P,this.context=j,this.refs=S,this.updater=Y||v}var T=E.prototype=new $;T.constructor=E,x(T,k.prototype),T.isPureReactComponent=!0;var _=Array.isArray;function Q(){}var N={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function X(P,j,Y){var G=Y.ref;return{$$typeof:t,type:P,key:j,ref:G!==void 0?G:null,props:Y}}function q(P,j){return X(P.type,j,P.props)}function z(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function Z(P){var j={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(Y){return j[Y]})}var F=/\/+/g;function M(P,j){return typeof P=="object"&&P!==null&&P.key!=null?Z(""+P.key):j.toString(36)}function B(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(Q,Q):(P.status="pending",P.then(function(j){P.status==="pending"&&(P.status="fulfilled",P.value=j)},function(j){P.status==="pending"&&(P.status="rejected",P.reason=j)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function L(P,j,Y,G,J){var ne=typeof P;(ne==="undefined"||ne==="boolean")&&(P=null);var le=!1;if(P===null)le=!0;else switch(ne){case"bigint":case"string":case"number":le=!0;break;case"object":switch(P.$$typeof){case t:case e:le=!0;break;case h:return le=P._init,L(le(P._payload),j,Y,G,J)}}if(le)return J=J(P),le=G===""?"."+M(P,0):G,_(J)?(Y="",le!=null&&(Y=le.replace(F,"$&/")+"/"),L(J,j,Y,"",function(be){return be})):J!=null&&(z(J)&&(J=q(J,Y+(J.key==null||P&&P.key===J.key?"":(""+J.key).replace(F,"$&/")+"/")+le)),j.push(J)),1;le=0;var H=G===""?".":G+":";if(_(P))for(var ce=0;ce<P.length;ce++)G=P[ce],ne=H+M(G,ce),le+=L(G,j,Y,ne,J);else if(ce=O(P),typeof ce=="function")for(P=ce.call(P),ce=0;!(G=P.next()).done;)G=G.value,ne=H+M(G,ce++),le+=L(G,j,Y,ne,J);else if(ne==="object"){if(typeof P.then=="function")return L(B(P),j,Y,G,J);throw j=String(P),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return le}function I(P,j,Y){if(P==null)return P;var G=[],J=0;return L(P,G,"","",function(ne){return j.call(Y,ne,J++)}),G}function U(P){if(P._status===-1){var j=P._result;j=j(),j.then(function(Y){(P._status===0||P._status===-1)&&(P._status=1,P._result=Y)},function(Y){(P._status===0||P._status===-1)&&(P._status=2,P._result=Y)}),P._status===-1&&(P._status=0,P._result=j)}if(P._status===1)return P._result.default;throw P._result}var V=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},te={map:I,forEach:function(P,j,Y){I(P,function(){j.apply(this,arguments)},Y)},count:function(P){var j=0;return I(P,function(){j++}),j},toArray:function(P){return I(P,function(j){return j})||[]},only:function(P){if(!z(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return Le.Activity=p,Le.Children=te,Le.Component=k,Le.Fragment=n,Le.Profiler=r,Le.PureComponent=E,Le.StrictMode=i,Le.Suspense=u,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,Le.__COMPILER_RUNTIME={__proto__:null,c:function(P){return N.H.useMemoCache(P)}},Le.cache=function(P){return function(){return P.apply(null,arguments)}},Le.cacheSignal=function(){return null},Le.cloneElement=function(P,j,Y){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var G=x({},P.props),J=P.key;if(j!=null)for(ne in j.key!==void 0&&(J=""+j.key),j)!R.call(j,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&j.ref===void 0||(G[ne]=j[ne]);var ne=arguments.length-2;if(ne===1)G.children=Y;else if(1<ne){for(var le=Array(ne),H=0;H<ne;H++)le[H]=arguments[H+2];G.children=le}return X(P.type,J,G)},Le.createContext=function(P){return P={$$typeof:o,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:s,_context:P},P},Le.createElement=function(P,j,Y){var G,J={},ne=null;if(j!=null)for(G in j.key!==void 0&&(ne=""+j.key),j)R.call(j,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(J[G]=j[G]);var le=arguments.length-2;if(le===1)J.children=Y;else if(1<le){for(var H=Array(le),ce=0;ce<le;ce++)H[ce]=arguments[ce+2];J.children=H}if(P&&P.defaultProps)for(G in le=P.defaultProps,le)J[G]===void 0&&(J[G]=le[G]);return X(P,ne,J)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(P){return{$$typeof:l,render:P}},Le.isValidElement=z,Le.lazy=function(P){return{$$typeof:h,_payload:{_status:-1,_result:P},_init:U}},Le.memo=function(P,j){return{$$typeof:f,type:P,compare:j===void 0?null:j}},Le.startTransition=function(P){var j=N.T,Y={};N.T=Y;try{var G=P(),J=N.S;J!==null&&J(Y,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(Q,V)}catch(ne){V(ne)}finally{j!==null&&Y.types!==null&&(j.types=Y.types),N.T=j}},Le.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},Le.use=function(P){return N.H.use(P)},Le.useActionState=function(P,j,Y){return N.H.useActionState(P,j,Y)},Le.useCallback=function(P,j){return N.H.useCallback(P,j)},Le.useContext=function(P){return N.H.useContext(P)},Le.useDebugValue=function(){},Le.useDeferredValue=function(P,j){return N.H.useDeferredValue(P,j)},Le.useEffect=function(P,j){return N.H.useEffect(P,j)},Le.useEffectEvent=function(P){return N.H.useEffectEvent(P)},Le.useId=function(){return N.H.useId()},Le.useImperativeHandle=function(P,j,Y){return N.H.useImperativeHandle(P,j,Y)},Le.useInsertionEffect=function(P,j){return N.H.useInsertionEffect(P,j)},Le.useLayoutEffect=function(P,j){return N.H.useLayoutEffect(P,j)},Le.useMemo=function(P,j){return N.H.useMemo(P,j)},Le.useOptimistic=function(P,j){return N.H.useOptimistic(P,j)},Le.useReducer=function(P,j,Y){return N.H.useReducer(P,j,Y)},Le.useRef=function(P){return N.H.useRef(P)},Le.useState=function(P){return N.H.useState(P)},Le.useSyncExternalStore=function(P,j,Y){return N.H.useSyncExternalStore(P,j,Y)},Le.useTransition=function(){return N.H.useTransition()},Le.version="19.2.6",Le}var TC;function kd(){return TC||(TC=1,Jv.exports=HX()),Jv.exports}var C=kd();const Bl=Dc(C),Ed=qX({__proto__:null,default:Bl},[C]);var e0={exports:{}},sf={},t0={exports:{}},n0={};/**
 * @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 CC;function KX(){return CC||(CC=1,(function(t){function e(L,I){var U=L.length;L.push(I);e:for(;0<U;){var V=U-1>>>1,te=L[V];if(0<r(te,I))L[V]=I,L[U]=te,U=V;else break e}}function n(L){return L.length===0?null:L[0]}function i(L){if(L.length===0)return null;var I=L[0],U=L.pop();if(U!==I){L[0]=U;e:for(var V=0,te=L.length,P=te>>>1;V<P;){var j=2*(V+1)-1,Y=L[j],G=j+1,J=L[G];if(0>r(Y,U))G<te&&0>r(J,Y)?(L[V]=J,L[G]=U,V=G):(L[V]=Y,L[j]=U,V=j);else if(G<te&&0>r(J,U))L[V]=J,L[G]=U,V=G;else break e}}return I}function r(L,I){var U=L.sortIndex-I.sortIndex;return U!==0?U:L.id-I.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],f=[],h=1,p=null,g=3,O=!1,v=!1,x=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function T(L){for(var I=n(f);I!==null;){if(I.callback===null)i(f);else if(I.startTime<=L)i(f),I.sortIndex=I.expirationTime,e(u,I);else break;I=n(f)}}function _(L){if(x=!1,T(L),!v)if(n(u)!==null)v=!0,Q||(Q=!0,Z());else{var I=n(f);I!==null&&B(_,I.startTime-L)}}var Q=!1,N=-1,R=5,X=-1;function q(){return S?!0:!(t.unstable_now()-X<R)}function z(){if(S=!1,Q){var L=t.unstable_now();X=L;var I=!0;try{e:{v=!1,x&&(x=!1,$(N),N=-1),O=!0;var U=g;try{t:{for(T(L),p=n(u);p!==null&&!(p.expirationTime>L&&q());){var V=p.callback;if(typeof V=="function"){p.callback=null,g=p.priorityLevel;var te=V(p.expirationTime<=L);if(L=t.unstable_now(),typeof te=="function"){p.callback=te,T(L),I=!0;break t}p===n(u)&&i(u),T(L)}else i(u);p=n(u)}if(p!==null)I=!0;else{var P=n(f);P!==null&&B(_,P.startTime-L),I=!1}}break e}finally{p=null,g=U,O=!1}I=void 0}}finally{I?Z():Q=!1}}}var Z;if(typeof E=="function")Z=function(){E(z)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,M=F.port2;F.port1.onmessage=z,Z=function(){M.postMessage(null)}}else Z=function(){k(z,0)};function B(L,I){N=k(function(){L(t.unstable_now())},I)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(L){L.callback=null},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(L){switch(g){case 1:case 2:case 3:var I=3;break;default:I=g}var U=g;g=I;try{return L()}finally{g=U}},t.unstable_requestPaint=function(){S=!0},t.unstable_runWithPriority=function(L,I){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var U=g;g=L;try{return I()}finally{g=U}},t.unstable_scheduleCallback=function(L,I,U){var V=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?V+U:V):U=V,L){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=U+te,L={id:h++,callback:I,priorityLevel:L,startTime:U,expirationTime:te,sortIndex:-1},U>V?(L.sortIndex=U,e(f,L),n(u)===null&&L===n(f)&&(x?($(N),N=-1):x=!0,B(_,U-V))):(L.sortIndex=te,e(u,L),v||O||(v=!0,Q||(Q=!0,Z()))),L},t.unstable_shouldYield=q,t.unstable_wrapCallback=function(L){var I=g;return function(){var U=g;g=I;try{return L.apply(this,arguments)}finally{g=U}}}})(n0)),n0}var $C;function JX(){return $C||($C=1,t0.exports=KX()),t0.exports}var i0={exports:{}},ln={};/**
 * @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 _C;function eZ(){if(_C)return ln;_C=1;var t=kd();function e(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)f+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal");function s(u,f,h){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:p==null?null:""+p,children:u,containerInfo:f,implementation:h}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(u,f){if(u==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,ln.createPortal=function(u,f){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return s(u,f,null,h)},ln.flushSync=function(u){var f=o.T,h=i.p;try{if(o.T=null,i.p=2,u)return u()}finally{o.T=f,i.p=h,i.d.f()}},ln.preconnect=function(u,f){typeof u=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,i.d.C(u,f))},ln.prefetchDNS=function(u){typeof u=="string"&&i.d.D(u)},ln.preinit=function(u,f){if(typeof u=="string"&&f&&typeof f.as=="string"){var h=f.as,p=l(h,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,O=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;h==="style"?i.d.S(u,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:O}):h==="script"&&i.d.X(u,{crossOrigin:p,integrity:g,fetchPriority:O,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},ln.preinitModule=function(u,f){if(typeof u=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var h=l(f.as,f.crossOrigin);i.d.M(u,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&i.d.M(u)},ln.preload=function(u,f){if(typeof u=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var h=f.as,p=l(h,f.crossOrigin);i.d.L(u,h,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},ln.preloadModule=function(u,f){if(typeof u=="string")if(f){var h=l(f.as,f.crossOrigin);i.d.m(u,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else i.d.m(u)},ln.requestFormReset=function(u){i.d.r(u)},ln.unstable_batchedUpdates=function(u,f){return u(f)},ln.useFormState=function(u,f,h){return o.H.useFormState(u,f,h)},ln.useFormStatus=function(){return o.H.useHostTransitionStatus()},ln.version="19.2.6",ln}var QC;function tN(){if(QC)return i0.exports;QC=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),i0.exports=eZ(),i0.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 AC;function tZ(){if(AC)return sf;AC=1;var t=JX(),e=kd(),n=tN();function i(a){var c="https://react.dev/errors/"+a;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)c+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var c=a,d=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(d=c.return),a=c.return;while(a)}return c.tag===3?d:null}function o(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function l(a){if(a.tag===31){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function u(a){if(s(a)!==a)throw Error(i(188))}function f(a){var c=a.alternate;if(!c){if(c=s(a),c===null)throw Error(i(188));return c!==a?null:a}for(var d=a,m=c;;){var b=d.return;if(b===null)break;var w=b.alternate;if(w===null){if(m=b.return,m!==null){d=m;continue}break}if(b.child===w.child){for(w=b.child;w;){if(w===d)return u(b),a;if(w===m)return u(b),c;w=w.sibling}throw Error(i(188))}if(d.return!==m.return)d=b,m=w;else{for(var A=!1,D=b.child;D;){if(D===d){A=!0,d=b,m=w;break}if(D===m){A=!0,m=b,d=w;break}D=D.sibling}if(!A){for(D=w.child;D;){if(D===d){A=!0,d=w,m=b;break}if(D===m){A=!0,m=w,d=b;break}D=D.sibling}if(!A)throw Error(i(189))}}if(d.alternate!==m)throw Error(i(190))}if(d.tag!==3)throw Error(i(188));return d.stateNode.current===d?a:c}function h(a){var c=a.tag;if(c===5||c===26||c===27||c===6)return a;for(a=a.child;a!==null;){if(c=h(a),c!==null)return c;a=a.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),E=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function Z(a){return a===null||typeof a!="object"?null:(a=z&&a[z]||a["@@iterator"],typeof a=="function"?a:null)}var F=Symbol.for("react.client.reference");function M(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===F?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case x:return"Fragment";case k:return"Profiler";case S:return"StrictMode";case _:return"Suspense";case Q:return"SuspenseList";case X:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case v:return"Portal";case E:return a.displayName||"Context";case $:return(a._context.displayName||"Context")+".Consumer";case T:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case N:return c=a.displayName||null,c!==null?c:M(a.type)||"Memo";case R:c=a._payload,a=a._init;try{return M(a(c))}catch{}}return null}var B=Array.isArray,L=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},V=[],te=-1;function P(a){return{current:a}}function j(a){0>te||(a.current=V[te],V[te]=null,te--)}function Y(a,c){te++,V[te]=a.current,a.current=c}var G=P(null),J=P(null),ne=P(null),le=P(null);function H(a,c){switch(Y(ne,c),Y(J,a),Y(G,null),c.nodeType){case 9:case 11:a=(a=c.documentElement)&&(a=a.namespaceURI)?UT(a):0;break;default:if(a=c.tagName,c=c.namespaceURI)c=UT(c),a=YT(c,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}j(G),Y(G,a)}function ce(){j(G),j(J),j(ne)}function be(a){a.memoizedState!==null&&Y(le,a);var c=G.current,d=YT(c,a.type);c!==d&&(Y(J,a),Y(G,d))}function Se(a){J.current===a&&(j(G),j(J)),le.current===a&&(j(le),Ju._currentValue=U)}var he,ve;function Ee(a){if(he===void 0)try{throw Error()}catch(d){var c=d.stack.trim().match(/\n( *(at )?)/);he=c&&c[1]||"",ve=-1<d.stack.indexOf(`
    at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
`+he+a+ve}var Xe=!1;function Je(a,c){if(!a||Xe)return"";Xe=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(c){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ae){var oe=ae}Reflect.construct(a,[],de)}else{try{de.call()}catch(ae){oe=ae}a.call(de.prototype)}}else{try{throw Error()}catch(ae){oe=ae}(de=a())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ae){if(ae&&oe&&typeof ae.stack=="string")return[ae.stack,oe.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=m.DetermineComponentFrameRoot(),A=w[0],D=w[1];if(A&&D){var K=A.split(`
`),se=D.split(`
`);for(b=m=0;m<K.length&&!K[m].includes("DetermineComponentFrameRoot");)m++;for(;b<se.length&&!se[b].includes("DetermineComponentFrameRoot");)b++;if(m===K.length||b===se.length)for(m=K.length-1,b=se.length-1;1<=m&&0<=b&&K[m]!==se[b];)b--;for(;1<=m&&0<=b;m--,b--)if(K[m]!==se[b]){if(m!==1||b!==1)do if(m--,b--,0>b||K[m]!==se[b]){var ue=`
`+K[m].replace(" at new "," at ");return a.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",a.displayName)),ue}while(1<=m&&0<=b);break}}}finally{Xe=!1,Error.prepareStackTrace=d}return(d=a?a.displayName||a.name:"")?Ee(d):""}function Nt(a,c){switch(a.tag){case 26:case 27:case 5:return Ee(a.type);case 16:return Ee("Lazy");case 13:return a.child!==c&&c!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Je(a.type,!1);case 11:return Je(a.type.render,!1);case 1:return Je(a.type,!0);case 31:return Ee("Activity");default:return""}}function ai(a){try{var c="",d=null;do c+=Nt(a,d),d=a,a=a.return;while(a);return c}catch(m){return`
Error generating stack: `+m.message+`
`+m.stack}}var Cn=Object.prototype.hasOwnProperty,$n=t.unstable_scheduleCallback,Gn=t.unstable_cancelCallback,$o=t.unstable_shouldYield,Dr=t.unstable_requestPaint,Pt=t.unstable_now,Vn=t.unstable_getCurrentPriorityLevel,li=t.unstable_ImmediatePriority,ci=t.unstable_UserBlockingPriority,ui=t.unstable_NormalPriority,su=t.unstable_LowPriority,za=t.unstable_IdlePriority,LO=t.log,DO=t.unstable_setDisableYieldValue,_o=null,On=null;function lr(a){if(typeof LO=="function"&&DO(a),On&&typeof On.setStrictMode=="function")try{On.setStrictMode(_o,a)}catch{}}var yn=Math.clz32?Math.clz32:ZO,zO=Math.log,XO=Math.LN2;function ZO(a){return a>>>=0,a===0?32:31-(zO(a)/XO|0)|0}var Xa=256,Za=262144,Ba=4194304;function zr(a){var c=a&42;if(c!==0)return c;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Ia(a,c,d){var m=a.pendingLanes;if(m===0)return 0;var b=0,w=a.suspendedLanes,A=a.pingedLanes;a=a.warmLanes;var D=m&134217727;return D!==0?(m=D&~w,m!==0?b=zr(m):(A&=D,A!==0?b=zr(A):d||(d=D&~a,d!==0&&(b=zr(d))))):(D=m&~w,D!==0?b=zr(D):A!==0?b=zr(A):d||(d=m&~a,d!==0&&(b=zr(d)))),b===0?0:c!==0&&c!==b&&(c&w)===0&&(w=b&-b,d=c&-c,w>=d||w===32&&(d&4194048)!==0)?c:b}function Qo(a,c){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&c)===0}function BO(a,c){switch(a){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 Wd(){var a=Ba;return Ba<<=1,(Ba&62914560)===0&&(Ba=4194304),a}function ou(a){for(var c=[],d=0;31>d;d++)c.push(a);return c}function Ao(a,c){a.pendingLanes|=c,c!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function IO(a,c,d,m,b,w){var A=a.pendingLanes;a.pendingLanes=d,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=d,a.entangledLanes&=d,a.errorRecoveryDisabledLanes&=d,a.shellSuspendCounter=0;var D=a.entanglements,K=a.expirationTimes,se=a.hiddenUpdates;for(d=A&~d;0<d;){var ue=31-yn(d),de=1<<ue;D[ue]=0,K[ue]=-1;var oe=se[ue];if(oe!==null)for(se[ue]=null,ue=0;ue<oe.length;ue++){var ae=oe[ue];ae!==null&&(ae.lane&=-536870913)}d&=~de}m!==0&&Fd(a,m,0),w!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=w&~(A&~c))}function Fd(a,c,d){a.pendingLanes|=c,a.suspendedLanes&=~c;var m=31-yn(c);a.entangledLanes|=c,a.entanglements[m]=a.entanglements[m]|1073741824|d&261930}function Hd(a,c){var d=a.entangledLanes|=c;for(a=a.entanglements;d;){var m=31-yn(d),b=1<<m;b&c|a[m]&c&&(a[m]|=c),d&=~b}}function Kd(a,c){var d=c&-c;return d=(d&42)!==0?1:au(d),(d&(a.suspendedLanes|c))!==0?0:d}function au(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function lu(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Jd(){var a=I.p;return a!==0?a:(a=window.event,a===void 0?32:mC(a.type))}function eh(a,c){var d=I.p;try{return I.p=a,c()}finally{I.p=d}}var cr=Math.random().toString(36).slice(2),Gt="__reactFiber$"+cr,an="__reactProps$"+cr,Xr="__reactContainer$"+cr,Ga="__reactEvents$"+cr,th="__reactListeners$"+cr,GO="__reactHandles$"+cr,nh="__reactResources$"+cr,No="__reactMarker$"+cr;function cu(a){delete a[Gt],delete a[an],delete a[Ga],delete a[th],delete a[GO]}function Qs(a){var c=a[Gt];if(c)return c;for(var d=a.parentNode;d;){if(c=d[Xr]||d[Gt]){if(d=c.alternate,c.child!==null||d!==null&&d.child!==null)for(a=eC(a);a!==null;){if(d=a[Gt])return d;a=eC(a)}return c}a=d,d=a.parentNode}return null}function As(a){if(a=a[Gt]||a[Xr]){var c=a.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return a}return null}function Ns(a){var c=a.tag;if(c===5||c===26||c===27||c===6)return a.stateNode;throw Error(i(33))}function Ps(a){var c=a[nh];return c||(c=a[nh]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function Lt(a){a[No]=!0}var ih=new Set,rh={};function Zr(a,c){Rs(a,c),Rs(a+"Capture",c)}function Rs(a,c){for(rh[a]=c,a=0;a<c.length;a++)ih.add(c[a])}var VO=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),sh={},uu={};function UO(a){return Cn.call(uu,a)?!0:Cn.call(sh,a)?!1:VO.test(a)?uu[a]=!0:(sh[a]=!0,!1)}function Va(a,c,d){if(UO(c))if(d===null)a.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":a.removeAttribute(c);return;case"boolean":var m=c.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(c);return}}a.setAttribute(c,""+d)}}function Ua(a,c,d){if(d===null)a.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttribute(c,""+d)}}function Mi(a,c,d,m){if(m===null)a.removeAttribute(d);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(d);return}a.setAttributeNS(c,d,""+m)}}function _n(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function oh(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function YO(a,c,d){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,c);if(!a.hasOwnProperty(c)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var b=m.get,w=m.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return b.call(this)},set:function(A){d=""+A,w.call(this,A)}}),Object.defineProperty(a,c,{enumerable:m.enumerable}),{getValue:function(){return d},setValue:function(A){d=""+A},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function fu(a){if(!a._valueTracker){var c=oh(a)?"checked":"value";a._valueTracker=YO(a,c,""+a[c])}}function du(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var d=c.getValue(),m="";return a&&(m=oh(a)?a.checked?"true":"false":a.value),a=m,a!==d?(c.setValue(a),!0):!1}function Ya(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var ah=/[\n"\\]/g;function Qn(a){return a.replace(ah,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function hu(a,c,d,m,b,w,A,D){a.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?a.type=A:a.removeAttribute("type"),c!=null?A==="number"?(c===0&&a.value===""||a.value!=c)&&(a.value=""+_n(c)):a.value!==""+_n(c)&&(a.value=""+_n(c)):A!=="submit"&&A!=="reset"||a.removeAttribute("value"),c!=null?pu(a,A,_n(c)):d!=null?pu(a,A,_n(d)):m!=null&&a.removeAttribute("value"),b==null&&w!=null&&(a.defaultChecked=!!w),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?a.name=""+_n(D):a.removeAttribute("name")}function qa(a,c,d,m,b,w,A,D){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(a.type=w),c!=null||d!=null){if(!(w!=="submit"&&w!=="reset"||c!=null)){fu(a);return}d=d!=null?""+_n(d):"",c=c!=null?""+_n(c):d,D||c===a.value||(a.value=c),a.defaultValue=c}m=m??b,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=D?a.checked:!!m,a.defaultChecked=!!m,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(a.name=A),fu(a)}function pu(a,c,d){c==="number"&&Ya(a.ownerDocument)===a||a.defaultValue===""+d||(a.defaultValue=""+d)}function js(a,c,d,m){if(a=a.options,c){c={};for(var b=0;b<d.length;b++)c["$"+d[b]]=!0;for(d=0;d<a.length;d++)b=c.hasOwnProperty("$"+a[d].value),a[d].selected!==b&&(a[d].selected=b),b&&m&&(a[d].defaultSelected=!0)}else{for(d=""+_n(d),c=null,b=0;b<a.length;b++){if(a[b].value===d){a[b].selected=!0,m&&(a[b].defaultSelected=!0);return}c!==null||a[b].disabled||(c=a[b])}c!==null&&(c.selected=!0)}}function gu(a,c,d){if(c!=null&&(c=""+_n(c),c!==a.value&&(a.value=c),d==null)){a.defaultValue!==c&&(a.defaultValue=c);return}a.defaultValue=d!=null?""+_n(d):""}function BS(a,c,d,m){if(c==null){if(m!=null){if(d!=null)throw Error(i(92));if(B(m)){if(1<m.length)throw Error(i(93));m=m[0]}d=m}d==null&&(d=""),c=d}d=_n(c),a.defaultValue=d,m=a.textContent,m===d&&m!==""&&m!==null&&(a.value=m),fu(a)}function Wa(a,c){if(c){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=c;return}}a.textContent=c}var Iz=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function IS(a,c,d){var m=c.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?m?a.setProperty(c,""):c==="float"?a.cssFloat="":a[c]="":m?a.setProperty(c,d):typeof d!="number"||d===0||Iz.has(c)?c==="float"?a.cssFloat=d:a[c]=(""+d).trim():a[c]=d+"px"}function GS(a,c,d){if(c!=null&&typeof c!="object")throw Error(i(62));if(a=a.style,d!=null){for(var m in d)!d.hasOwnProperty(m)||c!=null&&c.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var b in c)m=c[b],c.hasOwnProperty(b)&&d[b]!==m&&IS(a,b,m)}else for(var w in c)c.hasOwnProperty(w)&&IS(a,w,c[w])}function qO(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Gz=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Vz=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function lh(a){return Vz.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Br(){}var WO=null;function FO(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Fa=null,Ha=null;function VS(a){var c=As(a);if(c&&(a=c.stateNode)){var d=a[an]||null;e:switch(a=c.stateNode,c.type){case"input":if(hu(a,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),c=d.name,d.type==="radio"&&c!=null){for(d=a;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+Qn(""+c)+'"][type="radio"]'),c=0;c<d.length;c++){var m=d[c];if(m!==a&&m.form===a.form){var b=m[an]||null;if(!b)throw Error(i(90));hu(m,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(c=0;c<d.length;c++)m=d[c],m.form===a.form&&du(m)}break e;case"textarea":gu(a,d.value,d.defaultValue);break e;case"select":c=d.value,c!=null&&js(a,!!d.multiple,c,!1)}}}var HO=!1;function US(a,c,d){if(HO)return a(c,d);HO=!0;try{var m=a(c);return m}finally{if(HO=!1,(Fa!==null||Ha!==null)&&(Wh(),Fa&&(c=Fa,a=Ha,Ha=Fa=null,VS(c),a)))for(c=0;c<a.length;c++)VS(a[c])}}function mu(a,c){var d=a.stateNode;if(d===null)return null;var m=d[an]||null;if(m===null)return null;d=m[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(d&&typeof d!="function")throw Error(i(231,c,typeof d));return d}var Ir=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),KO=!1;if(Ir)try{var Ou={};Object.defineProperty(Ou,"passive",{get:function(){KO=!0}}),window.addEventListener("test",Ou,Ou),window.removeEventListener("test",Ou,Ou)}catch{KO=!1}var Ms=null,JO=null,ch=null;function YS(){if(ch)return ch;var a,c=JO,d=c.length,m,b="value"in Ms?Ms.value:Ms.textContent,w=b.length;for(a=0;a<d&&c[a]===b[a];a++);var A=d-a;for(m=1;m<=A&&c[d-m]===b[w-m];m++);return ch=b.slice(a,1<m?1-m:void 0)}function uh(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function fh(){return!0}function qS(){return!1}function An(a){function c(d,m,b,w,A){this._reactName=d,this._targetInst=b,this.type=m,this.nativeEvent=w,this.target=A,this.currentTarget=null;for(var D in a)a.hasOwnProperty(D)&&(d=a[D],this[D]=d?d(w):w[D]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?fh:qS,this.isPropagationStopped=qS,this}return p(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=fh)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=fh)},persist:function(){},isPersistent:fh}),c}var Po={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dh=An(Po),yu=p({},Po,{view:0,detail:0}),Uz=An(yu),ey,ty,vu,hh=p({},yu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:iy,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==vu&&(vu&&a.type==="mousemove"?(ey=a.screenX-vu.screenX,ty=a.screenY-vu.screenY):ty=ey=0,vu=a),ey)},movementY:function(a){return"movementY"in a?a.movementY:ty}}),WS=An(hh),Yz=p({},hh,{dataTransfer:0}),qz=An(Yz),Wz=p({},yu,{relatedTarget:0}),ny=An(Wz),Fz=p({},Po,{animationName:0,elapsedTime:0,pseudoElement:0}),Hz=An(Fz),Kz=p({},Po,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Jz=An(Kz),e3=p({},Po,{data:0}),FS=An(e3),t3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},n3={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},i3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function r3(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=i3[a])?!!c[a]:!1}function iy(){return r3}var s3=p({},yu,{key:function(a){if(a.key){var c=t3[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=uh(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?n3[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:iy,charCode:function(a){return a.type==="keypress"?uh(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?uh(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),o3=An(s3),a3=p({},hh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),HS=An(a3),l3=p({},yu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:iy}),c3=An(l3),u3=p({},Po,{propertyName:0,elapsedTime:0,pseudoElement:0}),f3=An(u3),d3=p({},hh,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),h3=An(d3),p3=p({},Po,{newState:0,oldState:0}),g3=An(p3),m3=[9,13,27,32],ry=Ir&&"CompositionEvent"in window,bu=null;Ir&&"documentMode"in document&&(bu=document.documentMode);var O3=Ir&&"TextEvent"in window&&!bu,KS=Ir&&(!ry||bu&&8<bu&&11>=bu),JS=" ",ek=!1;function tk(a,c){switch(a){case"keyup":return m3.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nk(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ka=!1;function y3(a,c){switch(a){case"compositionend":return nk(c);case"keypress":return c.which!==32?null:(ek=!0,JS);case"textInput":return a=c.data,a===JS&&ek?null:a;default:return null}}function v3(a,c){if(Ka)return a==="compositionend"||!ry&&tk(a,c)?(a=YS(),ch=JO=Ms=null,Ka=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return KS&&c.locale!=="ko"?null:c.data;default:return null}}var b3={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ik(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!b3[a.type]:c==="textarea"}function rk(a,c,d,m){Fa?Ha?Ha.push(m):Ha=[m]:Fa=m,c=np(c,"onChange"),0<c.length&&(d=new dh("onChange","change",null,d,m),a.push({event:d,listeners:c}))}var xu=null,wu=null;function x3(a){XT(a,0)}function ph(a){var c=Ns(a);if(du(c))return a}function sk(a,c){if(a==="change")return c}var ok=!1;if(Ir){var sy;if(Ir){var oy="oninput"in document;if(!oy){var ak=document.createElement("div");ak.setAttribute("oninput","return;"),oy=typeof ak.oninput=="function"}sy=oy}else sy=!1;ok=sy&&(!document.documentMode||9<document.documentMode)}function lk(){xu&&(xu.detachEvent("onpropertychange",ck),wu=xu=null)}function ck(a){if(a.propertyName==="value"&&ph(wu)){var c=[];rk(c,wu,a,FO(a)),US(x3,c)}}function w3(a,c,d){a==="focusin"?(lk(),xu=c,wu=d,xu.attachEvent("onpropertychange",ck)):a==="focusout"&&lk()}function S3(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return ph(wu)}function k3(a,c){if(a==="click")return ph(c)}function E3(a,c){if(a==="input"||a==="change")return ph(c)}function T3(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var Un=typeof Object.is=="function"?Object.is:T3;function Su(a,c){if(Un(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var d=Object.keys(a),m=Object.keys(c);if(d.length!==m.length)return!1;for(m=0;m<d.length;m++){var b=d[m];if(!Cn.call(c,b)||!Un(a[b],c[b]))return!1}return!0}function uk(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function fk(a,c){var d=uk(a);a=0;for(var m;d;){if(d.nodeType===3){if(m=a+d.textContent.length,a<=c&&m>=c)return{node:d,offset:c-a};a=m}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=uk(d)}}function dk(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?dk(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function hk(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var c=Ya(a.document);c instanceof a.HTMLIFrameElement;){try{var d=typeof c.contentWindow.location.href=="string"}catch{d=!1}if(d)a=c.contentWindow;else break;c=Ya(a.document)}return c}function ay(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}var C3=Ir&&"documentMode"in document&&11>=document.documentMode,Ja=null,ly=null,ku=null,cy=!1;function pk(a,c,d){var m=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;cy||Ja==null||Ja!==Ya(m)||(m=Ja,"selectionStart"in m&&ay(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),ku&&Su(ku,m)||(ku=m,m=np(ly,"onSelect"),0<m.length&&(c=new dh("onSelect","select",null,c,d),a.push({event:c,listeners:m}),c.target=Ja)))}function Ro(a,c){var d={};return d[a.toLowerCase()]=c.toLowerCase(),d["Webkit"+a]="webkit"+c,d["Moz"+a]="moz"+c,d}var el={animationend:Ro("Animation","AnimationEnd"),animationiteration:Ro("Animation","AnimationIteration"),animationstart:Ro("Animation","AnimationStart"),transitionrun:Ro("Transition","TransitionRun"),transitionstart:Ro("Transition","TransitionStart"),transitioncancel:Ro("Transition","TransitionCancel"),transitionend:Ro("Transition","TransitionEnd")},uy={},gk={};Ir&&(gk=document.createElement("div").style,"AnimationEvent"in window||(delete el.animationend.animation,delete el.animationiteration.animation,delete el.animationstart.animation),"TransitionEvent"in window||delete el.transitionend.transition);function jo(a){if(uy[a])return uy[a];if(!el[a])return a;var c=el[a],d;for(d in c)if(c.hasOwnProperty(d)&&d in gk)return uy[a]=c[d];return a}var mk=jo("animationend"),Ok=jo("animationiteration"),yk=jo("animationstart"),$3=jo("transitionrun"),_3=jo("transitionstart"),Q3=jo("transitioncancel"),vk=jo("transitionend"),bk=new Map,fy="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");fy.push("scrollEnd");function Li(a,c){bk.set(a,c),Zr(c,[a])}var gh=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},fi=[],tl=0,dy=0;function mh(){for(var a=tl,c=dy=tl=0;c<a;){var d=fi[c];fi[c++]=null;var m=fi[c];fi[c++]=null;var b=fi[c];fi[c++]=null;var w=fi[c];if(fi[c++]=null,m!==null&&b!==null){var A=m.pending;A===null?b.next=b:(b.next=A.next,A.next=b),m.pending=b}w!==0&&xk(d,b,w)}}function Oh(a,c,d,m){fi[tl++]=a,fi[tl++]=c,fi[tl++]=d,fi[tl++]=m,dy|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function hy(a,c,d,m){return Oh(a,c,d,m),yh(a)}function Mo(a,c){return Oh(a,null,null,c),yh(a)}function xk(a,c,d){a.lanes|=d;var m=a.alternate;m!==null&&(m.lanes|=d);for(var b=!1,w=a.return;w!==null;)w.childLanes|=d,m=w.alternate,m!==null&&(m.childLanes|=d),w.tag===22&&(a=w.stateNode,a===null||a._visibility&1||(b=!0)),a=w,w=w.return;return a.tag===3?(w=a.stateNode,b&&c!==null&&(b=31-yn(d),a=w.hiddenUpdates,m=a[b],m===null?a[b]=[c]:m.push(c),c.lane=d|536870912),w):null}function yh(a){if(50<Uu)throw Uu=0,wv=null,Error(i(185));for(var c=a.return;c!==null;)a=c,c=a.return;return a.tag===3?a.stateNode:null}var nl={};function A3(a,c,d,m){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yn(a,c,d,m){return new A3(a,c,d,m)}function py(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Gr(a,c){var d=a.alternate;return d===null?(d=Yn(a.tag,c,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=c,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&65011712,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,c=a.dependencies,d.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d.refCleanup=a.refCleanup,d}function wk(a,c){a.flags&=65011714;var d=a.alternate;return d===null?(a.childLanes=0,a.lanes=c,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=d.childLanes,a.lanes=d.lanes,a.child=d.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=d.memoizedProps,a.memoizedState=d.memoizedState,a.updateQueue=d.updateQueue,a.type=d.type,c=d.dependencies,a.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),a}function vh(a,c,d,m,b,w){var A=0;if(m=a,typeof a=="function")py(a)&&(A=1);else if(typeof a=="string")A=MX(a,d,G.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case X:return a=Yn(31,d,c,b),a.elementType=X,a.lanes=w,a;case x:return Lo(d.children,b,w,c);case S:A=8,b|=24;break;case k:return a=Yn(12,d,c,b|2),a.elementType=k,a.lanes=w,a;case _:return a=Yn(13,d,c,b),a.elementType=_,a.lanes=w,a;case Q:return a=Yn(19,d,c,b),a.elementType=Q,a.lanes=w,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case E:A=10;break e;case $:A=9;break e;case T:A=11;break e;case N:A=14;break e;case R:A=16,m=null;break e}A=29,d=Error(i(130,a===null?"null":typeof a,"")),m=null}return c=Yn(A,d,c,b),c.elementType=a,c.type=m,c.lanes=w,c}function Lo(a,c,d,m){return a=Yn(7,a,m,c),a.lanes=d,a}function gy(a,c,d){return a=Yn(6,a,null,c),a.lanes=d,a}function Sk(a){var c=Yn(18,null,null,0);return c.stateNode=a,c}function my(a,c,d){return c=Yn(4,a.children!==null?a.children:[],a.key,c),c.lanes=d,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}var kk=new WeakMap;function di(a,c){if(typeof a=="object"&&a!==null){var d=kk.get(a);return d!==void 0?d:(c={value:a,source:c,stack:ai(c)},kk.set(a,c),c)}return{value:a,source:c,stack:ai(c)}}var il=[],rl=0,bh=null,Eu=0,hi=[],pi=0,Ls=null,ur=1,fr="";function Vr(a,c){il[rl++]=Eu,il[rl++]=bh,bh=a,Eu=c}function Ek(a,c,d){hi[pi++]=ur,hi[pi++]=fr,hi[pi++]=Ls,Ls=a;var m=ur;a=fr;var b=32-yn(m)-1;m&=~(1<<b),d+=1;var w=32-yn(c)+b;if(30<w){var A=b-b%5;w=(m&(1<<A)-1).toString(32),m>>=A,b-=A,ur=1<<32-yn(c)+b|d<<b|m,fr=w+a}else ur=1<<w|d<<b|m,fr=a}function Oy(a){a.return!==null&&(Vr(a,1),Ek(a,1,0))}function yy(a){for(;a===bh;)bh=il[--rl],il[rl]=null,Eu=il[--rl],il[rl]=null;for(;a===Ls;)Ls=hi[--pi],hi[pi]=null,fr=hi[--pi],hi[pi]=null,ur=hi[--pi],hi[pi]=null}function Tk(a,c){hi[pi++]=ur,hi[pi++]=fr,hi[pi++]=Ls,ur=c.id,fr=c.overflow,Ls=a}var Ht=null,Ot=null,Ye=!1,Ds=null,gi=!1,vy=Error(i(519));function zs(a){var c=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Tu(di(c,a)),vy}function Ck(a){var c=a.stateNode,d=a.type,m=a.memoizedProps;switch(c[Gt]=a,c[an]=m,d){case"dialog":Ie("cancel",c),Ie("close",c);break;case"iframe":case"object":case"embed":Ie("load",c);break;case"video":case"audio":for(d=0;d<qu.length;d++)Ie(qu[d],c);break;case"source":Ie("error",c);break;case"img":case"image":case"link":Ie("error",c),Ie("load",c);break;case"details":Ie("toggle",c);break;case"input":Ie("invalid",c),qa(c,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Ie("invalid",c);break;case"textarea":Ie("invalid",c),BS(c,m.value,m.defaultValue,m.children)}d=m.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||c.textContent===""+d||m.suppressHydrationWarning===!0||GT(c.textContent,d)?(m.popover!=null&&(Ie("beforetoggle",c),Ie("toggle",c)),m.onScroll!=null&&Ie("scroll",c),m.onScrollEnd!=null&&Ie("scrollend",c),m.onClick!=null&&(c.onclick=Br),c=!0):c=!1,c||zs(a,!0)}function $k(a){for(Ht=a.return;Ht;)switch(Ht.tag){case 5:case 31:case 13:gi=!1;return;case 27:case 3:gi=!0;return;default:Ht=Ht.return}}function sl(a){if(a!==Ht)return!1;if(!Ye)return $k(a),Ye=!0,!1;var c=a.tag,d;if((d=c!==3&&c!==27)&&((d=c===5)&&(d=a.type,d=!(d!=="form"&&d!=="button")||Lv(a.type,a.memoizedProps)),d=!d),d&&Ot&&zs(a),$k(a),c===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Ot=JT(a)}else if(c===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Ot=JT(a)}else c===27?(c=Ot,Js(a.type)?(a=Bv,Bv=null,Ot=a):Ot=c):Ot=Ht?Oi(a.stateNode.nextSibling):null;return!0}function Do(){Ot=Ht=null,Ye=!1}function by(){var a=Ds;return a!==null&&(jn===null?jn=a:jn.push.apply(jn,a),Ds=null),a}function Tu(a){Ds===null?Ds=[a]:Ds.push(a)}var xy=P(null),zo=null,Ur=null;function Xs(a,c,d){Y(xy,c._currentValue),c._currentValue=d}function Yr(a){a._currentValue=xy.current,j(xy)}function wy(a,c,d){for(;a!==null;){var m=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,m!==null&&(m.childLanes|=c)):m!==null&&(m.childLanes&c)!==c&&(m.childLanes|=c),a===d)break;a=a.return}}function Sy(a,c,d,m){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var w=b.dependencies;if(w!==null){var A=b.child;w=w.firstContext;e:for(;w!==null;){var D=w;w=b;for(var K=0;K<c.length;K++)if(D.context===c[K]){w.lanes|=d,D=w.alternate,D!==null&&(D.lanes|=d),wy(w.return,d,a),m||(A=null);break e}w=D.next}}else if(b.tag===18){if(A=b.return,A===null)throw Error(i(341));A.lanes|=d,w=A.alternate,w!==null&&(w.lanes|=d),wy(A,d,a),A=null}else A=b.child;if(A!==null)A.return=b;else for(A=b;A!==null;){if(A===a){A=null;break}if(b=A.sibling,b!==null){b.return=A.return,A=b;break}A=A.return}b=A}}function ol(a,c,d,m){a=null;for(var b=c,w=!1;b!==null;){if(!w){if((b.flags&524288)!==0)w=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var A=b.alternate;if(A===null)throw Error(i(387));if(A=A.memoizedProps,A!==null){var D=b.type;Un(b.pendingProps.value,A.value)||(a!==null?a.push(D):a=[D])}}else if(b===le.current){if(A=b.alternate,A===null)throw Error(i(387));A.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(Ju):a=[Ju])}b=b.return}a!==null&&Sy(c,a,d,m),c.flags|=262144}function xh(a){for(a=a.firstContext;a!==null;){if(!Un(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Xo(a){zo=a,Ur=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Kt(a){return _k(zo,a)}function wh(a,c){return zo===null&&Xo(a),_k(a,c)}function _k(a,c){var d=c._currentValue;if(c={context:c,memoizedValue:d,next:null},Ur===null){if(a===null)throw Error(i(308));Ur=c,a.dependencies={lanes:0,firstContext:c},a.flags|=524288}else Ur=Ur.next=c;return d}var N3=typeof AbortController<"u"?AbortController:function(){var a=[],c=this.signal={aborted:!1,addEventListener:function(d,m){a.push(m)}};this.abort=function(){c.aborted=!0,a.forEach(function(d){return d()})}},P3=t.unstable_scheduleCallback,R3=t.unstable_NormalPriority,Dt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ky(){return{controller:new N3,data:new Map,refCount:0}}function Cu(a){a.refCount--,a.refCount===0&&P3(R3,function(){a.controller.abort()})}var $u=null,Ey=0,al=0,ll=null;function j3(a,c){if($u===null){var d=$u=[];Ey=0,al=$v(),ll={status:"pending",value:void 0,then:function(m){d.push(m)}}}return Ey++,c.then(Qk,Qk),c}function Qk(){if(--Ey===0&&$u!==null){ll!==null&&(ll.status="fulfilled");var a=$u;$u=null,al=0,ll=null;for(var c=0;c<a.length;c++)(0,a[c])()}}function M3(a,c){var d=[],m={status:"pending",value:null,reason:null,then:function(b){d.push(b)}};return a.then(function(){m.status="fulfilled",m.value=c;for(var b=0;b<d.length;b++)(0,d[b])(c)},function(b){for(m.status="rejected",m.reason=b,b=0;b<d.length;b++)(0,d[b])(void 0)}),m}var Ak=L.S;L.S=function(a,c){pT=Pt(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&j3(a,c),Ak!==null&&Ak(a,c)};var Zo=P(null);function Ty(){var a=Zo.current;return a!==null?a:ht.pooledCache}function Sh(a,c){c===null?Y(Zo,Zo.current):Y(Zo,c.pool)}function Nk(){var a=Ty();return a===null?null:{parent:Dt._currentValue,pool:a}}var cl=Error(i(460)),Cy=Error(i(474)),kh=Error(i(542)),Eh={then:function(){}};function Pk(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Rk(a,c,d){switch(d=a[d],d===void 0?a.push(c):d!==c&&(c.then(Br,Br),c=d),c.status){case"fulfilled":return c.value;case"rejected":throw a=c.reason,Mk(a),a;default:if(typeof c.status=="string")c.then(Br,Br);else{if(a=ht,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=c,a.status="pending",a.then(function(m){if(c.status==="pending"){var b=c;b.status="fulfilled",b.value=m}},function(m){if(c.status==="pending"){var b=c;b.status="rejected",b.reason=m}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw a=c.reason,Mk(a),a}throw Io=c,cl}}function Bo(a){try{var c=a._init;return c(a._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(Io=d,cl):d}}var Io=null;function jk(){if(Io===null)throw Error(i(459));var a=Io;return Io=null,a}function Mk(a){if(a===cl||a===kh)throw Error(i(483))}var ul=null,_u=0;function Th(a){var c=_u;return _u+=1,ul===null&&(ul=[]),Rk(ul,a,c)}function Qu(a,c){c=c.props.ref,a.ref=c!==void 0?c:null}function Ch(a,c){throw c.$$typeof===g?Error(i(525)):(a=Object.prototype.toString.call(c),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a)))}function Lk(a){function c(ie,ee){if(a){var re=ie.deletions;re===null?(ie.deletions=[ee],ie.flags|=16):re.push(ee)}}function d(ie,ee){if(!a)return null;for(;ee!==null;)c(ie,ee),ee=ee.sibling;return null}function m(ie){for(var ee=new Map;ie!==null;)ie.key!==null?ee.set(ie.key,ie):ee.set(ie.index,ie),ie=ie.sibling;return ee}function b(ie,ee){return ie=Gr(ie,ee),ie.index=0,ie.sibling=null,ie}function w(ie,ee,re){return ie.index=re,a?(re=ie.alternate,re!==null?(re=re.index,re<ee?(ie.flags|=67108866,ee):re):(ie.flags|=67108866,ee)):(ie.flags|=1048576,ee)}function A(ie){return a&&ie.alternate===null&&(ie.flags|=67108866),ie}function D(ie,ee,re,fe){return ee===null||ee.tag!==6?(ee=gy(re,ie.mode,fe),ee.return=ie,ee):(ee=b(ee,re),ee.return=ie,ee)}function K(ie,ee,re,fe){var Qe=re.type;return Qe===x?ue(ie,ee,re.props.children,fe,re.key):ee!==null&&(ee.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===R&&Bo(Qe)===ee.type)?(ee=b(ee,re.props),Qu(ee,re),ee.return=ie,ee):(ee=vh(re.type,re.key,re.props,null,ie.mode,fe),Qu(ee,re),ee.return=ie,ee)}function se(ie,ee,re,fe){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==re.containerInfo||ee.stateNode.implementation!==re.implementation?(ee=my(re,ie.mode,fe),ee.return=ie,ee):(ee=b(ee,re.children||[]),ee.return=ie,ee)}function ue(ie,ee,re,fe,Qe){return ee===null||ee.tag!==7?(ee=Lo(re,ie.mode,fe,Qe),ee.return=ie,ee):(ee=b(ee,re),ee.return=ie,ee)}function de(ie,ee,re){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=gy(""+ee,ie.mode,re),ee.return=ie,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case O:return re=vh(ee.type,ee.key,ee.props,null,ie.mode,re),Qu(re,ee),re.return=ie,re;case v:return ee=my(ee,ie.mode,re),ee.return=ie,ee;case R:return ee=Bo(ee),de(ie,ee,re)}if(B(ee)||Z(ee))return ee=Lo(ee,ie.mode,re,null),ee.return=ie,ee;if(typeof ee.then=="function")return de(ie,Th(ee),re);if(ee.$$typeof===E)return de(ie,wh(ie,ee),re);Ch(ie,ee)}return null}function oe(ie,ee,re,fe){var Qe=ee!==null?ee.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Qe!==null?null:D(ie,ee,""+re,fe);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case O:return re.key===Qe?K(ie,ee,re,fe):null;case v:return re.key===Qe?se(ie,ee,re,fe):null;case R:return re=Bo(re),oe(ie,ee,re,fe)}if(B(re)||Z(re))return Qe!==null?null:ue(ie,ee,re,fe,null);if(typeof re.then=="function")return oe(ie,ee,Th(re),fe);if(re.$$typeof===E)return oe(ie,ee,wh(ie,re),fe);Ch(ie,re)}return null}function ae(ie,ee,re,fe,Qe){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return ie=ie.get(re)||null,D(ee,ie,""+fe,Qe);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case O:return ie=ie.get(fe.key===null?re:fe.key)||null,K(ee,ie,fe,Qe);case v:return ie=ie.get(fe.key===null?re:fe.key)||null,se(ee,ie,fe,Qe);case R:return fe=Bo(fe),ae(ie,ee,re,fe,Qe)}if(B(fe)||Z(fe))return ie=ie.get(re)||null,ue(ee,ie,fe,Qe,null);if(typeof fe.then=="function")return ae(ie,ee,re,Th(fe),Qe);if(fe.$$typeof===E)return ae(ie,ee,re,wh(ee,fe),Qe);Ch(ee,fe)}return null}function ke(ie,ee,re,fe){for(var Qe=null,He=null,Te=ee,Ze=ee=0,Ve=null;Te!==null&&Ze<re.length;Ze++){Te.index>Ze?(Ve=Te,Te=null):Ve=Te.sibling;var Ke=oe(ie,Te,re[Ze],fe);if(Ke===null){Te===null&&(Te=Ve);break}a&&Te&&Ke.alternate===null&&c(ie,Te),ee=w(Ke,ee,Ze),He===null?Qe=Ke:He.sibling=Ke,He=Ke,Te=Ve}if(Ze===re.length)return d(ie,Te),Ye&&Vr(ie,Ze),Qe;if(Te===null){for(;Ze<re.length;Ze++)Te=de(ie,re[Ze],fe),Te!==null&&(ee=w(Te,ee,Ze),He===null?Qe=Te:He.sibling=Te,He=Te);return Ye&&Vr(ie,Ze),Qe}for(Te=m(Te);Ze<re.length;Ze++)Ve=ae(Te,ie,Ze,re[Ze],fe),Ve!==null&&(a&&Ve.alternate!==null&&Te.delete(Ve.key===null?Ze:Ve.key),ee=w(Ve,ee,Ze),He===null?Qe=Ve:He.sibling=Ve,He=Ve);return a&&Te.forEach(function(ro){return c(ie,ro)}),Ye&&Vr(ie,Ze),Qe}function Pe(ie,ee,re,fe){if(re==null)throw Error(i(151));for(var Qe=null,He=null,Te=ee,Ze=ee=0,Ve=null,Ke=re.next();Te!==null&&!Ke.done;Ze++,Ke=re.next()){Te.index>Ze?(Ve=Te,Te=null):Ve=Te.sibling;var ro=oe(ie,Te,Ke.value,fe);if(ro===null){Te===null&&(Te=Ve);break}a&&Te&&ro.alternate===null&&c(ie,Te),ee=w(ro,ee,Ze),He===null?Qe=ro:He.sibling=ro,He=ro,Te=Ve}if(Ke.done)return d(ie,Te),Ye&&Vr(ie,Ze),Qe;if(Te===null){for(;!Ke.done;Ze++,Ke=re.next())Ke=de(ie,Ke.value,fe),Ke!==null&&(ee=w(Ke,ee,Ze),He===null?Qe=Ke:He.sibling=Ke,He=Ke);return Ye&&Vr(ie,Ze),Qe}for(Te=m(Te);!Ke.done;Ze++,Ke=re.next())Ke=ae(Te,ie,Ze,Ke.value,fe),Ke!==null&&(a&&Ke.alternate!==null&&Te.delete(Ke.key===null?Ze:Ke.key),ee=w(Ke,ee,Ze),He===null?Qe=Ke:He.sibling=Ke,He=Ke);return a&&Te.forEach(function(YX){return c(ie,YX)}),Ye&&Vr(ie,Ze),Qe}function ft(ie,ee,re,fe){if(typeof re=="object"&&re!==null&&re.type===x&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case O:e:{for(var Qe=re.key;ee!==null;){if(ee.key===Qe){if(Qe=re.type,Qe===x){if(ee.tag===7){d(ie,ee.sibling),fe=b(ee,re.props.children),fe.return=ie,ie=fe;break e}}else if(ee.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===R&&Bo(Qe)===ee.type){d(ie,ee.sibling),fe=b(ee,re.props),Qu(fe,re),fe.return=ie,ie=fe;break e}d(ie,ee);break}else c(ie,ee);ee=ee.sibling}re.type===x?(fe=Lo(re.props.children,ie.mode,fe,re.key),fe.return=ie,ie=fe):(fe=vh(re.type,re.key,re.props,null,ie.mode,fe),Qu(fe,re),fe.return=ie,ie=fe)}return A(ie);case v:e:{for(Qe=re.key;ee!==null;){if(ee.key===Qe)if(ee.tag===4&&ee.stateNode.containerInfo===re.containerInfo&&ee.stateNode.implementation===re.implementation){d(ie,ee.sibling),fe=b(ee,re.children||[]),fe.return=ie,ie=fe;break e}else{d(ie,ee);break}else c(ie,ee);ee=ee.sibling}fe=my(re,ie.mode,fe),fe.return=ie,ie=fe}return A(ie);case R:return re=Bo(re),ft(ie,ee,re,fe)}if(B(re))return ke(ie,ee,re,fe);if(Z(re)){if(Qe=Z(re),typeof Qe!="function")throw Error(i(150));return re=Qe.call(re),Pe(ie,ee,re,fe)}if(typeof re.then=="function")return ft(ie,ee,Th(re),fe);if(re.$$typeof===E)return ft(ie,ee,wh(ie,re),fe);Ch(ie,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,ee!==null&&ee.tag===6?(d(ie,ee.sibling),fe=b(ee,re),fe.return=ie,ie=fe):(d(ie,ee),fe=gy(re,ie.mode,fe),fe.return=ie,ie=fe),A(ie)):d(ie,ee)}return function(ie,ee,re,fe){try{_u=0;var Qe=ft(ie,ee,re,fe);return ul=null,Qe}catch(Te){if(Te===cl||Te===kh)throw Te;var He=Yn(29,Te,null,ie.mode);return He.lanes=fe,He.return=ie,He}finally{}}}var Go=Lk(!0),Dk=Lk(!1),Zs=!1;function $y(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _y(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Bs(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Is(a,c,d){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(et&2)!==0){var b=m.pending;return b===null?c.next=c:(c.next=b.next,b.next=c),m.pending=c,c=yh(a),xk(a,null,d),c}return Oh(a,m,c,d),yh(a)}function Au(a,c,d){if(c=c.updateQueue,c!==null&&(c=c.shared,(d&4194048)!==0)){var m=c.lanes;m&=a.pendingLanes,d|=m,c.lanes=d,Hd(a,d)}}function Qy(a,c){var d=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var b=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var A={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?b=w=A:w=w.next=A,d=d.next}while(d!==null);w===null?b=w=c:w=w.next=c}else b=w=c;d={baseState:m.baseState,firstBaseUpdate:b,lastBaseUpdate:w,shared:m.shared,callbacks:m.callbacks},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=c}var Ay=!1;function Nu(){if(Ay){var a=ll;if(a!==null)throw a}}function Pu(a,c,d,m){Ay=!1;var b=a.updateQueue;Zs=!1;var w=b.firstBaseUpdate,A=b.lastBaseUpdate,D=b.shared.pending;if(D!==null){b.shared.pending=null;var K=D,se=K.next;K.next=null,A===null?w=se:A.next=se,A=K;var ue=a.alternate;ue!==null&&(ue=ue.updateQueue,D=ue.lastBaseUpdate,D!==A&&(D===null?ue.firstBaseUpdate=se:D.next=se,ue.lastBaseUpdate=K))}if(w!==null){var de=b.baseState;A=0,ue=se=K=null,D=w;do{var oe=D.lane&-536870913,ae=oe!==D.lane;if(ae?(Ge&oe)===oe:(m&oe)===oe){oe!==0&&oe===al&&(Ay=!0),ue!==null&&(ue=ue.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var ke=a,Pe=D;oe=c;var ft=d;switch(Pe.tag){case 1:if(ke=Pe.payload,typeof ke=="function"){de=ke.call(ft,de,oe);break e}de=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Pe.payload,oe=typeof ke=="function"?ke.call(ft,de,oe):ke,oe==null)break e;de=p({},de,oe);break e;case 2:Zs=!0}}oe=D.callback,oe!==null&&(a.flags|=64,ae&&(a.flags|=8192),ae=b.callbacks,ae===null?b.callbacks=[oe]:ae.push(oe))}else ae={lane:oe,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ue===null?(se=ue=ae,K=de):ue=ue.next=ae,A|=oe;if(D=D.next,D===null){if(D=b.shared.pending,D===null)break;ae=D,D=ae.next,ae.next=null,b.lastBaseUpdate=ae,b.shared.pending=null}}while(!0);ue===null&&(K=de),b.baseState=K,b.firstBaseUpdate=se,b.lastBaseUpdate=ue,w===null&&(b.shared.lanes=0),qs|=A,a.lanes=A,a.memoizedState=de}}function zk(a,c){if(typeof a!="function")throw Error(i(191,a));a.call(c)}function Xk(a,c){var d=a.callbacks;if(d!==null)for(a.callbacks=null,a=0;a<d.length;a++)zk(d[a],c)}var fl=P(null),$h=P(0);function Zk(a,c){a=ns,Y($h,a),Y(fl,c),ns=a|c.baseLanes}function Ny(){Y($h,ns),Y(fl,fl.current)}function Py(){ns=$h.current,j(fl),j($h)}var qn=P(null),mi=null;function Gs(a){var c=a.alternate;Y(Rt,Rt.current&1),Y(qn,a),mi===null&&(c===null||fl.current!==null||c.memoizedState!==null)&&(mi=a)}function Ry(a){Y(Rt,Rt.current),Y(qn,a),mi===null&&(mi=a)}function Bk(a){a.tag===22?(Y(Rt,Rt.current),Y(qn,a),mi===null&&(mi=a)):Vs()}function Vs(){Y(Rt,Rt.current),Y(qn,qn.current)}function Wn(a){j(qn),mi===a&&(mi=null),j(Rt)}var Rt=P(0);function _h(a){for(var c=a;c!==null;){if(c.tag===13){var d=c.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||Xv(d)||Zv(d)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var qr=0,ze=null,ct=null,zt=null,Qh=!1,dl=!1,Vo=!1,Ah=0,Ru=0,hl=null,L3=0;function $t(){throw Error(i(321))}function jy(a,c){if(c===null)return!1;for(var d=0;d<c.length&&d<a.length;d++)if(!Un(a[d],c[d]))return!1;return!0}function My(a,c,d,m,b,w){return qr=w,ze=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,L.H=a===null||a.memoizedState===null?EE:Hy,Vo=!1,w=d(m,b),Vo=!1,dl&&(w=Gk(c,d,m,b)),Ik(a),w}function Ik(a){L.H=Lu;var c=ct!==null&&ct.next!==null;if(qr=0,zt=ct=ze=null,Qh=!1,Ru=0,hl=null,c)throw Error(i(300));a===null||Xt||(a=a.dependencies,a!==null&&xh(a)&&(Xt=!0))}function Gk(a,c,d,m){ze=a;var b=0;do{if(dl&&(hl=null),Ru=0,dl=!1,25<=b)throw Error(i(301));if(b+=1,zt=ct=null,a.updateQueue!=null){var w=a.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}L.H=TE,w=c(d,m)}while(dl);return w}function D3(){var a=L.H,c=a.useState()[0];return c=typeof c.then=="function"?ju(c):c,a=a.useState()[0],(ct!==null?ct.memoizedState:null)!==a&&(ze.flags|=1024),c}function Ly(){var a=Ah!==0;return Ah=0,a}function Dy(a,c,d){c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~d}function zy(a){if(Qh){for(a=a.memoizedState;a!==null;){var c=a.queue;c!==null&&(c.pending=null),a=a.next}Qh=!1}qr=0,zt=ct=ze=null,dl=!1,Ru=Ah=0,hl=null}function vn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?ze.memoizedState=zt=a:zt=zt.next=a,zt}function jt(){if(ct===null){var a=ze.alternate;a=a!==null?a.memoizedState:null}else a=ct.next;var c=zt===null?ze.memoizedState:zt.next;if(c!==null)zt=c,ct=a;else{if(a===null)throw ze.alternate===null?Error(i(467)):Error(i(310));ct=a,a={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},zt===null?ze.memoizedState=zt=a:zt=zt.next=a}return zt}function Nh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ju(a){var c=Ru;return Ru+=1,hl===null&&(hl=[]),a=Rk(hl,a,c),c=ze,(zt===null?c.memoizedState:zt.next)===null&&(c=c.alternate,L.H=c===null||c.memoizedState===null?EE:Hy),a}function Ph(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return ju(a);if(a.$$typeof===E)return Kt(a)}throw Error(i(438,String(a)))}function Xy(a){var c=null,d=ze.updateQueue;if(d!==null&&(c=d.memoCache),c==null){var m=ze.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(c={data:m.data.map(function(b){return b.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),d===null&&(d=Nh(),ze.updateQueue=d),d.memoCache=c,d=c.data[c.index],d===void 0)for(d=c.data[c.index]=Array(a),m=0;m<a;m++)d[m]=q;return c.index++,d}function Wr(a,c){return typeof c=="function"?c(a):c}function Rh(a){var c=jt();return Zy(c,ct,a)}function Zy(a,c,d){var m=a.queue;if(m===null)throw Error(i(311));m.lastRenderedReducer=d;var b=a.baseQueue,w=m.pending;if(w!==null){if(b!==null){var A=b.next;b.next=w.next,w.next=A}c.baseQueue=b=w,m.pending=null}if(w=a.baseState,b===null)a.memoizedState=w;else{c=b.next;var D=A=null,K=null,se=c,ue=!1;do{var de=se.lane&-536870913;if(de!==se.lane?(Ge&de)===de:(qr&de)===de){var oe=se.revertLane;if(oe===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),de===al&&(ue=!0);else if((qr&oe)===oe){se=se.next,oe===al&&(ue=!0);continue}else de={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},K===null?(D=K=de,A=w):K=K.next=de,ze.lanes|=oe,qs|=oe;de=se.action,Vo&&d(w,de),w=se.hasEagerState?se.eagerState:d(w,de)}else oe={lane:de,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},K===null?(D=K=oe,A=w):K=K.next=oe,ze.lanes|=de,qs|=de;se=se.next}while(se!==null&&se!==c);if(K===null?A=w:K.next=D,!Un(w,a.memoizedState)&&(Xt=!0,ue&&(d=ll,d!==null)))throw d;a.memoizedState=w,a.baseState=A,a.baseQueue=K,m.lastRenderedState=w}return b===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function By(a){var c=jt(),d=c.queue;if(d===null)throw Error(i(311));d.lastRenderedReducer=a;var m=d.dispatch,b=d.pending,w=c.memoizedState;if(b!==null){d.pending=null;var A=b=b.next;do w=a(w,A.action),A=A.next;while(A!==b);Un(w,c.memoizedState)||(Xt=!0),c.memoizedState=w,c.baseQueue===null&&(c.baseState=w),d.lastRenderedState=w}return[w,m]}function Vk(a,c,d){var m=ze,b=jt(),w=Ye;if(w){if(d===void 0)throw Error(i(407));d=d()}else d=c();var A=!Un((ct||b).memoizedState,d);if(A&&(b.memoizedState=d,Xt=!0),b=b.queue,Vy(qk.bind(null,m,b,a),[a]),b.getSnapshot!==c||A||zt!==null&&zt.memoizedState.tag&1){if(m.flags|=2048,pl(9,{destroy:void 0},Yk.bind(null,m,b,d,c),null),ht===null)throw Error(i(349));w||(qr&127)!==0||Uk(m,c,d)}return d}function Uk(a,c,d){a.flags|=16384,a={getSnapshot:c,value:d},c=ze.updateQueue,c===null?(c=Nh(),ze.updateQueue=c,c.stores=[a]):(d=c.stores,d===null?c.stores=[a]:d.push(a))}function Yk(a,c,d,m){c.value=d,c.getSnapshot=m,Wk(c)&&Fk(a)}function qk(a,c,d){return d(function(){Wk(c)&&Fk(a)})}function Wk(a){var c=a.getSnapshot;a=a.value;try{var d=c();return!Un(a,d)}catch{return!0}}function Fk(a){var c=Mo(a,2);c!==null&&Mn(c,a,2)}function Iy(a){var c=vn();if(typeof a=="function"){var d=a;if(a=d(),Vo){lr(!0);try{d()}finally{lr(!1)}}}return c.memoizedState=c.baseState=a,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:a},c}function Hk(a,c,d,m){return a.baseState=d,Zy(a,ct,typeof m=="function"?m:Wr)}function z3(a,c,d,m,b){if(Lh(a))throw Error(i(485));if(a=c.action,a!==null){var w={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){w.listeners.push(A)}};L.T!==null?d(!0):w.isTransition=!1,m(w),d=c.pending,d===null?(w.next=c.pending=w,Kk(c,w)):(w.next=d.next,c.pending=d.next=w)}}function Kk(a,c){var d=c.action,m=c.payload,b=a.state;if(c.isTransition){var w=L.T,A={};L.T=A;try{var D=d(b,m),K=L.S;K!==null&&K(A,D),Jk(a,c,D)}catch(se){Gy(a,c,se)}finally{w!==null&&A.types!==null&&(w.types=A.types),L.T=w}}else try{w=d(b,m),Jk(a,c,w)}catch(se){Gy(a,c,se)}}function Jk(a,c,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(m){eE(a,c,m)},function(m){return Gy(a,c,m)}):eE(a,c,d)}function eE(a,c,d){c.status="fulfilled",c.value=d,tE(c),a.state=d,c=a.pending,c!==null&&(d=c.next,d===c?a.pending=null:(d=d.next,c.next=d,Kk(a,d)))}function Gy(a,c,d){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do c.status="rejected",c.reason=d,tE(c),c=c.next;while(c!==m)}a.action=null}function tE(a){a=a.listeners;for(var c=0;c<a.length;c++)(0,a[c])()}function nE(a,c){return c}function iE(a,c){if(Ye){var d=ht.formState;if(d!==null){e:{var m=ze;if(Ye){if(Ot){t:{for(var b=Ot,w=gi;b.nodeType!==8;){if(!w){b=null;break t}if(b=Oi(b.nextSibling),b===null){b=null;break t}}w=b.data,b=w==="F!"||w==="F"?b:null}if(b){Ot=Oi(b.nextSibling),m=b.data==="F!";break e}}zs(m)}m=!1}m&&(c=d[0])}}return d=vn(),d.memoizedState=d.baseState=c,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nE,lastRenderedState:c},d.queue=m,d=wE.bind(null,ze,m),m.dispatch=d,m=Iy(!1),w=Fy.bind(null,ze,!1,m.queue),m=vn(),b={state:c,dispatch:null,action:a,pending:null},m.queue=b,d=z3.bind(null,ze,b,w,d),b.dispatch=d,m.memoizedState=a,[c,d,!1]}function rE(a){var c=jt();return sE(c,ct,a)}function sE(a,c,d){if(c=Zy(a,c,nE)[0],a=Rh(Wr)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var m=ju(c)}catch(A){throw A===cl?kh:A}else m=c;c=jt();var b=c.queue,w=b.dispatch;return d!==c.memoizedState&&(ze.flags|=2048,pl(9,{destroy:void 0},X3.bind(null,b,d),null)),[m,w,a]}function X3(a,c){a.action=c}function oE(a){var c=jt(),d=ct;if(d!==null)return sE(c,d,a);jt(),c=c.memoizedState,d=jt();var m=d.queue.dispatch;return d.memoizedState=a,[c,m,!1]}function pl(a,c,d,m){return a={tag:a,create:d,deps:m,inst:c,next:null},c=ze.updateQueue,c===null&&(c=Nh(),ze.updateQueue=c),d=c.lastEffect,d===null?c.lastEffect=a.next=a:(m=d.next,d.next=a,a.next=m,c.lastEffect=a),a}function aE(){return jt().memoizedState}function jh(a,c,d,m){var b=vn();ze.flags|=a,b.memoizedState=pl(1|c,{destroy:void 0},d,m===void 0?null:m)}function Mh(a,c,d,m){var b=jt();m=m===void 0?null:m;var w=b.memoizedState.inst;ct!==null&&m!==null&&jy(m,ct.memoizedState.deps)?b.memoizedState=pl(c,w,d,m):(ze.flags|=a,b.memoizedState=pl(1|c,w,d,m))}function lE(a,c){jh(8390656,8,a,c)}function Vy(a,c){Mh(2048,8,a,c)}function Z3(a){ze.flags|=4;var c=ze.updateQueue;if(c===null)c=Nh(),ze.updateQueue=c,c.events=[a];else{var d=c.events;d===null?c.events=[a]:d.push(a)}}function cE(a){var c=jt().memoizedState;return Z3({ref:c,nextImpl:a}),function(){if((et&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}function uE(a,c){return Mh(4,2,a,c)}function fE(a,c){return Mh(4,4,a,c)}function dE(a,c){if(typeof c=="function"){a=a();var d=c(a);return function(){typeof d=="function"?d():c(null)}}if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function hE(a,c,d){d=d!=null?d.concat([a]):null,Mh(4,4,dE.bind(null,c,a),d)}function Uy(){}function pE(a,c){var d=jt();c=c===void 0?null:c;var m=d.memoizedState;return c!==null&&jy(c,m[1])?m[0]:(d.memoizedState=[a,c],a)}function gE(a,c){var d=jt();c=c===void 0?null:c;var m=d.memoizedState;if(c!==null&&jy(c,m[1]))return m[0];if(m=a(),Vo){lr(!0);try{a()}finally{lr(!1)}}return d.memoizedState=[m,c],m}function Yy(a,c,d){return d===void 0||(qr&1073741824)!==0&&(Ge&261930)===0?a.memoizedState=c:(a.memoizedState=d,a=mT(),ze.lanes|=a,qs|=a,d)}function mE(a,c,d,m){return Un(d,c)?d:fl.current!==null?(a=Yy(a,d,m),Un(a,c)||(Xt=!0),a):(qr&42)===0||(qr&1073741824)!==0&&(Ge&261930)===0?(Xt=!0,a.memoizedState=d):(a=mT(),ze.lanes|=a,qs|=a,c)}function OE(a,c,d,m,b){var w=I.p;I.p=w!==0&&8>w?w:8;var A=L.T,D={};L.T=D,Fy(a,!1,c,d);try{var K=b(),se=L.S;if(se!==null&&se(D,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var ue=M3(K,m);Mu(a,c,ue,Kn(a))}else Mu(a,c,m,Kn(a))}catch(de){Mu(a,c,{then:function(){},status:"rejected",reason:de},Kn())}finally{I.p=w,A!==null&&D.types!==null&&(A.types=D.types),L.T=A}}function B3(){}function qy(a,c,d,m){if(a.tag!==5)throw Error(i(476));var b=yE(a).queue;OE(a,b,c,U,d===null?B3:function(){return vE(a),d(m)})}function yE(a){var c=a.memoizedState;if(c!==null)return c;c={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:U},next:null};var d={};return c.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:d},next:null},a.memoizedState=c,a=a.alternate,a!==null&&(a.memoizedState=c),c}function vE(a){var c=yE(a);c.next===null&&(c=a.alternate.memoizedState),Mu(a,c.next.queue,{},Kn())}function Wy(){return Kt(Ju)}function bE(){return jt().memoizedState}function xE(){return jt().memoizedState}function I3(a){for(var c=a.return;c!==null;){switch(c.tag){case 24:case 3:var d=Kn();a=Bs(d);var m=Is(c,a,d);m!==null&&(Mn(m,c,d),Au(m,c,d)),c={cache:ky()},a.payload=c;return}c=c.return}}function G3(a,c,d){var m=Kn();d={lane:m,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Lh(a)?SE(c,d):(d=hy(a,c,d,m),d!==null&&(Mn(d,a,m),kE(d,c,m)))}function wE(a,c,d){var m=Kn();Mu(a,c,d,m)}function Mu(a,c,d,m){var b={lane:m,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(Lh(a))SE(c,b);else{var w=a.alternate;if(a.lanes===0&&(w===null||w.lanes===0)&&(w=c.lastRenderedReducer,w!==null))try{var A=c.lastRenderedState,D=w(A,d);if(b.hasEagerState=!0,b.eagerState=D,Un(D,A))return Oh(a,c,b,0),ht===null&&mh(),!1}catch{}finally{}if(d=hy(a,c,b,m),d!==null)return Mn(d,a,m),kE(d,c,m),!0}return!1}function Fy(a,c,d,m){if(m={lane:2,revertLane:$v(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Lh(a)){if(c)throw Error(i(479))}else c=hy(a,d,m,2),c!==null&&Mn(c,a,2)}function Lh(a){var c=a.alternate;return a===ze||c!==null&&c===ze}function SE(a,c){dl=Qh=!0;var d=a.pending;d===null?c.next=c:(c.next=d.next,d.next=c),a.pending=c}function kE(a,c,d){if((d&4194048)!==0){var m=c.lanes;m&=a.pendingLanes,d|=m,c.lanes=d,Hd(a,d)}}var Lu={readContext:Kt,use:Ph,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};Lu.useEffectEvent=$t;var EE={readContext:Kt,use:Ph,useCallback:function(a,c){return vn().memoizedState=[a,c===void 0?null:c],a},useContext:Kt,useEffect:lE,useImperativeHandle:function(a,c,d){d=d!=null?d.concat([a]):null,jh(4194308,4,dE.bind(null,c,a),d)},useLayoutEffect:function(a,c){return jh(4194308,4,a,c)},useInsertionEffect:function(a,c){jh(4,2,a,c)},useMemo:function(a,c){var d=vn();c=c===void 0?null:c;var m=a();if(Vo){lr(!0);try{a()}finally{lr(!1)}}return d.memoizedState=[m,c],m},useReducer:function(a,c,d){var m=vn();if(d!==void 0){var b=d(c);if(Vo){lr(!0);try{d(c)}finally{lr(!1)}}}else b=c;return m.memoizedState=m.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},m.queue=a,a=a.dispatch=G3.bind(null,ze,a),[m.memoizedState,a]},useRef:function(a){var c=vn();return a={current:a},c.memoizedState=a},useState:function(a){a=Iy(a);var c=a.queue,d=wE.bind(null,ze,c);return c.dispatch=d,[a.memoizedState,d]},useDebugValue:Uy,useDeferredValue:function(a,c){var d=vn();return Yy(d,a,c)},useTransition:function(){var a=Iy(!1);return a=OE.bind(null,ze,a.queue,!0,!1),vn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,c,d){var m=ze,b=vn();if(Ye){if(d===void 0)throw Error(i(407));d=d()}else{if(d=c(),ht===null)throw Error(i(349));(Ge&127)!==0||Uk(m,c,d)}b.memoizedState=d;var w={value:d,getSnapshot:c};return b.queue=w,lE(qk.bind(null,m,w,a),[a]),m.flags|=2048,pl(9,{destroy:void 0},Yk.bind(null,m,w,d,c),null),d},useId:function(){var a=vn(),c=ht.identifierPrefix;if(Ye){var d=fr,m=ur;d=(m&~(1<<32-yn(m)-1)).toString(32)+d,c="_"+c+"R_"+d,d=Ah++,0<d&&(c+="H"+d.toString(32)),c+="_"}else d=L3++,c="_"+c+"r_"+d.toString(32)+"_";return a.memoizedState=c},useHostTransitionStatus:Wy,useFormState:iE,useActionState:iE,useOptimistic:function(a){var c=vn();c.memoizedState=c.baseState=a;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=d,c=Fy.bind(null,ze,!0,d),d.dispatch=c,[a,c]},useMemoCache:Xy,useCacheRefresh:function(){return vn().memoizedState=I3.bind(null,ze)},useEffectEvent:function(a){var c=vn(),d={impl:a};return c.memoizedState=d,function(){if((et&2)!==0)throw Error(i(440));return d.impl.apply(void 0,arguments)}}},Hy={readContext:Kt,use:Ph,useCallback:pE,useContext:Kt,useEffect:Vy,useImperativeHandle:hE,useInsertionEffect:uE,useLayoutEffect:fE,useMemo:gE,useReducer:Rh,useRef:aE,useState:function(){return Rh(Wr)},useDebugValue:Uy,useDeferredValue:function(a,c){var d=jt();return mE(d,ct.memoizedState,a,c)},useTransition:function(){var a=Rh(Wr)[0],c=jt().memoizedState;return[typeof a=="boolean"?a:ju(a),c]},useSyncExternalStore:Vk,useId:bE,useHostTransitionStatus:Wy,useFormState:rE,useActionState:rE,useOptimistic:function(a,c){var d=jt();return Hk(d,ct,a,c)},useMemoCache:Xy,useCacheRefresh:xE};Hy.useEffectEvent=cE;var TE={readContext:Kt,use:Ph,useCallback:pE,useContext:Kt,useEffect:Vy,useImperativeHandle:hE,useInsertionEffect:uE,useLayoutEffect:fE,useMemo:gE,useReducer:By,useRef:aE,useState:function(){return By(Wr)},useDebugValue:Uy,useDeferredValue:function(a,c){var d=jt();return ct===null?Yy(d,a,c):mE(d,ct.memoizedState,a,c)},useTransition:function(){var a=By(Wr)[0],c=jt().memoizedState;return[typeof a=="boolean"?a:ju(a),c]},useSyncExternalStore:Vk,useId:bE,useHostTransitionStatus:Wy,useFormState:oE,useActionState:oE,useOptimistic:function(a,c){var d=jt();return ct!==null?Hk(d,ct,a,c):(d.baseState=a,[a,d.queue.dispatch])},useMemoCache:Xy,useCacheRefresh:xE};TE.useEffectEvent=cE;function Ky(a,c,d,m){c=a.memoizedState,d=d(m,c),d=d==null?c:p({},c,d),a.memoizedState=d,a.lanes===0&&(a.updateQueue.baseState=d)}var Jy={enqueueSetState:function(a,c,d){a=a._reactInternals;var m=Kn(),b=Bs(m);b.payload=c,d!=null&&(b.callback=d),c=Is(a,b,m),c!==null&&(Mn(c,a,m),Au(c,a,m))},enqueueReplaceState:function(a,c,d){a=a._reactInternals;var m=Kn(),b=Bs(m);b.tag=1,b.payload=c,d!=null&&(b.callback=d),c=Is(a,b,m),c!==null&&(Mn(c,a,m),Au(c,a,m))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var d=Kn(),m=Bs(d);m.tag=2,c!=null&&(m.callback=c),c=Is(a,m,d),c!==null&&(Mn(c,a,d),Au(c,a,d))}};function CE(a,c,d,m,b,w,A){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,w,A):c.prototype&&c.prototype.isPureReactComponent?!Su(d,m)||!Su(b,w):!0}function $E(a,c,d,m){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(d,m),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(d,m),c.state!==a&&Jy.enqueueReplaceState(c,c.state,null)}function Uo(a,c){var d=c;if("ref"in c){d={};for(var m in c)m!=="ref"&&(d[m]=c[m])}if(a=a.defaultProps){d===c&&(d=p({},d));for(var b in a)d[b]===void 0&&(d[b]=a[b])}return d}function _E(a){gh(a)}function QE(a){console.error(a)}function AE(a){gh(a)}function Dh(a,c){try{var d=a.onUncaughtError;d(c.value,{componentStack:c.stack})}catch(m){setTimeout(function(){throw m})}}function NE(a,c,d){try{var m=a.onCaughtError;m(d.value,{componentStack:d.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function ev(a,c,d){return d=Bs(d),d.tag=3,d.payload={element:null},d.callback=function(){Dh(a,c)},d}function PE(a){return a=Bs(a),a.tag=3,a}function RE(a,c,d,m){var b=d.type.getDerivedStateFromError;if(typeof b=="function"){var w=m.value;a.payload=function(){return b(w)},a.callback=function(){NE(c,d,m)}}var A=d.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(a.callback=function(){NE(c,d,m),typeof b!="function"&&(Ws===null?Ws=new Set([this]):Ws.add(this));var D=m.stack;this.componentDidCatch(m.value,{componentStack:D!==null?D:""})})}function V3(a,c,d,m,b){if(d.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(c=d.alternate,c!==null&&ol(c,d,b,!0),d=qn.current,d!==null){switch(d.tag){case 31:case 13:return mi===null?Fh():d.alternate===null&&_t===0&&(_t=3),d.flags&=-257,d.flags|=65536,d.lanes=b,m===Eh?d.flags|=16384:(c=d.updateQueue,c===null?d.updateQueue=new Set([m]):c.add(m),Ev(a,m,b)),!1;case 22:return d.flags|=65536,m===Eh?d.flags|=16384:(c=d.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([m])},d.updateQueue=c):(d=c.retryQueue,d===null?c.retryQueue=new Set([m]):d.add(m)),Ev(a,m,b)),!1}throw Error(i(435,d.tag))}return Ev(a,m,b),Fh(),!1}if(Ye)return c=qn.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=b,m!==vy&&(a=Error(i(422),{cause:m}),Tu(di(a,d)))):(m!==vy&&(c=Error(i(423),{cause:m}),Tu(di(c,d))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,m=di(m,d),b=ev(a.stateNode,m,b),Qy(a,b),_t!==4&&(_t=2)),!1;var w=Error(i(520),{cause:m});if(w=di(w,d),Vu===null?Vu=[w]:Vu.push(w),_t!==4&&(_t=2),c===null)return!0;m=di(m,d),d=c;do{switch(d.tag){case 3:return d.flags|=65536,a=b&-b,d.lanes|=a,a=ev(d.stateNode,m,a),Qy(d,a),!1;case 1:if(c=d.type,w=d.stateNode,(d.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ws===null||!Ws.has(w))))return d.flags|=65536,b&=-b,d.lanes|=b,b=PE(b),RE(b,a,d,m),Qy(d,b),!1}d=d.return}while(d!==null);return!1}var tv=Error(i(461)),Xt=!1;function Jt(a,c,d,m){c.child=a===null?Dk(c,null,d,m):Go(c,a.child,d,m)}function jE(a,c,d,m,b){d=d.render;var w=c.ref;if("ref"in m){var A={};for(var D in m)D!=="ref"&&(A[D]=m[D])}else A=m;return Xo(c),m=My(a,c,d,A,w,b),D=Ly(),a!==null&&!Xt?(Dy(a,c,b),Fr(a,c,b)):(Ye&&D&&Oy(c),c.flags|=1,Jt(a,c,m,b),c.child)}function ME(a,c,d,m,b){if(a===null){var w=d.type;return typeof w=="function"&&!py(w)&&w.defaultProps===void 0&&d.compare===null?(c.tag=15,c.type=w,LE(a,c,w,m,b)):(a=vh(d.type,null,m,c,c.mode,b),a.ref=c.ref,a.return=c,c.child=a)}if(w=a.child,!cv(a,b)){var A=w.memoizedProps;if(d=d.compare,d=d!==null?d:Su,d(A,m)&&a.ref===c.ref)return Fr(a,c,b)}return c.flags|=1,a=Gr(w,m),a.ref=c.ref,a.return=c,c.child=a}function LE(a,c,d,m,b){if(a!==null){var w=a.memoizedProps;if(Su(w,m)&&a.ref===c.ref)if(Xt=!1,c.pendingProps=m=w,cv(a,b))(a.flags&131072)!==0&&(Xt=!0);else return c.lanes=a.lanes,Fr(a,c,b)}return nv(a,c,d,m,b)}function DE(a,c,d,m){var b=m.children,w=a!==null?a.memoizedState:null;if(a===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((c.flags&128)!==0){if(w=w!==null?w.baseLanes|d:d,a!==null){for(m=c.child=a.child,b=0;m!==null;)b=b|m.lanes|m.childLanes,m=m.sibling;m=b&~w}else m=0,c.child=null;return zE(a,c,w,d,m)}if((d&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},a!==null&&Sh(c,w!==null?w.cachePool:null),w!==null?Zk(c,w):Ny(),Bk(c);else return m=c.lanes=536870912,zE(a,c,w!==null?w.baseLanes|d:d,d,m)}else w!==null?(Sh(c,w.cachePool),Zk(c,w),Vs(),c.memoizedState=null):(a!==null&&Sh(c,null),Ny(),Vs());return Jt(a,c,b,d),c.child}function Du(a,c){return a!==null&&a.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function zE(a,c,d,m,b){var w=Ty();return w=w===null?null:{parent:Dt._currentValue,pool:w},c.memoizedState={baseLanes:d,cachePool:w},a!==null&&Sh(c,null),Ny(),Bk(c),a!==null&&ol(a,c,m,!0),c.childLanes=b,null}function zh(a,c){return c=Zh({mode:c.mode,children:c.children},a.mode),c.ref=a.ref,a.child=c,c.return=a,c}function XE(a,c,d){return Go(c,a.child,null,d),a=zh(c,c.pendingProps),a.flags|=2,Wn(c),c.memoizedState=null,a}function U3(a,c,d){var m=c.pendingProps,b=(c.flags&128)!==0;if(c.flags&=-129,a===null){if(Ye){if(m.mode==="hidden")return a=zh(c,m),c.lanes=536870912,Du(null,a);if(Ry(c),(a=Ot)?(a=KT(a,gi),a=a!==null&&a.data==="&"?a:null,a!==null&&(c.memoizedState={dehydrated:a,treeContext:Ls!==null?{id:ur,overflow:fr}:null,retryLane:536870912,hydrationErrors:null},d=Sk(a),d.return=c,c.child=d,Ht=c,Ot=null)):a=null,a===null)throw zs(c);return c.lanes=536870912,null}return zh(c,m)}var w=a.memoizedState;if(w!==null){var A=w.dehydrated;if(Ry(c),b)if(c.flags&256)c.flags&=-257,c=XE(a,c,d);else if(c.memoizedState!==null)c.child=a.child,c.flags|=128,c=null;else throw Error(i(558));else if(Xt||ol(a,c,d,!1),b=(d&a.childLanes)!==0,Xt||b){if(m=ht,m!==null&&(A=Kd(m,d),A!==0&&A!==w.retryLane))throw w.retryLane=A,Mo(a,A),Mn(m,a,A),tv;Fh(),c=XE(a,c,d)}else a=w.treeContext,Ot=Oi(A.nextSibling),Ht=c,Ye=!0,Ds=null,gi=!1,a!==null&&Tk(c,a),c=zh(c,m),c.flags|=4096;return c}return a=Gr(a.child,{mode:m.mode,children:m.children}),a.ref=c.ref,c.child=a,a.return=c,a}function Xh(a,c){var d=c.ref;if(d===null)a!==null&&a.ref!==null&&(c.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(i(284));(a===null||a.ref!==d)&&(c.flags|=4194816)}}function nv(a,c,d,m,b){return Xo(c),d=My(a,c,d,m,void 0,b),m=Ly(),a!==null&&!Xt?(Dy(a,c,b),Fr(a,c,b)):(Ye&&m&&Oy(c),c.flags|=1,Jt(a,c,d,b),c.child)}function ZE(a,c,d,m,b,w){return Xo(c),c.updateQueue=null,d=Gk(c,m,d,b),Ik(a),m=Ly(),a!==null&&!Xt?(Dy(a,c,w),Fr(a,c,w)):(Ye&&m&&Oy(c),c.flags|=1,Jt(a,c,d,w),c.child)}function BE(a,c,d,m,b){if(Xo(c),c.stateNode===null){var w=nl,A=d.contextType;typeof A=="object"&&A!==null&&(w=Kt(A)),w=new d(m,w),c.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Jy,c.stateNode=w,w._reactInternals=c,w=c.stateNode,w.props=m,w.state=c.memoizedState,w.refs={},$y(c),A=d.contextType,w.context=typeof A=="object"&&A!==null?Kt(A):nl,w.state=c.memoizedState,A=d.getDerivedStateFromProps,typeof A=="function"&&(Ky(c,d,A,m),w.state=c.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(A=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),A!==w.state&&Jy.enqueueReplaceState(w,w.state,null),Pu(c,m,w,b),Nu(),w.state=c.memoizedState),typeof w.componentDidMount=="function"&&(c.flags|=4194308),m=!0}else if(a===null){w=c.stateNode;var D=c.memoizedProps,K=Uo(d,D);w.props=K;var se=w.context,ue=d.contextType;A=nl,typeof ue=="object"&&ue!==null&&(A=Kt(ue));var de=d.getDerivedStateFromProps;ue=typeof de=="function"||typeof w.getSnapshotBeforeUpdate=="function",D=c.pendingProps!==D,ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(D||se!==A)&&$E(c,w,m,A),Zs=!1;var oe=c.memoizedState;w.state=oe,Pu(c,m,w,b),Nu(),se=c.memoizedState,D||oe!==se||Zs?(typeof de=="function"&&(Ky(c,d,de,m),se=c.memoizedState),(K=Zs||CE(c,d,K,m,oe,se,A))?(ue||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(c.flags|=4194308)):(typeof w.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=m,c.memoizedState=se),w.props=m,w.state=se,w.context=A,m=K):(typeof w.componentDidMount=="function"&&(c.flags|=4194308),m=!1)}else{w=c.stateNode,_y(a,c),A=c.memoizedProps,ue=Uo(d,A),w.props=ue,de=c.pendingProps,oe=w.context,se=d.contextType,K=nl,typeof se=="object"&&se!==null&&(K=Kt(se)),D=d.getDerivedStateFromProps,(se=typeof D=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(A!==de||oe!==K)&&$E(c,w,m,K),Zs=!1,oe=c.memoizedState,w.state=oe,Pu(c,m,w,b),Nu();var ae=c.memoizedState;A!==de||oe!==ae||Zs||a!==null&&a.dependencies!==null&&xh(a.dependencies)?(typeof D=="function"&&(Ky(c,d,D,m),ae=c.memoizedState),(ue=Zs||CE(c,d,ue,m,oe,ae,K)||a!==null&&a.dependencies!==null&&xh(a.dependencies))?(se||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(m,ae,K),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(m,ae,K)),typeof w.componentDidUpdate=="function"&&(c.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof w.componentDidUpdate!="function"||A===a.memoizedProps&&oe===a.memoizedState||(c.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===a.memoizedProps&&oe===a.memoizedState||(c.flags|=1024),c.memoizedProps=m,c.memoizedState=ae),w.props=m,w.state=ae,w.context=K,m=ue):(typeof w.componentDidUpdate!="function"||A===a.memoizedProps&&oe===a.memoizedState||(c.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===a.memoizedProps&&oe===a.memoizedState||(c.flags|=1024),m=!1)}return w=m,Xh(a,c),m=(c.flags&128)!==0,w||m?(w=c.stateNode,d=m&&typeof d.getDerivedStateFromError!="function"?null:w.render(),c.flags|=1,a!==null&&m?(c.child=Go(c,a.child,null,b),c.child=Go(c,null,d,b)):Jt(a,c,d,b),c.memoizedState=w.state,a=c.child):a=Fr(a,c,b),a}function IE(a,c,d,m){return Do(),c.flags|=256,Jt(a,c,d,m),c.child}var iv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rv(a){return{baseLanes:a,cachePool:Nk()}}function sv(a,c,d){return a=a!==null?a.childLanes&~d:0,c&&(a|=Hn),a}function GE(a,c,d){var m=c.pendingProps,b=!1,w=(c.flags&128)!==0,A;if((A=w)||(A=a!==null&&a.memoizedState===null?!1:(Rt.current&2)!==0),A&&(b=!0,c.flags&=-129),A=(c.flags&32)!==0,c.flags&=-33,a===null){if(Ye){if(b?Gs(c):Vs(),(a=Ot)?(a=KT(a,gi),a=a!==null&&a.data!=="&"?a:null,a!==null&&(c.memoizedState={dehydrated:a,treeContext:Ls!==null?{id:ur,overflow:fr}:null,retryLane:536870912,hydrationErrors:null},d=Sk(a),d.return=c,c.child=d,Ht=c,Ot=null)):a=null,a===null)throw zs(c);return Zv(a)?c.lanes=32:c.lanes=536870912,null}var D=m.children;return m=m.fallback,b?(Vs(),b=c.mode,D=Zh({mode:"hidden",children:D},b),m=Lo(m,b,d,null),D.return=c,m.return=c,D.sibling=m,c.child=D,m=c.child,m.memoizedState=rv(d),m.childLanes=sv(a,A,d),c.memoizedState=iv,Du(null,m)):(Gs(c),ov(c,D))}var K=a.memoizedState;if(K!==null&&(D=K.dehydrated,D!==null)){if(w)c.flags&256?(Gs(c),c.flags&=-257,c=av(a,c,d)):c.memoizedState!==null?(Vs(),c.child=a.child,c.flags|=128,c=null):(Vs(),D=m.fallback,b=c.mode,m=Zh({mode:"visible",children:m.children},b),D=Lo(D,b,d,null),D.flags|=2,m.return=c,D.return=c,m.sibling=D,c.child=m,Go(c,a.child,null,d),m=c.child,m.memoizedState=rv(d),m.childLanes=sv(a,A,d),c.memoizedState=iv,c=Du(null,m));else if(Gs(c),Zv(D)){if(A=D.nextSibling&&D.nextSibling.dataset,A)var se=A.dgst;A=se,m=Error(i(419)),m.stack="",m.digest=A,Tu({value:m,source:null,stack:null}),c=av(a,c,d)}else if(Xt||ol(a,c,d,!1),A=(d&a.childLanes)!==0,Xt||A){if(A=ht,A!==null&&(m=Kd(A,d),m!==0&&m!==K.retryLane))throw K.retryLane=m,Mo(a,m),Mn(A,a,m),tv;Xv(D)||Fh(),c=av(a,c,d)}else Xv(D)?(c.flags|=192,c.child=a.child,c=null):(a=K.treeContext,Ot=Oi(D.nextSibling),Ht=c,Ye=!0,Ds=null,gi=!1,a!==null&&Tk(c,a),c=ov(c,m.children),c.flags|=4096);return c}return b?(Vs(),D=m.fallback,b=c.mode,K=a.child,se=K.sibling,m=Gr(K,{mode:"hidden",children:m.children}),m.subtreeFlags=K.subtreeFlags&65011712,se!==null?D=Gr(se,D):(D=Lo(D,b,d,null),D.flags|=2),D.return=c,m.return=c,m.sibling=D,c.child=m,Du(null,m),m=c.child,D=a.child.memoizedState,D===null?D=rv(d):(b=D.cachePool,b!==null?(K=Dt._currentValue,b=b.parent!==K?{parent:K,pool:K}:b):b=Nk(),D={baseLanes:D.baseLanes|d,cachePool:b}),m.memoizedState=D,m.childLanes=sv(a,A,d),c.memoizedState=iv,Du(a.child,m)):(Gs(c),d=a.child,a=d.sibling,d=Gr(d,{mode:"visible",children:m.children}),d.return=c,d.sibling=null,a!==null&&(A=c.deletions,A===null?(c.deletions=[a],c.flags|=16):A.push(a)),c.child=d,c.memoizedState=null,d)}function ov(a,c){return c=Zh({mode:"visible",children:c},a.mode),c.return=a,a.child=c}function Zh(a,c){return a=Yn(22,a,null,c),a.lanes=0,a}function av(a,c,d){return Go(c,a.child,null,d),a=ov(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function VE(a,c,d){a.lanes|=c;var m=a.alternate;m!==null&&(m.lanes|=c),wy(a.return,c,d)}function lv(a,c,d,m,b,w){var A=a.memoizedState;A===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:m,tail:d,tailMode:b,treeForkCount:w}:(A.isBackwards=c,A.rendering=null,A.renderingStartTime=0,A.last=m,A.tail=d,A.tailMode=b,A.treeForkCount=w)}function UE(a,c,d){var m=c.pendingProps,b=m.revealOrder,w=m.tail;m=m.children;var A=Rt.current,D=(A&2)!==0;if(D?(A=A&1|2,c.flags|=128):A&=1,Y(Rt,A),Jt(a,c,m,d),m=Ye?Eu:0,!D&&a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&VE(a,d,c);else if(a.tag===19)VE(a,d,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(d=c.child,b=null;d!==null;)a=d.alternate,a!==null&&_h(a)===null&&(b=d),d=d.sibling;d=b,d===null?(b=c.child,c.child=null):(b=d.sibling,d.sibling=null),lv(c,!1,b,d,w,m);break;case"backwards":case"unstable_legacy-backwards":for(d=null,b=c.child,c.child=null;b!==null;){if(a=b.alternate,a!==null&&_h(a)===null){c.child=b;break}a=b.sibling,b.sibling=d,d=b,b=a}lv(c,!0,d,null,w,m);break;case"together":lv(c,!1,null,null,void 0,m);break;default:c.memoizedState=null}return c.child}function Fr(a,c,d){if(a!==null&&(c.dependencies=a.dependencies),qs|=c.lanes,(d&c.childLanes)===0)if(a!==null){if(ol(a,c,d,!1),(d&c.childLanes)===0)return null}else return null;if(a!==null&&c.child!==a.child)throw Error(i(153));if(c.child!==null){for(a=c.child,d=Gr(a,a.pendingProps),c.child=d,d.return=c;a.sibling!==null;)a=a.sibling,d=d.sibling=Gr(a,a.pendingProps),d.return=c;d.sibling=null}return c.child}function cv(a,c){return(a.lanes&c)!==0?!0:(a=a.dependencies,!!(a!==null&&xh(a)))}function Y3(a,c,d){switch(c.tag){case 3:H(c,c.stateNode.containerInfo),Xs(c,Dt,a.memoizedState.cache),Do();break;case 27:case 5:be(c);break;case 4:H(c,c.stateNode.containerInfo);break;case 10:Xs(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,Ry(c),null;break;case 13:var m=c.memoizedState;if(m!==null)return m.dehydrated!==null?(Gs(c),c.flags|=128,null):(d&c.child.childLanes)!==0?GE(a,c,d):(Gs(c),a=Fr(a,c,d),a!==null?a.sibling:null);Gs(c);break;case 19:var b=(a.flags&128)!==0;if(m=(d&c.childLanes)!==0,m||(ol(a,c,d,!1),m=(d&c.childLanes)!==0),b){if(m)return UE(a,c,d);c.flags|=128}if(b=c.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),Y(Rt,Rt.current),m)break;return null;case 22:return c.lanes=0,DE(a,c,d,c.pendingProps);case 24:Xs(c,Dt,a.memoizedState.cache)}return Fr(a,c,d)}function YE(a,c,d){if(a!==null)if(a.memoizedProps!==c.pendingProps)Xt=!0;else{if(!cv(a,d)&&(c.flags&128)===0)return Xt=!1,Y3(a,c,d);Xt=(a.flags&131072)!==0}else Xt=!1,Ye&&(c.flags&1048576)!==0&&Ek(c,Eu,c.index);switch(c.lanes=0,c.tag){case 16:e:{var m=c.pendingProps;if(a=Bo(c.elementType),c.type=a,typeof a=="function")py(a)?(m=Uo(a,m),c.tag=1,c=BE(null,c,a,m,d)):(c.tag=0,c=nv(null,c,a,m,d));else{if(a!=null){var b=a.$$typeof;if(b===T){c.tag=11,c=jE(null,c,a,m,d);break e}else if(b===N){c.tag=14,c=ME(null,c,a,m,d);break e}}throw c=M(a)||a,Error(i(306,c,""))}}return c;case 0:return nv(a,c,c.type,c.pendingProps,d);case 1:return m=c.type,b=Uo(m,c.pendingProps),BE(a,c,m,b,d);case 3:e:{if(H(c,c.stateNode.containerInfo),a===null)throw Error(i(387));m=c.pendingProps;var w=c.memoizedState;b=w.element,_y(a,c),Pu(c,m,null,d);var A=c.memoizedState;if(m=A.cache,Xs(c,Dt,m),m!==w.cache&&Sy(c,[Dt],d,!0),Nu(),m=A.element,w.isDehydrated)if(w={element:m,isDehydrated:!1,cache:A.cache},c.updateQueue.baseState=w,c.memoizedState=w,c.flags&256){c=IE(a,c,m,d);break e}else if(m!==b){b=di(Error(i(424)),c),Tu(b),c=IE(a,c,m,d);break e}else{switch(a=c.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(Ot=Oi(a.firstChild),Ht=c,Ye=!0,Ds=null,gi=!0,d=Dk(c,null,m,d),c.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Do(),m===b){c=Fr(a,c,d);break e}Jt(a,c,m,d)}c=c.child}return c;case 26:return Xh(a,c),a===null?(d=rC(c.type,null,c.pendingProps,null))?c.memoizedState=d:Ye||(d=c.type,a=c.pendingProps,m=ip(ne.current).createElement(d),m[Gt]=c,m[an]=a,en(m,d,a),Lt(m),c.stateNode=m):c.memoizedState=rC(c.type,a.memoizedProps,c.pendingProps,a.memoizedState),null;case 27:return be(c),a===null&&Ye&&(m=c.stateNode=tC(c.type,c.pendingProps,ne.current),Ht=c,gi=!0,b=Ot,Js(c.type)?(Bv=b,Ot=Oi(m.firstChild)):Ot=b),Jt(a,c,c.pendingProps.children,d),Xh(a,c),a===null&&(c.flags|=4194304),c.child;case 5:return a===null&&Ye&&((b=m=Ot)&&(m=SX(m,c.type,c.pendingProps,gi),m!==null?(c.stateNode=m,Ht=c,Ot=Oi(m.firstChild),gi=!1,b=!0):b=!1),b||zs(c)),be(c),b=c.type,w=c.pendingProps,A=a!==null?a.memoizedProps:null,m=w.children,Lv(b,w)?m=null:A!==null&&Lv(b,A)&&(c.flags|=32),c.memoizedState!==null&&(b=My(a,c,D3,null,null,d),Ju._currentValue=b),Xh(a,c),Jt(a,c,m,d),c.child;case 6:return a===null&&Ye&&((a=d=Ot)&&(d=kX(d,c.pendingProps,gi),d!==null?(c.stateNode=d,Ht=c,Ot=null,a=!0):a=!1),a||zs(c)),null;case 13:return GE(a,c,d);case 4:return H(c,c.stateNode.containerInfo),m=c.pendingProps,a===null?c.child=Go(c,null,m,d):Jt(a,c,m,d),c.child;case 11:return jE(a,c,c.type,c.pendingProps,d);case 7:return Jt(a,c,c.pendingProps,d),c.child;case 8:return Jt(a,c,c.pendingProps.children,d),c.child;case 12:return Jt(a,c,c.pendingProps.children,d),c.child;case 10:return m=c.pendingProps,Xs(c,c.type,m.value),Jt(a,c,m.children,d),c.child;case 9:return b=c.type._context,m=c.pendingProps.children,Xo(c),b=Kt(b),m=m(b),c.flags|=1,Jt(a,c,m,d),c.child;case 14:return ME(a,c,c.type,c.pendingProps,d);case 15:return LE(a,c,c.type,c.pendingProps,d);case 19:return UE(a,c,d);case 31:return U3(a,c,d);case 22:return DE(a,c,d,c.pendingProps);case 24:return Xo(c),m=Kt(Dt),a===null?(b=Ty(),b===null&&(b=ht,w=ky(),b.pooledCache=w,w.refCount++,w!==null&&(b.pooledCacheLanes|=d),b=w),c.memoizedState={parent:m,cache:b},$y(c),Xs(c,Dt,b)):((a.lanes&d)!==0&&(_y(a,c),Pu(c,null,null,d),Nu()),b=a.memoizedState,w=c.memoizedState,b.parent!==m?(b={parent:m,cache:m},c.memoizedState=b,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=b),Xs(c,Dt,m)):(m=w.cache,Xs(c,Dt,m),m!==b.cache&&Sy(c,[Dt],d,!0))),Jt(a,c,c.pendingProps.children,d),c.child;case 29:throw c.pendingProps}throw Error(i(156,c.tag))}function Hr(a){a.flags|=4}function uv(a,c,d,m,b){if((c=(a.mode&32)!==0)&&(c=!1),c){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(bT())a.flags|=8192;else throw Io=Eh,Cy}else a.flags&=-16777217}function qE(a,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!cC(c))if(bT())a.flags|=8192;else throw Io=Eh,Cy}function Bh(a,c){c!==null&&(a.flags|=4),a.flags&16384&&(c=a.tag!==22?Wd():536870912,a.lanes|=c,yl|=c)}function zu(a,c){if(!Ye)switch(a.tailMode){case"hidden":c=a.tail;for(var d=null;c!==null;)c.alternate!==null&&(d=c),c=c.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function yt(a){var c=a.alternate!==null&&a.alternate.child===a.child,d=0,m=0;if(c)for(var b=a.child;b!==null;)d|=b.lanes|b.childLanes,m|=b.subtreeFlags&65011712,m|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)d|=b.lanes|b.childLanes,m|=b.subtreeFlags,m|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=m,a.childLanes=d,c}function q3(a,c,d){var m=c.pendingProps;switch(yy(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(c),null;case 1:return yt(c),null;case 3:return d=c.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),c.memoizedState.cache!==m&&(c.flags|=2048),Yr(Dt),ce(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(a===null||a.child===null)&&(sl(c)?Hr(c):a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,by())),yt(c),null;case 26:var b=c.type,w=c.memoizedState;return a===null?(Hr(c),w!==null?(yt(c),qE(c,w)):(yt(c),uv(c,b,null,m,d))):w?w!==a.memoizedState?(Hr(c),yt(c),qE(c,w)):(yt(c),c.flags&=-16777217):(a=a.memoizedProps,a!==m&&Hr(c),yt(c),uv(c,b,a,m,d)),null;case 27:if(Se(c),d=ne.current,b=c.type,a!==null&&c.stateNode!=null)a.memoizedProps!==m&&Hr(c);else{if(!m){if(c.stateNode===null)throw Error(i(166));return yt(c),null}a=G.current,sl(c)?Ck(c):(a=tC(b,m,d),c.stateNode=a,Hr(c))}return yt(c),null;case 5:if(Se(c),b=c.type,a!==null&&c.stateNode!=null)a.memoizedProps!==m&&Hr(c);else{if(!m){if(c.stateNode===null)throw Error(i(166));return yt(c),null}if(w=G.current,sl(c))Ck(c);else{var A=ip(ne.current);switch(w){case 1:w=A.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:w=A.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":w=A.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":w=A.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":w=A.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof m.is=="string"?A.createElement("select",{is:m.is}):A.createElement("select"),m.multiple?w.multiple=!0:m.size&&(w.size=m.size);break;default:w=typeof m.is=="string"?A.createElement(b,{is:m.is}):A.createElement(b)}}w[Gt]=c,w[an]=m;e:for(A=c.child;A!==null;){if(A.tag===5||A.tag===6)w.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===c)break e;for(;A.sibling===null;){if(A.return===null||A.return===c)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}c.stateNode=w;e:switch(en(w,b,m),b){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Hr(c)}}return yt(c),uv(c,c.type,a===null?null:a.memoizedProps,c.pendingProps,d),null;case 6:if(a&&c.stateNode!=null)a.memoizedProps!==m&&Hr(c);else{if(typeof m!="string"&&c.stateNode===null)throw Error(i(166));if(a=ne.current,sl(c)){if(a=c.stateNode,d=c.memoizedProps,m=null,b=Ht,b!==null)switch(b.tag){case 27:case 5:m=b.memoizedProps}a[Gt]=c,a=!!(a.nodeValue===d||m!==null&&m.suppressHydrationWarning===!0||GT(a.nodeValue,d)),a||zs(c,!0)}else a=ip(a).createTextNode(m),a[Gt]=c,c.stateNode=a}return yt(c),null;case 31:if(d=c.memoizedState,a===null||a.memoizedState!==null){if(m=sl(c),d!==null){if(a===null){if(!m)throw Error(i(318));if(a=c.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[Gt]=c}else Do(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;yt(c),a=!1}else d=by(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=d),a=!0;if(!a)return c.flags&256?(Wn(c),c):(Wn(c),null);if((c.flags&128)!==0)throw Error(i(558))}return yt(c),null;case 13:if(m=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=sl(c),m!==null&&m.dehydrated!==null){if(a===null){if(!b)throw Error(i(318));if(b=c.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(i(317));b[Gt]=c}else Do(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;yt(c),b=!1}else b=by(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return c.flags&256?(Wn(c),c):(Wn(c),null)}return Wn(c),(c.flags&128)!==0?(c.lanes=d,c):(d=m!==null,a=a!==null&&a.memoizedState!==null,d&&(m=c.child,b=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(b=m.alternate.memoizedState.cachePool.pool),w=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(w=m.memoizedState.cachePool.pool),w!==b&&(m.flags|=2048)),d!==a&&d&&(c.child.flags|=8192),Bh(c,c.updateQueue),yt(c),null);case 4:return ce(),a===null&&Nv(c.stateNode.containerInfo),yt(c),null;case 10:return Yr(c.type),yt(c),null;case 19:if(j(Rt),m=c.memoizedState,m===null)return yt(c),null;if(b=(c.flags&128)!==0,w=m.rendering,w===null)if(b)zu(m,!1);else{if(_t!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(w=_h(a),w!==null){for(c.flags|=128,zu(m,!1),a=w.updateQueue,c.updateQueue=a,Bh(c,a),c.subtreeFlags=0,a=d,d=c.child;d!==null;)wk(d,a),d=d.sibling;return Y(Rt,Rt.current&1|2),Ye&&Vr(c,m.treeForkCount),c.child}a=a.sibling}m.tail!==null&&Pt()>Yh&&(c.flags|=128,b=!0,zu(m,!1),c.lanes=4194304)}else{if(!b)if(a=_h(w),a!==null){if(c.flags|=128,b=!0,a=a.updateQueue,c.updateQueue=a,Bh(c,a),zu(m,!0),m.tail===null&&m.tailMode==="hidden"&&!w.alternate&&!Ye)return yt(c),null}else 2*Pt()-m.renderingStartTime>Yh&&d!==536870912&&(c.flags|=128,b=!0,zu(m,!1),c.lanes=4194304);m.isBackwards?(w.sibling=c.child,c.child=w):(a=m.last,a!==null?a.sibling=w:c.child=w,m.last=w)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=Pt(),a.sibling=null,d=Rt.current,Y(Rt,b?d&1|2:d&1),Ye&&Vr(c,m.treeForkCount),a):(yt(c),null);case 22:case 23:return Wn(c),Py(),m=c.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(c.flags|=8192):m&&(c.flags|=8192),m?(d&536870912)!==0&&(c.flags&128)===0&&(yt(c),c.subtreeFlags&6&&(c.flags|=8192)):yt(c),d=c.updateQueue,d!==null&&Bh(c,d.retryQueue),d=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),m=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),m!==d&&(c.flags|=2048),a!==null&&j(Zo),null;case 24:return d=null,a!==null&&(d=a.memoizedState.cache),c.memoizedState.cache!==d&&(c.flags|=2048),Yr(Dt),yt(c),null;case 25:return null;case 30:return null}throw Error(i(156,c.tag))}function W3(a,c){switch(yy(c),c.tag){case 1:return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Yr(Dt),ce(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 26:case 27:case 5:return Se(c),null;case 31:if(c.memoizedState!==null){if(Wn(c),c.alternate===null)throw Error(i(340));Do()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 13:if(Wn(c),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(i(340));Do()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return j(Rt),null;case 4:return ce(),null;case 10:return Yr(c.type),null;case 22:case 23:return Wn(c),Py(),a!==null&&j(Zo),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 24:return Yr(Dt),null;case 25:return null;default:return null}}function WE(a,c){switch(yy(c),c.tag){case 3:Yr(Dt),ce();break;case 26:case 27:case 5:Se(c);break;case 4:ce();break;case 31:c.memoizedState!==null&&Wn(c);break;case 13:Wn(c);break;case 19:j(Rt);break;case 10:Yr(c.type);break;case 22:case 23:Wn(c),Py(),a!==null&&j(Zo);break;case 24:Yr(Dt)}}function Xu(a,c){try{var d=c.updateQueue,m=d!==null?d.lastEffect:null;if(m!==null){var b=m.next;d=b;do{if((d.tag&a)===a){m=void 0;var w=d.create,A=d.inst;m=w(),A.destroy=m}d=d.next}while(d!==b)}}catch(D){st(c,c.return,D)}}function Us(a,c,d){try{var m=c.updateQueue,b=m!==null?m.lastEffect:null;if(b!==null){var w=b.next;m=w;do{if((m.tag&a)===a){var A=m.inst,D=A.destroy;if(D!==void 0){A.destroy=void 0,b=c;var K=d,se=D;try{se()}catch(ue){st(b,K,ue)}}}m=m.next}while(m!==w)}}catch(ue){st(c,c.return,ue)}}function FE(a){var c=a.updateQueue;if(c!==null){var d=a.stateNode;try{Xk(c,d)}catch(m){st(a,a.return,m)}}}function HE(a,c,d){d.props=Uo(a.type,a.memoizedProps),d.state=a.memoizedState;try{d.componentWillUnmount()}catch(m){st(a,c,m)}}function Zu(a,c){try{var d=a.ref;if(d!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof d=="function"?a.refCleanup=d(m):d.current=m}}catch(b){st(a,c,b)}}function dr(a,c){var d=a.ref,m=a.refCleanup;if(d!==null)if(typeof m=="function")try{m()}catch(b){st(a,c,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(b){st(a,c,b)}else d.current=null}function KE(a){var c=a.type,d=a.memoizedProps,m=a.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":d.autoFocus&&m.focus();break e;case"img":d.src?m.src=d.src:d.srcSet&&(m.srcset=d.srcSet)}}catch(b){st(a,a.return,b)}}function fv(a,c,d){try{var m=a.stateNode;OX(m,a.type,d,c),m[an]=c}catch(b){st(a,a.return,b)}}function JE(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Js(a.type)||a.tag===4}function dv(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||JE(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Js(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function hv(a,c,d){var m=a.tag;if(m===5||m===6)a=a.stateNode,c?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(a,c):(c=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,c.appendChild(a),d=d._reactRootContainer,d!=null||c.onclick!==null||(c.onclick=Br));else if(m!==4&&(m===27&&Js(a.type)&&(d=a.stateNode,c=null),a=a.child,a!==null))for(hv(a,c,d),a=a.sibling;a!==null;)hv(a,c,d),a=a.sibling}function Ih(a,c,d){var m=a.tag;if(m===5||m===6)a=a.stateNode,c?d.insertBefore(a,c):d.appendChild(a);else if(m!==4&&(m===27&&Js(a.type)&&(d=a.stateNode),a=a.child,a!==null))for(Ih(a,c,d),a=a.sibling;a!==null;)Ih(a,c,d),a=a.sibling}function eT(a){var c=a.stateNode,d=a.memoizedProps;try{for(var m=a.type,b=c.attributes;b.length;)c.removeAttributeNode(b[0]);en(c,m,d),c[Gt]=a,c[an]=d}catch(w){st(a,a.return,w)}}var Kr=!1,Zt=!1,pv=!1,tT=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function F3(a,c){if(a=a.containerInfo,jv=up,a=hk(a),ay(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var m=d.getSelection&&d.getSelection();if(m&&m.rangeCount!==0){d=m.anchorNode;var b=m.anchorOffset,w=m.focusNode;m=m.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var A=0,D=-1,K=-1,se=0,ue=0,de=a,oe=null;t:for(;;){for(var ae;de!==d||b!==0&&de.nodeType!==3||(D=A+b),de!==w||m!==0&&de.nodeType!==3||(K=A+m),de.nodeType===3&&(A+=de.nodeValue.length),(ae=de.firstChild)!==null;)oe=de,de=ae;for(;;){if(de===a)break t;if(oe===d&&++se===b&&(D=A),oe===w&&++ue===m&&(K=A),(ae=de.nextSibling)!==null)break;de=oe,oe=de.parentNode}de=ae}d=D===-1||K===-1?null:{start:D,end:K}}else d=null}d=d||{start:0,end:0}}else d=null;for(Mv={focusedElem:a,selectionRange:d},up=!1,Wt=c;Wt!==null;)if(c=Wt,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Wt=a;else for(;Wt!==null;){switch(c=Wt,w=c.alternate,a=c.flags,c.tag){case 0:if((a&4)!==0&&(a=c.updateQueue,a=a!==null?a.events:null,a!==null))for(d=0;d<a.length;d++)b=a[d],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&w!==null){a=void 0,d=c,b=w.memoizedProps,w=w.memoizedState,m=d.stateNode;try{var ke=Uo(d.type,b);a=m.getSnapshotBeforeUpdate(ke,w),m.__reactInternalSnapshotBeforeUpdate=a}catch(Pe){st(d,d.return,Pe)}}break;case 3:if((a&1024)!==0){if(a=c.stateNode.containerInfo,d=a.nodeType,d===9)zv(a);else if(d===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":zv(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=c.sibling,a!==null){a.return=c.return,Wt=a;break}Wt=c.return}}function nT(a,c,d){var m=d.flags;switch(d.tag){case 0:case 11:case 15:es(a,d),m&4&&Xu(5,d);break;case 1:if(es(a,d),m&4)if(a=d.stateNode,c===null)try{a.componentDidMount()}catch(A){st(d,d.return,A)}else{var b=Uo(d.type,c.memoizedProps);c=c.memoizedState;try{a.componentDidUpdate(b,c,a.__reactInternalSnapshotBeforeUpdate)}catch(A){st(d,d.return,A)}}m&64&&FE(d),m&512&&Zu(d,d.return);break;case 3:if(es(a,d),m&64&&(a=d.updateQueue,a!==null)){if(c=null,d.child!==null)switch(d.child.tag){case 27:case 5:c=d.child.stateNode;break;case 1:c=d.child.stateNode}try{Xk(a,c)}catch(A){st(d,d.return,A)}}break;case 27:c===null&&m&4&&eT(d);case 26:case 5:es(a,d),c===null&&m&4&&KE(d),m&512&&Zu(d,d.return);break;case 12:es(a,d);break;case 31:es(a,d),m&4&&sT(a,d);break;case 13:es(a,d),m&4&&oT(a,d),m&64&&(a=d.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(d=sX.bind(null,d),EX(a,d))));break;case 22:if(m=d.memoizedState!==null||Kr,!m){c=c!==null&&c.memoizedState!==null||Zt,b=Kr;var w=Zt;Kr=m,(Zt=c)&&!w?ts(a,d,(d.subtreeFlags&8772)!==0):es(a,d),Kr=b,Zt=w}break;case 30:break;default:es(a,d)}}function iT(a){var c=a.alternate;c!==null&&(a.alternate=null,iT(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&cu(c)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var xt=null,Nn=!1;function Jr(a,c,d){for(d=d.child;d!==null;)rT(a,c,d),d=d.sibling}function rT(a,c,d){if(On&&typeof On.onCommitFiberUnmount=="function")try{On.onCommitFiberUnmount(_o,d)}catch{}switch(d.tag){case 26:Zt||dr(d,c),Jr(a,c,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:Zt||dr(d,c);var m=xt,b=Nn;Js(d.type)&&(xt=d.stateNode,Nn=!1),Jr(a,c,d),Fu(d.stateNode),xt=m,Nn=b;break;case 5:Zt||dr(d,c);case 6:if(m=xt,b=Nn,xt=null,Jr(a,c,d),xt=m,Nn=b,xt!==null)if(Nn)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(d.stateNode)}catch(w){st(d,c,w)}else try{xt.removeChild(d.stateNode)}catch(w){st(d,c,w)}break;case 18:xt!==null&&(Nn?(a=xt,FT(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,d.stateNode),Tl(a)):FT(xt,d.stateNode));break;case 4:m=xt,b=Nn,xt=d.stateNode.containerInfo,Nn=!0,Jr(a,c,d),xt=m,Nn=b;break;case 0:case 11:case 14:case 15:Us(2,d,c),Zt||Us(4,d,c),Jr(a,c,d);break;case 1:Zt||(dr(d,c),m=d.stateNode,typeof m.componentWillUnmount=="function"&&HE(d,c,m)),Jr(a,c,d);break;case 21:Jr(a,c,d);break;case 22:Zt=(m=Zt)||d.memoizedState!==null,Jr(a,c,d),Zt=m;break;default:Jr(a,c,d)}}function sT(a,c){if(c.memoizedState===null&&(a=c.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Tl(a)}catch(d){st(c,c.return,d)}}}function oT(a,c){if(c.memoizedState===null&&(a=c.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Tl(a)}catch(d){st(c,c.return,d)}}function H3(a){switch(a.tag){case 31:case 13:case 19:var c=a.stateNode;return c===null&&(c=a.stateNode=new tT),c;case 22:return a=a.stateNode,c=a._retryCache,c===null&&(c=a._retryCache=new tT),c;default:throw Error(i(435,a.tag))}}function Gh(a,c){var d=H3(a);c.forEach(function(m){if(!d.has(m)){d.add(m);var b=oX.bind(null,a,m);m.then(b,b)}})}function Pn(a,c){var d=c.deletions;if(d!==null)for(var m=0;m<d.length;m++){var b=d[m],w=a,A=c,D=A;e:for(;D!==null;){switch(D.tag){case 27:if(Js(D.type)){xt=D.stateNode,Nn=!1;break e}break;case 5:xt=D.stateNode,Nn=!1;break e;case 3:case 4:xt=D.stateNode.containerInfo,Nn=!0;break e}D=D.return}if(xt===null)throw Error(i(160));rT(w,A,b),xt=null,Nn=!1,w=b.alternate,w!==null&&(w.return=null),b.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)aT(c,a),c=c.sibling}var Di=null;function aT(a,c){var d=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Pn(c,a),Rn(a),m&4&&(Us(3,a,a.return),Xu(3,a),Us(5,a,a.return));break;case 1:Pn(c,a),Rn(a),m&512&&(Zt||d===null||dr(d,d.return)),m&64&&Kr&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(d=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=d===null?m:d.concat(m))));break;case 26:var b=Di;if(Pn(c,a),Rn(a),m&512&&(Zt||d===null||dr(d,d.return)),m&4){var w=d!==null?d.memoizedState:null;if(m=a.memoizedState,d===null)if(m===null)if(a.stateNode===null){e:{m=a.type,d=a.memoizedProps,b=b.ownerDocument||b;t:switch(m){case"title":w=b.getElementsByTagName("title")[0],(!w||w[No]||w[Gt]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=b.createElement(m),b.head.insertBefore(w,b.querySelector("head > title"))),en(w,m,d),w[Gt]=a,Lt(w),m=w;break e;case"link":var A=aC("link","href",b).get(m+(d.href||""));if(A){for(var D=0;D<A.length;D++)if(w=A[D],w.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&w.getAttribute("rel")===(d.rel==null?null:d.rel)&&w.getAttribute("title")===(d.title==null?null:d.title)&&w.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){A.splice(D,1);break t}}w=b.createElement(m),en(w,m,d),b.head.appendChild(w);break;case"meta":if(A=aC("meta","content",b).get(m+(d.content||""))){for(D=0;D<A.length;D++)if(w=A[D],w.getAttribute("content")===(d.content==null?null:""+d.content)&&w.getAttribute("name")===(d.name==null?null:d.name)&&w.getAttribute("property")===(d.property==null?null:d.property)&&w.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&w.getAttribute("charset")===(d.charSet==null?null:d.charSet)){A.splice(D,1);break t}}w=b.createElement(m),en(w,m,d),b.head.appendChild(w);break;default:throw Error(i(468,m))}w[Gt]=a,Lt(w),m=w}a.stateNode=m}else lC(b,a.type,a.stateNode);else a.stateNode=oC(b,m,a.memoizedProps);else w!==m?(w===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):w.count--,m===null?lC(b,a.type,a.stateNode):oC(b,m,a.memoizedProps)):m===null&&a.stateNode!==null&&fv(a,a.memoizedProps,d.memoizedProps)}break;case 27:Pn(c,a),Rn(a),m&512&&(Zt||d===null||dr(d,d.return)),d!==null&&m&4&&fv(a,a.memoizedProps,d.memoizedProps);break;case 5:if(Pn(c,a),Rn(a),m&512&&(Zt||d===null||dr(d,d.return)),a.flags&32){b=a.stateNode;try{Wa(b,"")}catch(ke){st(a,a.return,ke)}}m&4&&a.stateNode!=null&&(b=a.memoizedProps,fv(a,b,d!==null?d.memoizedProps:b)),m&1024&&(pv=!0);break;case 6:if(Pn(c,a),Rn(a),m&4){if(a.stateNode===null)throw Error(i(162));m=a.memoizedProps,d=a.stateNode;try{d.nodeValue=m}catch(ke){st(a,a.return,ke)}}break;case 3:if(op=null,b=Di,Di=rp(c.containerInfo),Pn(c,a),Di=b,Rn(a),m&4&&d!==null&&d.memoizedState.isDehydrated)try{Tl(c.containerInfo)}catch(ke){st(a,a.return,ke)}pv&&(pv=!1,lT(a));break;case 4:m=Di,Di=rp(a.stateNode.containerInfo),Pn(c,a),Rn(a),Di=m;break;case 12:Pn(c,a),Rn(a);break;case 31:Pn(c,a),Rn(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gh(a,m)));break;case 13:Pn(c,a),Rn(a),a.child.flags&8192&&a.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Uh=Pt()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gh(a,m)));break;case 22:b=a.memoizedState!==null;var K=d!==null&&d.memoizedState!==null,se=Kr,ue=Zt;if(Kr=se||b,Zt=ue||K,Pn(c,a),Zt=ue,Kr=se,Rn(a),m&8192)e:for(c=a.stateNode,c._visibility=b?c._visibility&-2:c._visibility|1,b&&(d===null||K||Kr||Zt||Yo(a)),d=null,c=a;;){if(c.tag===5||c.tag===26){if(d===null){K=d=c;try{if(w=K.stateNode,b)A=w.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{D=K.stateNode;var de=K.memoizedProps.style,oe=de!=null&&de.hasOwnProperty("display")?de.display:null;D.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(ke){st(K,K.return,ke)}}}else if(c.tag===6){if(d===null){K=c;try{K.stateNode.nodeValue=b?"":K.memoizedProps}catch(ke){st(K,K.return,ke)}}}else if(c.tag===18){if(d===null){K=c;try{var ae=K.stateNode;b?HT(ae,!0):HT(K.stateNode,!1)}catch(ke){st(K,K.return,ke)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===a)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break e;for(;c.sibling===null;){if(c.return===null||c.return===a)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}m&4&&(m=a.updateQueue,m!==null&&(d=m.retryQueue,d!==null&&(m.retryQueue=null,Gh(a,d))));break;case 19:Pn(c,a),Rn(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gh(a,m)));break;case 30:break;case 21:break;default:Pn(c,a),Rn(a)}}function Rn(a){var c=a.flags;if(c&2){try{for(var d,m=a.return;m!==null;){if(JE(m)){d=m;break}m=m.return}if(d==null)throw Error(i(160));switch(d.tag){case 27:var b=d.stateNode,w=dv(a);Ih(a,w,b);break;case 5:var A=d.stateNode;d.flags&32&&(Wa(A,""),d.flags&=-33);var D=dv(a);Ih(a,D,A);break;case 3:case 4:var K=d.stateNode.containerInfo,se=dv(a);hv(a,se,K);break;default:throw Error(i(161))}}catch(ue){st(a,a.return,ue)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function lT(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var c=a;lT(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),a=a.sibling}}function es(a,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)nT(a,c.alternate,c),c=c.sibling}function Yo(a){for(a=a.child;a!==null;){var c=a;switch(c.tag){case 0:case 11:case 14:case 15:Us(4,c,c.return),Yo(c);break;case 1:dr(c,c.return);var d=c.stateNode;typeof d.componentWillUnmount=="function"&&HE(c,c.return,d),Yo(c);break;case 27:Fu(c.stateNode);case 26:case 5:dr(c,c.return),Yo(c);break;case 22:c.memoizedState===null&&Yo(c);break;case 30:Yo(c);break;default:Yo(c)}a=a.sibling}}function ts(a,c,d){for(d=d&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var m=c.alternate,b=a,w=c,A=w.flags;switch(w.tag){case 0:case 11:case 15:ts(b,w,d),Xu(4,w);break;case 1:if(ts(b,w,d),m=w,b=m.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(se){st(m,m.return,se)}if(m=w,b=m.updateQueue,b!==null){var D=m.stateNode;try{var K=b.shared.hiddenCallbacks;if(K!==null)for(b.shared.hiddenCallbacks=null,b=0;b<K.length;b++)zk(K[b],D)}catch(se){st(m,m.return,se)}}d&&A&64&&FE(w),Zu(w,w.return);break;case 27:eT(w);case 26:case 5:ts(b,w,d),d&&m===null&&A&4&&KE(w),Zu(w,w.return);break;case 12:ts(b,w,d);break;case 31:ts(b,w,d),d&&A&4&&sT(b,w);break;case 13:ts(b,w,d),d&&A&4&&oT(b,w);break;case 22:w.memoizedState===null&&ts(b,w,d),Zu(w,w.return);break;case 30:break;default:ts(b,w,d)}c=c.sibling}}function gv(a,c){var d=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),a=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(a=c.memoizedState.cachePool.pool),a!==d&&(a!=null&&a.refCount++,d!=null&&Cu(d))}function mv(a,c){a=null,c.alternate!==null&&(a=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==a&&(c.refCount++,a!=null&&Cu(a))}function zi(a,c,d,m){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)cT(a,c,d,m),c=c.sibling}function cT(a,c,d,m){var b=c.flags;switch(c.tag){case 0:case 11:case 15:zi(a,c,d,m),b&2048&&Xu(9,c);break;case 1:zi(a,c,d,m);break;case 3:zi(a,c,d,m),b&2048&&(a=null,c.alternate!==null&&(a=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==a&&(c.refCount++,a!=null&&Cu(a)));break;case 12:if(b&2048){zi(a,c,d,m),a=c.stateNode;try{var w=c.memoizedProps,A=w.id,D=w.onPostCommit;typeof D=="function"&&D(A,c.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(K){st(c,c.return,K)}}else zi(a,c,d,m);break;case 31:zi(a,c,d,m);break;case 13:zi(a,c,d,m);break;case 23:break;case 22:w=c.stateNode,A=c.alternate,c.memoizedState!==null?w._visibility&2?zi(a,c,d,m):Bu(a,c):w._visibility&2?zi(a,c,d,m):(w._visibility|=2,gl(a,c,d,m,(c.subtreeFlags&10256)!==0||!1)),b&2048&&gv(A,c);break;case 24:zi(a,c,d,m),b&2048&&mv(c.alternate,c);break;default:zi(a,c,d,m)}}function gl(a,c,d,m,b){for(b=b&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var w=a,A=c,D=d,K=m,se=A.flags;switch(A.tag){case 0:case 11:case 15:gl(w,A,D,K,b),Xu(8,A);break;case 23:break;case 22:var ue=A.stateNode;A.memoizedState!==null?ue._visibility&2?gl(w,A,D,K,b):Bu(w,A):(ue._visibility|=2,gl(w,A,D,K,b)),b&&se&2048&&gv(A.alternate,A);break;case 24:gl(w,A,D,K,b),b&&se&2048&&mv(A.alternate,A);break;default:gl(w,A,D,K,b)}c=c.sibling}}function Bu(a,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var d=a,m=c,b=m.flags;switch(m.tag){case 22:Bu(d,m),b&2048&&gv(m.alternate,m);break;case 24:Bu(d,m),b&2048&&mv(m.alternate,m);break;default:Bu(d,m)}c=c.sibling}}var Iu=8192;function ml(a,c,d){if(a.subtreeFlags&Iu)for(a=a.child;a!==null;)uT(a,c,d),a=a.sibling}function uT(a,c,d){switch(a.tag){case 26:ml(a,c,d),a.flags&Iu&&a.memoizedState!==null&&LX(d,Di,a.memoizedState,a.memoizedProps);break;case 5:ml(a,c,d);break;case 3:case 4:var m=Di;Di=rp(a.stateNode.containerInfo),ml(a,c,d),Di=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Iu,Iu=16777216,ml(a,c,d),Iu=m):ml(a,c,d));break;default:ml(a,c,d)}}function fT(a){var c=a.alternate;if(c!==null&&(a=c.child,a!==null)){c.child=null;do c=a.sibling,a.sibling=null,a=c;while(a!==null)}}function Gu(a){var c=a.deletions;if((a.flags&16)!==0){if(c!==null)for(var d=0;d<c.length;d++){var m=c[d];Wt=m,hT(m,a)}fT(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)dT(a),a=a.sibling}function dT(a){switch(a.tag){case 0:case 11:case 15:Gu(a),a.flags&2048&&Us(9,a,a.return);break;case 3:Gu(a);break;case 12:Gu(a);break;case 22:var c=a.stateNode;a.memoizedState!==null&&c._visibility&2&&(a.return===null||a.return.tag!==13)?(c._visibility&=-3,Vh(a)):Gu(a);break;default:Gu(a)}}function Vh(a){var c=a.deletions;if((a.flags&16)!==0){if(c!==null)for(var d=0;d<c.length;d++){var m=c[d];Wt=m,hT(m,a)}fT(a)}for(a=a.child;a!==null;){switch(c=a,c.tag){case 0:case 11:case 15:Us(8,c,c.return),Vh(c);break;case 22:d=c.stateNode,d._visibility&2&&(d._visibility&=-3,Vh(c));break;default:Vh(c)}a=a.sibling}}function hT(a,c){for(;Wt!==null;){var d=Wt;switch(d.tag){case 0:case 11:case 15:Us(8,d,c);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var m=d.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Cu(d.memoizedState.cache)}if(m=d.child,m!==null)m.return=d,Wt=m;else e:for(d=a;Wt!==null;){m=Wt;var b=m.sibling,w=m.return;if(iT(m),m===d){Wt=null;break e}if(b!==null){b.return=w,Wt=b;break e}Wt=w}}}var K3={getCacheForType:function(a){var c=Kt(Dt),d=c.data.get(a);return d===void 0&&(d=a(),c.data.set(a,d)),d},cacheSignal:function(){return Kt(Dt).controller.signal}},J3=typeof WeakMap=="function"?WeakMap:Map,et=0,ht=null,Be=null,Ge=0,rt=0,Fn=null,Ys=!1,Ol=!1,Ov=!1,ns=0,_t=0,qs=0,qo=0,yv=0,Hn=0,yl=0,Vu=null,jn=null,vv=!1,Uh=0,pT=0,Yh=1/0,qh=null,Ws=null,Vt=0,Fs=null,vl=null,is=0,bv=0,xv=null,gT=null,Uu=0,wv=null;function Kn(){return(et&2)!==0&&Ge!==0?Ge&-Ge:L.T!==null?$v():Jd()}function mT(){if(Hn===0)if((Ge&536870912)===0||Ye){var a=Za;Za<<=1,(Za&3932160)===0&&(Za=262144),Hn=a}else Hn=536870912;return a=qn.current,a!==null&&(a.flags|=32),Hn}function Mn(a,c,d){(a===ht&&(rt===2||rt===9)||a.cancelPendingCommit!==null)&&(bl(a,0),Hs(a,Ge,Hn,!1)),Ao(a,d),((et&2)===0||a!==ht)&&(a===ht&&((et&2)===0&&(qo|=d),_t===4&&Hs(a,Ge,Hn,!1)),hr(a))}function OT(a,c,d){if((et&6)!==0)throw Error(i(327));var m=!d&&(c&127)===0&&(c&a.expiredLanes)===0||Qo(a,c),b=m?nX(a,c):kv(a,c,!0),w=m;do{if(b===0){Ol&&!m&&Hs(a,c,0,!1);break}else{if(d=a.current.alternate,w&&!eX(d)){b=kv(a,c,!1),w=!1;continue}if(b===2){if(w=c,a.errorRecoveryDisabledLanes&w)var A=0;else A=a.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){c=A;e:{var D=a;b=Vu;var K=D.current.memoizedState.isDehydrated;if(K&&(bl(D,A).flags|=256),A=kv(D,A,!1),A!==2){if(Ov&&!K){D.errorRecoveryDisabledLanes|=w,qo|=w,b=4;break e}w=jn,jn=b,w!==null&&(jn===null?jn=w:jn.push.apply(jn,w))}b=A}if(w=!1,b!==2)continue}}if(b===1){bl(a,0),Hs(a,c,0,!0);break}e:{switch(m=a,w=b,w){case 0:case 1:throw Error(i(345));case 4:if((c&4194048)!==c)break;case 6:Hs(m,c,Hn,!Ys);break e;case 2:jn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((c&62914560)===c&&(b=Uh+300-Pt(),10<b)){if(Hs(m,c,Hn,!Ys),Ia(m,0,!0)!==0)break e;is=c,m.timeoutHandle=qT(yT.bind(null,m,d,jn,qh,vv,c,Hn,qo,yl,Ys,w,"Throttled",-0,0),b);break e}yT(m,d,jn,qh,vv,c,Hn,qo,yl,Ys,w,null,-0,0)}}break}while(!0);hr(a)}function yT(a,c,d,m,b,w,A,D,K,se,ue,de,oe,ae){if(a.timeoutHandle=-1,de=c.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Br},uT(c,w,de);var ke=(w&62914560)===w?Uh-Pt():(w&4194048)===w?pT-Pt():0;if(ke=DX(de,ke),ke!==null){is=w,a.cancelPendingCommit=ke(TT.bind(null,a,c,w,d,m,b,A,D,K,ue,de,null,oe,ae)),Hs(a,w,A,!se);return}}TT(a,c,w,d,m,b,A,D,K)}function eX(a){for(var c=a;;){var d=c.tag;if((d===0||d===11||d===15)&&c.flags&16384&&(d=c.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var m=0;m<d.length;m++){var b=d[m],w=b.getSnapshot;b=b.value;try{if(!Un(w(),b))return!1}catch{return!1}}if(d=c.child,c.subtreeFlags&16384&&d!==null)d.return=c,c=d;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Hs(a,c,d,m){c&=~yv,c&=~qo,a.suspendedLanes|=c,a.pingedLanes&=~c,m&&(a.warmLanes|=c),m=a.expirationTimes;for(var b=c;0<b;){var w=31-yn(b),A=1<<w;m[w]=-1,b&=~A}d!==0&&Fd(a,d,c)}function Wh(){return(et&6)===0?(Yu(0),!1):!0}function Sv(){if(Be!==null){if(rt===0)var a=Be.return;else a=Be,Ur=zo=null,zy(a),ul=null,_u=0,a=Be;for(;a!==null;)WE(a.alternate,a),a=a.return;Be=null}}function bl(a,c){var d=a.timeoutHandle;d!==-1&&(a.timeoutHandle=-1,bX(d)),d=a.cancelPendingCommit,d!==null&&(a.cancelPendingCommit=null,d()),is=0,Sv(),ht=a,Be=d=Gr(a.current,null),Ge=c,rt=0,Fn=null,Ys=!1,Ol=Qo(a,c),Ov=!1,yl=Hn=yv=qo=qs=_t=0,jn=Vu=null,vv=!1,(c&8)!==0&&(c|=c&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=c;0<m;){var b=31-yn(m),w=1<<b;c|=a[b],m&=~w}return ns=c,mh(),d}function vT(a,c){ze=null,L.H=Lu,c===cl||c===kh?(c=jk(),rt=3):c===Cy?(c=jk(),rt=4):rt=c===tv?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Fn=c,Be===null&&(_t=1,Dh(a,di(c,a.current)))}function bT(){var a=qn.current;return a===null?!0:(Ge&4194048)===Ge?mi===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?a===mi:!1}function xT(){var a=L.H;return L.H=Lu,a===null?Lu:a}function wT(){var a=L.A;return L.A=K3,a}function Fh(){_t=4,Ys||(Ge&4194048)!==Ge&&qn.current!==null||(Ol=!0),(qs&134217727)===0&&(qo&134217727)===0||ht===null||Hs(ht,Ge,Hn,!1)}function kv(a,c,d){var m=et;et|=2;var b=xT(),w=wT();(ht!==a||Ge!==c)&&(qh=null,bl(a,c)),c=!1;var A=_t;e:do try{if(rt!==0&&Be!==null){var D=Be,K=Fn;switch(rt){case 8:Sv(),A=6;break e;case 3:case 2:case 9:case 6:qn.current===null&&(c=!0);var se=rt;if(rt=0,Fn=null,xl(a,D,K,se),d&&Ol){A=0;break e}break;default:se=rt,rt=0,Fn=null,xl(a,D,K,se)}}tX(),A=_t;break}catch(ue){vT(a,ue)}while(!0);return c&&a.shellSuspendCounter++,Ur=zo=null,et=m,L.H=b,L.A=w,Be===null&&(ht=null,Ge=0,mh()),A}function tX(){for(;Be!==null;)ST(Be)}function nX(a,c){var d=et;et|=2;var m=xT(),b=wT();ht!==a||Ge!==c?(qh=null,Yh=Pt()+500,bl(a,c)):Ol=Qo(a,c);e:do try{if(rt!==0&&Be!==null){c=Be;var w=Fn;t:switch(rt){case 1:rt=0,Fn=null,xl(a,c,w,1);break;case 2:case 9:if(Pk(w)){rt=0,Fn=null,kT(c);break}c=function(){rt!==2&&rt!==9||ht!==a||(rt=7),hr(a)},w.then(c,c);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:Pk(w)?(rt=0,Fn=null,kT(c)):(rt=0,Fn=null,xl(a,c,w,7));break;case 5:var A=null;switch(Be.tag){case 26:A=Be.memoizedState;case 5:case 27:var D=Be;if(A?cC(A):D.stateNode.complete){rt=0,Fn=null;var K=D.sibling;if(K!==null)Be=K;else{var se=D.return;se!==null?(Be=se,Hh(se)):Be=null}break t}}rt=0,Fn=null,xl(a,c,w,5);break;case 6:rt=0,Fn=null,xl(a,c,w,6);break;case 8:Sv(),_t=6;break e;default:throw Error(i(462))}}iX();break}catch(ue){vT(a,ue)}while(!0);return Ur=zo=null,L.H=m,L.A=b,et=d,Be!==null?0:(ht=null,Ge=0,mh(),_t)}function iX(){for(;Be!==null&&!$o();)ST(Be)}function ST(a){var c=YE(a.alternate,a,ns);a.memoizedProps=a.pendingProps,c===null?Hh(a):Be=c}function kT(a){var c=a,d=c.alternate;switch(c.tag){case 15:case 0:c=ZE(d,c,c.pendingProps,c.type,void 0,Ge);break;case 11:c=ZE(d,c,c.pendingProps,c.type.render,c.ref,Ge);break;case 5:zy(c);default:WE(d,c),c=Be=wk(c,ns),c=YE(d,c,ns)}a.memoizedProps=a.pendingProps,c===null?Hh(a):Be=c}function xl(a,c,d,m){Ur=zo=null,zy(c),ul=null,_u=0;var b=c.return;try{if(V3(a,b,c,d,Ge)){_t=1,Dh(a,di(d,a.current)),Be=null;return}}catch(w){if(b!==null)throw Be=b,w;_t=1,Dh(a,di(d,a.current)),Be=null;return}c.flags&32768?(Ye||m===1?a=!0:Ol||(Ge&536870912)!==0?a=!1:(Ys=a=!0,(m===2||m===9||m===3||m===6)&&(m=qn.current,m!==null&&m.tag===13&&(m.flags|=16384))),ET(c,a)):Hh(c)}function Hh(a){var c=a;do{if((c.flags&32768)!==0){ET(c,Ys);return}a=c.return;var d=q3(c.alternate,c,ns);if(d!==null){Be=d;return}if(c=c.sibling,c!==null){Be=c;return}Be=c=a}while(c!==null);_t===0&&(_t=5)}function ET(a,c){do{var d=W3(a.alternate,a);if(d!==null){d.flags&=32767,Be=d;return}if(d=a.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!c&&(a=a.sibling,a!==null)){Be=a;return}Be=a=d}while(a!==null);_t=6,Be=null}function TT(a,c,d,m,b,w,A,D,K){a.cancelPendingCommit=null;do Kh();while(Vt!==0);if((et&6)!==0)throw Error(i(327));if(c!==null){if(c===a.current)throw Error(i(177));if(w=c.lanes|c.childLanes,w|=dy,IO(a,d,w,A,D,K),a===ht&&(Be=ht=null,Ge=0),vl=c,Fs=a,is=d,bv=w,xv=b,gT=m,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,aX(ui,function(){return AT(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||m){m=L.T,L.T=null,b=I.p,I.p=2,A=et,et|=4;try{F3(a,c,d)}finally{et=A,I.p=b,L.T=m}}Vt=1,CT(),$T(),_T()}}function CT(){if(Vt===1){Vt=0;var a=Fs,c=vl,d=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||d){d=L.T,L.T=null;var m=I.p;I.p=2;var b=et;et|=4;try{aT(c,a);var w=Mv,A=hk(a.containerInfo),D=w.focusedElem,K=w.selectionRange;if(A!==D&&D&&D.ownerDocument&&dk(D.ownerDocument.documentElement,D)){if(K!==null&&ay(D)){var se=K.start,ue=K.end;if(ue===void 0&&(ue=se),"selectionStart"in D)D.selectionStart=se,D.selectionEnd=Math.min(ue,D.value.length);else{var de=D.ownerDocument||document,oe=de&&de.defaultView||window;if(oe.getSelection){var ae=oe.getSelection(),ke=D.textContent.length,Pe=Math.min(K.start,ke),ft=K.end===void 0?Pe:Math.min(K.end,ke);!ae.extend&&Pe>ft&&(A=ft,ft=Pe,Pe=A);var ie=fk(D,Pe),ee=fk(D,ft);if(ie&&ee&&(ae.rangeCount!==1||ae.anchorNode!==ie.node||ae.anchorOffset!==ie.offset||ae.focusNode!==ee.node||ae.focusOffset!==ee.offset)){var re=de.createRange();re.setStart(ie.node,ie.offset),ae.removeAllRanges(),Pe>ft?(ae.addRange(re),ae.extend(ee.node,ee.offset)):(re.setEnd(ee.node,ee.offset),ae.addRange(re))}}}}for(de=[],ae=D;ae=ae.parentNode;)ae.nodeType===1&&de.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<de.length;D++){var fe=de[D];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}up=!!jv,Mv=jv=null}finally{et=b,I.p=m,L.T=d}}a.current=c,Vt=2}}function $T(){if(Vt===2){Vt=0;var a=Fs,c=vl,d=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||d){d=L.T,L.T=null;var m=I.p;I.p=2;var b=et;et|=4;try{nT(a,c.alternate,c)}finally{et=b,I.p=m,L.T=d}}Vt=3}}function _T(){if(Vt===4||Vt===3){Vt=0,Dr();var a=Fs,c=vl,d=is,m=gT;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Vt=5:(Vt=0,vl=Fs=null,QT(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(Ws=null),lu(d),c=c.stateNode,On&&typeof On.onCommitFiberRoot=="function")try{On.onCommitFiberRoot(_o,c,void 0,(c.current.flags&128)===128)}catch{}if(m!==null){c=L.T,b=I.p,I.p=2,L.T=null;try{for(var w=a.onRecoverableError,A=0;A<m.length;A++){var D=m[A];w(D.value,{componentStack:D.stack})}}finally{L.T=c,I.p=b}}(is&3)!==0&&Kh(),hr(a),b=a.pendingLanes,(d&261930)!==0&&(b&42)!==0?a===wv?Uu++:(Uu=0,wv=a):Uu=0,Yu(0)}}function QT(a,c){(a.pooledCacheLanes&=c)===0&&(c=a.pooledCache,c!=null&&(a.pooledCache=null,Cu(c)))}function Kh(){return CT(),$T(),_T(),AT()}function AT(){if(Vt!==5)return!1;var a=Fs,c=bv;bv=0;var d=lu(is),m=L.T,b=I.p;try{I.p=32>d?32:d,L.T=null,d=xv,xv=null;var w=Fs,A=is;if(Vt=0,vl=Fs=null,is=0,(et&6)!==0)throw Error(i(331));var D=et;if(et|=4,dT(w.current),cT(w,w.current,A,d),et=D,Yu(0,!1),On&&typeof On.onPostCommitFiberRoot=="function")try{On.onPostCommitFiberRoot(_o,w)}catch{}return!0}finally{I.p=b,L.T=m,QT(a,c)}}function NT(a,c,d){c=di(d,c),c=ev(a.stateNode,c,2),a=Is(a,c,2),a!==null&&(Ao(a,2),hr(a))}function st(a,c,d){if(a.tag===3)NT(a,a,d);else for(;c!==null;){if(c.tag===3){NT(c,a,d);break}else if(c.tag===1){var m=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Ws===null||!Ws.has(m))){a=di(d,a),d=PE(2),m=Is(c,d,2),m!==null&&(RE(d,m,c,a),Ao(m,2),hr(m));break}}c=c.return}}function Ev(a,c,d){var m=a.pingCache;if(m===null){m=a.pingCache=new J3;var b=new Set;m.set(c,b)}else b=m.get(c),b===void 0&&(b=new Set,m.set(c,b));b.has(d)||(Ov=!0,b.add(d),a=rX.bind(null,a,c,d),c.then(a,a))}function rX(a,c,d){var m=a.pingCache;m!==null&&m.delete(c),a.pingedLanes|=a.suspendedLanes&d,a.warmLanes&=~d,ht===a&&(Ge&d)===d&&(_t===4||_t===3&&(Ge&62914560)===Ge&&300>Pt()-Uh?(et&2)===0&&bl(a,0):yv|=d,yl===Ge&&(yl=0)),hr(a)}function PT(a,c){c===0&&(c=Wd()),a=Mo(a,c),a!==null&&(Ao(a,c),hr(a))}function sX(a){var c=a.memoizedState,d=0;c!==null&&(d=c.retryLane),PT(a,d)}function oX(a,c){var d=0;switch(a.tag){case 31:case 13:var m=a.stateNode,b=a.memoizedState;b!==null&&(d=b.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(i(314))}m!==null&&m.delete(c),PT(a,d)}function aX(a,c){return $n(a,c)}var Jh=null,wl=null,Tv=!1,ep=!1,Cv=!1,Ks=0;function hr(a){a!==wl&&a.next===null&&(wl===null?Jh=wl=a:wl=wl.next=a),ep=!0,Tv||(Tv=!0,cX())}function Yu(a,c){if(!Cv&&ep){Cv=!0;do for(var d=!1,m=Jh;m!==null;){if(a!==0){var b=m.pendingLanes;if(b===0)var w=0;else{var A=m.suspendedLanes,D=m.pingedLanes;w=(1<<31-yn(42|a)+1)-1,w&=b&~(A&~D),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,LT(m,w))}else w=Ge,w=Ia(m,m===ht?w:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(w&3)===0||Qo(m,w)||(d=!0,LT(m,w));m=m.next}while(d);Cv=!1}}function lX(){RT()}function RT(){ep=Tv=!1;var a=0;Ks!==0&&vX()&&(a=Ks);for(var c=Pt(),d=null,m=Jh;m!==null;){var b=m.next,w=jT(m,c);w===0?(m.next=null,d===null?Jh=b:d.next=b,b===null&&(wl=d)):(d=m,(a!==0||(w&3)!==0)&&(ep=!0)),m=b}Vt!==0&&Vt!==5||Yu(a),Ks!==0&&(Ks=0)}function jT(a,c){for(var d=a.suspendedLanes,m=a.pingedLanes,b=a.expirationTimes,w=a.pendingLanes&-62914561;0<w;){var A=31-yn(w),D=1<<A,K=b[A];K===-1?((D&d)===0||(D&m)!==0)&&(b[A]=BO(D,c)):K<=c&&(a.expiredLanes|=D),w&=~D}if(c=ht,d=Ge,d=Ia(a,a===c?d:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,d===0||a===c&&(rt===2||rt===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Gn(m),a.callbackNode=null,a.callbackPriority=0;if((d&3)===0||Qo(a,d)){if(c=d&-d,c===a.callbackPriority)return c;switch(m!==null&&Gn(m),lu(d)){case 2:case 8:d=ci;break;case 32:d=ui;break;case 268435456:d=za;break;default:d=ui}return m=MT.bind(null,a),d=$n(d,m),a.callbackPriority=c,a.callbackNode=d,c}return m!==null&&m!==null&&Gn(m),a.callbackPriority=2,a.callbackNode=null,2}function MT(a,c){if(Vt!==0&&Vt!==5)return a.callbackNode=null,a.callbackPriority=0,null;var d=a.callbackNode;if(Kh()&&a.callbackNode!==d)return null;var m=Ge;return m=Ia(a,a===ht?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(OT(a,m,c),jT(a,Pt()),a.callbackNode!=null&&a.callbackNode===d?MT.bind(null,a):null)}function LT(a,c){if(Kh())return null;OT(a,c,!0)}function cX(){xX(function(){(et&6)!==0?$n(li,lX):RT()})}function $v(){if(Ks===0){var a=al;a===0&&(a=Xa,Xa<<=1,(Xa&261888)===0&&(Xa=256)),Ks=a}return Ks}function DT(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:lh(""+a)}function zT(a,c){var d=c.ownerDocument.createElement("input");return d.name=c.name,d.value=c.value,a.id&&d.setAttribute("form",a.id),c.parentNode.insertBefore(d,c),a=new FormData(a),d.parentNode.removeChild(d),a}function uX(a,c,d,m,b){if(c==="submit"&&d&&d.stateNode===b){var w=DT((b[an]||null).action),A=m.submitter;A&&(c=(c=A[an]||null)?DT(c.formAction):A.getAttribute("formAction"),c!==null&&(w=c,A=null));var D=new dh("action","action",null,m,b);a.push({event:D,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Ks!==0){var K=A?zT(b,A):new FormData(b);qy(d,{pending:!0,data:K,method:b.method,action:w},null,K)}}else typeof w=="function"&&(D.preventDefault(),K=A?zT(b,A):new FormData(b),qy(d,{pending:!0,data:K,method:b.method,action:w},w,K))},currentTarget:b}]})}}for(var _v=0;_v<fy.length;_v++){var Qv=fy[_v],fX=Qv.toLowerCase(),dX=Qv[0].toUpperCase()+Qv.slice(1);Li(fX,"on"+dX)}Li(mk,"onAnimationEnd"),Li(Ok,"onAnimationIteration"),Li(yk,"onAnimationStart"),Li("dblclick","onDoubleClick"),Li("focusin","onFocus"),Li("focusout","onBlur"),Li($3,"onTransitionRun"),Li(_3,"onTransitionStart"),Li(Q3,"onTransitionCancel"),Li(vk,"onTransitionEnd"),Rs("onMouseEnter",["mouseout","mouseover"]),Rs("onMouseLeave",["mouseout","mouseover"]),Rs("onPointerEnter",["pointerout","pointerover"]),Rs("onPointerLeave",["pointerout","pointerover"]),Zr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),hX=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qu));function XT(a,c){c=(c&4)!==0;for(var d=0;d<a.length;d++){var m=a[d],b=m.event;m=m.listeners;e:{var w=void 0;if(c)for(var A=m.length-1;0<=A;A--){var D=m[A],K=D.instance,se=D.currentTarget;if(D=D.listener,K!==w&&b.isPropagationStopped())break e;w=D,b.currentTarget=se;try{w(b)}catch(ue){gh(ue)}b.currentTarget=null,w=K}else for(A=0;A<m.length;A++){if(D=m[A],K=D.instance,se=D.currentTarget,D=D.listener,K!==w&&b.isPropagationStopped())break e;w=D,b.currentTarget=se;try{w(b)}catch(ue){gh(ue)}b.currentTarget=null,w=K}}}}function Ie(a,c){var d=c[Ga];d===void 0&&(d=c[Ga]=new Set);var m=a+"__bubble";d.has(m)||(ZT(c,a,2,!1),d.add(m))}function Av(a,c,d){var m=0;c&&(m|=4),ZT(d,a,m,c)}var tp="_reactListening"+Math.random().toString(36).slice(2);function Nv(a){if(!a[tp]){a[tp]=!0,ih.forEach(function(d){d!=="selectionchange"&&(hX.has(d)||Av(d,!1,a),Av(d,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[tp]||(c[tp]=!0,Av("selectionchange",!1,c))}}function ZT(a,c,d,m){switch(mC(c)){case 2:var b=ZX;break;case 8:b=BX;break;default:b=Yv}d=b.bind(null,c,d,a),b=void 0,!KO||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(b=!0),m?b!==void 0?a.addEventListener(c,d,{capture:!0,passive:b}):a.addEventListener(c,d,!0):b!==void 0?a.addEventListener(c,d,{passive:b}):a.addEventListener(c,d,!1)}function Pv(a,c,d,m,b){var w=m;if((c&1)===0&&(c&2)===0&&m!==null)e:for(;;){if(m===null)return;var A=m.tag;if(A===3||A===4){var D=m.stateNode.containerInfo;if(D===b)break;if(A===4)for(A=m.return;A!==null;){var K=A.tag;if((K===3||K===4)&&A.stateNode.containerInfo===b)return;A=A.return}for(;D!==null;){if(A=Qs(D),A===null)return;if(K=A.tag,K===5||K===6||K===26||K===27){m=w=A;continue e}D=D.parentNode}}m=m.return}US(function(){var se=w,ue=FO(d),de=[];e:{var oe=bk.get(a);if(oe!==void 0){var ae=dh,ke=a;switch(a){case"keypress":if(uh(d)===0)break e;case"keydown":case"keyup":ae=o3;break;case"focusin":ke="focus",ae=ny;break;case"focusout":ke="blur",ae=ny;break;case"beforeblur":case"afterblur":ae=ny;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=WS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=qz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=c3;break;case mk:case Ok:case yk:ae=Hz;break;case vk:ae=f3;break;case"scroll":case"scrollend":ae=Uz;break;case"wheel":ae=h3;break;case"copy":case"cut":case"paste":ae=Jz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=HS;break;case"toggle":case"beforetoggle":ae=g3}var Pe=(c&4)!==0,ft=!Pe&&(a==="scroll"||a==="scrollend"),ie=Pe?oe!==null?oe+"Capture":null:oe;Pe=[];for(var ee=se,re;ee!==null;){var fe=ee;if(re=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||re===null||ie===null||(fe=mu(ee,ie),fe!=null&&Pe.push(Wu(ee,fe,re))),ft)break;ee=ee.return}0<Pe.length&&(oe=new ae(oe,ke,null,d,ue),de.push({event:oe,listeners:Pe}))}}if((c&7)===0){e:{if(oe=a==="mouseover"||a==="pointerover",ae=a==="mouseout"||a==="pointerout",oe&&d!==WO&&(ke=d.relatedTarget||d.fromElement)&&(Qs(ke)||ke[Xr]))break e;if((ae||oe)&&(oe=ue.window===ue?ue:(oe=ue.ownerDocument)?oe.defaultView||oe.parentWindow:window,ae?(ke=d.relatedTarget||d.toElement,ae=se,ke=ke?Qs(ke):null,ke!==null&&(ft=s(ke),Pe=ke.tag,ke!==ft||Pe!==5&&Pe!==27&&Pe!==6)&&(ke=null)):(ae=null,ke=se),ae!==ke)){if(Pe=WS,fe="onMouseLeave",ie="onMouseEnter",ee="mouse",(a==="pointerout"||a==="pointerover")&&(Pe=HS,fe="onPointerLeave",ie="onPointerEnter",ee="pointer"),ft=ae==null?oe:Ns(ae),re=ke==null?oe:Ns(ke),oe=new Pe(fe,ee+"leave",ae,d,ue),oe.target=ft,oe.relatedTarget=re,fe=null,Qs(ue)===se&&(Pe=new Pe(ie,ee+"enter",ke,d,ue),Pe.target=re,Pe.relatedTarget=ft,fe=Pe),ft=fe,ae&&ke)t:{for(Pe=pX,ie=ae,ee=ke,re=0,fe=ie;fe;fe=Pe(fe))re++;fe=0;for(var Qe=ee;Qe;Qe=Pe(Qe))fe++;for(;0<re-fe;)ie=Pe(ie),re--;for(;0<fe-re;)ee=Pe(ee),fe--;for(;re--;){if(ie===ee||ee!==null&&ie===ee.alternate){Pe=ie;break t}ie=Pe(ie),ee=Pe(ee)}Pe=null}else Pe=null;ae!==null&&BT(de,oe,ae,Pe,!1),ke!==null&&ft!==null&&BT(de,ft,ke,Pe,!0)}}e:{if(oe=se?Ns(se):window,ae=oe.nodeName&&oe.nodeName.toLowerCase(),ae==="select"||ae==="input"&&oe.type==="file")var He=sk;else if(ik(oe))if(ok)He=E3;else{He=S3;var Te=w3}else ae=oe.nodeName,!ae||ae.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?se&&qO(se.elementType)&&(He=sk):He=k3;if(He&&(He=He(a,se))){rk(de,He,d,ue);break e}Te&&Te(a,oe,se),a==="focusout"&&se&&oe.type==="number"&&se.memoizedProps.value!=null&&pu(oe,"number",oe.value)}switch(Te=se?Ns(se):window,a){case"focusin":(ik(Te)||Te.contentEditable==="true")&&(Ja=Te,ly=se,ku=null);break;case"focusout":ku=ly=Ja=null;break;case"mousedown":cy=!0;break;case"contextmenu":case"mouseup":case"dragend":cy=!1,pk(de,d,ue);break;case"selectionchange":if(C3)break;case"keydown":case"keyup":pk(de,d,ue)}var Ze;if(ry)e:{switch(a){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Ka?tk(a,d)&&(Ve="onCompositionEnd"):a==="keydown"&&d.keyCode===229&&(Ve="onCompositionStart");Ve&&(KS&&d.locale!=="ko"&&(Ka||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Ka&&(Ze=YS()):(Ms=ue,JO="value"in Ms?Ms.value:Ms.textContent,Ka=!0)),Te=np(se,Ve),0<Te.length&&(Ve=new FS(Ve,a,null,d,ue),de.push({event:Ve,listeners:Te}),Ze?Ve.data=Ze:(Ze=nk(d),Ze!==null&&(Ve.data=Ze)))),(Ze=O3?y3(a,d):v3(a,d))&&(Ve=np(se,"onBeforeInput"),0<Ve.length&&(Te=new FS("onBeforeInput","beforeinput",null,d,ue),de.push({event:Te,listeners:Ve}),Te.data=Ze)),uX(de,a,se,d,ue)}XT(de,c)})}function Wu(a,c,d){return{instance:a,listener:c,currentTarget:d}}function np(a,c){for(var d=c+"Capture",m=[];a!==null;){var b=a,w=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||w===null||(b=mu(a,d),b!=null&&m.unshift(Wu(a,b,w)),b=mu(a,c),b!=null&&m.push(Wu(a,b,w))),a.tag===3)return m;a=a.return}return[]}function pX(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function BT(a,c,d,m,b){for(var w=c._reactName,A=[];d!==null&&d!==m;){var D=d,K=D.alternate,se=D.stateNode;if(D=D.tag,K!==null&&K===m)break;D!==5&&D!==26&&D!==27||se===null||(K=se,b?(se=mu(d,w),se!=null&&A.unshift(Wu(d,se,K))):b||(se=mu(d,w),se!=null&&A.push(Wu(d,se,K)))),d=d.return}A.length!==0&&a.push({event:c,listeners:A})}var gX=/\r\n?/g,mX=/\u0000|\uFFFD/g;function IT(a){return(typeof a=="string"?a:""+a).replace(gX,`
`).replace(mX,"")}function GT(a,c){return c=IT(c),IT(a)===c}function ut(a,c,d,m,b,w){switch(d){case"children":typeof m=="string"?c==="body"||c==="textarea"&&m===""||Wa(a,m):(typeof m=="number"||typeof m=="bigint")&&c!=="body"&&Wa(a,""+m);break;case"className":Ua(a,"class",m);break;case"tabIndex":Ua(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Ua(a,d,m);break;case"style":GS(a,m,w);break;case"data":if(c!=="object"){Ua(a,"data",m);break}case"src":case"href":if(m===""&&(c!=="a"||d!=="href")){a.removeAttribute(d);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(d);break}m=lh(""+m),a.setAttribute(d,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(d==="formAction"?(c!=="input"&&ut(a,c,"name",b.name,b,null),ut(a,c,"formEncType",b.formEncType,b,null),ut(a,c,"formMethod",b.formMethod,b,null),ut(a,c,"formTarget",b.formTarget,b,null)):(ut(a,c,"encType",b.encType,b,null),ut(a,c,"method",b.method,b,null),ut(a,c,"target",b.target,b,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(d);break}m=lh(""+m),a.setAttribute(d,m);break;case"onClick":m!=null&&(a.onclick=Br);break;case"onScroll":m!=null&&Ie("scroll",a);break;case"onScrollEnd":m!=null&&Ie("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(d=m.__html,d!=null){if(b.children!=null)throw Error(i(60));a.innerHTML=d}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}d=lh(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(d,""+m):a.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(d,""):a.removeAttribute(d);break;case"capture":case"download":m===!0?a.setAttribute(d,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(d,m):a.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(d,m):a.removeAttribute(d);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(d):a.setAttribute(d,m);break;case"popover":Ie("beforetoggle",a),Ie("toggle",a),Va(a,"popover",m);break;case"xlinkActuate":Mi(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Mi(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Mi(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Mi(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Mi(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Mi(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Mi(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Mi(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Mi(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Va(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=Gz.get(d)||d,Va(a,d,m))}}function Rv(a,c,d,m,b,w){switch(d){case"style":GS(a,m,w);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(d=m.__html,d!=null){if(b.children!=null)throw Error(i(60));a.innerHTML=d}}break;case"children":typeof m=="string"?Wa(a,m):(typeof m=="number"||typeof m=="bigint")&&Wa(a,""+m);break;case"onScroll":m!=null&&Ie("scroll",a);break;case"onScrollEnd":m!=null&&Ie("scrollend",a);break;case"onClick":m!=null&&(a.onclick=Br);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!rh.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(b=d.endsWith("Capture"),c=d.slice(2,b?d.length-7:void 0),w=a[an]||null,w=w!=null?w[d]:null,typeof w=="function"&&a.removeEventListener(c,w,b),typeof m=="function")){typeof w!="function"&&w!==null&&(d in a?a[d]=null:a.hasAttribute(d)&&a.removeAttribute(d)),a.addEventListener(c,m,b);break e}d in a?a[d]=m:m===!0?a.setAttribute(d,""):Va(a,d,m)}}}function en(a,c,d){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",a),Ie("load",a);var m=!1,b=!1,w;for(w in d)if(d.hasOwnProperty(w)){var A=d[w];if(A!=null)switch(w){case"src":m=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,c));default:ut(a,c,w,A,d,null)}}b&&ut(a,c,"srcSet",d.srcSet,d,null),m&&ut(a,c,"src",d.src,d,null);return;case"input":Ie("invalid",a);var D=w=A=b=null,K=null,se=null;for(m in d)if(d.hasOwnProperty(m)){var ue=d[m];if(ue!=null)switch(m){case"name":b=ue;break;case"type":A=ue;break;case"checked":K=ue;break;case"defaultChecked":se=ue;break;case"value":w=ue;break;case"defaultValue":D=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(i(137,c));break;default:ut(a,c,m,ue,d,null)}}qa(a,w,D,K,se,A,b,!1);return;case"select":Ie("invalid",a),m=A=w=null;for(b in d)if(d.hasOwnProperty(b)&&(D=d[b],D!=null))switch(b){case"value":w=D;break;case"defaultValue":A=D;break;case"multiple":m=D;default:ut(a,c,b,D,d,null)}c=w,d=A,a.multiple=!!m,c!=null?js(a,!!m,c,!1):d!=null&&js(a,!!m,d,!0);return;case"textarea":Ie("invalid",a),w=b=m=null;for(A in d)if(d.hasOwnProperty(A)&&(D=d[A],D!=null))switch(A){case"value":m=D;break;case"defaultValue":b=D;break;case"children":w=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(i(91));break;default:ut(a,c,A,D,d,null)}BS(a,m,b,w);return;case"option":for(K in d)if(d.hasOwnProperty(K)&&(m=d[K],m!=null))switch(K){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:ut(a,c,K,m,d,null)}return;case"dialog":Ie("beforetoggle",a),Ie("toggle",a),Ie("cancel",a),Ie("close",a);break;case"iframe":case"object":Ie("load",a);break;case"video":case"audio":for(m=0;m<qu.length;m++)Ie(qu[m],a);break;case"image":Ie("error",a),Ie("load",a);break;case"details":Ie("toggle",a);break;case"embed":case"source":case"link":Ie("error",a),Ie("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in d)if(d.hasOwnProperty(se)&&(m=d[se],m!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,c));default:ut(a,c,se,m,d,null)}return;default:if(qO(c)){for(ue in d)d.hasOwnProperty(ue)&&(m=d[ue],m!==void 0&&Rv(a,c,ue,m,d,void 0));return}}for(D in d)d.hasOwnProperty(D)&&(m=d[D],m!=null&&ut(a,c,D,m,d,null))}function OX(a,c,d,m){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,w=null,A=null,D=null,K=null,se=null,ue=null;for(ae in d){var de=d[ae];if(d.hasOwnProperty(ae)&&de!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":K=de;default:m.hasOwnProperty(ae)||ut(a,c,ae,null,m,de)}}for(var oe in m){var ae=m[oe];if(de=d[oe],m.hasOwnProperty(oe)&&(ae!=null||de!=null))switch(oe){case"type":w=ae;break;case"name":b=ae;break;case"checked":se=ae;break;case"defaultChecked":ue=ae;break;case"value":A=ae;break;case"defaultValue":D=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(i(137,c));break;default:ae!==de&&ut(a,c,oe,ae,m,de)}}hu(a,A,D,K,se,ue,w,b);return;case"select":ae=A=D=oe=null;for(w in d)if(K=d[w],d.hasOwnProperty(w)&&K!=null)switch(w){case"value":break;case"multiple":ae=K;default:m.hasOwnProperty(w)||ut(a,c,w,null,m,K)}for(b in m)if(w=m[b],K=d[b],m.hasOwnProperty(b)&&(w!=null||K!=null))switch(b){case"value":oe=w;break;case"defaultValue":D=w;break;case"multiple":A=w;default:w!==K&&ut(a,c,b,w,m,K)}c=D,d=A,m=ae,oe!=null?js(a,!!d,oe,!1):!!m!=!!d&&(c!=null?js(a,!!d,c,!0):js(a,!!d,d?[]:"",!1));return;case"textarea":ae=oe=null;for(D in d)if(b=d[D],d.hasOwnProperty(D)&&b!=null&&!m.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:ut(a,c,D,null,m,b)}for(A in m)if(b=m[A],w=d[A],m.hasOwnProperty(A)&&(b!=null||w!=null))switch(A){case"value":oe=b;break;case"defaultValue":ae=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(i(91));break;default:b!==w&&ut(a,c,A,b,m,w)}gu(a,oe,ae);return;case"option":for(var ke in d)if(oe=d[ke],d.hasOwnProperty(ke)&&oe!=null&&!m.hasOwnProperty(ke))switch(ke){case"selected":a.selected=!1;break;default:ut(a,c,ke,null,m,oe)}for(K in m)if(oe=m[K],ae=d[K],m.hasOwnProperty(K)&&oe!==ae&&(oe!=null||ae!=null))switch(K){case"selected":a.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:ut(a,c,K,oe,m,ae)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Pe in d)oe=d[Pe],d.hasOwnProperty(Pe)&&oe!=null&&!m.hasOwnProperty(Pe)&&ut(a,c,Pe,null,m,oe);for(se in m)if(oe=m[se],ae=d[se],m.hasOwnProperty(se)&&oe!==ae&&(oe!=null||ae!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(i(137,c));break;default:ut(a,c,se,oe,m,ae)}return;default:if(qO(c)){for(var ft in d)oe=d[ft],d.hasOwnProperty(ft)&&oe!==void 0&&!m.hasOwnProperty(ft)&&Rv(a,c,ft,void 0,m,oe);for(ue in m)oe=m[ue],ae=d[ue],!m.hasOwnProperty(ue)||oe===ae||oe===void 0&&ae===void 0||Rv(a,c,ue,oe,m,ae);return}}for(var ie in d)oe=d[ie],d.hasOwnProperty(ie)&&oe!=null&&!m.hasOwnProperty(ie)&&ut(a,c,ie,null,m,oe);for(de in m)oe=m[de],ae=d[de],!m.hasOwnProperty(de)||oe===ae||oe==null&&ae==null||ut(a,c,de,oe,m,ae)}function VT(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function yX(){if(typeof performance.getEntriesByType=="function"){for(var a=0,c=0,d=performance.getEntriesByType("resource"),m=0;m<d.length;m++){var b=d[m],w=b.transferSize,A=b.initiatorType,D=b.duration;if(w&&D&&VT(A)){for(A=0,D=b.responseEnd,m+=1;m<d.length;m++){var K=d[m],se=K.startTime;if(se>D)break;var ue=K.transferSize,de=K.initiatorType;ue&&VT(de)&&(K=K.responseEnd,A+=ue*(K<D?1:(D-se)/(K-se)))}if(--m,c+=8*(w+A)/(b.duration/1e3),a++,10<a)break}}if(0<a)return c/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var jv=null,Mv=null;function ip(a){return a.nodeType===9?a:a.ownerDocument}function UT(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function YT(a,c){if(a===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&c==="foreignObject"?0:a}function Lv(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Dv=null;function vX(){var a=window.event;return a&&a.type==="popstate"?a===Dv?!1:(Dv=a,!0):(Dv=null,!1)}var qT=typeof setTimeout=="function"?setTimeout:void 0,bX=typeof clearTimeout=="function"?clearTimeout:void 0,WT=typeof Promise=="function"?Promise:void 0,xX=typeof queueMicrotask=="function"?queueMicrotask:typeof WT<"u"?function(a){return WT.resolve(null).then(a).catch(wX)}:qT;function wX(a){setTimeout(function(){throw a})}function Js(a){return a==="head"}function FT(a,c){var d=c,m=0;do{var b=d.nextSibling;if(a.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"||d==="/&"){if(m===0){a.removeChild(b),Tl(c);return}m--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")m++;else if(d==="html")Fu(a.ownerDocument.documentElement);else if(d==="head"){d=a.ownerDocument.head,Fu(d);for(var w=d.firstChild;w;){var A=w.nextSibling,D=w.nodeName;w[No]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&w.rel.toLowerCase()==="stylesheet"||d.removeChild(w),w=A}}else d==="body"&&Fu(a.ownerDocument.body);d=b}while(d);Tl(c)}function HT(a,c){var d=a;a=0;do{var m=d.nextSibling;if(d.nodeType===1?c?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(c?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),m&&m.nodeType===8)if(d=m.data,d==="/$"){if(a===0)break;a--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||a++;d=m}while(d)}function zv(a){var c=a.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var d=c;switch(c=c.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":zv(d),cu(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}a.removeChild(d)}}function SX(a,c,d,m){for(;a.nodeType===1;){var b=d;if(a.nodeName.toLowerCase()!==c.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[No])switch(c){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(w=a.getAttribute("rel"),w==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(w!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(w=a.getAttribute("src"),(w!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&w&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(c==="input"&&a.type==="hidden"){var w=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===w)return a}else return a;if(a=Oi(a.nextSibling),a===null)break}return null}function kX(a,c,d){if(c==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!d||(a=Oi(a.nextSibling),a===null))return null;return a}function KT(a,c){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=Oi(a.nextSibling),a===null))return null;return a}function Xv(a){return a.data==="$?"||a.data==="$~"}function Zv(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function EX(a,c){var d=a.ownerDocument;if(a.data==="$~")a._reactRetry=c;else if(a.data!=="$?"||d.readyState!=="loading")c();else{var m=function(){c(),d.removeEventListener("DOMContentLoaded",m)};d.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function Oi(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return a}var Bv=null;function JT(a){a=a.nextSibling;for(var c=0;a;){if(a.nodeType===8){var d=a.data;if(d==="/$"||d==="/&"){if(c===0)return Oi(a.nextSibling);c--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||c++}a=a.nextSibling}return null}function eC(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var d=a.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(c===0)return a;c--}else d!=="/$"&&d!=="/&"||c++}a=a.previousSibling}return null}function tC(a,c,d){switch(c=ip(d),a){case"html":if(a=c.documentElement,!a)throw Error(i(452));return a;case"head":if(a=c.head,!a)throw Error(i(453));return a;case"body":if(a=c.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function Fu(a){for(var c=a.attributes;c.length;)a.removeAttributeNode(c[0]);cu(a)}var yi=new Map,nC=new Set;function rp(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var rs=I.d;I.d={f:TX,r:CX,D:$X,C:_X,L:QX,m:AX,X:PX,S:NX,M:RX};function TX(){var a=rs.f(),c=Wh();return a||c}function CX(a){var c=As(a);c!==null&&c.tag===5&&c.type==="form"?vE(c):rs.r(a)}var Sl=typeof document>"u"?null:document;function iC(a,c,d){var m=Sl;if(m&&typeof c=="string"&&c){var b=Qn(c);b='link[rel="'+a+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),nC.has(b)||(nC.add(b),a={rel:a,crossOrigin:d,href:c},m.querySelector(b)===null&&(c=m.createElement("link"),en(c,"link",a),Lt(c),m.head.appendChild(c)))}}function $X(a){rs.D(a),iC("dns-prefetch",a,null)}function _X(a,c){rs.C(a,c),iC("preconnect",a,c)}function QX(a,c,d){rs.L(a,c,d);var m=Sl;if(m&&a&&c){var b='link[rel="preload"][as="'+Qn(c)+'"]';c==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+Qn(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+Qn(d.imageSizes)+'"]')):b+='[href="'+Qn(a)+'"]';var w=b;switch(c){case"style":w=kl(a);break;case"script":w=El(a)}yi.has(w)||(a=p({rel:"preload",href:c==="image"&&d&&d.imageSrcSet?void 0:a,as:c},d),yi.set(w,a),m.querySelector(b)!==null||c==="style"&&m.querySelector(Hu(w))||c==="script"&&m.querySelector(Ku(w))||(c=m.createElement("link"),en(c,"link",a),Lt(c),m.head.appendChild(c)))}}function AX(a,c){rs.m(a,c);var d=Sl;if(d&&a){var m=c&&typeof c.as=="string"?c.as:"script",b='link[rel="modulepreload"][as="'+Qn(m)+'"][href="'+Qn(a)+'"]',w=b;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=El(a)}if(!yi.has(w)&&(a=p({rel:"modulepreload",href:a},c),yi.set(w,a),d.querySelector(b)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Ku(w)))return}m=d.createElement("link"),en(m,"link",a),Lt(m),d.head.appendChild(m)}}}function NX(a,c,d){rs.S(a,c,d);var m=Sl;if(m&&a){var b=Ps(m).hoistableStyles,w=kl(a);c=c||"default";var A=b.get(w);if(!A){var D={loading:0,preload:null};if(A=m.querySelector(Hu(w)))D.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":c},d),(d=yi.get(w))&&Iv(a,d);var K=A=m.createElement("link");Lt(K),en(K,"link",a),K._p=new Promise(function(se,ue){K.onload=se,K.onerror=ue}),K.addEventListener("load",function(){D.loading|=1}),K.addEventListener("error",function(){D.loading|=2}),D.loading|=4,sp(A,c,m)}A={type:"stylesheet",instance:A,count:1,state:D},b.set(w,A)}}}function PX(a,c){rs.X(a,c);var d=Sl;if(d&&a){var m=Ps(d).hoistableScripts,b=El(a),w=m.get(b);w||(w=d.querySelector(Ku(b)),w||(a=p({src:a,async:!0},c),(c=yi.get(b))&&Gv(a,c),w=d.createElement("script"),Lt(w),en(w,"link",a),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},m.set(b,w))}}function RX(a,c){rs.M(a,c);var d=Sl;if(d&&a){var m=Ps(d).hoistableScripts,b=El(a),w=m.get(b);w||(w=d.querySelector(Ku(b)),w||(a=p({src:a,async:!0,type:"module"},c),(c=yi.get(b))&&Gv(a,c),w=d.createElement("script"),Lt(w),en(w,"link",a),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},m.set(b,w))}}function rC(a,c,d,m){var b=(b=ne.current)?rp(b):null;if(!b)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(c=kl(d.href),d=Ps(b).hoistableStyles,m=d.get(c),m||(m={type:"style",instance:null,count:0,state:null},d.set(c,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){a=kl(d.href);var w=Ps(b).hoistableStyles,A=w.get(a);if(A||(b=b.ownerDocument||b,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(a,A),(w=b.querySelector(Hu(a)))&&!w._p&&(A.instance=w,A.state.loading=5),yi.has(a)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},yi.set(a,d),w||jX(b,a,d,A.state))),c&&m===null)throw Error(i(528,""));return A}if(c&&m!==null)throw Error(i(529,""));return null;case"script":return c=d.async,d=d.src,typeof d=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=El(d),d=Ps(b).hoistableScripts,m=d.get(c),m||(m={type:"script",instance:null,count:0,state:null},d.set(c,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function kl(a){return'href="'+Qn(a)+'"'}function Hu(a){return'link[rel="stylesheet"]['+a+"]"}function sC(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function jX(a,c,d,m){a.querySelector('link[rel="preload"][as="style"]['+c+"]")?m.loading=1:(c=a.createElement("link"),m.preload=c,c.addEventListener("load",function(){return m.loading|=1}),c.addEventListener("error",function(){return m.loading|=2}),en(c,"link",d),Lt(c),a.head.appendChild(c))}function El(a){return'[src="'+Qn(a)+'"]'}function Ku(a){return"script[async]"+a}function oC(a,c,d){if(c.count++,c.instance===null)switch(c.type){case"style":var m=a.querySelector('style[data-href~="'+Qn(d.href)+'"]');if(m)return c.instance=m,Lt(m),m;var b=p({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),Lt(m),en(m,"style",b),sp(m,d.precedence,a),c.instance=m;case"stylesheet":b=kl(d.href);var w=a.querySelector(Hu(b));if(w)return c.state.loading|=4,c.instance=w,Lt(w),w;m=sC(d),(b=yi.get(b))&&Iv(m,b),w=(a.ownerDocument||a).createElement("link"),Lt(w);var A=w;return A._p=new Promise(function(D,K){A.onload=D,A.onerror=K}),en(w,"link",m),c.state.loading|=4,sp(w,d.precedence,a),c.instance=w;case"script":return w=El(d.src),(b=a.querySelector(Ku(w)))?(c.instance=b,Lt(b),b):(m=d,(b=yi.get(w))&&(m=p({},d),Gv(m,b)),a=a.ownerDocument||a,b=a.createElement("script"),Lt(b),en(b,"link",m),a.head.appendChild(b),c.instance=b);case"void":return null;default:throw Error(i(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(m=c.instance,c.state.loading|=4,sp(m,d.precedence,a));return c.instance}function sp(a,c,d){for(var m=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=m.length?m[m.length-1]:null,w=b,A=0;A<m.length;A++){var D=m[A];if(D.dataset.precedence===c)w=D;else if(w!==b)break}w?w.parentNode.insertBefore(a,w.nextSibling):(c=d.nodeType===9?d.head:d,c.insertBefore(a,c.firstChild))}function Iv(a,c){a.crossOrigin==null&&(a.crossOrigin=c.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=c.referrerPolicy),a.title==null&&(a.title=c.title)}function Gv(a,c){a.crossOrigin==null&&(a.crossOrigin=c.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=c.referrerPolicy),a.integrity==null&&(a.integrity=c.integrity)}var op=null;function aC(a,c,d){if(op===null){var m=new Map,b=op=new Map;b.set(d,m)}else b=op,m=b.get(d),m||(m=new Map,b.set(d,m));if(m.has(a))return m;for(m.set(a,null),d=d.getElementsByTagName(a),b=0;b<d.length;b++){var w=d[b];if(!(w[No]||w[Gt]||a==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var A=w.getAttribute(c)||"";A=a+A;var D=m.get(A);D?D.push(w):m.set(A,[w])}}return m}function lC(a,c,d){a=a.ownerDocument||a,a.head.insertBefore(d,c==="title"?a.querySelector("head > title"):null)}function MX(a,c,d){if(d===1||c.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return a=c.disabled,typeof c.precedence=="string"&&a==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function cC(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function LX(a,c,d,m){if(d.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var b=kl(m.href),w=c.querySelector(Hu(b));if(w){c=w._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(a.count++,a=ap.bind(a),c.then(a,a)),d.state.loading|=4,d.instance=w,Lt(w);return}w=c.ownerDocument||c,m=sC(m),(b=yi.get(b))&&Iv(m,b),w=w.createElement("link"),Lt(w);var A=w;A._p=new Promise(function(D,K){A.onload=D,A.onerror=K}),en(w,"link",m),d.instance=w}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(d,c),(c=d.state.preload)&&(d.state.loading&3)===0&&(a.count++,d=ap.bind(a),c.addEventListener("load",d),c.addEventListener("error",d))}}var Vv=0;function DX(a,c){return a.stylesheets&&a.count===0&&cp(a,a.stylesheets),0<a.count||0<a.imgCount?function(d){var m=setTimeout(function(){if(a.stylesheets&&cp(a,a.stylesheets),a.unsuspend){var w=a.unsuspend;a.unsuspend=null,w()}},6e4+c);0<a.imgBytes&&Vv===0&&(Vv=62500*yX());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&cp(a,a.stylesheets),a.unsuspend)){var w=a.unsuspend;a.unsuspend=null,w()}},(a.imgBytes>Vv?50:800)+c);return a.unsuspend=d,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(b)}}:null}function ap(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cp(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var lp=null;function cp(a,c){a.stylesheets=null,a.unsuspend!==null&&(a.count++,lp=new Map,c.forEach(zX,a),lp=null,ap.call(a))}function zX(a,c){if(!(c.state.loading&4)){var d=lp.get(a);if(d)var m=d.get(null);else{d=new Map,lp.set(a,d);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<b.length;w++){var A=b[w];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(d.set(A.dataset.precedence,A),m=A)}m&&d.set(null,m)}b=c.instance,A=b.getAttribute("data-precedence"),w=d.get(A)||m,w===m&&d.set(null,b),d.set(A,b),this.count++,m=ap.bind(this),b.addEventListener("load",m),b.addEventListener("error",m),w?w.parentNode.insertBefore(b,w.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),c.state.loading|=4}}var Ju={$$typeof:E,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function XX(a,c,d,m,b,w,A,D,K){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ou(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ou(0),this.hiddenUpdates=ou(null),this.identifierPrefix=m,this.onUncaughtError=b,this.onCaughtError=w,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function uC(a,c,d,m,b,w,A,D,K,se,ue,de){return a=new XX(a,c,d,A,K,se,ue,de,D),c=1,w===!0&&(c|=24),w=Yn(3,null,null,c),a.current=w,w.stateNode=a,c=ky(),c.refCount++,a.pooledCache=c,c.refCount++,w.memoizedState={element:m,isDehydrated:d,cache:c},$y(w),a}function fC(a){return a?(a=nl,a):nl}function dC(a,c,d,m,b,w){b=fC(b),m.context===null?m.context=b:m.pendingContext=b,m=Bs(c),m.payload={element:d},w=w===void 0?null:w,w!==null&&(m.callback=w),d=Is(a,m,c),d!==null&&(Mn(d,a,c),Au(d,a,c))}function hC(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<c?d:c}}function Uv(a,c){hC(a,c),(a=a.alternate)&&hC(a,c)}function pC(a){if(a.tag===13||a.tag===31){var c=Mo(a,67108864);c!==null&&Mn(c,a,67108864),Uv(a,67108864)}}function gC(a){if(a.tag===13||a.tag===31){var c=Kn();c=au(c);var d=Mo(a,c);d!==null&&Mn(d,a,c),Uv(a,c)}}var up=!0;function ZX(a,c,d,m){var b=L.T;L.T=null;var w=I.p;try{I.p=2,Yv(a,c,d,m)}finally{I.p=w,L.T=b}}function BX(a,c,d,m){var b=L.T;L.T=null;var w=I.p;try{I.p=8,Yv(a,c,d,m)}finally{I.p=w,L.T=b}}function Yv(a,c,d,m){if(up){var b=qv(m);if(b===null)Pv(a,c,m,fp,d),OC(a,m);else if(GX(b,a,c,d,m))m.stopPropagation();else if(OC(a,m),c&4&&-1<IX.indexOf(a)){for(;b!==null;){var w=As(b);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var A=zr(w.pendingLanes);if(A!==0){var D=w;for(D.pendingLanes|=2,D.entangledLanes|=2;A;){var K=1<<31-yn(A);D.entanglements[1]|=K,A&=~K}hr(w),(et&6)===0&&(Yh=Pt()+500,Yu(0))}}break;case 31:case 13:D=Mo(w,2),D!==null&&Mn(D,w,2),Wh(),Uv(w,2)}if(w=qv(m),w===null&&Pv(a,c,m,fp,d),w===b)break;b=w}b!==null&&m.stopPropagation()}else Pv(a,c,m,null,d)}}function qv(a){return a=FO(a),Wv(a)}var fp=null;function Wv(a){if(fp=null,a=Qs(a),a!==null){var c=s(a);if(c===null)a=null;else{var d=c.tag;if(d===13){if(a=o(c),a!==null)return a;a=null}else if(d===31){if(a=l(c),a!==null)return a;a=null}else if(d===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null)}}return fp=a,null}function mC(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Vn()){case li:return 2;case ci:return 8;case ui:case su:return 32;case za:return 268435456;default:return 32}default:return 32}}var Fv=!1,eo=null,to=null,no=null,ef=new Map,tf=new Map,io=[],IX="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function OC(a,c){switch(a){case"focusin":case"focusout":eo=null;break;case"dragenter":case"dragleave":to=null;break;case"mouseover":case"mouseout":no=null;break;case"pointerover":case"pointerout":ef.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":tf.delete(c.pointerId)}}function nf(a,c,d,m,b,w){return a===null||a.nativeEvent!==w?(a={blockedOn:c,domEventName:d,eventSystemFlags:m,nativeEvent:w,targetContainers:[b]},c!==null&&(c=As(c),c!==null&&pC(c)),a):(a.eventSystemFlags|=m,c=a.targetContainers,b!==null&&c.indexOf(b)===-1&&c.push(b),a)}function GX(a,c,d,m,b){switch(c){case"focusin":return eo=nf(eo,a,c,d,m,b),!0;case"dragenter":return to=nf(to,a,c,d,m,b),!0;case"mouseover":return no=nf(no,a,c,d,m,b),!0;case"pointerover":var w=b.pointerId;return ef.set(w,nf(ef.get(w)||null,a,c,d,m,b)),!0;case"gotpointercapture":return w=b.pointerId,tf.set(w,nf(tf.get(w)||null,a,c,d,m,b)),!0}return!1}function yC(a){var c=Qs(a.target);if(c!==null){var d=s(c);if(d!==null){if(c=d.tag,c===13){if(c=o(d),c!==null){a.blockedOn=c,eh(a.priority,function(){gC(d)});return}}else if(c===31){if(c=l(d),c!==null){a.blockedOn=c,eh(a.priority,function(){gC(d)});return}}else if(c===3&&d.stateNode.current.memoizedState.isDehydrated){a.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}a.blockedOn=null}function dp(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var d=qv(a.nativeEvent);if(d===null){d=a.nativeEvent;var m=new d.constructor(d.type,d);WO=m,d.target.dispatchEvent(m),WO=null}else return c=As(d),c!==null&&pC(c),a.blockedOn=d,!1;c.shift()}return!0}function vC(a,c,d){dp(a)&&d.delete(c)}function VX(){Fv=!1,eo!==null&&dp(eo)&&(eo=null),to!==null&&dp(to)&&(to=null),no!==null&&dp(no)&&(no=null),ef.forEach(vC),tf.forEach(vC)}function hp(a,c){a.blockedOn===c&&(a.blockedOn=null,Fv||(Fv=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,VX)))}var pp=null;function bC(a){pp!==a&&(pp=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){pp===a&&(pp=null);for(var c=0;c<a.length;c+=3){var d=a[c],m=a[c+1],b=a[c+2];if(typeof m!="function"){if(Wv(m||d)===null)continue;break}var w=As(d);w!==null&&(a.splice(c,3),c-=3,qy(w,{pending:!0,data:b,method:d.method,action:m},m,b))}}))}function Tl(a){function c(K){return hp(K,a)}eo!==null&&hp(eo,a),to!==null&&hp(to,a),no!==null&&hp(no,a),ef.forEach(c),tf.forEach(c);for(var d=0;d<io.length;d++){var m=io[d];m.blockedOn===a&&(m.blockedOn=null)}for(;0<io.length&&(d=io[0],d.blockedOn===null);)yC(d),d.blockedOn===null&&io.shift();if(d=(a.ownerDocument||a).$$reactFormReplay,d!=null)for(m=0;m<d.length;m+=3){var b=d[m],w=d[m+1],A=b[an]||null;if(typeof w=="function")A||bC(d);else if(A){var D=null;if(w&&w.hasAttribute("formAction")){if(b=w,A=w[an]||null)D=A.formAction;else if(Wv(b)!==null)continue}else D=A.action;typeof D=="function"?d[m+1]=D:(d.splice(m,3),m-=3),bC(d)}}}function xC(){function a(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(A){return b=A})},focusReset:"manual",scroll:"manual"})}function c(){b!==null&&(b(),b=null),m||setTimeout(d,20)}function d(){if(!m&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(d,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),b!==null&&(b(),b=null)}}}function Hv(a){this._internalRoot=a}gp.prototype.render=Hv.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(i(409));var d=c.current,m=Kn();dC(d,m,a,c,null,null)},gp.prototype.unmount=Hv.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;dC(a.current,2,null,a,null,null),Wh(),c[Xr]=null}};function gp(a){this._internalRoot=a}gp.prototype.unstable_scheduleHydration=function(a){if(a){var c=Jd();a={blockedOn:null,target:a,priority:c};for(var d=0;d<io.length&&c!==0&&c<io[d].priority;d++);io.splice(d,0,a),d===0&&yC(a)}};var wC=e.version;if(wC!=="19.2.6")throw Error(i(527,wC,"19.2.6"));I.findDOMNode=function(a){var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=f(c),a=a!==null?h(a):null,a=a===null?null:a.stateNode,a};var UX={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mp.isDisabled&&mp.supportsFiber)try{_o=mp.inject(UX),On=mp}catch{}}return sf.createRoot=function(a,c){if(!r(a))throw Error(i(299));var d=!1,m="",b=_E,w=QE,A=AE;return c!=null&&(c.unstable_strictMode===!0&&(d=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(b=c.onUncaughtError),c.onCaughtError!==void 0&&(w=c.onCaughtError),c.onRecoverableError!==void 0&&(A=c.onRecoverableError)),c=uC(a,1,!1,null,null,d,m,null,b,w,A,xC),a[Xr]=c.current,Nv(a),new Hv(c)},sf.hydrateRoot=function(a,c,d){if(!r(a))throw Error(i(299));var m=!1,b="",w=_E,A=QE,D=AE,K=null;return d!=null&&(d.unstable_strictMode===!0&&(m=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(w=d.onUncaughtError),d.onCaughtError!==void 0&&(A=d.onCaughtError),d.onRecoverableError!==void 0&&(D=d.onRecoverableError),d.formState!==void 0&&(K=d.formState)),c=uC(a,1,!0,c,d??null,m,b,K,w,A,D,xC),c.context=fC(null),d=c.current,m=Kn(),m=au(m),b=Bs(m),b.callback=null,Is(d,b,m),d=m,c.current.lanes=d,Ao(c,d),hr(c),a[Xr]=c.current,Nv(a),new gp(c)},sf.version="19.2.6",sf}var NC;function nZ(){if(NC)return e0.exports;NC=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),e0.exports=tZ(),e0.exports}var iZ=nZ();const rZ=new Set(["pulse","approvals","trust","build","automation","knowledge","setup","graph","dashboard","git-workflow","instructions","module-map","site-map","design-tokens"]);function PC(t){const e=t.replace(/^#\/?/,"").split(/[?#]/)[0]??"";return rZ.has(e)?e:"pulse"}function zc(){const[t,e]=C.useState(()=>PC(window.location.hash));return C.useEffect(()=>{const i=()=>e(PC(window.location.hash));return window.addEventListener("hashchange",i),()=>window.removeEventListener("hashchange",i)},[]),{route:t,navigate:i=>{window.location.hash=`/${i}`}}}async function _i(){const t=await fetch("/api/dashboard");if(!t.ok)throw new Error("Failed to fetch /api/dashboard: "+t.status);return await t.json()}async function lt(t){try{const e=await t.json();if(typeof e.error=="string")return e.error}catch{}return"Request failed with status "+t.status}async function nN(){const t=await fetch("/api/inventory");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function Dw(){const t=await fetch("/api/decisions");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function sZ(t,e,n){const i=await fetch("/api/decisions/"+encodeURIComponent(t)+"/resolve",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({chosen_option_key:e})});if(!i.ok)throw new Error(await lt(i))}async function oZ(){const t=await fetch("/api/site-map/map");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function aZ(){const t=await fetch("/api/site-map/progress");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function lZ(t){const e=await fetch("/api/site-map/layout",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({districts:t})});if(!e.ok)throw new Error(await lt(e))}async function cZ(){const t=await fetch("/api/site-map/layout/reset",{method:"POST"});if(!t.ok)throw new Error(await lt(t))}async function uZ(t,e){const n=await fetch("/api/module-decisions/"+encodeURIComponent(t)+"/"+e,{method:"POST"});if(!n.ok)throw new Error(await lt(n))}async function fZ(){const t=await fetch("/api/config/git-workflow");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function dZ(t,e){return Es("/api/config/git-workflow/"+encodeURIComponent(t),"PUT",e)}async function Es(t,e,n){const i=await fetch(t,{method:e,headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(i.ok)return{status:"ok",result:(await i.json()).result};if(i.status===422){const r=await i.json();return{status:"invalid",error:r.error??"The change failed validation.",issues:r.issues??[]}}if(i.status===409){const r=await i.json();if(r.conflict)return{status:"conflict",error:r.error??"The file changed since you loaded it.",conflict:r.conflict};throw new Error(r.error??"Request failed with status 409")}throw new Error(await lt(i))}async function iN(){const t=await fetch("/api/config/profile");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function hZ(t){return Es("/api/config/profile","PUT",{profile:t})}async function pZ(t,e){return Es("/api/capabilities/"+encodeURIComponent(t),"POST",{enabled:e})}async function gZ(){const t=await fetch("/api/config/module-map");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function mZ(t){return Es("/api/config/module-map","PUT",t)}async function OZ(){const t=await fetch("/api/config/rag");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function yZ(t){return Es("/api/config/rag","PUT",{intelligence:t})}async function vZ(){const t=await fetch("/api/config/design-tokens");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function bZ(t){return Es("/api/config/design-tokens","PUT",t)}async function xZ(){const t=await fetch("/api/files/instructions");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function wZ(t){const e=await fetch("/api/files/instructions/"+t.split("/").map(encodeURIComponent).join("/"));if(!e.ok)throw new Error(await lt(e));return await e.json()}async function SZ(t,e){return Es("/api/files/instructions/"+t.split("/").map(encodeURIComponent).join("/"),"PUT",e)}async function kZ(){const t=await fetch("/api/packs");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function EZ(t){return Es("/api/packs/install","POST",t)}async function TZ(t){return Es("/api/packs/remove","POST",t)}async function CZ(t){const e=await fetch("/api/ops/"+t,{method:"POST"});if(!e.ok)throw new Error(await lt(e));return(await e.json()).result}async function RC(t){const e=await fetch("/api/ops/"+encodeURIComponent(t));if(!e.ok)throw new Error(await lt(e));return await e.json()}async function rN(t){const e=new URLSearchParams;t.gate&&e.set("gate",t.gate),t.verdict&&e.set("verdict",t.verdict);const n=e.toString(),i=await fetch("/api/ledger/evidence"+(n?"?"+n:""));if(!i.ok)throw new Error(await lt(i));return await i.json()}async function Xg(){const t=await fetch("/api/ledger/receipts");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function $Z(){const t=await fetch("/api/ledger/ai-bom");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function _Z(){const t=await fetch("/api/onboarding-checklist");if(!t.ok)throw new Error(await lt(t));return await t.json()}async function QZ(t){const e=await fetch("/api/audit"+("?limit="+t));if(!e.ok)throw new Error(await lt(e));return await e.json()}async function AZ(){const t=await fetch("/api/export/evidence-packet?format=markdown");if(!t.ok)throw new Error(await lt(t));return await t.text()}async function NZ(){const t=await fetch("/api/ledger/pr-comment");if(!t.ok)throw new Error(await lt(t));return await t.text()}async function jC(){const t=await fetch("/api/graph");if(!t.ok)throw new Error("Failed to fetch /api/graph: "+t.status);return await t.json()}async function PZ(t){const e=await fetch("/api/node/"+encodeURIComponent(t));if(!e.ok)throw new Error("Failed to fetch detail: "+e.status);return await e.json()}async function RZ(t){const e=await fetch("/api/chunk/"+encodeURIComponent(t)+"/content");if(!e.ok)throw new Error("Failed to fetch chunk content: "+e.status);return await e.json()}async function jZ(t){const e=await fetch("/api/similar",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!e.ok)throw new Error("Failed to fetch /api/similar: "+e.status);return await e.json()}async function MZ(){const t=await fetch("/api/saved-views");if(!t.ok)throw new Error(await lt(t));return(await t.json()).views}async function LZ(t){const e=await fetch("/api/saved-views/"+encodeURIComponent(t.id),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:t.name,area:t.area,scope:t.scope})});if(!e.ok)throw new Error(await lt(e));return(await e.json()).result}async function DZ(t){const e=await fetch("/api/saved-views/"+encodeURIComponent(t),{method:"DELETE"});if(!e.ok)throw new Error(await lt(e))}const Xc={pulse:"Everything important about your project, in one glance.",approvals:"Nothing risky moves forward without you. This is where you stay in control without reading logs.",trust:"Proof you can show anyone: what was checked, who wrote it, who vouched.",build:"Your codebase, mapped, measured, and honest.",graph:"Your codebase as a living map: modules, files, and how they connect.",automation:"Decide once how work flows. Paqad follows your rules every time.",knowledge:"Everything your agents know about this project. Edit it here, every agent learns it instantly.",setup:"Your project's foundation. Set it once, change it any time.","site-map":"How your app really behaves: every screen, journey, and guard, checked against the code."},Ef={green:"Healthy",amber:"Needs attention",red:"At risk",unknown:"Not yet measured"};function zZ(t){return Ef[t??"unknown"]??"Not yet measured"}const sN={instructions:{problem:"Every agent starts from zero unless you tell it the rules.",benefit:"Your standards, applied to every change without repeating yourself.",without:"Each session reinvents your conventions, and some get them wrong."},workflows:{problem:"Multi-step work drifts when every step is improvised.",benefit:"Named procedures the agent follows the same way every time.",without:"The same request produces a different process every run."},"git-workflow":{problem:"How work ships is a decision, not a default.",benefit:"Branches, tickets and merges follow rules you set once.",without:"Every delivery negotiates process from scratch."},"module-map":{problem:"Nobody can hold a whole codebase in their head.",benefit:"A living map of what exists, what it does and how it connects.",without:"Changes land in the wrong place and the architecture quietly erodes."},profile:{problem:"Advice that ignores what your project is becomes noise.",benefit:"Paqad tunes its checks to the shape of your project.",without:"Generic rules fire on things that do not apply to you."},capabilities:{problem:"What the agent may do should be explicit, not assumed.",benefit:"A clear record of what is switched on and what stays off.",without:"Capability creep happens silently."},packs:{problem:"Good practices exist, wiring them in is the hard part.",benefit:"Drop-in rule packs for your stack, ready to enforce.",without:"You curate every rule by hand."},providers:{problem:"Tickets and repos live in different tools for every team.",benefit:"Paqad talks to your tracker and host through one configuration.",without:"Status lives in your head instead of your tools."},rag:{problem:"Agents answer better when they can look things up.",benefit:"Your code and docs, indexed so agents cite the real thing.",without:"Answers come from memory and guesswork."},"design-tokens":{problem:"Visual consistency dies one hardcoded value at a time.",benefit:"One palette every screen draws from.",without:"Each new screen invents its own colors and spacing."},patterns:{problem:"The same problem gets solved five different ways.",benefit:"Approved solutions the agent reaches for first.",without:"Every implementation is a fresh opinion."},approvals:{problem:"Staying in control should not require reading logs.",benefit:"Everything waiting on you, in one inbox with one-click answers.",without:"Decisions stall in transcripts you never open."},"evidence-ledger":{problem:"Claims about checks are cheap.",benefit:"An append-only record of every gate that ran and what it found.",without:"History can be rewritten by whoever edits last."},receipts:{problem:"Anyone can claim the checks ran. Few can prove it.",benefit:"Who wrote it, who vouched for it, sealed.",without:"Reviews rest on trust in memory and screenshots."},"ai-bom":{problem:"You will be asked which AI touched your code. Most teams cannot answer.",benefit:"A standard, exportable list of every model that contributed.",without:"Compliance questions turn into archaeology."},"audit-log":{problem:"When something goes wrong, you need the timeline.",benefit:"Every meaningful action, recorded as it happened.",without:"Incident reviews start with guesswork."},"quality-baseline":{problem:"Quality drifts in small steps nobody notices.",benefit:"A recorded floor your project is measured against.",without:"Slow decline looks normal until it is not."},pentest:{problem:"Vulnerabilities are cheapest to fix the day they are written.",benefit:"Security findings surfaced while the code is still fresh.",without:"Issues wait for an annual audit, or an attacker."},"rule-compliance":{problem:"Rules that are not checked are suggestions.",benefit:"A score that shows which rules hold and where they slip.",without:"You assume compliance until a review proves otherwise."}},oN="paqad-graph-theme";function XZ(t){return t!=="auto"?t:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Zg(){const t=localStorage.getItem(oN);return t==="light"||t==="dark"?t:"auto"}function Gb(t){document.documentElement.dataset.theme=XZ(t)}function aN(t){localStorage.setItem(oN,t),Gb(t)}function ZZ(){const t=Zg();Gb(t),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>Gb(Zg()))}function BZ(){const{navigate:t}=zc(),[e,n]=C.useState(!1),[i,r]=C.useState(""),[s,o]=C.useState(0),l=C.useRef(null),u=C.useMemo(()=>{const O=v=>()=>t(v);return[{label:"Pulse",kind:"page",run:O("pulse")},{label:"Approvals",kind:"page",run:O("approvals")},{label:"Trust",kind:"page",run:O("trust")},{label:"Build",kind:"page",run:O("build")},{label:"Automation",kind:"page",run:O("automation")},{label:"Knowledge",kind:"page",run:O("knowledge")},{label:"Setup",kind:"page",run:O("setup")},{label:"Graph",kind:"page",run:O("graph")},{label:"Legacy health view",kind:"page",run:O("dashboard")},{label:"Git workflow",kind:"page",run:O("git-workflow")},{label:"Instructions",kind:"page",run:O("instructions")},{label:"Module map",kind:"page",run:O("module-map")},{label:"Design tokens",kind:"page",run:O("design-tokens")},{label:"Resolve approvals",kind:"action",run:O("approvals")},{label:"Export the evidence packet",kind:"action",run:()=>window.open("/api/export/evidence-packet?format=html","_blank")}]},[t]),f=C.useMemo(()=>{const O=i.trim().toLowerCase();return O===""?u:u.filter(v=>v.label.toLowerCase().includes(O))},[u,i]);if(C.useEffect(()=>{const O=v=>{if((v.metaKey||v.ctrlKey)&&v.key.toLowerCase()==="k"){v.preventDefault(),n(x=>!x),r(""),o(0);return}v.key==="Escape"&&n(!1)};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[]),C.useEffect(()=>{e&&l.current?.focus()},[e]),!e)return null;const h=Math.min(s,Math.max(f.length-1,0)),p=O=>{O!==void 0&&(n(!1),O.run())},g=O=>{O.key==="ArrowDown"?(O.preventDefault(),o(v=>f.length===0?0:(v+1)%f.length)):O.key==="ArrowUp"?(O.preventDefault(),o(v=>f.length===0?0:(v-1+f.length)%f.length)):O.key==="Enter"&&(O.preventDefault(),p(f[h]))};return y.jsx("div",{className:"fixed inset-0 z-50 flex justify-center",style:{background:"color-mix(in srgb, var(--color-canvas-fg) 20%, transparent)"},onMouseDown:()=>n(!1),role:"presentation",children:y.jsxs("div",{className:"palette-in mt-[15vh] h-fit w-full max-w-[520px] rounded-[10px] p-2",style:{background:"var(--color-canvas)",border:"1px solid color-mix(in srgb, var(--color-border) 70%, transparent)"},role:"dialog","aria-label":"Command palette",onMouseDown:O=>O.stopPropagation(),children:[y.jsx("input",{ref:l,type:"text",className:"w-full bg-transparent px-2.5 py-2 text-body outline-none",style:{color:"var(--color-canvas-fg)"},placeholder:"Jump to a page or run an action","aria-label":"Jump to a page or run an action",value:i,onChange:O=>{r(O.target.value),o(0)},onKeyDown:g}),y.jsxs("div",{className:"mt-1 flex max-h-[320px] flex-col gap-0.5 overflow-y-auto",children:[f.length===0&&y.jsx("div",{className:"px-2.5 py-2 text-secondary",style:{color:"var(--color-muted)"},children:"Nothing matches."}),f.map((O,v)=>y.jsxs("button",{type:"button",className:"flex items-center gap-2.5 rounded-[6px] px-2.5 py-1.5 text-left text-secondary",style:{background:v===h?"var(--color-surface)":"transparent",color:"var(--color-canvas-fg)"},onMouseEnter:()=>o(v),onClick:()=>p(O),children:[y.jsx("span",{className:"min-w-0 flex-1 truncate",children:O.label}),y.jsx("span",{className:"shrink-0 text-caption",style:{color:"var(--color-muted)"},children:O.kind})]},O.kind+O.label))]})]})})}const MC="paqad-nav-collapsed";function IZ({name:t}){const e={pulse:y.jsx("path",{d:"M2 8h3l2-4 3 8 2-4h2"}),approvals:y.jsx("path",{d:"M2 9l3 3 4-4M2 5h12M9 9h5M9 13h5",transform:"translate(0 -1)"}),trust:y.jsx("path",{d:"M8 2l5 2v4c0 3-2 5-5 6-3-1-5-3-5-6V4l5-2z"}),build:y.jsx("path",{d:"M8 2l5 3v6l-5 3-5-3V5l5-3zM8 8l5-3M8 8L3 5M8 8v6"}),graph:y.jsx("path",{d:"M4 4a1.5 1.5 0 1 0 0-.01M12 4a1.5 1.5 0 1 0 0-.01M8 13a1.5 1.5 0 1 0 0-.01M4.8 4.8l2.4 7M11.2 4.8l-2.4 7M5 4h6"}),automation:y.jsx("path",{d:"M3 6a5 5 0 0 1 9-2m1 6a5 5 0 0 1-9 2M12 1v3H9M4 15v-3h3"}),knowledge:y.jsx("path",{d:"M3 3a3 3 0 0 1 5 1 3 3 0 0 1 5-1v9a3 3 0 0 0-5 1 3 3 0 0 0-5-1V3z"}),setup:y.jsx("path",{d:"M3 5h10M3 11h10M6 3v4M11 9v4"}),"site-map":y.jsx("path",{d:"M2 4l4-2 4 2 4-2v10l-4 2-4-2-4 2V4zM6 2v10M10 4v10"})};return y.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:"shrink-0",children:e[t]})}function Qi({projectName:t,frameworkVersion:e,sseLive:n,hideSidebar:i=!1,children:r}){const{route:s,navigate:o}=zc(),[l,u]=C.useState(()=>Zg()),[f,h]=C.useState(null),[p,g]=C.useState(()=>{try{return localStorage.getItem(MC)==="1"}catch{return!1}});C.useEffect(()=>{const $=()=>{Dw().then(T=>h(T.pendingCount)).catch(()=>h(null))};$();const E=new EventSource("/api/events");return E.addEventListener("dashboard-updated",$),()=>{E.close()}},[]);const O=()=>{g($=>{const E=!$;try{localStorage.setItem(MC,E?"1":"0")}catch{}return E})},v=()=>{const $=l==="light"?"dark":l==="dark"?"auto":"light";u($),aN($)},S={"git-workflow":"automation",instructions:"knowledge","design-tokens":"knowledge","module-map":"build"}[s]??s,k=($,E,T)=>{const _=S===$;return y.jsxs("button",{type:"button",title:Xc[$],"aria-current":_?"page":void 0,className:"relative flex w-full items-center gap-2.5 rounded-[6px] px-2.5 py-1.5 text-secondary "+(p?"justify-center":""),style:{background:_?"var(--color-surface)":"transparent",color:_?"var(--color-canvas-fg)":"var(--color-muted)"},onClick:()=>o($),children:[y.jsx(IZ,{name:$}),!p&&y.jsx("span",{className:"truncate",children:E}),typeof T=="number"&&T>0&&y.jsx("span",{className:"inline-block rounded-full px-1.5 text-[10px] font-semibold "+(p?"absolute":"ml-auto"),style:{background:"var(--color-accent)",color:"var(--color-canvas)",...p?{transform:"translate(10px, -8px)"}:{}},children:T})]},$)};return y.jsxs("div",{className:"flex h-full w-full overflow-hidden",style:{background:"var(--color-canvas)",color:"var(--color-canvas-fg)"},children:[!i&&y.jsxs("aside",{className:"flex shrink-0 flex-col px-3 py-4 "+(p?"w-[60px]":"w-[216px]"),style:{background:"var(--color-canvas)",borderRight:"1px solid color-mix(in srgb, var(--color-border) 60%, transparent)"},children:[y.jsxs("div",{className:"flex items-center gap-2 px-1 "+(p?"justify-center":""),children:[!p&&y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("div",{className:"text-secondary font-semibold",children:"paqad-ai"}),y.jsxs("div",{className:"truncate text-caption",style:{color:"var(--color-muted)"},children:[t??"(unnamed project)",e?" · v"+e:""]})]}),y.jsx("button",{type:"button",className:"rounded-[6px] p-1.5",style:{color:"var(--color-muted)"},title:p?"Expand the sidebar":"Collapse the sidebar","aria-label":p?"Expand the sidebar":"Collapse the sidebar",onClick:O,children:y.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",children:p?y.jsx("path",{d:"M5 3l4 4-4 4"}):y.jsx("path",{d:"M9 3L5 7l4 4"})})})]}),y.jsxs("nav",{className:"mt-5 flex flex-col gap-0.5",children:[k("pulse","Pulse"),k("approvals","Approvals",f),k("trust","Trust"),k("build","Build"),k("site-map","Site map"),k("graph","Graph"),k("automation","Automation"),k("knowledge","Knowledge"),k("setup","Setup")]}),y.jsxs("div",{className:"mt-auto flex items-center gap-2 px-1 pt-4 "+(p?"flex-col justify-center":""),children:[y.jsxs("button",{type:"button",className:"rounded-[6px] px-2 py-1 text-caption",style:{color:"var(--color-muted)"},onClick:v,title:"Theme: "+l,children:["◐",!p&&" "+l]}),y.jsxs("span",{className:"flex items-center gap-1 text-caption "+(p?"":"ml-auto"),style:{color:n?"var(--color-mod-green)":"var(--color-muted)"},title:n?"Live (SSE connected)":"Reconnecting",children:[y.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{background:n?"var(--color-mod-green)":"var(--color-muted)"}}),!p&&(n?"live":"…")]})]})]}),y.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-auto",children:r}),y.jsx(BZ,{})]})}const GZ="Done. The agent continues with your choice.";function VZ(t){const e=Date.now()-Date.parse(t);if(!Number.isFinite(e)||e<0)return"";const n=Math.floor(e/864e5);if(n>0)return n+(n===1?" day":" days")+" waiting";const i=Math.floor(e/36e5);return i>0?i+(i===1?" hour":" hours")+" waiting":"just now"}function UZ({title:t}){return y.jsxs("div",{className:"rounded-lg border p-4 text-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:[y.jsx("div",{style:{color:"var(--color-muted)"},children:t}),y.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[y.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{background:"var(--color-accent)"}}),y.jsx("span",{children:GZ})]})]})}function YZ({item:t,onResolved:e}){const[n,i]=C.useState(null),[r,s]=C.useState(null),o=l=>{i(l),s(null),sZ(t.id,l).then(()=>{e(t.question)}).catch(u=>{s(u instanceof Error?u.message:String(u))}).finally(()=>i(null))};return y.jsxs("div",{className:"rounded-lg border p-4 text-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)",color:"var(--color-canvas-fg)"},children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsx("div",{className:"font-medium",children:t.question}),y.jsxs("span",{className:"shrink-0 text-xs",style:{color:"var(--color-muted)"},children:[t.id," · ",VZ(t.created_at)]})]}),y.jsx("div",{className:"mt-1 text-xs",style:{color:"var(--color-muted)"},children:t.context}),y.jsxs("div",{className:"mt-1 text-xs",style:{color:"var(--color-muted)"},children:["Asked by ",t.requested_by," · ",t.category]}),y.jsx("div",{className:"mt-3 flex flex-col gap-2",children:t.options.map(l=>{const u=t.recommendation===l.option_key;return y.jsxs("button",{type:"button",disabled:n!==null,className:"rounded-md border px-3 py-2 text-left disabled:opacity-50",style:{borderColor:u?"var(--color-accent)":"var(--color-border)",background:"var(--color-canvas)"},onClick:()=>o(l.option_key),children:[y.jsx("span",{className:"font-medium",children:n===l.option_key?"Saving…":l.label}),u&&y.jsx("span",{className:"ml-2 text-xs",style:{color:"var(--color-accent)"},children:"recommended"}),y.jsxs("span",{className:"mt-0.5 block text-xs",style:{color:"var(--color-muted)"},children:[l.one_line_preview," ",l.trade_off]})]},l.option_key)})}),r&&y.jsxs("div",{className:"mt-2 text-xs",style:{color:"var(--color-mod-red)"},children:[r," Your choice was not saved. Try again or resolve it in the conversation."]})]})}function qZ({item:t,onResolved:e}){const[n,i]=C.useState(!1),[r,s]=C.useState(null),o=l=>{i(!0),s(null),uZ(t.id,l).then(()=>{e(l==="accept"?"Module "+t.proposed_slug+" accepted. The map gains it on the next apply.":"Module "+t.proposed_slug+" rejected.")}).catch(u=>{s(u instanceof Error?u.message:String(u))}).finally(()=>i(!1))};return y.jsxs("div",{className:"rounded-lg border p-4 text-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)",color:"var(--color-canvas-fg)"},children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{className:"font-medium",children:["New module proposed: ",t.proposed_name," (",t.proposed_slug,")"]}),y.jsxs("span",{className:"shrink-0 text-xs",style:{color:"var(--color-muted)"},children:[t.id," · ",t.confidence," confidence"]})]}),t.reasoning&&y.jsx("div",{className:"mt-1 text-xs",style:{color:"var(--color-muted)"},children:t.reasoning}),t.prompt_excerpt&&y.jsxs("div",{className:"mt-1 text-xs italic",style:{color:"var(--color-muted)"},children:["“",t.prompt_excerpt,"”"]}),y.jsxs("div",{className:"mt-3 flex gap-2",children:[y.jsx("button",{type:"button",disabled:n,className:"rounded-md border px-3 py-1.5 disabled:opacity-50",style:{borderColor:"var(--color-accent)",color:"var(--color-accent)"},onClick:()=>o("accept"),children:"Accept"}),y.jsx("button",{type:"button",disabled:n,className:"rounded-md border px-3 py-1.5 disabled:opacity-50",style:{borderColor:"var(--color-border)",color:"var(--color-muted)"},onClick:()=>o("reject"),children:"Reject"})]}),y.jsxs("div",{className:"mt-2 text-xs",style:{color:"var(--color-muted)"},children:["Accept: the module map gains ",t.proposed_slug,", keeping your architecture map truthful. Reject: the proposal is closed and nothing changes."]}),r&&y.jsx("div",{className:"mt-2 text-xs",style:{color:"var(--color-mod-red)"},children:r})]})}function WZ(){const[t,e]=C.useState(null),[n,i]=C.useState(null),[r,s]=C.useState(!1),[o,l]=C.useState(null),[u,f]=C.useState(null),[h,p]=C.useState([]),g=C.useCallback(()=>{Dw().then(x=>{e(x),i(null)}).catch(x=>{i(x instanceof Error?x.message:String(x))})},[]);C.useEffect(()=>{g(),_i().then(x=>{l(x.projectName),f(x.frameworkVersion)}).catch(()=>{})},[g]),C.useEffect(()=>{const x=new EventSource("/api/events");return x.addEventListener("open",()=>s(!0)),x.addEventListener("error",()=>s(!1)),x.addEventListener("dashboard-updated",()=>g()),()=>{x.close()}},[g]);const O=x=>S=>{p(k=>[...k,{id:x,title:S}]),g()},v=t?[...t.pauses,...t.proposals].filter(x=>!h.some(S=>S.id===x.id)).sort((x,S)=>S.created_at.localeCompare(x.created_at)):[];return y.jsx(Qi,{projectName:o,frameworkVersion:u,sseLive:r,children:y.jsxs("div",{className:"mx-auto w-full max-w-3xl p-6",children:[y.jsx("h1",{className:"text-xl font-semibold",children:"Approvals"}),y.jsx("p",{className:"mt-1 text-sm",style:{color:"var(--color-muted)"},children:Xc.approvals}),n&&y.jsxs("div",{className:"mt-4 rounded-lg border p-4 text-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-mod-red)"},children:["Could not load the inbox: ",n]}),h.length>0&&y.jsx("div",{className:"mt-4 flex flex-col gap-3",children:h.map(x=>y.jsx(UZ,{title:x.title},x.id))}),t&&v.length===0&&h.length===0&&!n&&y.jsx("div",{className:"mt-6 rounded-lg border p-6 text-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)",color:"var(--color-muted)"},children:"Nothing needs you. Paqad pauses here the moment something does."}),y.jsx("div",{className:"mt-4 flex flex-col gap-3",children:v.map(x=>x.kind==="pause"?y.jsx(YZ,{item:x,onResolved:O(x.id)},x.id):y.jsx(qZ,{item:x,onResolved:O(x.id)},x.id))}),!t&&!n&&y.jsx("div",{className:"mt-6 text-sm",style:{color:"var(--color-muted)"},children:"Loading…"})]})})}const FZ={you:"You manage this",paqad:"Paqad manages this",shared:"Shared"};function Zc({managedBy:t}){const e=t==="you"?{background:"var(--color-accent)"}:t==="paqad"?{background:"var(--color-muted)"}:{background:"transparent",border:"1px solid var(--color-accent)"};return y.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 text-caption",style:{color:"var(--color-muted)"},children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block rounded-full",style:{width:6,height:6,...e}}),FZ[t]]})}const HZ={target:"_blank",rel:"noopener noreferrer"};function lN({title:t,problem:e,benefit:n,without:i,docsHref:r,onClose:s}){const[o,l]=C.useState(!1),u=C.useRef(null),f=C.useRef(null);C.useEffect(()=>{const p=requestAnimationFrame(()=>l(!0));return()=>cancelAnimationFrame(p)},[]),C.useEffect(()=>{f.current?.focus();const p=g=>{if(g.key==="Escape"){s();return}if(g.key!=="Tab"||!u.current)return;const O=u.current.querySelectorAll('button, a[href], [tabindex]:not([tabindex="-1"])');if(O.length===0)return;const v=O[0],x=O[O.length-1];g.shiftKey&&document.activeElement===v?(g.preventDefault(),x.focus()):!g.shiftKey&&document.activeElement===x&&(g.preventDefault(),v.focus())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[s]);const h=(p,g)=>y.jsxs("div",{className:"mt-5",children:[y.jsx("div",{className:"text-secondary font-medium",style:{color:"var(--color-muted)"},children:p}),y.jsx("div",{className:"mt-1 text-body",style:{color:"var(--color-canvas-fg)"},children:g})]});return y.jsxs("div",{className:"fixed inset-0 z-50",role:"dialog","aria-modal":"true","aria-label":t,children:[y.jsx("button",{type:"button","aria-label":"Close",tabIndex:-1,className:"absolute inset-0 h-full w-full cursor-default",style:{background:"rgba(15, 23, 42, 0.2)"},onClick:s}),y.jsxs("div",{ref:u,className:"absolute top-0 right-0 flex h-full w-[360px] max-w-full flex-col overflow-y-auto p-6",style:{background:"var(--color-surface)",boxShadow:"-8px 0 24px rgba(15, 23, 42, 0.12)",transform:o?"translateX(0)":"translateX(100%)",transition:"transform 200ms ease-out"},children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsx("h2",{className:"text-section font-semibold",style:{color:"var(--color-canvas-fg)"},children:t}),y.jsx("button",{ref:f,type:"button","aria-label":"Close",className:"rounded-[6px] px-2 py-1 text-secondary",style:{color:"var(--color-muted)"},onClick:s,children:"Close"})]}),h("The problem",e),h("What you get",n),i&&h("What happens without it",i),r&&y.jsx("div",{className:"mt-auto pt-6",children:y.jsx("a",{href:r,...HZ,className:"text-secondary",style:{color:"var(--color-accent)"},children:"Read the docs"})})]})]})}function Tn({children:t}){return y.jsx("p",{className:"mt-1 truncate text-secondary font-normal",style:{color:"var(--color-muted)"},children:t})}const KZ={web:"Editable here soon. For now the CLI and your editor remain the path.",prompt:"Lives in the conversation. This page shows status.",evidence:"View only, by design.",operation:null},JZ={"git-workflow":{label:"Edit the rules",route:"#/git-workflow"},instructions:{label:"Open the editor",route:"#/instructions"},"module-map":{label:"Edit the map",route:"#/module-map"},"design-tokens":{label:"Open the token editor",route:"#/design-tokens"}};function cN({item:t,onWhy:e}){const n=JZ[t.key],i=n?null:KZ[t.class];return y.jsxs("div",{className:"flex flex-col rounded-[10px] p-4",style:{background:"var(--color-surface)",color:"var(--color-canvas-fg)"},children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsx("div",{className:"min-w-0 text-body font-medium",children:t.name}),y.jsx(Zc,{managedBy:t.managedBy})]}),y.jsx(Tn,{children:t.why}),y.jsx("div",{className:"mt-2 text-secondary",style:{color:t.state.exists?"var(--color-canvas-fg)":"var(--color-muted)"},children:t.state.detail}),i&&y.jsx("div",{className:"mt-2 text-caption",style:{color:"var(--color-muted)"},children:i}),n&&y.jsx("div",{className:"mt-3",children:y.jsx("button",{type:"button",className:"rounded-[6px] border px-3 py-1.5 text-secondary font-medium",style:{borderColor:"var(--color-accent)",color:"var(--color-accent)"},onClick:()=>{window.location.hash=n.route.replace(/^#/,"")},children:n.label})}),y.jsx("div",{className:"mt-3",children:y.jsx("button",{type:"button",className:"text-caption",style:{color:"var(--color-accent)"},onClick:()=>e(t),children:"Why this matters"})})]})}function r0({area:t,title:e,extra:n}){const[i,r]=C.useState(null),[s,o]=C.useState(null),[l,u]=C.useState(!1),[f,h]=C.useState(null),[p,g]=C.useState(null),[O,v]=C.useState(null),{navigate:x}=zc(),S=C.useCallback(()=>{nN().then(E=>{r(E.items.filter(T=>T.area===t)),o(null)}).catch(E=>{o(E instanceof Error?E.message:String(E))})},[t]);C.useEffect(()=>{S(),_i().then(E=>{h(E.projectName),g(E.frameworkVersion)}).catch(()=>{})},[S]),C.useEffect(()=>{const E=new EventSource("/api/events");return E.addEventListener("open",()=>u(!0)),E.addEventListener("error",()=>u(!1)),E.addEventListener("dashboard-updated",()=>S()),()=>{E.close()}},[S]);const k=E=>{const T=sN[E.key]??{problem:E.why,benefit:E.why,without:""};v({title:E.name,copy:T})},$=i?[{heading:"You manage",members:i.filter(E=>E.class==="web")},{heading:"Paqad runs",members:i.filter(E=>E.class==="prompt"||E.class==="operation")},{heading:"Evidence",members:i.filter(E=>E.class==="evidence")}].filter(E=>E.members.length>0):[];return y.jsxs(Qi,{projectName:f,frameworkVersion:p,sseLive:l,children:[y.jsxs("div",{className:"mx-auto w-full max-w-4xl p-6",children:[y.jsx("h1",{className:"text-page font-semibold",children:e}),y.jsx(Tn,{children:Xc[t]}),s&&y.jsxs("div",{className:"mt-4 rounded-[10px] border p-4 text-secondary",style:{background:"var(--color-surface)",borderColor:"var(--color-mod-red)"},children:["Could not load this area: ",s]}),t==="build"&&y.jsxs("div",{className:"mt-6 flex items-center justify-between gap-3 rounded-[10px] p-4",style:{background:"var(--color-surface)"},children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"text-body font-medium",children:"Architecture graph"}),y.jsx(Tn,{children:"Every module, file and connection, drawn from the code itself."})]}),y.jsx("button",{type:"button",className:"shrink-0 rounded-[6px] border px-3 py-1.5 text-secondary font-medium",style:{borderColor:"var(--color-accent)",color:"var(--color-accent)"},onClick:()=>x("graph"),children:"Open the graph"})]}),$.map(E=>y.jsxs("section",{className:"mt-8",children:[y.jsx("h2",{className:"text-section font-medium",children:E.heading}),y.jsx("div",{className:"mt-3 grid gap-4 md:grid-cols-2",children:E.members.map(T=>y.jsx(cN,{item:T,onWhy:k},T.key))})]},E.heading)),n,i&&i.length===0&&!s&&y.jsx("div",{className:"mt-6 text-secondary",style:{color:"var(--color-muted)"},children:"Nothing lives in this area yet."}),!i&&!s&&y.jsx("div",{className:"mt-6 text-secondary",style:{color:"var(--color-muted)"},children:"Loading…"})]}),O&&y.jsx(lN,{title:O.title,problem:O.copy.problem,benefit:O.copy.benefit,without:O.copy.without,docsHref:O.copy.docsHref,onClose:()=>v(null)})]})}function e4({what:t,goodLooksLike:e}){const[n,i]=C.useState(!1),r=C.useRef(null);return C.useEffect(()=>{if(!n)return;const s=l=>{r.current&&!r.current.contains(l.target)&&i(!1)},o=l=>{l.key==="Escape"&&i(!1)};return window.addEventListener("mousedown",s),window.addEventListener("keydown",o),()=>{window.removeEventListener("mousedown",s),window.removeEventListener("keydown",o)}},[n]),y.jsxs("div",{className:"relative inline-block",ref:r,children:[y.jsx("button",{type:"button","aria-label":"What does this section mean?","aria-expanded":n,className:"inline-flex h-5 w-5 items-center justify-center rounded-full border text-xs",style:{borderColor:"var(--color-border)",color:"var(--color-muted)",background:"var(--color-canvas)"},onClick:()=>i(s=>!s),children:"?"}),n&&y.jsxs("div",{role:"dialog",className:"absolute right-0 z-10 mt-2 w-72 rounded-lg border p-3 text-xs shadow-lg",style:{background:"var(--color-surface)",borderColor:"var(--color-border)",color:"var(--color-canvas-fg)"},children:[y.jsx("div",{className:"font-semibold",children:"What this is"}),y.jsx("div",{className:"mt-1",style:{color:"var(--color-muted)"},children:t}),y.jsx("div",{className:"mt-3 font-semibold",children:"What good looks like"}),y.jsx("div",{className:"mt-1",style:{color:"var(--color-muted)"},children:e})]})]})}const t4={green:"var(--color-mod-green)",amber:"var(--color-mod-amber)",red:"var(--color-mod-red)",unknown:"var(--color-mod-unknown)"};function n4({score:t,band:e,title:n}){const i=t===null?"—":`${t}%`;return y.jsx("span",{className:"inline-flex select-none items-center justify-center rounded-full px-2 py-0.5 text-xs font-semibold text-white",style:{background:t4[e],minWidth:"2.5rem"},title:n??`Score = ${i} (${e})`,children:i})}function i4({section:t,pulsing:e,onOpen:n}){const i=t.score===null?`${t.title}: not applicable for this project`:`Score = ${t.score}% (${t.band})`;return y.jsxs("div",{className:"flex flex-col rounded-lg border p-4 text-sm shadow-sm transition-colors",style:{background:"var(--color-surface)",borderColor:e?"var(--color-accent)":"var(--color-border)",color:"var(--color-canvas-fg)"},children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsx("div",{className:"font-semibold",children:t.title}),y.jsx(n4,{score:t.score,band:t.band,title:i})]}),y.jsxs("div",{className:"mt-2 flex items-start justify-between gap-3",children:[y.jsx("div",{className:"min-h-[2.5em]",style:{color:"var(--color-muted)"},children:t.summary}),t.helper&&y.jsx(e4,{what:t.helper.what,goodLooksLike:t.helper.goodLooksLike})]}),t.metrics.length>0&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"my-3 border-t",style:{borderColor:"var(--color-border)"}}),y.jsx("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs",style:{color:"var(--color-muted)"},children:t.metrics.map(r=>y.jsxs("li",{children:[y.jsxs("span",{className:"opacity-70",children:[r.label,": "]}),y.jsx("span",{style:{color:"var(--color-canvas-fg)"},children:r.value})]},r.label))})]}),n&&y.jsx("div",{className:"mt-3 flex justify-end",children:y.jsx("button",{type:"button",className:"text-xs",style:{color:"var(--color-accent)"},onClick:()=>n(t),children:"Open →"})})]})}const LC={green:"var(--color-mod-green)",amber:"var(--color-mod-amber)",red:"var(--color-mod-red)",unknown:"var(--color-mod-unknown)"},r4={green:"All good",amber:"Needs your attention",red:"Needs your attention",unknown:"Not configured yet"};function s4({score:t,band:e,attention:n}){const i=t===null?"—":`${t}%`,r=t===null?0:t;return y.jsxs("div",{className:"sticky top-0 z-10 flex flex-col gap-3 border-b px-6 py-4 backdrop-blur",style:{background:"color-mix(in oklab, var(--color-canvas) 90%, transparent)",borderColor:"var(--color-border)"},children:[y.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-6 gap-y-2",children:[y.jsxs("div",{className:"flex items-baseline gap-3",children:[y.jsx("div",{className:"text-3xl font-semibold",style:{color:LC[e]},children:i}),y.jsx("div",{className:"text-sm uppercase tracking-wide",style:{color:"var(--color-muted)"},children:"Overall"})]}),y.jsx("div",{className:"text-base font-medium",children:r4[e]})]}),y.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full",style:{background:"var(--color-border)"},children:y.jsx("div",{className:"h-full rounded-full",style:{width:`${r}%`,background:LC[e]}})}),n.length>0&&y.jsx("ul",{className:"grid gap-1 text-xs",style:{color:"var(--color-canvas-fg)"},children:n.map((s,o)=>y.jsxs("li",{children:[y.jsx("span",{className:"mr-2 inline-block rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase",style:{background:s.severity==="critical"?"var(--color-mod-red)":s.severity==="warn"?"var(--color-mod-amber)":"var(--color-mod-unknown)",color:"white"},children:s.severity}),s.message]},`${s.sectionId}-${o}`))})]})}function o4(){const[t,e]=C.useState(null),[n,i]=C.useState(null),[r,s]=C.useState(!1),[o,l]=C.useState(new Set),u=C.useRef(null),{navigate:f}=zc(),h=C.useMemo(()=>()=>{_i().then(O=>{const v=u.current;if(v){const x=new Set,S=new Map(v.sections.map(k=>[k.id,k]));for(const k of O.sections){const $=S.get(k.id);(!$||$.score!==k.score||$.summary!==k.summary)&&x.add(k.id)}l(x),x.size>0&&setTimeout(()=>l(new Set),250)}u.current=O,e(O),i(null)}).catch(O=>{i(O instanceof Error?O.message:String(O))})},[]);C.useEffect(()=>{h()},[h]),C.useEffect(()=>{const O=new EventSource("/api/events");return O.addEventListener("open",()=>s(!0)),O.addEventListener("error",()=>s(!1)),O.addEventListener("dashboard-updated",()=>h()),()=>{O.close()}},[h]);const p={architecture:"graph",decisions:"approvals","module-decisions":"approvals",attestation:"trust"},g=O=>{const v=p[O.id];v&&f(v)};return y.jsxs(Qi,{projectName:t?.projectName??null,frameworkVersion:t?.frameworkVersion??null,sseLive:r,children:[t&&y.jsx(s4,{score:t.overallScore,band:t.overallBand,attention:t.attention}),n&&y.jsxs("div",{className:"m-6 rounded-lg border p-4 text-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-mod-red)"},children:["Error loading dashboard: ",n]}),t?.notOnboarded&&y.jsx("div",{className:"grid flex-1 place-items-center p-6",children:y.jsxs("div",{className:"max-w-md rounded-lg border p-6 text-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:[y.jsx("div",{className:"text-base font-medium",children:"Project not onboarded"}),y.jsxs("div",{className:"mt-2",style:{color:"var(--color-muted)"},children:["Run ",y.jsx("code",{children:"paqad-ai onboard"})," in this project to populate the dashboard."]})]})}),t&&!t.notOnboarded&&y.jsx("div",{className:"grid gap-6 p-6 md:grid-cols-2 xl:grid-cols-3",children:t.sections.map(O=>y.jsx(i4,{section:O,pulsing:o.has(O.id),onOpen:p[O.id]?g:void 0},O.id))}),!t&&!n&&y.jsx("div",{className:"grid flex-1 place-items-center text-sm",style:{color:"var(--color-muted)"},children:"Loading…"})]})}let Vb=[],uN=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1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").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?uN:Vb).push(n=n+t[e])})();function a4(t){if(t<768)return!1;for(let e=0,n=Vb.length;;){let i=e+n>>1;if(t<Vb[i])n=i;else if(t>=uN[i])e=i+1;else return!0;if(e==n)return!1}}function DC(t){return t>=127462&&t<=127487}const zC=8205;function l4(t,e,n=!0,i=!0){return(n?fN:c4)(t,e,i)}function fN(t,e,n){if(e==t.length)return e;e&&dN(t.charCodeAt(e))&&hN(t.charCodeAt(e-1))&&e--;let i=s0(t,e);for(e+=XC(i);e<t.length;){let r=s0(t,e);if(i==zC||r==zC||n&&a4(r))e+=XC(r),i=r;else if(DC(r)){let s=0,o=e-2;for(;o>=0&&DC(s0(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function c4(t,e,n){for(;e>0;){let i=fN(t,e-2,n);if(i<e)return i;e--}return 0}function s0(t,e){let n=t.charCodeAt(e);if(!hN(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return dN(i)?(n-55296<<10)+(i-56320)+65536:n}function dN(t){return t>=56320&&t<57344}function hN(t){return t>=55296&&t<56320}function XC(t){return t<65536?1:2}class We{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,i){[e,n]=uc(this,e,n);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),wr.from(r,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=uc(this,e,n);let i=[];return this.decompose(e,n,i,0),wr.from(i,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new jf(this),s=new jf(e);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(e=1){return new jf(this,e)}iterRange(e,n=this.length){return new pN(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new gN(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?We.empty:e.length<=32?new Mt(e):wr.from(Mt.split(e,[]))}}class Mt extends We{constructor(e,n=u4(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((n?i:l)>=e)return new f4(r,l,i,o);r=l+1,i++}}decompose(e,n,i,r){let s=e<=0&&n>=this.length?this:new Mt(ZC(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),l=gg(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new Mt(l,o.length+s.length));else{let u=l.length>>1;i.push(new Mt(l.slice(0,u)),new Mt(l.slice(u)))}}else i.push(s)}replace(e,n,i){if(!(i instanceof Mt))return super.replace(e,n,i);[e,n]=uc(this,e,n);let r=gg(this.text,gg(i.text,ZC(this.text,0,e)),n),s=this.length+i.length-(n-e);return r.length<=32?new Mt(r,s):wr.from(Mt.split(r,[]),s)}sliceString(e,n=this.length,i=`
`){[e,n]=uc(this,e,n);let r="";for(let s=0,o=0;s<=n&&o<this.text.length;o++){let l=this.text[o],u=s+l.length;s>e&&o&&(r+=i),e<u&&n>s&&(r+=l.slice(Math.max(0,e-s),n-s)),s=u+1}return r}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(n.push(new Mt(i,r)),i=[],r=-1);return r>-1&&n.push(new Mt(i,r)),n}}class wr extends We{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,u=i+o.lines-1;if((n?u:l)>=e)return o.lineInner(e,n,i,r);r=l+1,i=u+1}}decompose(e,n,i,r){for(let s=0,o=0;o<=n&&s<this.children.length;s++){let l=this.children[s],u=o+l.length;if(e<=u&&n>=o){let f=r&((o<=e?1:0)|(u>=n?2:0));o>=e&&u<=n&&!f?i.push(l):l.decompose(e-o,n-o,i,f)}o=u+1}}replace(e,n,i){if([e,n]=uc(this,e,n),i.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(e>=s&&n<=l){let u=o.replace(e-s,n-s,i),f=this.lines-o.lines+u.lines;if(u.lines<f>>4&&u.lines>f>>6){let h=this.children.slice();return h[r]=u,new wr(h,this.length-(n-e)+i.length)}return super.replace(s,l,u)}s=l+1}return super.replace(e,n,i)}sliceString(e,n=this.length,i=`
`){[e,n]=uc(this,e,n);let r="";for(let s=0,o=0;s<this.children.length&&o<=n;s++){let l=this.children[s],u=o+l.length;o>e&&s&&(r+=i),e<u&&n>o&&(r+=l.sliceString(e-o,n-o,i)),o=u+1}return r}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof wr))return 0;let i=0,[r,s,o,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==o||s==l)return i;let u=this.children[r],f=e.children[s];if(u!=f)return i+u.scanIdentical(f,n);i+=u.length+1}}static from(e,n=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let O of e)i+=O.lines;if(i<32){let O=[];for(let v of e)v.flatten(O);return new Mt(O,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],u=0,f=-1,h=[];function p(O){let v;if(O.lines>s&&O instanceof wr)for(let x of O.children)p(x);else O.lines>o&&(u>o||!u)?(g(),l.push(O)):O instanceof Mt&&u&&(v=h[h.length-1])instanceof Mt&&O.lines+v.lines<=32?(u+=O.lines,f+=O.length+1,h[h.length-1]=new Mt(v.text.concat(O.text),v.length+1+O.length)):(u+O.lines>r&&g(),u+=O.lines,f+=O.length+1,h.push(O))}function g(){u!=0&&(l.push(h.length==1?h[0]:wr.from(h,f)),f=-1,u=h.length=0)}for(let O of e)p(O);return g(),l.length==1?l[0]:new wr(l,n)}}We.empty=new Mt([""],0);function u4(t){let e=-1;for(let n of t)e+=n.length+1;return e}function gg(t,e,n=0,i=1e9){for(let r=0,s=0,o=!0;s<t.length&&r<=i;s++){let l=t[s],u=r+l.length;u>=n&&(u>i&&(l=l.slice(0,i-r)),r<n&&(l=l.slice(n-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=u+1}return e}function ZC(t,e,n){return gg(t,[""],e,n)}class jf{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof Mt?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof Mt?r.text.length:r.children.length;if(o==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(r instanceof Mt){let u=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=n,u.length>Math.max(0,e))return this.value=e==0?u:n>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=r.children[o+(n<0?-1:0)];e>u.length?(e-=u.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(u),this.offsets.push(n>0?1:(u instanceof Mt?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class pN{constructor(e,n,i){this.value="",this.done=!1,this.cursor=new jf(e,n>i?-1:1),this.pos=n>i?e.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class gN{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:i,value:r}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(We.prototype[Symbol.iterator]=function(){return this.iter()},jf.prototype[Symbol.iterator]=pN.prototype[Symbol.iterator]=gN.prototype[Symbol.iterator]=function(){return this});let f4=class{constructor(e,n,i,r){this.from=e,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function uc(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function un(t,e,n=!0,i=!0){return l4(t,e,n,i)}function d4(t){return t>=56320&&t<57344}function h4(t){return t>=55296&&t<56320}function mN(t,e){let n=t.charCodeAt(e);if(!h4(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return d4(i)?(n-55296<<10)+(i-56320)+65536:n}function p4(t){return t<65536?1:2}const Ub=/\r\n?|\n/;var wn=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(wn||(wn={}));class Qr{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n+1];e+=i<0?this.sections[n]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,i=0,r=0;n<this.sections.length;){let s=this.sections[n++],o=this.sections[n++];o<0?(e(i,r,s),r+=s):r+=o,i+=s}}iterChangedRanges(e,n=!1){Yb(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];r<0?e.push(i,r):e.push(r,i)}return new Qr(e)}composeDesc(e){return this.empty?e:e.empty?this:ON(this,e)}mapDesc(e,n=!1){return e.empty?this:qb(this,e,n)}mapPos(e,n=-1,i=wn.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],u=this.sections[o++],f=r+l;if(u<0){if(f>e)return s+(e-r);s+=l}else{if(i!=wn.Simple&&f>=e&&(i==wn.TrackDel&&r<e&&f>e||i==wn.TrackBefore&&r<e||i==wn.TrackAfter&&f>e))return null;if(f>e||f==e&&n<0&&!l)return e==r||n<0?s:s+u;s+=u}r=f}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,n=e){for(let i=0,r=0;i<this.sections.length&&r<=n;){let s=this.sections[i++],o=this.sections[i++],l=r+s;if(o>=0&&r<=n&&l>=e)return r<e&&l>n?"cover":!0;r=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qr(e)}static create(e){return new Qr(e)}}class Ut extends Qr{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Yb(this,(n,i,r,s,o)=>e=e.replace(r,r+(i-n),o),!1),e}mapDesc(e,n=!1){return qb(this,e,n,!0)}invert(e){let n=this.sections.slice(),i=[];for(let r=0,s=0;r<n.length;r+=2){let o=n[r],l=n[r+1];if(l>=0){n[r]=l,n[r+1]=o;let u=r>>1;for(;i.length<u;)i.push(We.empty);i.push(o?e.slice(s,s+o):We.empty)}s+=o}return new Ut(n,i)}compose(e){return this.empty?e:e.empty?this:ON(this,e,!0)}map(e,n=!1){return e.empty?this:qb(this,e,n,!0)}iterChanges(e,n=!1){Yb(this,e,n)}get desc(){return Qr.create(this.sections)}filter(e){let n=[],i=[],r=[],s=new qf(this);e:for(let o=0,l=0;;){let u=o==e.length?1e9:e[o++];for(;l<u||l==u&&s.len==0;){if(s.done)break e;let h=Math.min(s.len,u-l);cn(r,h,-1);let p=s.ins==-1?-1:s.off==0?s.ins:0;cn(n,h,p),p>0&&Oo(i,n,s.text),s.forward(h),l+=h}let f=e[o++];for(;l<f;){if(s.done)break e;let h=Math.min(s.len,f-l);cn(n,h,-1),cn(r,h,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(h),l+=h}}return{changes:new Ut(n,i),filtered:Qr.create(r)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n],r=this.sections[n+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,i){let r=[],s=[],o=0,l=null;function u(h=!1){if(!h&&!r.length)return;o<n&&cn(r,n-o,-1);let p=new Ut(r,s);l=l?l.compose(p.map(l)):p,r=[],s=[],o=0}function f(h){if(Array.isArray(h))for(let p of h)f(p);else if(h instanceof Ut){if(h.length!=n)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${n})`);u(),l=l?l.compose(h.map(l)):h}else{let{from:p,to:g=p,insert:O}=h;if(p>g||p<0||g>n)throw new RangeError(`Invalid change range ${p} to ${g} (in doc of length ${n})`);let v=O?typeof O=="string"?We.of(O.split(i||Ub)):O:We.empty,x=v.length;if(p==g&&x==0)return;p<o&&u(),p>o&&cn(r,p-o,-1),cn(r,g-p,x),Oo(s,r,v),o=g}}return f(e),u(!l),l}static empty(e){return new Ut(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length<r;)i.push(We.empty);i[r]=We.of(s.slice(1)),n.push(s[0],i[r].length)}}}return new Ut(n,i)}static createSet(e,n){return new Ut(e,n)}}function cn(t,e,n,i=!1){if(e==0&&n<=0)return;let r=t.length-2;r>=0&&n<=0&&n==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=n:i?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function Oo(t,e,n){if(n.length==0)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(We.empty);t.push(n)}}function Yb(t,e,n){let i=t.inserted;for(let r=0,s=0,o=0;o<t.sections.length;){let l=t.sections[o++],u=t.sections[o++];if(u<0)r+=l,s+=l;else{let f=r,h=s,p=We.empty;for(;f+=l,h+=u,u&&i&&(p=p.append(i[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],u=t.sections[o++];e(r,f,s,h,p),r=f,s=h}}}function qb(t,e,n,i=!1){let r=[],s=i?[]:null,o=new qf(t),l=new qf(e);for(let u=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let f=Math.min(o.len,l.len);cn(r,f,-1),o.forward(f),l.forward(f)}else if(l.ins>=0&&(o.ins<0||u==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!n))){let f=l.len;for(cn(r,l.ins,-1);f;){let h=Math.min(o.len,f);o.ins>=0&&u<o.i&&o.len<=h&&(cn(r,0,o.ins),s&&Oo(s,r,o.text),u=o.i),o.forward(h),f-=h}l.next()}else if(o.ins>=0){let f=0,h=o.len;for(;h;)if(l.ins==-1){let p=Math.min(h,l.len);f+=p,h-=p,l.forward(p)}else if(l.ins==0&&l.len<h)h-=l.len,l.next();else break;cn(r,f,u<o.i?o.ins:0),s&&u<o.i&&Oo(s,r,o.text),u=o.i,o.forward(o.len-h)}else{if(o.done&&l.done)return s?Ut.createSet(r,s):Qr.create(r);throw new Error("Mismatched change set lengths")}}}function ON(t,e,n=!1){let i=[],r=n?[]:null,s=new qf(t),o=new qf(e);for(let l=!1;;){if(s.done&&o.done)return r?Ut.createSet(i,r):Qr.create(i);if(s.ins==0)cn(i,s.len,0,l),s.next();else if(o.len==0&&!o.done)cn(i,0,o.ins,l),r&&Oo(r,i,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let u=Math.min(s.len2,o.len),f=i.length;if(s.ins==-1){let h=o.ins==-1?-1:o.off?0:o.ins;cn(i,u,h,l),r&&h&&Oo(r,i,o.text)}else o.ins==-1?(cn(i,s.off?0:s.len,u,l),r&&Oo(r,i,s.textBit(u))):(cn(i,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&Oo(r,i,o.text));l=(s.ins>u||o.ins>=0&&o.len>u)&&(l||i.length>f),s.forward2(u),o.forward(u)}}}}class qf{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?We.empty:e[n]}textBit(e){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!e?We.empty:n[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ia{constructor(e,n,i){this.from=e,this.to=n,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,n):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new ia(i,r,this.flags)}extend(e,n=e,i=0){if(e<=this.anchor&&n>=this.anchor)return pe.range(e,n,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return pe.range(this.anchor,r,void 0,void 0,i)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return pe.range(e.anchor,e.head)}static create(e,n,i){return new ia(e,n,i)}}class pe{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:pe.create(this.ranges.map(i=>i.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new pe([this.main],0)}addRange(e,n=!0){return pe.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let i=this.ranges.slice();return i[n]=e,pe.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new pe(e.ranges.map(n=>ia.fromJSON(n)),e.main)}static single(e,n=e){return new pe([pe.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return pe.normalized(e.slice(),n);i=s.to}return new pe(e,n)}static cursor(e,n=0,i,r){return ia.create(e,e,(n==0?0:n<0?8:16)|(i==null?7:Math.min(6,i))|(r??16777215)<<6)}static range(e,n,i,r,s){let o=(i??16777215)<<6|(r==null?7:Math.min(6,r));return!s&&e!=n&&(s=n<e?1:-1),n<e?ia.create(n,e,48|o):ia.create(e,n,(s?s<0?8:16:0)|o)}static normalized(e,n=0){let i=e[n];e.sort((r,s)=>r.from-s.from),n=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,u=Math.max(s.to,o.to);r<=n&&n--,e.splice(--r,2,s.anchor>s.head?pe.range(u,l):pe.range(l,u))}}return new pe(e,n)}}function yN(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let zw=0;class Ae{constructor(e,n,i,r,s){this.combine=e,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=zw++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Ae(e.combine||(n=>n),e.compareInput||((n,i)=>n===i),e.compare||(e.combine?(n,i)=>n===i:Xw),!!e.static,e.enables)}of(e){return new mg([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new mg(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new mg(e,this,2,n)}from(e,n){return n||(n=i=>i),this.compute([e],i=>n(i.field(e)))}}function Xw(t,e){return t==e||t.length==e.length&&t.every((n,i)=>n===e[i])}class mg{constructor(e,n,i,r){this.dependencies=e,this.facet=n,this.type=i,this.value=r,this.id=zw++}dynamicSlot(e){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,u=!1,f=!1,h=[];for(let p of this.dependencies)p=="doc"?u=!0:p=="selection"?f=!0:(((n=e[p.id])!==null&&n!==void 0?n:1)&1)==0&&h.push(e[p.id]);return{create(p){return p.values[o]=i(p),1},update(p,g){if(u&&g.docChanged||f&&(g.docChanged||g.selection)||Wb(p,h)){let O=i(p);if(l?!BC(O,p.values[o],r):!r(O,p.values[o]))return p.values[o]=O,1}return 0},reconfigure:(p,g)=>{let O,v=g.config.address[s];if(v!=null){let x=Ig(g,v);if(this.dependencies.every(S=>S instanceof Ae?g.facet(S)===p.facet(S):S instanceof Ts?g.field(S,!1)==p.field(S,!1):!0)||(l?BC(O=i(p),x,r):r(O=i(p),x)))return p.values[o]=x,0}else O=i(p);return p.values[o]=O,1}}}}function BC(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function Wb(t,e){let n=!1;for(let i of e)Mf(t,i)&1&&(n=!0);return n}function g4(t,e,n){let i=n.map(u=>t[u.id]),r=n.map(u=>u.type),s=i.filter(u=>!(u&1)),o=t[e.id]>>1;function l(u){let f=[];for(let h=0;h<i.length;h++){let p=Ig(u,i[h]);if(r[h]==2)for(let g of p)f.push(g);else f.push(p)}return e.combine(f)}return{create(u){for(let f of i)Mf(u,f);return u.values[o]=l(u),1},update(u,f){if(!Wb(u,s))return 0;let h=l(u);return e.compare(h,u.values[o])?0:(u.values[o]=h,1)},reconfigure(u,f){let h=Wb(u,i),p=f.config.facets[e.id],g=f.facet(e);if(p&&!h&&Xw(n,p))return u.values[o]=g,0;let O=l(u);return e.compare(O,g)?(u.values[o]=g,0):(u.values[o]=O,1)}}}const Op=Ae.define({static:!0});class Ts{constructor(e,n,i,r,s){this.id=e,this.createF=n,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let n=new Ts(zw++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Op).find(i=>i.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(Op),o=r.facet(Op),l;return(l=s.find(u=>u.field==this))&&l!=o.find(u=>u.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(e){return[this,Op.of({field:this,create:e})]}get extension(){return this}}const Jo={lowest:4,low:3,default:2,high:1,highest:0};function of(t){return e=>new vN(e,t)}const Bc={highest:of(Jo.highest),high:of(Jo.high),default:of(Jo.default),low:of(Jo.low),lowest:of(Jo.lowest)};class vN{constructor(e,n){this.inner=e,this.prec=n}}class Td{of(e){return new Fb(this,e)}reconfigure(e){return Td.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Fb{constructor(e,n){this.compartment=e,this.inner=n}}class Bg{constructor(e,n,i,r,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,i){let r=[],s=Object.create(null),o=new Map;for(let g of m4(e,n,o))g instanceof Ts?r.push(g):(s[g.facet.id]||(s[g.facet.id]=[])).push(g);let l=Object.create(null),u=[],f=[];for(let g of r)l[g.id]=f.length<<1,f.push(O=>g.slot(O));let h=i?.config.facets;for(let g in s){let O=s[g],v=O[0].facet,x=h&&h[g]||[];if(O.every(S=>S.type==0))if(l[v.id]=u.length<<1|1,Xw(x,O))u.push(i.facet(v));else{let S=v.combine(O.map(k=>k.value));u.push(i&&v.compare(S,i.facet(v))?i.facet(v):S)}else{for(let S of O)S.type==0?(l[S.id]=u.length<<1|1,u.push(S.value)):(l[S.id]=f.length<<1,f.push(k=>S.dynamicSlot(k)));l[v.id]=f.length<<1,f.push(S=>g4(S,v,O))}}let p=f.map(g=>g(l));return new Bg(e,o,p,l,u,s)}}function m4(t,e,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let u=r.get(o);if(u!=null){if(u<=l)return;let f=i[u].indexOf(o);f>-1&&i[u].splice(f,1),o instanceof Fb&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let f of o)s(f,l);else if(o instanceof Fb){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let f=e.get(o.compartment)||o.inner;n.set(o.compartment,f),s(f,l)}else if(o instanceof vN)s(o.inner,o.prec);else if(o instanceof Ts)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof mg)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,Jo.default);else{let f=o.extension;if(!f)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(f,l)}}return s(t,Jo.default),i.reduce((o,l)=>o.concat(l))}function Mf(t,e){if(e&1)return 2;let n=e>>1,i=t.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function Ig(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const bN=Ae.define(),Hb=Ae.define({combine:t=>t.some(e=>e),static:!0}),xN=Ae.define({combine:t=>t.length?t[0]:void 0,static:!0}),wN=Ae.define(),SN=Ae.define(),kN=Ae.define(),EN=Ae.define({combine:t=>t.length?t[0]:!1});class Cs{constructor(e,n){this.type=e,this.value=n}static define(){return new O4}}class O4{of(e){return new Cs(this,e)}}class y4{constructor(e){this.map=e}of(e){return new wt(this,e)}}class wt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new wt(this.type,n)}is(e){return this.type==e}static define(e={}){return new y4(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(n);s&&i.push(s)}return i}}wt.reconfigure=wt.define();wt.appendConfig=wt.define();class Bt{constructor(e,n,i,r,s,o){this.startState=e,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&yN(i,n.newLength),s.some(l=>l.type==Bt.time)||(this.annotations=s.concat(Bt.time.of(Date.now())))}static create(e,n,i,r,s,o){return new Bt(e,n,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Bt.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Bt.time=Cs.define();Bt.userEvent=Cs.define();Bt.addToHistory=Cs.define();Bt.remote=Cs.define();function v4(t,e){let n=[];for(let i=0,r=0;;){let s,o;if(i<t.length&&(r==e.length||e[r]>=t[i]))s=t[i++],o=t[i++];else if(r<e.length)s=e[r++],o=e[r++];else return n;!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function TN(t,e,n){var i;let r,s,o;return n?(r=e.changes,s=Ut.empty(e.changes.length),o=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(i=t.selection)===null||i===void 0?void 0:i.map(r),effects:wt.mapEffects(t.effects,r).concat(wt.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Kb(t,e,n){let i=e.selection,r=Kl(e.annotations);return e.userEvent&&(r=r.concat(Bt.userEvent.of(e.userEvent))),{changes:e.changes instanceof Ut?e.changes:Ut.of(e.changes||[],n,t.facet(xN)),selection:i&&(i instanceof pe?i:pe.single(i.anchor,i.head)),effects:Kl(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function CN(t,e,n){let i=Kb(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let o=!!e[s].sequential;i=TN(i,Kb(t,e[s],o?i.changes.newLength:t.doc.length),o)}let r=Bt.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return x4(n?b4(r):r)}function b4(t){let e=t.startState,n=!0;for(let r of e.facet(wN)){let s=r(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:v4(n,s))}if(n!==!0){let r,s;if(n===!1)s=t.changes.invertedDesc,r=Ut.empty(e.doc.length);else{let o=t.changes.filter(n);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=Bt.create(e,r,t.selection&&t.selection.map(s),wt.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let i=e.facet(SN);for(let r=i.length-1;r>=0;r--){let s=i[r](t);s instanceof Bt?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Bt?t=s[0]:t=CN(e,Kl(s),!1)}return t}function x4(t){let e=t.startState,n=e.facet(kN),i=t;for(let r=n.length-1;r>=0;r--){let s=n[r](t);s&&Object.keys(s).length&&(i=TN(i,Kb(e,s,t.changes.newLength),!0))}return i==t?t:Bt.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}const w4=[];function Kl(t){return t==null?w4:Array.isArray(t)?t:[t]}var hs=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(hs||(hs={}));const S4=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Jb;try{Jb=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function k4(t){if(Jb)return Jb.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||S4.test(n)))return!0}return!1}function E4(t){return e=>{if(!/\S/.test(e))return hs.Space;if(k4(e))return hs.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return hs.Word;return hs.Other}}class tt{constructor(e,n,i,r,s,o){this.config=e,this.doc=n,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)Mf(this,l<<1);this.computeSlot=null}field(e,n=!0){let i=this.config.address[e.id];if(i==null){if(n)throw new RangeError("Field is not present in this state");return}return Mf(this,i),Ig(this,i)}update(...e){return CN(this,e,!0)}applyTransaction(e){let n=this.config,{base:i,compartments:r}=n;for(let l of e.effects)l.is(Td.reconfigure)?(n&&(r=new Map,n.compartments.forEach((u,f)=>r.set(f,u)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(wt.reconfigure)?(n=null,i=l.value):l.is(wt.appendConfig)&&(n=null,i=Kl(i).concat(l.value));let s;n?s=e.startState.values.slice():(n=Bg.resolve(i,r,this),s=new tt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(u,f)=>f.reconfigure(u,this),null).values);let o=e.startState.facet(Hb)?e.newSelection:e.newSelection.asSingle();new tt(n,e.newDoc,o,s,(l,u)=>u.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:pe.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,i=e(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=Kl(i.effects);for(let l=1;l<n.ranges.length;l++){let u=e(n.ranges[l]),f=this.changes(u.changes),h=f.map(r);for(let g=0;g<l;g++)s[g]=s[g].map(h);let p=r.mapDesc(f,!0);s.push(u.range.map(p)),r=r.compose(h),o=wt.mapEffects(o,h).concat(wt.mapEffects(Kl(u.effects),p))}return{changes:r,selection:pe.create(s,n.mainIndex),effects:o}}changes(e=[]){return e instanceof Ut?e:Ut.of(e,this.doc.length,this.facet(tt.lineSeparator))}toText(e){return We.of(e.split(this.facet(tt.lineSeparator)||Ub))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Mf(this,n),Ig(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof Ts&&this.config.address[r.id]!=null&&(n[i]=r.spec.toJSON(this.field(e[i]),this))}return n}static fromJSON(e,n={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let o=i[s],l=e[s];r.push(o.init(u=>o.spec.fromJSON(l,u)))}}return tt.create({doc:e.doc,selection:pe.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=Bg.resolve(e.extensions||[],new Map),i=e.doc instanceof We?e.doc:We.of((e.doc||"").split(n.staticFacet(tt.lineSeparator)||Ub)),r=e.selection?e.selection instanceof pe?e.selection:pe.single(e.selection.anchor,e.selection.head):pe.single(0);return yN(r,i.length),n.staticFacet(Hb)||(r=r.asSingle()),new tt(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(tt.tabSize)}get lineBreak(){return this.facet(tt.lineSeparator)||`
`}get readOnly(){return this.facet(EN)}phrase(e,...n){for(let i of this.facet(tt.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),e}languageDataAt(e,n,i=-1){let r=[];for(let s of this.facet(bN))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return E4(n.length?n[0]:"")}wordAt(e){let{text:n,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let u=un(n,o,!1);if(s(n.slice(u,o))!=hs.Word)break;o=u}for(;l<r;){let u=un(n,l);if(s(n.slice(l,u))!=hs.Word)break;l=u}return o==l?null:pe.range(o+i,l+i)}}tt.allowMultipleSelections=Hb;tt.tabSize=Ae.define({combine:t=>t.length?t[0]:4});tt.lineSeparator=xN;tt.readOnly=EN;tt.phrases=Ae.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every(r=>t[r]==e[r])}});tt.languageData=bN;tt.changeFilter=wN;tt.transactionFilter=SN;tt.transactionExtender=kN;Td.reconfigure=wt.define();function Zw(t,e,n={}){let i={};for(let r of t)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}class bo{eq(e){return this==e}range(e,n=e){return ex.create(e,n,this)}}bo.prototype.startSide=bo.prototype.endSide=0;bo.prototype.point=!1;bo.prototype.mapMode=wn.TrackDel;function Bw(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let ex=class $N{constructor(e,n,i){this.from=e,this.to=n,this.value=i}static create(e,n,i){return new $N(e,n,i)}};function tx(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Iw{constructor(e,n,i,r){this.from=e,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,n,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let u=o+l>>1,f=s[u]-e||(i?this.value[u].endSide:this.value[u].startSide)-n;if(u==o)return f>=0?o:l;f>=0?l=u:o=u+1}}between(e,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let i=[],r=[],s=[],o=-1,l=-1;for(let u=0;u<this.value.length;u++){let f=this.value[u],h=this.from[u]+e,p=this.to[u]+e,g,O;if(h==p){let v=n.mapPos(h,f.startSide,f.mapMode);if(v==null||(g=O=v,f.startSide!=f.endSide&&(O=n.mapPos(h,f.endSide),O<g)))continue}else if(g=n.mapPos(h,f.startSide),O=n.mapPos(p,f.endSide),g>O||g==O&&f.startSide>0&&f.endSide<=0)continue;(O-g||f.endSide-f.startSide)<0||(o<0&&(o=g),f.point&&(l=Math.max(l,O-g)),i.push(f),r.push(g-o),s.push(O-o))}return{mapped:i.length?new Iw(r,s,i,l):null,pos:o}}}class ot{constructor(e,n,i,r){this.chunkPos=e,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(e,n,i,r){return new ot(e,n,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(tx)),this.isEmpty)return n.length?ot.of(n):this;let l=new _N(this,null,-1).goto(0),u=0,f=[],h=new fc;for(;l.value||u<n.length;)if(u<n.length&&(l.from-n[u].from||l.startSide-n[u].value.startSide)>=0){let p=n[u++];h.addInner(p.from,p.to,p.value)||f.push(p)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(u==n.length||this.chunkEnd(l.chunkIndex)<n[u].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&h.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(h.addInner(l.from,l.to,l.value)||f.push(ex.create(l.from,l.to,l.value))),l.next());return h.finishInner(this.nextLayer.isEmpty&&!f.length?ot.empty:this.nextLayer.update({add:f,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],i=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],u=this.chunk[o],f=e.touchesRange(l,l+u.length);if(f===!1)r=Math.max(r,u.maxPoint),n.push(u),i.push(e.mapPos(l));else if(f===!0){let{mapped:h,pos:p}=u.map(l,e);h&&(r=Math.max(r,h.maxPoint),n.push(h),i.push(p))}}let s=this.nextLayer.map(e);return n.length==0?s:new ot(i,n,s||ot.empty,r)}between(e,n,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(n>=s&&e<=s+o.length&&o.between(s,e-s,n-s,i)===!1)return}this.nextLayer.between(e,n,i)}}iter(e=0){return Wf.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Wf.from(e).goto(n)}static compare(e,n,i,r,s=-1){let o=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),l=n.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),u=IC(o,l,i),f=new af(o,u,s),h=new af(l,u,s);i.iterGaps((p,g,O)=>GC(f,p,h,g,O,r)),i.empty&&i.length==0&&GC(f,0,h,0,0,r)}static eq(e,n,i=0,r){r==null&&(r=999999999);let s=e.filter(h=>!h.isEmpty&&n.indexOf(h)<0),o=n.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=IC(s,o),u=new af(s,l,0).goto(i),f=new af(o,l,0).goto(i);for(;;){if(u.to!=f.to||!nx(u.active,f.active)||u.point&&(!f.point||!Bw(u.point,f.point)))return!1;if(u.to>r)return!0;u.next(),f.next()}}static spans(e,n,i,r,s=-1){let o=new af(e,null,s).goto(n),l=n,u=o.openStart;for(;;){let f=Math.min(o.to,i);if(o.point){let h=o.activeForPoint(o.to),p=o.pointFrom<n?h.length+1:o.point.startSide<0?h.length:Math.min(h.length,u);r.point(l,f,o.point,h,p,o.pointRank),u=Math.min(o.openEnd(f),h.length)}else f>l&&(r.span(l,f,o.active,u),u=o.openEnd(f));if(o.to>i)return u+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,n=!1){let i=new fc;for(let r of e instanceof ex?[e]:n?T4(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return ot.empty;let n=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=ot.empty;r=r.nextLayer)n=new ot(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}ot.empty=new ot([],[],null,-1);function T4(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(tx(e,i)>0)return t.slice().sort(tx);e=i}return t}ot.empty.nextLayer=ot.empty;class fc{finishChunk(e){this.chunks.push(new Iw(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,i){this.addInner(e,n,i)||(this.nextLayer||(this.nextLayer=new fc)).add(e,n,i)}addInner(e,n,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+e,this.lastTo=n.to[i]+e,!0}finish(){return this.finishInner(ot.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=ot.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function IC(t,e,n){let i=new Map;for(let s of t)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&i.set(s.chunk[o],s.chunkPos[o]);let r=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=i.get(s.chunk[o]);l!=null&&(n?n.mapPos(l):l)==s.chunkPos[o]&&!n?.touchesRange(l,l+s.chunk[o].length)&&r.add(s.chunk[o])}return r}class _N{constructor(e,n,i,r=0){this.layer=e,this.skip=n,this.minPoint=i,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],i=e+n.from[this.rangeIndex];if(this.from=i,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Wf{constructor(e){this.heap=e}static from(e,n=null,i=-1){let r=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&r.push(new _N(o,n,i,s));return r.length==1?r[0]:new Wf(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let i of this.heap)i.goto(e,n);for(let i=this.heap.length>>1;i>=0;i--)o0(this.heap,i);return this.next(),this}forward(e,n){for(let i of this.heap)i.forward(e,n);for(let i=this.heap.length>>1;i>=0;i--)o0(this.heap,i);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),o0(this.heap,0)}}}function o0(t,e){for(let n=t[e];;){let i=(e<<1)+1;if(i>=t.length)break;let r=t[i];if(i+1<t.length&&r.compare(t[i+1])>=0&&(r=t[i+1],i++),n.compare(r)<0)break;t[i]=n,t[e]=r,e=i}}class af{constructor(e,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Wf.from(e,n,i)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){yp(this.active,e),yp(this.activeTo,e),yp(this.activeRank,e),this.minActive=VC(this.active,this.activeTo)}addActive(e){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||r-this.activeTo[n])>0;)n++;vp(this.active,n,i),vp(this.activeTo,n,r),vp(this.activeRank,n,s),e&&vp(e,n,this.cursor.from),this.minActive=VC(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&yp(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(e){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)n++;return n}}function GC(t,e,n,i,r,s){t.goto(e),n.goto(i);let o=i+r,l=i,u=i-e,f=!!s.boundChange;for(let h=!1;;){let p=t.to+u-n.to,g=p||t.endSide-n.endSide,O=g<0?t.to+u:n.to,v=Math.min(O,o);if(t.point||n.point?(t.point&&n.point&&Bw(t.point,n.point)&&nx(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(l,v,t.point,n.point),h=!1):(h&&s.boundChange(l),v>l&&!nx(t.active,n.active)&&s.compareRange(l,v,t.active,n.active),f&&v<o&&(p||t.openEnd(O)!=n.openEnd(O))&&(h=!0)),O>o)break;l=O,g<=0&&t.next(),g>=0&&n.next()}}function nx(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!Bw(t[n],e[n]))return!1;return!0}function yp(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function vp(t,e,n){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=n}function VC(t,e){let n=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||t[r].endSide-t[n].endSide)<0&&(n=r,i=e[r]);return n}function jr(t,e,n=t.length){let i=0;for(let r=0;r<n&&r<t.length;)t.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=un(t,r));return i}function C4(t,e,n,i){for(let r=0,s=0;;){if(s>=e)return r;if(r==t.length)break;s+=t.charCodeAt(r)==9?n-s%n:1,r=un(t,r)}return t.length}const ix="ͼ",UC=typeof Symbol>"u"?"__"+ix:Symbol.for(ix),rx=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),YC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class xo{constructor(e,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,u,f){let h=[],p=/^@(\w+)\b/.exec(o[0]),g=p&&p[1]=="keyframes";if(p&&l==null)return u.push(o[0]+";");for(let O in l){let v=l[O];if(/&/.test(O))s(O.split(/,\s*/).map(x=>o.map(S=>x.replace(/&/,S))).reduce((x,S)=>x.concat(S)),v,u);else if(v&&typeof v=="object"){if(!p)throw new RangeError("The value of a property ("+O+") should be a primitive value.");s(r(O),v,h,g)}else v!=null&&h.push(O.replace(/_.*/,"").replace(/[A-Z]/g,x=>"-"+x.toLowerCase())+": "+v+";")}(h.length||g)&&u.push((i&&!p&&!f?o.map(i):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
`)}static newName(){let e=YC[UC]||1;return YC[UC]=e+1,ix+e.toString(36)}static mount(e,n,i){let r=e[rx],s=i&&i.nonce;r?s&&r.setNonce(s):r=new $4(e,s),r.mount(Array.isArray(n)?n:[n],e)}}let qC=new Map;class $4{constructor(e,n){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=qC.get(i);if(s)return e[rx]=s;this.sheet=new r.CSSStyleSheet,qC.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[rx]=this}mount(e,n){let i=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],u=this.modules.indexOf(l);if(u<s&&u>-1&&(this.modules.splice(u,1),s--,u=-1),u==-1){if(this.modules.splice(s++,0,l),i)for(let f=0;f<l.rules.length;f++)i.insertRule(l.rules[f],r++)}else{for(;s<u;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(i)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let o="";for(let u=0;u<this.modules.length;u++)o+=this.modules[u].getRules()+`
`;this.styleTag.textContent=o;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var wo={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ff={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},_4=typeof navigator<"u"&&/Mac/.test(navigator.platform),Q4=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var nn=0;nn<10;nn++)wo[48+nn]=wo[96+nn]=String(nn);for(var nn=1;nn<=24;nn++)wo[nn+111]="F"+nn;for(var nn=65;nn<=90;nn++)wo[nn]=String.fromCharCode(nn+32),Ff[nn]=String.fromCharCode(nn);for(var a0 in wo)Ff.hasOwnProperty(a0)||(Ff[a0]=wo[a0]);function A4(t){var e=_4&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Q4&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ff:wo)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}let xn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},sx=typeof document<"u"?document:{documentElement:{style:{}}};const ox=/Edge\/(\d+)/.exec(xn.userAgent),QN=/MSIE \d/.test(xn.userAgent),ax=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xn.userAgent),zm=!!(QN||ax||ox),WC=!zm&&/gecko\/(\d+)/i.test(xn.userAgent),l0=!zm&&/Chrome\/(\d+)/.exec(xn.userAgent),FC="webkitFontSmoothing"in sx.documentElement.style,lx=!zm&&/Apple Computer/.test(xn.vendor),HC=lx&&(/Mobile\/\w+/.test(xn.userAgent)||xn.maxTouchPoints>2);var we={mac:HC||/Mac/.test(xn.platform),windows:/Win/.test(xn.platform),linux:/Linux|X11/.test(xn.platform),ie:zm,ie_version:QN?sx.documentMode||6:ax?+ax[1]:ox?+ox[1]:0,gecko:WC,gecko_version:WC?+(/Firefox\/(\d+)/.exec(xn.userAgent)||[0,0])[1]:0,chrome:!!l0,chrome_version:l0?+l0[1]:0,ios:HC,android:/Android\b/.test(xn.userAgent),webkit:FC,webkit_version:FC?+(/\bAppleWebKit\/(\d+)/.exec(xn.userAgent)||[0,0])[1]:0,safari:lx,safari_version:lx?+(/\bVersion\/(\d+(\.\d+)?)/.exec(xn.userAgent)||[0,0])[1]:0,tabSize:sx.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Gw(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const Gg=Object.create(null);function Vw(t,e,n){if(t==e)return!0;t||(t=Gg),e||(e=Gg);let i=Object.keys(t),r=Object.keys(e);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function N4(t,e){for(let n=t.attributes.length-1;n>=0;n--){let i=t.attributes[n].name;e[i]==null&&t.removeAttribute(i)}for(let n in e){let i=e[n];n=="style"?t.style.cssText=i:t.getAttribute(n)!=i&&t.setAttribute(n,i)}}function KC(t,e,n){let i=!1;if(e)for(let r in e)n&&r in n||(i=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(n)for(let r in n)e&&e[r]==n[r]||(i=!0,r=="style"?t.style.cssText=n[r]:t.setAttribute(r,n[r]));return i}function P4(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=i.value}return e}class Aa{eq(e){return!1}updateDOM(e,n,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var kn=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(kn||(kn={}));class vt extends bo{constructor(e,n,i,r){super(),this.startSide=e,this.endSide=n,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Cd(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return n+=i&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Oa(e,n,n,i,e.widget||null,!1)}static replace(e){let n=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=AN(e,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new Oa(e,i,r,n,e.widget||null,!0)}static line(e){return new $d(e)}static set(e,n=!1){return ot.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}vt.none=ot.empty;class Cd extends vt{constructor(e){let{start:n,end:i}=AN(e);super(n?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Gw(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Gg}eq(e){return this==e||e instanceof Cd&&this.tagName==e.tagName&&Vw(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Cd.prototype.point=!1;class $d extends vt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof $d&&this.spec.class==e.spec.class&&Vw(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}$d.prototype.mapMode=wn.TrackBefore;$d.prototype.point=!0;class Oa extends vt{constructor(e,n,i,r,s,o){super(n,i,s,e),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?wn.TrackBefore:wn.TrackAfter:wn.TrackDel}get type(){return this.startSide!=this.endSide?kn.WidgetRange:this.startSide<=0?kn.WidgetBefore:kn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Oa&&R4(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Oa.prototype.point=!0;function AN(t,e=!1){let{inclusiveStart:n,inclusiveEnd:i}=t;return n==null&&(n=t.inclusive),i==null&&(i=t.inclusive),{start:n??e,end:i??e}}function R4(t,e){return t==e||!!(t&&e&&t.compare(e))}function Jl(t,e,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=t?n[r]=Math.max(n[r],e):n.push(t,e)}class Hf extends bo{constructor(e,n,i){super(),this.tagName=e,this.attributes=n,this.rank=i}eq(e){return e==this||e instanceof Hf&&this.tagName==e.tagName&&Vw(this.attributes,e.attributes)}static create(e){return new Hf(e.tagName,e.attributes||Gg,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return ot.of(e,n)}}Hf.prototype.startSide=Hf.prototype.endSide=-1;function Kf(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function cx(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Lf(t,e){if(!e.anchorNode)return!1;try{return cx(t,e.anchorNode)}catch{return!1}}function Og(t){return t.nodeType==3?Jf(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Df(t,e,n,i){return n?JC(t,e,n,i,-1)||JC(t,e,n,i,1):!1}function So(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Vg(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function JC(t,e,n,i,r){for(;;){if(t==n&&e==i)return!0;if(e==(r<0?0:bs(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=So(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?bs(t):0}else return!1}}function bs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ug(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function j4(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function NN(t,e){let n=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function M4(t,e,n,i,r,s,o,l){let u=t.ownerDocument,f=u.defaultView||window;for(let h=t,p=!1;h&&!p;)if(h.nodeType==1){let g,O=h==u.body,v=1,x=1;if(O)g=j4(f);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(p=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let $=h.getBoundingClientRect();({scaleX:v,scaleY:x}=NN(h,$)),g={left:$.left,right:$.left+h.clientWidth*v,top:$.top,bottom:$.top+h.clientHeight*x}}let S=0,k=0;if(r=="nearest")e.top<g.top+o?(k=e.top-(g.top+o),n>0&&e.bottom>g.bottom+k&&(k=e.bottom-g.bottom+o)):e.bottom>g.bottom-o&&(k=e.bottom-g.bottom+o,n<0&&e.top-k<g.top&&(k=e.top-(g.top+o)));else{let $=e.bottom-e.top,E=g.bottom-g.top;k=(r=="center"&&$<=E?e.top+$/2-E/2:r=="start"||r=="center"&&n<0?e.top-o:e.bottom-E+o)-g.top}if(i=="nearest"?e.left<g.left+s?(S=e.left-(g.left+s),n>0&&e.right>g.right+S&&(S=e.right-g.right+s)):e.right>g.right-s&&(S=e.right-g.right+s,n<0&&e.left<g.left+S&&(S=e.left-(g.left+s))):S=(i=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:i=="start"==l?e.left-s:e.right-(g.right-g.left)+s)-g.left,S||k)if(O)f.scrollBy(S,k);else{let $=0,E=0;if(k){let T=h.scrollTop;h.scrollTop+=k/x,E=(h.scrollTop-T)*x}if(S){let T=h.scrollLeft;h.scrollLeft+=S/v,$=(h.scrollLeft-T)*v}e={left:e.left-$,top:e.top-E,right:e.right-$,bottom:e.bottom-E},$&&Math.abs($-S)<1&&(i="nearest"),E&&Math.abs(E-k)<1&&(r="nearest")}if(O)break;(e.top<g.top||e.bottom>g.bottom||e.left<g.left||e.right>g.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function PN(t,e=!0){let n=t.ownerDocument,i=null,r=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}class L4{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:i}=e;this.set(n,Math.min(e.anchorOffset,n?bs(n):0),i,Math.min(e.focusOffset,i?bs(i):0))}set(e,n,i,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let Ho=null;we.safari&&we.safari_version>=26&&(Ho=!1);function RN(t){if(t.setActive)return t.setActive();if(Ho)return t.focus(Ho);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Ho==null?{get preventScroll(){return Ho={preventScroll:!0},!0}}:void 0),!Ho){Ho=!1;for(let n=0;n<e.length;){let i=e[n++],r=e[n++],s=e[n++];i.scrollTop!=r&&(i.scrollTop=r),i.scrollLeft!=s&&(i.scrollLeft=s)}}}let e2;function Jf(t,e,n=e){let i=e2||(e2=document.createRange());return i.setEnd(t,n),i.setStart(t,e),i}function ec(t,e,n,i){let r={key:e,code:e,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,t.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,t.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function D4(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function z4(t,e){let n=e.focusNode,i=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=i)return!1;for(i=Math.min(i,bs(n));;)if(i){if(n.nodeType!=1)return!1;let r=n.childNodes[i-1];r.contentEditable=="false"?i--:(n=r,i=bs(n))}else{if(n==t)return!0;i=So(n),n=n.parentNode}}function jN(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function MN(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=bs(n)}else if(n.parentNode&&!Vg(n))i=So(n),n=n.parentNode;else return null}}function LN(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i<n.nodeValue.length)return{node:n,offset:i};if(n.nodeType==1&&i<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[i],i=0}else if(n.parentNode&&!Vg(n))i=So(n)+1,n=n.parentNode;else return null}}class Wi{constructor(e,n,i=!0){this.node=e,this.offset=n,this.precise=i}static before(e,n){return new Wi(e.parentNode,So(e),n)}static after(e,n){return new Wi(e.parentNode,So(e)+1,n)}}var Et=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Et||(Et={}));const ya=Et.LTR,Uw=Et.RTL;function DN(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const X4=DN("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Z4=DN("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),ux=Object.create(null),pr=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);ux[e]=n,ux[n]=-e}function zN(t){return t<=247?X4[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?Z4[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const B4=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Er{get dir(){return this.level%2?Uw:ya}constructor(e,n,i){this.from=e,this.to=n,this.level=i}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,i,r){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=n&&l.to>=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.from<n:l.to>n:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function XN(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let i=t[n],r=e[n];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!XN(i.inner,r.inner))return!1}return!0}const pt=[];function I4(t,e,n,i,r){for(let s=0;s<=i.length;s++){let o=s?i[s-1].to:e,l=s<i.length?i[s].from:n,u=s?256:r;for(let f=o,h=u,p=u;f<l;f++){let g=zN(t.charCodeAt(f));g==512?g=h:g==8&&p==4&&(g=16),pt[f]=g==4?2:g,g&7&&(p=g),h=g}for(let f=o,h=u,p=u;f<l;f++){let g=pt[f];if(g==128)f<l-1&&h==pt[f+1]&&h&24?g=pt[f]=h:pt[f]=256;else if(g==64){let O=f+1;for(;O<l&&pt[O]==64;)O++;let v=f&&h==8||O<n&&pt[O]==8?p==1?1:8:256;for(let x=f;x<O;x++)pt[x]=v;f=O-1}else g==8&&p==1&&(pt[f]=1);h=g,g&7&&(p=g)}}}function G4(t,e,n,i,r){let s=r==1?2:1;for(let o=0,l=0,u=0;o<=i.length;o++){let f=o?i[o-1].to:e,h=o<i.length?i[o].from:n;for(let p=f,g,O,v;p<h;p++)if(O=ux[g=t.charCodeAt(p)])if(O<0){for(let x=l-3;x>=0;x-=3)if(pr[x+1]==-O){let S=pr[x+2],k=S&2?r:S&4?S&1?s:r:0;k&&(pt[p]=pt[pr[x]]=k),l=x;break}}else{if(pr.length==189)break;pr[l++]=p,pr[l++]=g,pr[l++]=u}else if((v=pt[p])==2||v==1){let x=v==r;u=x?0:1;for(let S=l-3;S>=0;S-=3){let k=pr[S+2];if(k&2)break;if(x)pr[S+2]|=2;else{if(k&4)break;pr[S+2]|=4}}}}}function V4(t,e,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:t,l=r<n.length?n[r].from:e;for(let u=o;u<l;){let f=pt[u];if(f==256){let h=u+1;for(;;)if(h==l){if(r==n.length)break;h=n[r++].to,l=r<n.length?n[r].from:e}else if(pt[h]==256)h++;else break;let p=s==1,g=(h<e?pt[h]:i)==1,O=p==g?p?1:2:i;for(let v=h,x=r,S=x?n[x-1].to:t;v>u;)v==S&&(v=n[--x].from,S=x?n[x-1].to:t),pt[--v]=O;u=h}else s=f,u++}}}function fx(t,e,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let u=e,f=0;u<n;){let h=!0,p=!1;if(f==s.length||u<s[f].from){let x=pt[u];x!=l&&(h=!1,p=x==16)}let g=!h&&l==1?[]:null,O=h?i:i+1,v=u;e:for(;;)if(f<s.length&&v==s[f].from){if(p)break e;let x=s[f];if(!h)for(let S=x.to,k=f+1;;){if(S==n)break e;if(k<s.length&&s[k].from==S)S=s[k++].to;else{if(pt[S]==l)break e;break}}if(f++,g)g.push(x);else{x.from>u&&o.push(new Er(u,x.from,O));let S=x.direction==ya!=!(O%2);dx(t,S?i+1:i,r,x.inner,x.from,x.to,o),u=x.to}v=x.to}else{if(v==n||(h?pt[v]!=l:pt[v]==l))break;v++}g?fx(t,u,v,i+1,r,g,o):u<v&&o.push(new Er(u,v,O)),u=v}else for(let u=n,f=s.length;u>e;){let h=!0,p=!1;if(!f||u>s[f-1].to){let x=pt[u-1];x!=l&&(h=!1,p=x==16)}let g=!h&&l==1?[]:null,O=h?i:i+1,v=u;e:for(;;)if(f&&v==s[f-1].to){if(p)break e;let x=s[--f];if(!h)for(let S=x.from,k=f;;){if(S==e)break e;if(k&&s[k-1].to==S)S=s[--k].from;else{if(pt[S-1]==l)break e;break}}if(g)g.push(x);else{x.to<u&&o.push(new Er(x.to,u,O));let S=x.direction==ya!=!(O%2);dx(t,S?i+1:i,r,x.inner,x.from,x.to,o),u=x.from}v=x.from}else{if(v==e||(h?pt[v-1]!=l:pt[v-1]==l))break;v--}g?fx(t,v,u,i+1,r,g,o):v<u&&o.push(new Er(v,u,O)),u=v}}function dx(t,e,n,i,r,s,o){let l=e%2?2:1;I4(t,r,s,i,l),G4(t,r,s,i,l),V4(r,s,i,l),fx(t,r,s,e,n,i,o)}function U4(t,e,n){if(!t)return[new Er(0,0,e==Uw?1:0)];if(e==ya&&!n.length&&!B4.test(t))return ZN(t.length);if(n.length)for(;t.length>pt.length;)pt[pt.length]=256;let i=[],r=e==ya?0:1;return dx(t,r,r,n,0,t.length,i),i}function ZN(t){return[new Er(0,t,0)]}let BN="";function Y4(t,e,n,i,r){var s;let o=i.head-t.from,l=Er.find(e,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),u=e[l],f=u.side(r,n);if(o==f){let g=l+=r?1:-1;if(g<0||g>=e.length)return null;u=e[l=g],o=u.side(!r,n),f=u.side(r,n)}let h=un(t.text,o,u.forward(r,n));(h<u.from||h>u.to)&&(h=f),BN=t.text.slice(Math.min(o,h),Math.max(o,h));let p=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return p&&h==f&&p.level+(r?0:1)<u.level?pe.cursor(p.side(!r,n)+t.from,p.forward(r,n)?1:-1,p.level):pe.cursor(h+t.from,u.forward(r,n)?-1:1,u.level)}function q4(t,e,n){for(let i=e;i<n;i++){let r=zN(t.charCodeAt(i));if(r==1)return ya;if(r==2||r==4)return Uw}return ya}const IN=Ae.define(),GN=Ae.define(),VN=Ae.define(),UN=Ae.define(),hx=Ae.define(),YN=Ae.define(),qN=Ae.define(),Yw=Ae.define(),qw=Ae.define(),WN=Ae.define({combine:t=>t.some(e=>e)}),FN=Ae.define({combine:t=>t.some(e=>e)}),HN=Ae.define();class tc{constructor(e,n,i,r,s,o=!1){this.range=e,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new tc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new tc(pe.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const bp=wt.define({map:(t,e)=>t.map(e)}),KN=wt.define();function Tr(t,e,n){let i=t.facet(UN);i.length?i[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const fs=Ae.define({combine:t=>t.length?t[0]:!0});let W4=0;const Il=Ae.define({combine(t){return t.filter((e,n)=>{for(let i=0;i<n;i++)if(t[i].plugin==e.plugin)return!1;return!0})}});class xs{constructor(e,n,i,r,s){this.id=e,this.create=n,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Il.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Il.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:i,eventObservers:r,provide:s,decorations:o}=n||{};return new xs(W4++,e,i,r,l=>{let u=[];return o&&u.push(Xm.of(f=>{let h=f.plugin(l);return h?o(h):vt.none})),s&&u.push(s(l)),u})}static fromClass(e,n){return xs.define((i,r)=>new e(i,r),n)}}class c0{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(Tr(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Tr(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){Tr(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const JN=Ae.define(),Ww=Ae.define(),Xm=Ae.define(),eP=Ae.define(),Fw=Ae.define(),_d=Ae.define(),tP=Ae.define();function t2(t,e){let n=t.state.facet(tP);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(t):s),r=[];return ot.spans(i,e.from,e.to,{point(){},span(s,o,l,u){let f=s-e.from,h=o-e.from,p=r;for(let g=l.length-1;g>=0;g--,u--){let O=l[g].spec.bidiIsolate,v;if(O==null&&(O=q4(e.text,f,h)),u>0&&p.length&&(v=p[p.length-1]).to==f&&v.direction==O)v.to=h,p=v.inner;else{let x={from:f,to:h,direction:O,inner:[]};p.push(x),p=x.inner}}}}),r}const nP=Ae.define();function iP(t){let e=0,n=0,i=0,r=0;for(let s of t.state.facet(nP)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:n,top:i,bottom:r}}const Tf=Ae.define();class xi{constructor(e,n,i,r){this.fromA=e,this.toA=n,this.fromB=i,this.toB=r}join(e){return new xi(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,i=this;for(;n>0;n--){let r=e[n-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(n-1,1)}}return e.splice(n,0,i),e}static extendWithRanges(e,n){if(n.length==0)return e;let i=[];for(let r=0,s=0,o=0;;){let l=r<e.length?e[r].fromB:1e9,u=s<n.length?n[s]:1e9,f=Math.min(l,u);if(f==1e9)break;let h=f+o,p=f,g=h;for(;;)if(s<n.length&&n[s]<=p){let O=n[s+1];s+=2,p=Math.max(p,O);for(let v=r;v<e.length&&e[v].fromB<=p;v++)o=e[v].toA-e[v].toB;g=Math.max(g,O+o)}else if(r<e.length&&e[r].fromB<=p){let O=e[r++];p=Math.max(p,O.toB),g=Math.max(g,O.toA),o=O.toA-O.toB}else break;i.push(new xi(h,g,f,p))}return i}}class Yg{constructor(e,n,i){this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Ut.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,l,u)=>r.push(new xi(s,o,l,u))),this.changedRanges=r}static create(e,n,i){return new Yg(e,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const F4=[];class Qt{constructor(e,n,i=0){this.dom=e,this.length=n,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return F4}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&N4(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let i=n;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let i=So(this.dom),r=this.length?e>0:n>0;return new Wi(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Bm)return e;return null}static get(e){return e.cmTile}}class Zm extends Qt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,i=null,r,s=e?.node==n?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=n2(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=n2(r);this.length=o}}function n2(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Bm extends Zm{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Qt.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof ms)n.push(r),i=o,r=0;else{let l=s+o.length,u=e(o,s);if(u!==void 0)return u;s=l+o.breakAfter}}}resolveBlock(e,n){let i,r=-1,s,o=-1;if(this.blockTiles((l,u)=>{let f=u+l.length;if(e>=u&&e<=f){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(u<e||e==f&&(n<-1?l.length:l.covers(1)))&&(!i||!l.isWidget()&&i.isWidget())&&(i=l,r=e-u),(f>e||e==u&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-u)}}),!i&&!s)throw new Error("No tile at position "+e);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}}class ms extends Zm{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let i=new ms(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}}class dc extends Zm{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,i){let r=new dc(n||document.createElement("div"),e);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,n,i){let r=null,s=-1,o=null,l=-1;function u(h,p){for(let g=0,O=0;g<h.children.length&&O<=p;g++){let v=h.children[g],x=O+v.length;x>=p&&(v.isComposite()?u(v,p-O):(!o||o.isHidden&&(n>0||i&&K4(o,v)))&&(x>p||v.flags&32)?(o=v,l=p-O):(O<p||v.flags&16&&!v.isHidden)&&(r=v,s=p-O)),O=x}}u(this,e);let f=(n<0?r:o)||r||o;return f?{tile:f,offset:f==r?s:l}:null}coordsIn(e,n){let i=this.resolveInline(e,n,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),n):H4(this)}domIn(e,n){let i=this.resolveInline(e,n);if(i){let{tile:r,offset:s}=i;if(this.dom.contains(r.dom))return r.isText()?new Wi(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:n);let o=i.tile.parent,l=!1;for(let u of o.children){if(l)return new Wi(u.dom,0);u==i.tile&&(l=!0)}}return new Wi(this.dom,0)}}function H4(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Og(e);return n[n.length-1]||null}function K4(t,e){let n=t.coordsIn(0,1),i=e.coordsIn(0,1);return n&&i&&i.top<n.bottom}class Xn extends Zm{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let i=new Xn(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}}class ra extends Qt{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let i=this.dom.nodeValue.length;e>i&&(e=i);let r=e,s=e,o=0;e==0&&n<0||e==i&&n>=0?we.chrome||we.gecko||(e?(r--,o=1):s<i&&(s++,o=-1)):n<0?r--:s<i&&s++;let l=Jf(this.dom,r,s).getClientRects();if(!l.length)return null;let u=l[(o?o<0:n>=0)?0:l.length-1];return we.safari&&!o&&u.width==0&&(u=Array.prototype.find.call(l,f=>f.width)||u),o?Ug(u,o<0):u||null}static of(e,n){let i=new ra(n||document.createTextNode(e),e);return n||(i.flags|=2),i}}class va extends Qt{constructor(e,n,i,r){super(e,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,i){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;if(i)return Ug(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let u=l?s.length-1:0;o=s[u],!(e>0?u==0:u==s.length-1||o.top<o.bottom);u+=l?-1:1);return Ug(o,!l)}}get overrideDOMText(){if(!this.length)return We.empty;let{root:e}=this;if(!e)return We.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,i,r,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new va(s,i,e,r)}}class qg extends Qt{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return We.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class J4{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;e||n>0;)if(r.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let u=r.children[s],f=u.breakAfter;(n>0?u.length<=e:u.length<e)&&(!i||i.skip(u,0,u.length)!==!1||!u.isComposite)?(o=!!f,s++,e-=u.length):(l.push({tile:r,index:s}),r=u,s=0,i&&u.isComposite()&&i.enter(u))}else if(s==r.length)o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++;else if(e){let u=Math.min(e,r.length-s);i&&i.skip(r,s,s+u),e-=u,s+=u}else break;return this.tile=r,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class eB{constructor(e,n,i,r){this.from=e,this.to=n,this.wrapper=i,this.rank=r}}class tB{constructor(e,n,i){this.cache=e,this.root=n,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,i,r){var s;this.flushBuffer();let o=this.ensureMarks(n,i),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let u=o.children[o.children.length-1]=new ra(l.dom,l.text+e);u.parent=o}else o.append(r||ra.of(e,(s=this.cache.find(ra))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let i=this.curLine;i.dom!=n.line.dom&&(i.setDOM(this.cache.reused.has(n.line)?u0(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let r=i;for(let l=n.marks.length-1;l>=0;l--){let u=n.marks[l],f=r.lastChild;if(f instanceof Xn&&f.mark.eq(u.mark))f.dom!=u.dom&&f.setDOM(u0(u.dom)),r=f;else{if(this.cache.reused.get(u)){let p=Qt.get(u.dom);p&&p.setDOM(u0(u.dom))}let h=Xn.of(u.mark,u.dom);r.append(h),r=h}this.cache.reused.set(u,2)}let s=Qt.get(e.text);s&&this.cache.reused.set(s,2);let o=new ra(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,r.append(o)}addInlineWidget(e,n,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var i;e||(e=rP);let r=dc.start(e,n||((i=this.cache.find(dc))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(n>0&&(l=r.lastChild)&&l instanceof Xn&&l.mark.eq(o))r=l,n--;else{let u=Xn.of(o,(i=this.cache.find(Xn,f=>f.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(u),r=u,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!i2(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(we.ios&&i2(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(f0,0,32)||new va(f0.toDOM(),0,f0,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=e.rank*102+e.value.rank,i=new eB(e.from,e.to,e.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.from<this.pos&&r instanceof ms&&r.wrapper.eq(i.wrapper))n=r;else{let s=ms.of(i.wrapper,(e=this.cache.find(ms,o=>o.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),i=this.cache.find(qg,void 0,1);return i&&(i.flags=n),i||new qg(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class nB{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const Wg=[va,dc,ra,Xn,qg,ms,Bm];for(let t=0;t<Wg.length;t++)Wg[t].bucket=t;class iB{constructor(e){this.view=e,this.buckets=Wg.map(()=>[]),this.index=Wg.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,i=this.buckets[n];i.length<6?i.push(e):i[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,i=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let l=s.length-1;l>=0;l--){let u=(l+o)%s.length,f=s[u];if((!n||n(f))&&!this.reused.has(f))return s.splice(u,1),u<o&&this.index[r]--,this.reused.set(f,i),f}return null}findWidget(e,n,i){let r=this.buckets[0];if(r.length)for(let s=0,o=0;;s++){if(s==r.length){if(o)return null;o=1,s=0}let l=r[s];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view,l.widget)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==n&&(l.flags&497)==i?(this.reused.set(l,1),l):(this.reused.set(l,2),new va(l.dom,n,e,l.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class rB{constructor(e,n,i,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new iB(e),this.text=new nB(e.state.doc),this.builder=new tB(this.cache,new Bm(e,e.contentDOM),ot.iter(i)),this.cache.reused.set(n,2),this.old=new J4(n),this.reuseWalker={skip:(o,l,u)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=o<e.length?e[o++]:null,u=l?l.fromA:this.old.root.length;if(u>r){let f=u-r;this.preserve(f,!o,!l),r=u,s+=f}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,i),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,l.toA),this.emit(n.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(s,l.toB)),s=l.toB,r=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,i){let r=aB(this.old),s=this.openMarks;this.old.advance(e,i?1:-1,{skip:(o,l,u)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(u-l);else{let f=u>0||l<o.length?va.of(o.widget,this.view,u-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);f.flags&256?(f.flags&=-2,this.builder.addBlockWidget(f)):(this.builder.ensureLine(null),this.builder.addInlineWidget(f,r,s),s=r.length)}else if(o.isText())this.builder.ensureLine(null),!l&&u==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,r,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,u),r,s)),s=r.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof qg)this.cache.add(o);else if(o instanceof Xn)this.builder.ensureLine(null),this.builder.addMark(o,r,s),this.cache.reused.set(o,1),s=r.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Xn&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof Xn&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let i=null,r=this.builder,s=0,o=ot.spans(this.decorations,e,n,{point:(l,u,f,h,p,g)=>{if(f instanceof Oa){if(this.disallowBlockEffectsFor[g]){if(f.block)throw new RangeError("Block decorations may not be specified via plugins");if(u>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=h.length,p>h.length)r.continueWidget(u-l);else{let O=f.widget||(f.block?hc.block:hc.inline),v=sB(f),x=this.cache.findWidget(O,u-l,v)||va.of(O,this.view,u-l,v);f.block?(f.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(x)):(r.ensureLine(i),r.addInlineWidget(x,h,p))}i=null}else i=oB(i,f);u>l&&this.text.skip(u-l)},span:(l,u,f,h)=>{for(let p=l;p<u;){let g=this.text.next(Math.min(512,u-p));g==null?(r.addLineStartIfNotCovered(i),r.addBreak(),p++):(r.ensureLine(i),r.addText(g,f,p==l?h:f.length),p+=g.length),i=null}}});r.addLineStartIfNotCovered(i),this.openWidget=o>s,this.openMarks=o}forward(e,n,i=1){n-e<=10?this.old.advance(n-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let n=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=Qt.get(r);if(r==this.view.contentDOM)break;s instanceof Xn?n.push(s):s?.isLine()?i=s:s instanceof ms||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new dc(r,rP):i||n.push(Xn.of(new Cd({tagName:r.nodeName.toLowerCase(),attributes:P4(r)}),r)))}return{line:i,marks:n}}}function i2(t,e){let n=i=>{for(let r of i.children)if((e?r.isText():r.length)||n(r))return!0;return!1};return n(t)}function sB(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const rP={class:"cm-line"};function oB(t,e){let n=e.spec.attributes,i=e.spec.class;return!n&&!i||(t||(t={class:"cm-line"}),n&&Gw(n,t),i&&(t.class+=" "+i)),t}function aB(t){let e=[];for(let n=t.parents.length;n>1;n--){let i=n==t.parents.length?t.tile:t.parents[n].tile;i instanceof Xn&&e.push(i.mark)}return e}function u0(t){let e=Qt.get(t);return e&&e.setDOM(t.cloneNode()),t}class hc extends Aa{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}hc.inline=new hc("span");hc.block=new hc("div");const f0=new class extends Aa{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class r2{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=vt.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Bm(e,e.contentDOM),this.updateInner([new xi(0,0,0,e.state.doc.length)],null)}update(e){var n;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:h,toA:p})=>p<this.minWidthFrom||h>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!mB(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?cB(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:h,to:p}=this.hasComposition;i=new xi(h,p,e.changes.mapPos(h,-1),e.changes.mapPos(p,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(we.ie||we.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let u=dB(o,this.decorations,e.changes);u.length&&(i=xi.extendWithRanges(i,u));let f=pB(l,this.blockWrappers,e.changes);return f.length&&(i=xi.extendWithRanges(i,f)),s&&!i.some(h=>h.fromA<=s.range.fromA&&h.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||e.length){let o=this.tile,l=new rB(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Qt.get(n.text)&&l.cache.reused.set(Qt.get(n.text),2),this.tile=l.run(e,n),px(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=we.chrome||we.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof d0&&r.push(s.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let i of n.effects)i.is(KN)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,s=r==i,o=!s&&!(this.view.state.facet(fs)||i.tabIndex>-1)&&Lf(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let u=this.view.state.selection.main,f,h;if(u.empty?h=f=this.inlineDOMNearPos(u.anchor,u.assoc||1):(h=this.inlineDOMNearPos(u.head,u.head==u.from?1:-1),f=this.inlineDOMNearPos(u.anchor,u.anchor==u.from?1:-1)),we.gecko&&u.empty&&!this.hasComposition&&lB(f)){let g=document.createTextNode("");this.view.observer.ignore(()=>f.node.insertBefore(g,f.node.childNodes[f.offset]||null)),f=h=new Wi(g,0),l=!0}let p=this.view.observer.selectionRange;(l||!p.focusNode||(!Df(f.node,f.offset,p.anchorNode,p.anchorOffset)||!Df(h.node,h.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,u))&&(this.view.observer.ignore(()=>{we.android&&we.chrome&&i.contains(p.focusNode)&&gB(p.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let g=Kf(this.view.root);if(g)if(u.empty){if(we.gecko){let O=uB(f.node,f.offset);if(O&&O!=3){let v=(O==1?MN:LN)(f.node,f.offset);v&&(f=new Wi(v.node,v.offset))}}g.collapse(f.node,f.offset),u.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=u.bidiLevel)}else if(g.extend){g.collapse(f.node,f.offset);try{g.extend(h.node,h.offset)}catch{}}else{let O=document.createRange();u.anchor>u.head&&([f,h]=[h,f]),O.setEnd(h.node,h.offset),O.setStart(f.node,f.offset),g.removeAllRanges(),g.addRange(O)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(f,h)),this.impreciseAnchor=f.precise?null:new Wi(p.anchorNode,p.anchorOffset),this.impreciseHead=h.precise?null:new Wi(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Df(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,i=Kf(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let u=this.coordsAt(n.head,-1),f=this.coordsAt(n.head,1);if(!u||!f||u.bottom>f.top)return;let h=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(h.node,h.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(e,n){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[n];else{let o=bs(e)==0?0:n==0?-1:1;for(;;){let l=e.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!Qt.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let u=i.children[o];if(u.dom==s)return l;l+=u.length+u.breakAfter}}else return i.isText()?e==i.dom?r+n:r+(n?i.length:0):r}domAtPos(e,n){let{tile:i,offset:r}=this.tile.resolveBlock(e,n);return i.isWidget()?i.domPosFor(e,n):i.domIn(r,n)}inlineDOMNearPos(e,n){let i,r=-1,s=!1,o,l=-1,u=!1;return this.tile.blockTiles((f,h)=>{if(f.isWidget()){if(f.flags&32&&h>=e)return!0;f.flags&16&&(s=!0)}else{let p=h+f.length;if(h<=e&&(i=f,r=e-h,s=p<e),p>=e&&!o&&(o=f,l=e-h,u=h>e),h>e&&o)return!0}}),!i&&!o?this.domAtPos(e,n):(s&&o?i=null:u&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(e,n){let{tile:i,offset:r}=this.tile.resolveBlock(e,n);return i.isWidget()?i.widget instanceof d0?null:i.coordsInWidget(r,n,!0):i.coordsIn(r,n)}lineAt(e,n){let{tile:i}=this.tile.resolveBlock(e,n);return i.isLine()?i:null}coordsForChar(e){let{tile:n,offset:i}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let u=r(l,o);if(u)return u}if(o-=l.length,o<0)break}else if(s.isText()&&o<s.length){let l=un(s.text,o);if(l==o)return null;let u=Jf(s.dom,o,l).getClientRects();for(let f=0;f<u.length;f++){let h=u[f];if(f==u.length-1||h.top<h.bottom&&h.left<h.right)return h}}return null}return r(n,i)}measureVisibleLineHeights(e){let n=[],{from:i,to:r}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,u=this.view.textDirection==Et.LTR,f=0,h=(p,g,O)=>{for(let v=0;v<p.children.length&&!(g>r);v++){let x=p.children[v],S=g+x.length,k=x.dom.getBoundingClientRect(),{height:$}=k;if(O&&!v&&(f+=k.top-O.top),x instanceof ms)S>i&&h(x,g,k);else if(g>=i&&(f>0&&n.push(-f),n.push($+f),f=0,o)){let E=x.dom.lastChild,T=E?Og(E):[];if(T.length){let _=T[T.length-1],Q=u?_.right-k.left:k.right-_.left;Q>l&&(l=Q,this.minWidth=s,this.minWidthFrom=g,this.minWidthTo=S)}}O&&v==p.children.length-1&&(f+=O.bottom-k.bottom),g=S+x.breakAfter}};return h(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?Et.RTL:Et.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,u;for(let f of o.children){if(!f.isText()||/[^ -~]/.test(f.text))return;let h=Og(f.dom);if(h.length!=1)return;l+=h[0].width,u=h[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:u}}});if(e)return e;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=Og(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;e.push(vt.replace({widget:new d0(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return vt.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Xm).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(Fw).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,n.push(ot.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(eP).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var n;if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet(HN))try{if(h(this.view,e.range,e))return!0}catch(p){Tr(this.view.state,p,"scroll handler")}let{range:i}=e,r=this.coordsAt(i.head,(n=i.assoc)!==null&&n!==void 0?n:i.empty?0:i.head>i.anchor?-1:1),s;if(!r)return;!i.empty&&(s=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let o=iP(this.view),l={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:u,offsetHeight:f}=this.view.scrollDOM;if(M4(this.view.scrollDOM,l,i.head<i.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,u),-u),Math.max(Math.min(e.yMargin,f),-f),this.view.textDirection==Et.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let h=this.view.docView.lineAt(i.head,1);h&&h.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=i=>i.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){px(this.tile)}}function px(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let i of t.children)px(i,e)}}function lB(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function sP(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let i=MN(n.focusNode,n.focusOffset),r=LN(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=Qt.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(t.docView.lastCompositionAfterCursor){let u=Qt.get(i.node);!u||u.isText()&&u.text!=i.node.nodeValue||(s=r)}}if(t.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function cB(t,e,n){let i=sP(t,n);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(i.from,i.to)!=l)return null;let u=e.invertedDesc;return{range:new xi(u.mapPos(s),u.mapPos(o),s,o),text:r}}function uB(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let fB=class{constructor(){this.changes=[]}compareRange(e,n){Jl(e,n,this.changes)}comparePoint(e,n){Jl(e,n,this.changes)}boundChange(e){Jl(e,e,this.changes)}};function dB(t,e,n){let i=new fB;return ot.compare(t,e,n,i),i.changes}class hB{constructor(){this.changes=[]}compareRange(e,n){Jl(e,n,this.changes)}comparePoint(){}boundChange(e){Jl(e,e,this.changes)}}function pB(t,e,n){let i=new hB;return ot.compare(t,e,n,i),i.changes}function gB(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function mB(t,e){let n=!1;return e&&t.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(n=!0)}),n}class d0 extends Aa{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function OB(t,e,n=1){let i=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(r.length==0)return pe.cursor(e);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=un(r.text,s,!1):l=un(r.text,s);let u=i(r.text.slice(o,l));for(;o>0;){let f=un(r.text,o,!1);if(i(r.text.slice(f,o))!=u)break;o=f}for(;l<r.length;){let f=un(r.text,l);if(i(r.text.slice(l,f))!=u)break;l=f}return pe.range(o+r.from,l+r.from)}function yB(t,e,n,i,r){let s=Math.round((i-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,u=Math.floor((r-n.top-(t.defaultLineHeight-l)*.5)/l);s+=u*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+C4(o,s,t.state.tabSize)}function gx(t,e,n){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==kn.Text&&(r.type!=s.type||(n<0?s.from<e:s.to>e)))&&(r=s)}}return r||i}return i}function vB(t,e,n,i){let r=gx(t,e.head,e.assoc||-1),s=!i||r.type!=kn.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(r.from),u=t.posAtCoords({x:n==(l==Et.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(u!=null)return pe.cursor(u,n?-1:1)}return pe.cursor(n?r.to:r.from,n?-1:1)}function s2(t,e,n,i){let r=t.state.doc.lineAt(e.head),s=t.bidiSpans(r),o=t.textDirectionAt(r.from);for(let l=e,u=null;;){let f=Y4(r,s,o,l,n),h=BN;if(!f){if(r.number==(n?t.state.doc.lines:1))return l;h=`
`,r=t.state.doc.line(r.number+(n?1:-1)),s=t.bidiSpans(r),f=t.visualLineSide(r,!n)}if(u){if(!u(h))return l}else{if(!i)return f;u=i(h)}l=f}}function bB(t,e,n){let i=t.state.charCategorizer(e),r=i(n);return s=>{let o=i(s);return r==hs.Space&&(r=o),r==o}}function xB(t,e,n,i){let r=e.head,s=n?1:-1;if(r==(n?t.state.doc.length:0))return pe.cursor(r,e.assoc);let o=e.goalColumn,l,u=t.contentDOM.getBoundingClientRect(),f=t.coordsAtPos(r,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),h=t.documentTop;if(f)o==null&&(o=f.left-u.left),l=s<0?f.top:f.bottom;else{let v=t.viewState.lineBlockAt(r);o==null&&(o=Math.min(u.right-u.left,t.defaultCharacterWidth*(r-v.from))),l=(s<0?v.top:v.bottom)+h}let p=u.left+o,g=t.viewState.heightOracle.textHeight>>1,O=i??g;for(let v=0;;v+=g){let x=l+(O+v)*s,S=mx(t,{x:p,y:x},!1,s);if(n?x>u.bottom:x<u.top)return pe.cursor(S.pos,S.assoc);let k=t.coordsAtPos(S.pos,S.assoc),$=k?(k.top+k.bottom)/2:0;if(!k||(n?$>l:$<l))return pe.cursor(S.pos,S.assoc,void 0,o)}}function zf(t,e,n){for(;;){let i=0;for(let r of t)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let u=i||n||(e-s<o-e?-1:1);e=u<0?s:o,i=u}});if(!i)return e}}function oP(t,e){let n=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],s=null;if(r.empty){let o=zf(t,r.from,0);o!=r.from&&(s=pe.cursor(o,-1))}else{let o=zf(t,r.from,-1),l=zf(t,r.to,1);(o!=r.from||l!=r.to)&&(s=pe.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(n||(n=e.ranges.slice()),n[i]=s)}return n?pe.create(n,e.mainIndex):e}function h0(t,e,n){let i=zf(t.state.facet(_d).map(r=>r(t)),n.from,e.head>n.from?-1:1);return i==n.from?n:pe.cursor(i,i<n.from?1:-1)}class Sr{constructor(e,n){this.pos=e,this.assoc=n}}function mx(t,e,n,i){let r=t.contentDOM.getBoundingClientRect(),s=r.top+t.viewState.paddingTop,{x:o,y:l}=e,u=l-s,f;for(;;){if(u<0)return new Sr(0,1);if(u>t.viewState.docHeight)return new Sr(t.state.doc.length,-1);if(f=t.elementAtHeight(u),i==null)break;if(f.type==kn.Text){if(i<0?f.to<t.viewport.from:f.from>t.viewport.to)break;let g=t.docView.coordsAt(i<0?f.from:f.to,i>0?-1:1);if(g&&(i<0?g.top<=u+s:g.bottom>=u+s))break}let p=t.viewState.heightOracle.textHeight/2;u=i>0?f.bottom+p:f.top-p}if(t.viewport.from>=f.to||t.viewport.to<=f.from){if(n)return null;if(f.type==kn.Text){let p=yB(t,r,f,o,l);return new Sr(p,p==f.from?1:-1)}}if(f.type!=kn.Text)return u<(f.top+f.bottom)/2?new Sr(f.from,1):new Sr(f.to,-1);let h=t.docView.lineAt(f.from,2);return(!h||h.length!=f.length)&&(h=t.docView.lineAt(f.from,-2)),new wB(t,o,l,t.textDirectionAt(f.from)).scanTile(h,f.from)}class wB{constructor(e,n,i,r){this.view=e,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[Er.find(r,e-i.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[Er.find(r,e-i.from,-1,n)].dir}bidiIn(e,n){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<n)}scan(e,n,i=!1){let r=0,s=e.length-1,o=new Set,l=this.bidiIn(e[0],e[s]),u,f,h=-1,p=1e9,g;e:for(;r<s;){let v=s-r,x=r+s>>1;t:if(o.has(x)){let k=r+Math.floor(Math.random()*v);for(let $=0;$<v;$++){if(!o.has(k)){x=k;break t}k++,k==s&&(k=r)}break e}o.add(x);let S=n(x);if(S)for(let k=0;k<S.length;k++){let $=S[k],E=0;if(!($.width==0&&S.length>1)){if($.bottom<this.y)(!u||u.bottom<$.bottom)&&(u=$),E=1;else if($.top>this.y)(!f||f.top>$.top)&&(f=$),E=-1;else{let T=$.left>this.x?this.x-$.left:$.right<this.x?this.x-$.right:0,_=Math.abs(T);_<p&&(h=x,p=_,g=$),T&&(E=T<0==(this.baseDir==Et.LTR)?-1:1)}E==-1&&(!l||this.baseDirAt(e[x],1))?s=x:E==1&&(!l||this.baseDirAt(e[x+1],-1))&&(r=x+1)}}}if(!g){if(!f&&!u)return{i:e[0],after:!1};let v=u&&(!f||this.y-u.bottom<f.top-this.y)?u:f;return this.y=(v.top+v.bottom)/2,this.scan(e,n,!0)}if(p&&!i){let{top:v,bottom:x}=g;if(u&&u.bottom>(v+v+x)/3)return this.y=u.bottom-1,this.scan(e,n,!0);if(f&&f.top<(v+x+x)/3)return this.y=f.top+1,this.scan(e,n,!0)}let O=(l?this.dirAt(e[h],1):this.baseDir)==Et.LTR;return{i:h,after:this.x>(g.left+g.right)/2==O}}scanText(e,n){let i=[];for(let s=0;s<e.length;s=un(e.text,s))i.push(n+s);i.push(n+e.length);let r=this.scan(i,s=>{let o=i[s]-n,l=i[s+1]-n;return Jf(e.dom,o,l).getClientRects()});return r.after?new Sr(i[r.i+1],-1):new Sr(i[r.i],1)}scanTile(e,n){if(!e.length)return new Sr(n,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,u=n;l<e.children.length;l++)i.push(u+=e.children[l].length);let r=this.scan(i,l=>{let u=e.children[l];return u.flags&48?null:(u.dom.nodeType==1?u.dom:Jf(u.dom,0,u.length)).getClientRects()}),s=e.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new Sr(i[r.i+1],-1):new Sr(o,1)}}const Ll="￿";class SB{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(tt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ll}readRange(e,n){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=Qt.get(r),l=r.nextSibling;if(l==n){o?.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let u=Qt.get(l);(o&&u?o.breakAfter:(o?o.breakAfter:Vg(r))||Vg(l)&&(r.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!EB(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(e){let n=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=o-1);i=s+o}}readNode(e){let n=Qt.get(e),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(e,n){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(kB(e,i.node,i.offset)?n:0))}}function kB(t,e,n){for(;;){if(!e||n<bs(e))return!1;if(e==t)return!0;n=So(e)+1,e=e.parentNode}}function EB(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let i=Qt.get(t);if(!i?.isWidget())return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let r=i.overrideDOMText;if(r?.length)return!1}return!0}class o2{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class TB{constructor(e,n,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=aP(e.docView.tile,n,i,0))){let u=s||o?[]:$B(e),f=new SB(u,e);f.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=f.text,this.newSel=_B(u,this.bounds.from)}else{let u=e.observer.selectionRange,f=s&&s.node==u.focusNode&&s.offset==u.focusOffset||!cx(e.contentDOM,u.focusNode)?l.main.head:e.docView.posFromDOM(u.focusNode,u.focusOffset),h=o&&o.node==u.anchorNode&&o.offset==u.anchorOffset||!cx(e.contentDOM,u.anchorNode)?l.main.anchor:e.docView.posFromDOM(u.anchorNode,u.anchorOffset),p=e.viewport;if((we.ios||we.chrome)&&l.main.empty&&f!=h&&(p.from>0||p.to<e.state.doc.length)){let g=Math.min(f,h),O=Math.max(f,h),v=p.from-g,x=p.to-O;(v==0||v==1||g==0)&&(x==0||x==-1||O==e.state.doc.length)&&(f=0,h=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(pe.range(h,f));else if(e.lineWrapping&&h==f&&!(l.main.empty&&l.main.head==f)&&e.inputState.lastTouchTime>Date.now()-100){let g=e.coordsAtPos(f,-1),O=0;g&&(O=e.inputState.lastTouchY<=g.bottom?-1:1),this.newSel=pe.create([pe.cursor(f,O)])}else this.newSel=pe.single(h,f)}}}function aP(t,e,n,i){if(t.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let u=0,f=i,h=i;u<t.children.length;u++){let p=t.children[u],g=f+p.length;if(f<e&&g>n)return aP(p,e,n,f);if(g>=e&&r==-1&&(r=u,s=f),f>n&&p.dom.parentNode==t.dom){o=u,l=h;break}h=g,f=g+p.breakAfter}return{from:s,to:l<0?i+t.length:l,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o<t.children.length&&o>=0?t.children[o].dom:null}}else return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function lP(t,e){let n,{newSel:i}=e,{state:r}=t,s=r.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:u}=e.bounds,f=s.from,h=null;(o===8||we.android&&e.text.length<u-l)&&(f=s.to,h="end");let p=r.doc.sliceString(l,u,Ll),g,O;!s.empty&&s.from>=l&&s.to<=u&&(e.typeOver||p!=e.text)&&p.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&p.slice(s.to-l)==e.text.slice(g=e.text.length-(p.length-(s.to-l)))?n={from:s.from,to:s.to,insert:We.of(e.text.slice(s.from-l,g).split(Ll))}:(O=cP(p,e.text,f-l,h))&&(we.chrome&&o==13&&O.toB==O.from+2&&e.text.slice(O.from,O.toB)==Ll+Ll&&O.toB--,n={from:l+O.from,to:l+O.toA,insert:We.of(e.text.slice(O.from,O.toB).split(Ll))})}else i&&(!t.hasFocus&&r.facet(fs)||Fg(i,s))&&(i=null);if(!n&&!i)return!1;if((we.mac||we.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=pe.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:We.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:r.toText(t.inputState.insertingText)}:we.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
 `&&t.lineWrapping&&(i&&(i=pe.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:We.of([" "])}),n)return Hw(t,n,i,o);if(i&&!Fg(i,s)){let l=!1,u="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),u=t.inputState.lastSelectionOrigin,u=="select.pointer"&&(i=oP(r.facet(_d).map(f=>f(t)),i))),t.dispatch({selection:i,scrollIntoView:l,userEvent:u}),!0}else return!1}function Hw(t,e,n,i=-1){if(we.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(we.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ec(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&ec(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&ec(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=CB(t,e,n));return t.state.facet(YN).some(u=>u(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function CB(t,e,n){let i,r=t.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let u=e.from<s.from?-1:1,f=u<0?s.from:s.to,h=zf(r.facet(_d).map(p=>p(t)),f,u);e.from==h&&(o=h)}if(o>-1)i={changes:e,selection:pe.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let u=s.from<e.from?r.sliceDoc(s.from,e.from):"",f=s.to>e.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(t.state.toText(u+e.insert.sliceString(0,void 0,t.state.lineBreak)+f))}else{let u=r.changes(e),f=n&&n.main.to<=u.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let h=t.state.sliceDoc(e.from,e.to),p,g=n&&sP(t,n.main.head);if(g){let v=e.insert.length-(e.to-e.from);p={from:g.from,to:g.to-v}}else p=t.state.doc.lineAt(s.head);let O=s.to-e.to;i=r.changeByRange(v=>{if(v.from==s.from&&v.to==s.to)return{changes:u,range:f||v.map(u)};let x=v.to-O,S=x-h.length;if(t.state.sliceDoc(S,x)!=h||x>=p.from&&S<=p.to)return{range:v};let k=r.changes({from:S,to:x,insert:e.insert}),$=v.to-s.to;return{changes:k,range:f?pe.range(Math.max(0,f.anchor+$),Math.max(0,f.head+$)):v.map(k)}})}else i={changes:u,selection:f&&r.selection.replaceRange(f)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function cP(t,e,n,i){let r=Math.min(t.length,e.length),s=0;for(;s<r&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let u=Math.max(0,s-Math.min(o,l));n-=o+u-s}if(o<s&&t.length<e.length){let u=n<=s&&n>=o?s-n:0;s-=u,l=s+(l-o),o=s}else if(l<s){let u=n<=s&&n>=l?s-n:0;s-=u,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function $B(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new o2(n,i)),(r!=n||s!=i)&&e.push(new o2(r,s))),e}function _B(t,e){if(t.length==0)return null;let n=t[0].pos,i=t.length==2?t[1].pos:n;return n>-1&&i>-1?pe.single(n+e,i+e):null}function Fg(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class QB{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,we.safari&&e.contentDOM.addEventListener("input",()=>null),we.gecko&&VB(e.contentDOM.ownerDocument)}handleEvent(e){!DB(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=AB(e),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&fP.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),we.android&&we.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return we.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((n=uP.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||NB.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,ec(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:we.safari&&!we.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function a2(t,e){return(n,i)=>{try{return e.call(t,i,n)}catch(r){Tr(n.state,r)}}}function AB(t){let e=Object.create(null);function n(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of t){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let u=s[l];u&&n(l).handlers.push(a2(i.value,u))}if(o)for(let l in o){let u=o[l];u&&n(l).observers.push(a2(i.value,u))}}for(let i in Ki)n(i).handlers.push(Ki[i]);for(let i in In)n(i).observers.push(In[i]);return e}const uP=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],NB="dthko",fP=[16,17,18,20,91,92,224,225],xp=6;function wp(t){return Math.max(0,t)*.7+8}function PB(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class RB{constructor(e,n,i,r){this.view=e,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=PN(e.contentDOM),this.atoms=e.state.facet(_d).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(tt.allowMultipleSelections)&&jB(e,n),this.dragging=LB(e,n)&&pP(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&PB(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let u=iP(this.view);e.clientX-u.left<=r+xp?n=-wp(r-e.clientX):e.clientX+u.right>=o-xp&&(n=wp(e.clientX-o)),e.clientY-u.top<=s+xp?i=-wp(s-e.clientY):e.clientY+u.bottom>=l-xp&&(i=wp(e.clientY-l)),this.setScrollSpeed(n,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,i=oP(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function jB(t,e){let n=t.state.facet(IN);return n.length?n[0](e):we.mac?e.metaKey:e.ctrlKey}function MB(t,e){let n=t.state.facet(GN);return n.length?n[0](e):we.mac?!e.altKey:!e.ctrlKey}function LB(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let i=Kf(t.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let o=r[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function DB(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,i;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=Qt.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const Ki=Object.create(null),In=Object.create(null),dP=we.ie&&we.ie_version<15||we.ios&&we.webkit_version<604;function zB(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),hP(t,n.value)},50)}function Im(t,e,n){for(let i of t.facet(e))n=i(n,t);return n}function hP(t,e){e=Im(t.state,Yw,e);let{state:n}=t,i,r=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(Ox!=null&&n.selection.ranges.every(u=>u.empty)&&Ox==s.toString()){let u=-1;i=n.changeByRange(f=>{let h=n.doc.lineAt(f.from);if(h.from==u)return{range:f};u=h.from;let p=n.toText((o?s.line(r++).text:e)+n.lineBreak);return{changes:{from:h.from,insert:p},range:pe.cursor(f.from+p.length)}})}else o?i=n.changeByRange(u=>{let f=s.line(r++);return{changes:{from:u.from,to:u.to,insert:f.text},range:pe.cursor(u.from+f.length)}}):i=n.replaceSelection(s);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}In.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};In.wheel=In.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};Ki.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);In.touchstart=(t,e)=>{let n=t.inputState,i=e.targetTouches[0];n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};In.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Ki.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of t.state.facet(VN))if(n=i(t,e),n)break;if(!n&&e.button==0&&(n=ZB(t,e)),n){let i=!t.hasFocus;t.inputState.startMouseSelection(new RB(t,e,n,i)),i&&t.observer.ignore(()=>{RN(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function l2(t,e,n,i){if(i==1)return pe.cursor(e,n);if(i==2)return OB(t.state,e,n);{let r=t.docView.lineAt(e,n),s=t.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<t.state.doc.length&&l==s.to&&l++,pe.range(o,l)}}const XB=we.ie&&we.ie_version<=11;let c2=null,u2=0,f2=0;function pP(t){if(!XB)return t.detail;let e=c2,n=f2;return c2=t,f2=Date.now(),u2=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(u2+1)%3:1}function ZB(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=pP(e),r=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let u=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),f,h=l2(t,u.pos,u.assoc,i);if(n.pos!=u.pos&&!o){let p=l2(t,n.pos,n.assoc,i),g=Math.min(p.from,h.from),O=Math.max(p.to,h.to);h=g<h.from?pe.range(g,O,h.assoc):pe.range(O,g,h.assoc)}return o?r.replaceRange(r.main.extend(h.from,h.to,h.assoc)):l&&i==1&&r.ranges.length>1&&(f=BB(r,u.pos))?f:l?r.addRange(h):pe.create([h])}}}function BB(t,e){for(let n=0;n<t.ranges.length;n++){let{from:i,to:r}=t.ranges[n];if(i<=e&&r>=e)return pe.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Ki.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=pe.range(s,o))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Im(t.state,qw,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ki.dragend=t=>(t.inputState.draggedContent=null,!1);function d2(t,e,n,i){if(n=Im(t.state,Yw,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=i&&s&&MB(t,e)?{from:s.from,to:s.to}:null,l={from:r,insert:n},u=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(r,-1),head:u.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Ki.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&d2(t,e,i.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<n.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return d2(t,e,i,!0),!0}return!1};Ki.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=dP?null:e.clipboardData;return n?(hP(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(zB(t),!1)};function IB(t,e){let n=t.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),t.focus()},50)}function GB(t){let e=[],n=[],i=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),n.push(r));if(!e.length){let r=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>r&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),r=o.number}i=!0}return{text:Im(t,qw,e.join(t.lineBreak)),ranges:n,linewise:i}}let Ox=null;Ki.copy=Ki.cut=(t,e)=>{if(!Lf(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=GB(t.state);if(!n&&!r)return!1;Ox=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=dP?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(IB(t,n),!1)};const gP=Cs.define();function mP(t,e){let n=[];for(let i of t.facet(qN)){let r=i(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:gP.of(!0)}):null}function OP(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=mP(t.state,e);n?t.dispatch(n):t.update([])}},10)}In.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),OP(t)};In.blur=t=>{t.observer.clearSelectionRange(),OP(t)};In.compositionstart=In.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};In.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,we.chrome&&we.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};In.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Ki.beforeinput=(t,e)=>{var n,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],u=t.posAtDOM(l.startContainer,l.startOffset),f=t.posAtDOM(l.endContainer,l.endOffset);return Hw(t,{from:u,to:f,insert:t.state.toText(s)},null),!0}}let r;if(we.chrome&&we.android&&(r=uP.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return we.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),we.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>In.compositionend(t,e),20),!1};const h2=new Set;function VB(t){h2.has(t)||(h2.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const p2=["pre-wrap","normal","pre-line","break-spaces"];let pc=!1;function g2(){pc=!1}class UB{constructor(e){this.lineWrapping=e,this.doc=We.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return p2.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(n=!0,this.heightSamples[Math.floor(r*10)]=!0)}return n}refresh(e,n,i,r,s,o){let l=p2.indexOf(e)>-1,u=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,u){this.heightSamples={};for(let f=0;f<o.length;f++){let h=o[f];h<0?f++:this.heightSamples[Math.floor(h*10)]=!0}}return u}}class YB{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Ui{constructor(e,n,i,r,s){this.from=e,this.length=n,this.top=i,this.height=r,this._content=s}get type(){return typeof this._content=="number"?kn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Oa?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Ui(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var mt=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(mt||(mt={}));const yg=.001;class En{constructor(e,n,i=2){this.length=e,this.height=n,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>yg&&(pc=!0),this.height=e)}replace(e,n,i){return En.of(i)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:u,toA:f,fromB:h,toB:p}=r[l],g=s.lineAt(u,mt.ByPosNoHeight,i.setDoc(n),0,0),O=g.to>=f?g:s.lineAt(f,mt.ByPosNoHeight,i,0,0);for(p+=O.to-f,f=O.to;l>0&&g.from<=r[l-1].toA;)u=r[l-1].fromA,h=r[l-1].fromB,l--,u<g.from&&(g=s.lineAt(u,mt.ByPosNoHeight,i,0,0));h+=g.from-u,u=g.from;let v=Kw.build(i.setDoc(o),e,h,p);s=Hg(s,s.replace(u,f,v))}return s.updateHeight(i,0)}static empty(){return new ni(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,i=e.length,r=0,s=0;for(;;)if(n==i)if(r>s*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[n++];l&&(r+=l.size)}else{let l=e[--i];l&&(s+=l.size)}let o=0;return e[n-1]==null?(o=1,n--):e[n]==null&&(o=1,i++),new WB(En.of(e.slice(0,n)),o,En.of(e.slice(i)))}}function Hg(t,e){return t==e?t:(t.constructor!=e.constructor&&(pc=!0),e)}En.prototype.size=1;const qB=vt.replace({});class yP extends En{constructor(e,n,i){super(e,n),this.deco=i,this.spaceAbove=0}mainBlock(e,n){return new Ui(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new Ui(r,0,i,this.spaceAbove,qB):this.mainBlock(i,r)}lineAt(e,n,i,r,s){let o=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,i,r,s).join(o):o}forEachLine(e,n,i,r,s,o){e<=s+this.length&&n>=s&&o(this.lineAt(0,mt.ByPos,i,r,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ni extends yP{constructor(e,n,i){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,n){return new Ui(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,i){let r=i[0];return i.length==1&&(r instanceof ni||r instanceof tn&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof tn?r=new ni(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):En.of(i)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class tn extends En{constructor(e){super(e,0)}heightMetrics(e,n){let i=e.doc.lineAt(n).number,r=e.doc.lineAt(n+this.length).number,s=r-i+1,o,l=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*s);o=u/s,this.length>s+1&&(l=(this.height-u)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(e,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:u}=this.heightMetrics(n,r);if(n.lineWrapping){let f=r+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),h=n.doc.lineAt(f),p=l+h.length*u,g=Math.max(i,e-p/2);return new Ui(h.from,h.length,g,p,0)}else{let f=Math.max(0,Math.min(o-s,Math.floor((e-i)/l))),{from:h,length:p}=n.doc.line(s+f);return new Ui(h,p,i+l*f,l,0)}}lineAt(e,n,i,r,s){if(n==mt.ByHeight)return this.blockAt(e,i,r,s);if(n==mt.ByPosNoHeight){let{from:O,to:v}=i.doc.lineAt(e);return new Ui(O,v-O,0,0,0)}let{firstLine:o,perLine:l,perChar:u}=this.heightMetrics(i,s),f=i.doc.lineAt(e),h=l+f.length*u,p=f.number-o,g=r+l*p+u*(f.from-s-p);return new Ui(f.from,f.length,Math.max(r,Math.min(g,r+this.height-h)),h,0)}forEachLine(e,n,i,r,s,o){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:l,perLine:u,perChar:f}=this.heightMetrics(i,s);for(let h=e,p=r;h<=n;){let g=i.doc.lineAt(h);if(h==e){let v=g.number-l;p+=u*v+f*(e-s-v)}let O=u+f*g.length;o(new Ui(g.from,g.length,p,O,0)),p+=O,h=g.to+1}}replace(e,n,i){let r=this.length-n;if(r>0){let s=i[i.length-1];s instanceof tn?i[i.length-1]=new tn(s.length+r):i.push(null,new tn(r-1))}if(e>0){let s=i[0];s instanceof tn?i[0]=new tn(e+s.length):i.unshift(new tn(e-1),null)}return En.of(i)}decomposeLeft(e,n){n.push(new tn(e-1),null)}decomposeRight(e,n){n.push(null,new tn(this.length-e-1))}updateHeight(e,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],l=Math.max(n,r.from),u=-1;for(r.from>n&&o.push(new tn(r.from-n-1).updateHeight(e,n));l<=s&&r.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let p=r.heights[r.index++],g=0;p<0&&(g=-p,p=r.heights[r.index++]),u==-1?u=p:Math.abs(p-u)>=yg&&(u=-2);let O=new ni(h,p,g);O.outdated=!1,o.push(O),l+=h+1}l<=s&&o.push(null,new tn(s-l).updateHeight(e,l));let f=En.of(o);return(u<0||Math.abs(f.height-this.height)>=yg||Math.abs(u-this.heightMetrics(e,n).perLine)>=yg)&&(pc=!0),Hg(this,f)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class WB extends En{constructor(e,n,i){super(e.length+n+i.length,e.height+i.height,n|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,n,i,r){let s=i+this.left.height;return e<s?this.left.blockAt(e,n,i,r):this.right.blockAt(e,n,s,r+this.left.length+this.break)}lineAt(e,n,i,r,s){let o=r+this.left.height,l=s+this.left.length+this.break,u=n==mt.ByHeight?e<o:e<l,f=u?this.left.lineAt(e,n,i,r,s):this.right.lineAt(e,n,i,o,l);if(this.break||(u?f.to<l:f.from>l))return f;let h=n==mt.ByPosNoHeight?mt.ByPosNoHeight:mt.ByPos;return u?f.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,r,s).join(f)}forEachLine(e,n,i,r,s,o){let l=r+this.left.height,u=s+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,n,i,r,s,o),n>=u&&this.right.forEachLine(e,n,i,l,u,o);else{let f=this.lineAt(u,mt.ByPos,i,r,s);e<f.from&&this.left.forEachLine(e,f.from-1,i,r,s,o),f.to>=e&&f.from<=n&&o(f),n>f.to&&this.right.forEachLine(f.to+1,n,i,l,u,o)}}replace(e,n,i){let r=this.left.length+this.break;if(n<r)return this.balanced(this.left.replace(e,n,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,n-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of i)s.push(l);if(e>0&&m2(s,o-1),n<this.length){let l=s.length;this.decomposeRight(n,s),m2(s,l)}return En.of(s)}decomposeLeft(e,n){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(i++,e>=i&&n.push(null)),e>i&&this.right.decomposeLeft(e-i,n)}decomposeRight(e,n){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,n);e<i&&this.left.decomposeRight(e,n),this.break&&e<r&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?En.of(this.break?[e,null,n]:[e,n]):(this.left=Hg(this.left,e),this.right=Hg(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,i=!1,r){let{left:s,right:o}=this,l=n+s.length+this.break,u=null;return r&&r.from<=n+s.length&&r.more?u=s=s.updateHeight(e,n,i,r):s.updateHeight(e,n,i),r&&r.from<=l+o.length&&r.more?u=o=o.updateHeight(e,l,i,r):o.updateHeight(e,l,i),u?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function m2(t,e){let n,i;t[e]==null&&(n=t[e-1])instanceof tn&&(i=t[e+1])instanceof tn&&t.splice(e-1,3,new tn(n.length+1+i.length))}const FB=5;class Kw{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof ni?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new ni(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,i){if(e<n||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=n-e;i.block?this.addBlock(new yP(o,r,i)):(o||s||r>=FB)&&this.addLineDeco(r,s,o)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new ni(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let i=new tn(n-e);return this.oracle.doc.lineAt(e).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ni)return e;let n=new ni(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof ni)&&!this.isCovered?this.nodes.push(new ni(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof ni&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,n,i,r){let s=new Kw(i,e);return ot.spans(n,i,r,s,0),s.finish(i)}}function HB(t,e,n){let i=new KB;return ot.compare(t,e,n,i,0),i.changes}class KB{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,i,r){(e<n||i&&i.heightRelevant||r&&r.heightRelevant)&&Jl(e,n,this.changes,5)}}function JB(t,e){let n=t.getBoundingClientRect(),i=t.ownerDocument,r=i.defaultView||window,s=Math.max(0,n.left),o=Math.min(r.innerWidth,n.right),l=Math.max(0,n.top),u=Math.min(r.innerHeight,n.bottom);for(let f=t.parentNode;f&&f!=i.body;)if(f.nodeType==1){let h=f,p=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&p.overflow!="visible"){let g=h.getBoundingClientRect();s=Math.max(s,g.left),o=Math.min(o,g.right),l=Math.max(l,g.top),u=Math.min(f==t.parentNode?r.innerHeight:u,g.bottom)}f=p.position=="absolute"||p.position=="fixed"?h.offsetParent:h.parentNode}else if(f.nodeType==11)f=f.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+e),bottom:Math.max(l,u)-(n.top+e)}}function eI(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function tI(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class p0{constructor(e,n,i,r){this.from=e,this.to=n,this.size=i,this.displaySize=r}static same(e,n){if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],s=n[i];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,n){return vt.replace({widget:new nI(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class nI extends Aa{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class O2{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=y2,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Et.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=n.facet(Ww).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new UB(i),this.stateDeco=v2(n),this.heightMap=En.empty().applyChanges(this.stateDeco,We.empty,this.heightOracle.setDoc(n.doc),[new xi(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=vt.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new Sp(s,o))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?y2:new Jw(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Cf(e,this.scaler))})}update(e,n=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=v2(this.state);let r=e.changedRanges,s=xi.extendWithRanges(r,HB(i,this.stateDeco,e?e.changes:Ut.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);g2(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||pc)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let u=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<u.from||n.range.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,n));let f=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(f||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(FN)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Et.RTL:Et.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),u=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let f=0,h=0;if(l.width&&l.height){let{scaleX:_,scaleY:Q}=NN(n,l);(_>.005&&Math.abs(this.scaleX-_)>.005||Q>.005&&Math.abs(this.scaleY-Q)>.005)&&(this.scaleX=_,this.scaleY=Q,f|=16,o=u=!0)}let p=(parseInt(i.paddingTop)||0)*this.scaleY,g=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=g)&&(this.paddingTop=p,this.paddingBottom=g,f|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,f|=16);let O=PN(this.view.contentDOM,!1).y;O!=this.scrollParent&&(this.scrollParent=O,this.scrollAnchorHeight=-1,this.scrollOffset=0);let v=this.getScrollOffset();this.scrollOffset!=v&&(this.scrollAnchorHeight=-1,this.scrollOffset=v),this.scrolledToBottom=jN(this.scrollParent||e.win);let x=(this.printing?tI:JB)(n,this.paddingTop),S=x.top-this.pixelViewport.top,k=x.bottom-this.pixelViewport.bottom;this.pixelViewport=x;let $=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if($!=this.inView&&(this.inView=$,$&&(u=!0)),!this.inView&&!this.scrollTarget&&!eI(e.dom))return 0;let E=l.width;if((this.contentDOMWidth!=E||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,f|=16),u){let _=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(_)&&(o=!0),o||r.lineWrapping&&Math.abs(E-this.contentDOMWidth)>r.charWidth){let{lineHeight:Q,charWidth:N,textHeight:R}=e.docView.measureTextSize();o=Q>0&&r.refresh(s,Q,N,R,Math.max(5,E/N),_),o&&(e.docView.minWidth=0,f|=16)}S>0&&k>0?h=Math.max(S,k):S<0&&k<0&&(h=Math.min(S,k)),g2();for(let Q of this.viewports){let N=Q.from==this.viewport.from?_:e.docView.measureVisibleLineHeights(Q);this.heightMap=(o?En.empty().applyChanges(this.stateDeco,We.empty,this.heightOracle,[new xi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new YB(Q.from,N))}pc&&(f|=2)}let T=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return T&&(f&2&&(f|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),f|=this.updateForViewport()),(f&2||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),f|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),f}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,u=new Sp(r.lineAt(o-i*1e3,mt.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,mt.ByHeight,s,0,0).to);if(n){let{head:f}=n.range;if(f<u.from||f>u.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=r.lineAt(f,mt.ByPos,s,0,0),g;n.y=="center"?g=(p.top+p.bottom)/2-h/2:n.y=="start"||n.y=="nearest"&&f<u.from?g=p.top:g=p.bottom-h,u=new Sp(r.lineAt(g-1e3/2,mt.ByHeight,s,0,0).from,r.lineAt(g+h+1e3/2,mt.ByHeight,s,0,0).to)}}return u}mapViewport(e,n){let i=n.mapPos(e.from,-1),r=n.mapPos(e.to,1);return new Sp(this.heightMap.lineAt(i,mt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,mt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,mt.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,mt.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||r<=o-Math.max(10,Math.min(-i,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let i=[];for(let r of e)n.touchesRange(r.from,r.to)||i.push(new p0(n.mapPos(r.from),n.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,n){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=Et.LTR&&!i)return[];let l=[],u=(h,p,g,O)=>{if(p-h<s)return;let v=this.state.selection.main,x=[v.from];v.empty||x.push(v.to);for(let k of x)if(k>h&&k<p){u(h,k-10,g,O),u(k+10,p,g,O);return}let S=rI(e,k=>k.from>=g.from&&k.to<=g.to&&Math.abs(k.from-h)<s&&Math.abs(k.to-p)<s&&!x.some($=>k.from<$&&k.to>$));if(!S){if(p<g.to&&n&&i&&n.visibleRanges.some(E=>E.from<=p&&E.to>=p)){let E=n.moveToLineBoundary(pe.cursor(p),!1,!0).head;E>h&&(p=E)}let k=this.gapSize(g,h,p,O),$=i||k<2e6?k:2e6;S=new p0(h,p,k,$)}l.push(S)},f=h=>{if(h.length<o||h.type!=kn.Text)return;let p=iI(h.from,h.to,this.stateDeco);if(p.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,O,v;if(i){let x=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,S,k;if(g!=null){let $=Ep(p,g),E=((this.visibleBottom-this.visibleTop)/2+x)/h.height;S=$-E,k=$+E}else S=(this.visibleTop-h.top-x)/h.height,k=(this.visibleBottom-h.top+x)/h.height;O=kp(p,S),v=kp(p,k)}else{let x=p.total*this.heightOracle.charWidth,S=r*this.heightOracle.charWidth,k=0;if(x>2e6)for(let Q of e)Q.from>=h.from&&Q.from<h.to&&Q.size!=Q.displaySize&&Q.from*this.heightOracle.charWidth+k<this.pixelViewport.left&&(k=Q.size-Q.displaySize);let $=this.pixelViewport.left+k,E=this.pixelViewport.right+k,T,_;if(g!=null){let Q=Ep(p,g),N=((E-$)/2+S)/x;T=Q-N,_=Q+N}else T=($-S)/x,_=(E+S)/x;O=kp(p,T),v=kp(p,_)}O>h.from&&u(h.from,O,h,p),v<h.to&&u(v,h.to,h,p)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(f):f(h);return l}gapSize(e,n,i,r){let s=Ep(r,i)-Ep(r,n);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){p0.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=vt.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];ot.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s<i.length&&!(r&8);s++){let o=this.visibleRanges[s],l=i[s];(o.from!=l.from||o.to!=l.to)&&(r|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Cf(this.heightMap.lineAt(e,mt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Cf(this.heightMap.lineAt(this.scaler.fromDOM(e),mt.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Cf(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let Sp=class{constructor(e,n){this.from=e,this.to=n}};function iI(t,e,n){let i=[],r=t,s=0;return ot.spans(n,t,e,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r<e&&(i.push({from:r,to:e}),s+=e-r),{total:s,ranges:i}}function kp({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let i=Math.floor(t*n);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(i<=l)return s+i;i-=l}}function Ep(t,e){let n=0;for(let{from:i,to:r}of t.ranges){if(e<=r){n+=e-i;break}n+=r-i}return n/t.total}function rI(t,e){for(let n of t)if(e(n))return n}const y2={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function v2(t){let e=t.facet(Xm).filter(i=>typeof i!="function"),n=t.facet(Fw).filter(i=>typeof i!="function");return n.length&&e.push(ot.join(n)),e}class Jw{constructor(e,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:u})=>{let f=n.lineAt(l,mt.ByPos,e,0,0).top,h=n.lineAt(u,mt.ByPos,e,0,0).bottom;return r+=h-f,{from:l,to:u,top:f,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return r+(e-i)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);i=s.bottom,r=s.domBottom}}fromDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return i+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);i=s.bottom,r=s.domBottom}}eq(e){return e instanceof Jw?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,i)=>n.from==e.viewports[i].from&&n.to==e.viewports[i].to):!1}}function Cf(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),i=e.toDOM(t.bottom);return new Ui(t.from,t.length,n,i-n,Array.isArray(t._content)?t._content.map(r=>Cf(r,e)):t._content)}const Tp=Ae.define({combine:t=>t.join(" ")}),yx=Ae.define({combine:t=>t.indexOf(!0)>-1}),vx=xo.newName(),vP=xo.newName(),bP=xo.newName(),xP={"&light":"."+vP,"&dark":"."+bP};function bx(t,e,n){return new xo(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return t;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):t+" "+i}})}const sI=bx("."+vx,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},xP),oI={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},g0=we.ie&&we.ie_version<=11;class aI{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new L4,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(we.ie&&we.ie_version<=11||we.ios&&e.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&we.android&&e.constructor.EDIT_CONTEXT!==!1&&!(we.chrome&&we.chrome_version<126)&&(this.editContext=new cI(e),e.state.facet(fs)&&(e.contentDOM.editContext=this.editContext.editContext)),g0&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,i)=>n!=e[i]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(fs)?i.root.activeElement!=this.dom:!Lf(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(we.ie&&we.ie_version<=11||we.android&&we.chrome)&&!i.state.selection.main.empty&&r.focusNode&&Df(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Kf(e.root);if(!n)return!1;let i=we.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&lI(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=Lf(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&z4(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let i=this.dom;i;)if(i.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=n)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,oI),g0&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),g0&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var i;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&ec(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:e,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&Lf(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new TB(this.view,e,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=lP(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!Fg(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let i=b2(n,e.previousSibling||e.target.previousSibling,-1),r=b2(n,e.nextSibling||e.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(fs)!=e.state.facet(fs)&&(e.view.contentDOM.editContext=e.state.facet(fs)?this.editContext.editContext:null))}destroy(){var e,n,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function b2(t,e,n){for(;e;){let i=Qt.get(e);if(i&&i.parent==t)return i;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function x2(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return Df(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function lI(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return x2(t,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),n?x2(t,n):null}class cI{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),u=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let f=u-l>i.text.length;l==this.from&&s<this.from?l=s:u==this.to&&s>this.to&&(u=s);let h=cP(e.state.sliceDoc(l,u),i.text,(f?r.from:r.to)-l,f?"end":null);if(!h){let g=pe.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Fg(g,r)||e.dispatch({selection:g,userEvent:"select"});return}let p={from:h.from+l,to:h.toA+l,insert:We.of(i.text.slice(h.from,h.toB).split(`
`))};if((we.mac||we.android)&&p.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:l,to:u,insert:We.of([i.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let g=this.to-this.from+(p.to-p.from+p.insert.length);Hw(e,p,pe.single(this.toEditorPos(i.selectionStart,g),this.toEditorPos(i.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let u=e.coordsForChar(o);s=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||s||new DOMRect,r.push(s)}n.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let u=this.toEditorPos(s.rangeStart),f=this.toEditorPos(s.rangeEnd);if(u<f){let h=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(vt.mark({attributes:{style:h}}).range(u,f))}}}e.dispatch({effects:KN.of(vt.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let r=Kf(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,u,f)=>{if(i)return;let h=f.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(f)){r=this.pendingContextChange=null,n+=h,this.to+=h;return}else r=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=h,this.to+=h;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+f.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),f.toString()),this.to+=h}n+=h}),r&&!i&&this.revertPending(e.state),!i}update(e){let n=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ne{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||D4(e.parent)||document,this.viewState=new O2(this,e.state||tt.create(e)),e.scrollTo&&e.scrollTo.is(bp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Il).map(r=>new c0(r));for(let r of this.plugins)r.update(this);this.observer=new aI(this),this.inputState=new QB(this),this.inputState.ensureHandlers(this.plugins),this.docView=new r2(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof Bt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let g of e){if(g.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=g.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,u=null;e.some(g=>g.annotation(gP))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,u=mP(s,o),u||(l=1));let f=this.observer.delayedAndroidKey,h=null;if(f?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(tt.phrases)!=this.state.facet(tt.phrases))return this.setState(s);r=Yg.create(this,s,e),r.flags|=l;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(p&&(p=p.map(g.changes)),g.scrollIntoView){let{main:O}=g.state.selection,{x:v,y:x}=this.state.facet(Ne.cursorScrollMargin);p=new tc(O.empty?O:pe.cursor(O.head,O.head>O.anchor?-1:1),"nearest","nearest",x,v)}for(let O of g.effects)O.is(bp)&&(p=O.value.clip(this.state))}this.viewState.update(r,p),this.bidiCache=Kg.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(Tf)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Tp)!=r.state.facet(Tp)&&(this.viewState.mustMeasureContent=!0),(n||i||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let g of this.state.facet(hx))try{g(r)}catch(O){Tr(this.state,O,"update listener")}(u||h)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),h&&!lP(this,h)&&f.force&&ec(this.contentDOM,f.key,f.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new O2(this,e),this.plugins=e.facet(Il).map(i=>new c0(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new r2(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Il),i=e.state.facet(Il);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new c0(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);n!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(i){Tr(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(jN(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let O=this.viewState.scrollAnchorAt(r);s=O.from,o=O.top}this.updateState=1;let u=this.viewState.measure();if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let f=[];u&4||([this.measureRequests,f]=[f,this.measureRequests]);let h=f.map(O=>{try{return O.read(this)}catch(v){return Tr(this.state,v),w2}}),p=Yg.create(this,this.state,[]),g=!1;p.flags|=u,n?n.flags|=u:n=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),g=this.docView.update(p),g&&this.docViewUpdate());for(let O=0;O<f.length;O++)if(h[O]!=w2)try{let v=f[O];v.write&&v.write(h[O],this)}catch(v){Tr(this.state,v)}if(g&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let v=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o)/this.scaleY;if((v>1||v<-1)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+v,i?i.scrollTop+=v:this.win.scrollBy(0,v),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(hx))l(n)}get themeClasses(){return vx+" "+(this.state.facet(yx)?bP:vP)+" "+this.state.facet(Tp)}updateAttrs(){let e=S2(this,JN,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(fs)?"true":"false",class:"cm-content",style:`${we.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),S2(this,Ww,n);let i=this.observer.ignore(()=>{let r=KC(this.contentDOM,this.contentAttrs,n),s=KC(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=n,i}showAnnouncements(e){let n=!0;for(let i of e)for(let r of i.effects)if(r.is(Ne.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Tf);let e=this.state.facet(Ne.cspNonce);xo.mount(this.root,this.styleModules.concat(sI).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(i=>i.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,i){return h0(this,e,s2(this,e,n,i))}moveByGroup(e,n){return h0(this,e,s2(this,e,n,i=>bB(this,e.head,i)))}visualLineSide(e,n){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[n?i.length-1:0];return pe.cursor(s.side(n,r)+e.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(e,n,i=!0){return vB(this,e,n,i)}moveVertically(e,n,i){return h0(this,e,xB(this,e,n,i))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let i=mx(this,e,n);return i&&i.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),mx(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let i=this.docView.coordsAt(e,n);if(!i||i.left==i.right)return i;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[Er.find(s,e-r.from,-1,n)];return Ug(i,o.dir==Et.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(WN)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>uI)return ZN(e.length);let n=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||XN(s.isolates,i=t2(this,e))))return s.order;i||(i=t2(this,e));let r=U4(e.text,n,i);return this.bidiCache.push(new Kg(e.from,e.to,n,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||we.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{RN(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){var i,r,s,o;return bp.of(new tc(typeof e=="number"?pe.cursor(e):e,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return bp.of(new tc(pe.cursor(i.from),"start","start",i.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return xs.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return xs.define(()=>({}),{eventObservers:e})}static theme(e,n){let i=xo.newName(),r=[Tp.of(i),Tf.of(bx(`.${i}`,e))];return n&&n.dark&&r.push(yx.of(!0)),r}static baseTheme(e){return Bc.lowest(Tf.of(bx("."+vx,e,xP)))}static findFromDOM(e){var n;let i=e.querySelector(".cm-content"),r=i&&Qt.get(i)||Qt.get(e);return((n=r?.root)===null||n===void 0?void 0:n.view)||null}}Ne.styleModule=Tf;Ne.inputHandler=YN;Ne.clipboardInputFilter=Yw;Ne.clipboardOutputFilter=qw;Ne.scrollHandler=HN;Ne.focusChangeEffect=qN;Ne.perLineTextDirection=WN;Ne.exceptionSink=UN;Ne.updateListener=hx;Ne.editable=fs;Ne.mouseSelectionStyle=VN;Ne.dragMovesSelection=GN;Ne.clickAddsSelectionRange=IN;Ne.decorations=Xm;Ne.blockWrappers=eP;Ne.outerDecorations=Fw;Ne.atomicRanges=_d;Ne.bidiIsolatedRanges=tP;Ne.cursorScrollMargin=Ae.define({combine:t=>{let e=5,n=5;for(let i of t)typeof i=="number"?e=n=i:{x:e,y:n}=i;return{x:e,y:n}}});Ne.scrollMargins=nP;Ne.darkTheme=yx;Ne.cspNonce=Ae.define({combine:t=>t.length?t[0]:""});Ne.contentAttributes=Ww;Ne.editorAttributes=JN;Ne.lineWrapping=Ne.contentAttributes.of({class:"cm-lineWrapping"});Ne.announce=wt.define();const uI=4096,w2={};class Kg{constructor(e,n,i,r,s,o){this.from=e,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:Et.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!n.touchesRange(o.from,o.to)&&i.push(new Kg(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}}function S2(t,e,n){for(let i=t.state.facet(e),r=i.length-1;r>=0;r--){let s=i[r],o=typeof s=="function"?s(t):s;o&&Gw(o,n)}return n}const fI=we.mac?"mac":we.windows?"win":we.linux?"linux":"key";function dI(t,e){const n=t.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let u=0;u<n.length-1;++u){const f=n[u];if(/^(cmd|meta|m)$/i.test(f))l=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))s=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+f)}return r&&(i="Alt-"+i),s&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function Cp(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const hI=Bc.default(Ne.domEventHandlers({keydown(t,e){return OI(pI(e.state),t,e,"editor")}})),Gm=Ae.define({enables:hI}),k2=new WeakMap;function pI(t){let e=t.facet(Gm),n=k2.get(e);return n||k2.set(e,n=mI(e.reduce((i,r)=>i.concat(r),[]))),n}let go=null;const gI=4e3;function mI(t,e=fI){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let u=i[o];if(u==null)i[o]=l;else if(u!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,u,f,h)=>{var p,g;let O=n[o]||(n[o]=Object.create(null)),v=l.split(/ (?!$)/).map(k=>dI(k,e));for(let k=1;k<v.length;k++){let $=v.slice(0,k).join(" ");r($,!0),O[$]||(O[$]={preventDefault:!0,stopPropagation:!1,run:[E=>{let T=go={view:E,prefix:$,scope:o};return setTimeout(()=>{go==T&&(go=null)},gI),!0}]})}let x=v.join(" ");r(x,!1);let S=O[x]||(O[x]={preventDefault:!1,stopPropagation:!1,run:((g=(p=O._any)===null||p===void 0?void 0:p.run)===null||g===void 0?void 0:g.slice())||[]});u&&S.run.push(u),f&&(S.preventDefault=!0),h&&(S.stopPropagation=!0)};for(let o of t){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let f of l){let h=n[f]||(n[f]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=o;for(let g in h)h[g].run.push(O=>p(O,xx))}let u=o[e]||o.key;if(u)for(let f of l)s(f,u,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(f,"Shift-"+u,o.shift,o.preventDefault,o.stopPropagation)}return n}let xx=null;function OI(t,e,n,i){xx=e;let r=A4(e),s=mN(r,0),o=p4(s)==r.length&&r!=" ",l="",u=!1,f=!1,h=!1;go&&go.view==n&&go.scope==i&&(l=go.prefix+" ",fP.indexOf(e.keyCode)<0&&(f=!0,go=null));let p=new Set,g=S=>{if(S){for(let k of S.run)if(!p.has(k)&&(p.add(k),k(n)))return S.stopPropagation&&(h=!0),!0;S.preventDefault&&(S.stopPropagation&&(h=!0),f=!0)}return!1},O=t[i],v,x;return O&&(g(O[l+Cp(r,e,!o)])?u=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(we.windows&&e.ctrlKey&&e.altKey)&&!(we.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(v=wo[e.keyCode])&&v!=r?(g(O[l+Cp(v,e,!0)])||e.shiftKey&&(x=Ff[e.keyCode])!=r&&x!=v&&g(O[l+Cp(x,e,!1)]))&&(u=!0):o&&e.shiftKey&&g(O[l+Cp(r,e,!0)])&&(u=!0),!u&&g(O._any)&&(u=!0)),f&&(u=!0),u&&h&&e.stopPropagation(),xx=null,u}class da{constructor(e,n,i,r,s){this.className=e,this.left=n,this.top=i,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,i){if(i.empty){let r=e.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=wP(e);return[new da(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return yI(e,n,i)}}function wP(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Et.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function E2(t,e,n,i){let r=t.coordsAtPos(e,n*2);if(!r)return i;let s=t.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=t.posAtCoords({x:s.left+1,y:o}),u=t.posAtCoords({x:s.right-1,y:o});return l==null||u==null?i:{from:Math.max(i.from,Math.min(l,u)),to:Math.min(i.to,Math.max(l,u))}}function yI(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let i=Math.max(n.from,t.viewport.from),r=Math.min(n.to,t.viewport.to),s=t.textDirection==Et.LTR,o=t.contentDOM,l=o.getBoundingClientRect(),u=wP(t),f=o.querySelector(".cm-line"),h=f&&window.getComputedStyle(f),p=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),g=l.right-(h?parseInt(h.paddingRight):0),O=gx(t,i,1),v=gx(t,r,-1),x=O.type==kn.Text?O:null,S=v.type==kn.Text?v:null;if(x&&(t.lineWrapping||O.widgetLineBreaks)&&(x=E2(t,i,1,x)),S&&(t.lineWrapping||v.widgetLineBreaks)&&(S=E2(t,r,-1,S)),x&&S&&x.from==S.from&&x.to==S.to)return $(E(n.from,n.to,x));{let _=x?E(n.from,null,x):T(O,!1),Q=S?E(null,n.to,S):T(v,!0),N=[];return(x||O).to<(S||v).from-(x&&S?1:0)||O.widgetLineBreaks>1&&_.bottom+t.defaultLineHeight/2<Q.top?N.push(k(p,_.bottom,g,Q.top)):_.bottom<Q.top&&t.elementAtHeight((_.bottom+Q.top)/2).type==kn.Text&&(_.bottom=Q.top=(_.bottom+Q.top)/2),$(_).concat(N).concat($(Q))}function k(_,Q,N,R){return new da(e,_-u.left,Q-u.top,Math.max(0,N-_),R-Q)}function $({top:_,bottom:Q,horizontal:N}){let R=[];for(let X=0;X<N.length;X+=2)R.push(k(N[X],_,N[X+1],Q));return R}function E(_,Q,N){let R=1e9,X=-1e9,q=[];function z(M,B,L,I,U){let V=t.coordsAtPos(M,M==N.to?-2:2),te=t.coordsAtPos(L,L==N.from?2:-2);!V||!te||(R=Math.min(V.top,te.top,R),X=Math.max(V.bottom,te.bottom,X),U==Et.LTR?q.push(s&&B?p:V.left,s&&I?g:te.right):q.push(!s&&I?p:te.left,!s&&B?g:V.right))}let Z=_??N.from,F=Q??N.to;for(let M of t.visibleRanges)if(M.to>Z&&M.from<F)for(let B=Math.max(M.from,Z),L=Math.min(M.to,F);;){let I=t.state.doc.lineAt(B);for(let U of t.bidiSpans(I)){let V=U.from+I.from,te=U.to+I.from;if(V>=L)break;te>B&&z(Math.max(V,B),_==null&&V<=Z,Math.min(te,L),Q==null&&te>=F,U.dir)}if(B=I.to+1,B>=L)break}return q.length==0&&z(Z,_==null,F,Q==null,t.textDirection),{top:R,bottom:X,horizontal:q}}function T(_,Q){let N=l.top+(Q?_.top:_.bottom);return{top:N,bottom:N,horizontal:[]}}}function vI(t,e){return t.constructor==e.constructor&&t.eq(e)}class bI{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(vg)!=e.state.facet(vg)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,i=e.facet(vg);for(;n<i.length&&i[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,i)=>!vI(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of e)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=e,we.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const vg=Ae.define();function SP(t){return[xs.define(e=>new bI(e,t)),vg.of(t)]}const gc=Ae.define({combine(t){return Zw(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function xI(t={}){return[gc.of(t),wI,SI,kI,FN.of(!0)]}function kP(t){return t.startState.facet(gc)!=t.state.facet(gc)}const wI=SP({above:!0,markers(t){let{state:e}=t,n=e.facet(gc),i=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&we.ios&&n.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:pe.cursor(r.head,r.assoc);for(let u of da.forRange(t,o,l))i.push(u)}}return i},update(t,e){t.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=kP(t);return n&&T2(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){T2(e.state,t)},class:"cm-cursorLayer"});function T2(t,e){e.style.animationDuration=t.facet(gc).cursorBlinkRate+"ms"}const SI=SP({above:!1,markers(t){let e=[],{main:n,ranges:i}=t.state.selection;for(let r of i)if(!r.empty)for(let s of da.forRange(t,"cm-selectionBackground",r))e.push(s);if(we.ios&&!n.empty&&t.state.facet(gc).iosSelectionHandles){for(let r of da.forRange(t,"cm-selectionHandle cm-selectionHandle-start",pe.cursor(n.from,1)))e.push(r);for(let r of da.forRange(t,"cm-selectionHandle cm-selectionHandle-end",pe.cursor(n.to,1)))e.push(r)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||kP(t)},class:"cm-selectionLayer"}),kI=Bc.highest(Ne.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));function C2(t,e,n,i,r){e.lastIndex=0;for(let s=t.iterRange(n,i),o=n,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=e.exec(s.value);)r(o+l.index,l)}function EI(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let i=[];for(let{from:r,to:s}of n)r=Math.max(t.state.doc.lineAt(r).from,r-e),s=Math.min(t.state.doc.lineAt(s).to,s+e),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class TI{constructor(e){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:o=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(l,u,f,h)=>r(h,f,f+l[0].length,l,u);else if(typeof i=="function")this.addMatch=(l,u,f,h)=>{let p=i(l,u,f);p&&h(f,f+l[0].length,p)};else if(i)this.addMatch=(l,u,f,h)=>h(f,f+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let n=new fc,i=n.add.bind(n);for(let{from:r,to:s}of EI(e,this.maxLength))C2(e.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,e,o,i));return n.finish()}updateDeco(e,n){let i=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,o,l,u)=>{u>=e.view.viewport.from&&l<=e.view.viewport.to&&(i=Math.min(l,i),r=Math.max(u,r))}),e.viewportMoved||r-i>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,n.map(e.changes),i,r):n}updateRange(e,n,i,r){for(let s of e.visibleRanges){let o=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=o){let u=e.state.doc.lineAt(o),f=u.to<l?e.state.doc.lineAt(l):u,h=Math.max(s.from,u.from),p=Math.min(s.to,f.to);if(this.boundary){for(;o>u.from;o--)if(this.boundary.test(u.text[o-1-u.from])){h=o;break}for(;l<f.to;l++)if(this.boundary.test(f.text[l-f.from])){p=l;break}}let g=[],O,v=(x,S,k)=>g.push(k.range(x,S));if(u==f)for(this.regexp.lastIndex=h-u.from;(O=this.regexp.exec(u.text))&&O.index<p-u.from;)this.addMatch(O,e,O.index+u.from,v);else C2(e.state.doc,this.regexp,h,p,(x,S)=>this.addMatch(S,e,x,v));n=n.update({filterFrom:h,filterTo:p,filter:(x,S)=>x<h||S>p,add:g})}}return n}}const wx=/x/.unicode!=null?"gu":"g",CI=new RegExp(`[\0-\b
--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,wx),$I={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let m0=null;function _I(){var t;if(m0==null&&typeof document<"u"&&document.body){let e=document.body.style;m0=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return m0||!1}const bg=Ae.define({combine(t){let e=Zw(t,{render:null,specialChars:CI,addSpecialChars:null});return(e.replaceTabs=!_I())&&(e.specialChars=new RegExp("	|"+e.specialChars.source,wx)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,wx)),e}});function QI(t={}){return[bg.of(t),AI()]}let $2=null;function AI(){return $2||($2=xs.fromClass(class{constructor(t){this.view=t,this.decorations=vt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(bg)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new TI({regexp:t.specialChars,decoration:(e,n,i)=>{let{doc:r}=n.state,s=mN(e[0],0);if(s==9){let o=r.lineAt(i),l=n.state.tabSize,u=jr(o.text,l,i-o.from);return vt.replace({widget:new jI((l-u%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=vt.replace({widget:new RI(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(bg);t.startState.facet(bg)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const NI="•";function PI(t){return t>=32?NI:t==10?"␤":String.fromCharCode(9216+t)}class RI extends Aa{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=PI(this.code),i=e.state.phrase("Control character")+" "+($I[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let s=document.createElement("span");return s.textContent=n,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class jI extends Aa{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="	",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class mc extends bo{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}mc.prototype.elementClass="";mc.prototype.toDOM=void 0;mc.prototype.mapMode=wn.TrackBefore;mc.prototype.startSide=mc.prototype.endSide=-1;mc.prototype.point=!0;const EP=1024;let MI=0;class wi{constructor(e,n){this.from=e,this.to=n}}class Me{constructor(e={}){this.id=MI++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=qt.match(e)),n=>{let i=e(n);return i===void 0?null:[this,i]}}}Me.closedBy=new Me({deserialize:t=>t.split(" ")});Me.openedBy=new Me({deserialize:t=>t.split(" ")});Me.group=new Me({deserialize:t=>t.split(" ")});Me.isolate=new Me({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Me.contextHash=new Me({perNode:!0});Me.lookAhead=new Me({perNode:!0});Me.mounted=new Me({perNode:!0});class nc{constructor(e,n,i,r=!1){this.tree=e,this.overlay=n,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[Me.mounted.id]}}const LI=Object.create(null);class qt{constructor(e,n,i,r=0){this.name=e,this.props=n,this.id=i,this.flags=r}static define(e){let n=e.props&&e.props.length?Object.create(null):LI,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new qt(e.name||"",n,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Me.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let i in e)for(let r of i.split(" "))n[r]=e[i];return i=>{for(let r=i.prop(Me.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}}qt.none=new qt("",Object.create(null),0,8);class Qd{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let i of this.types){let r=null;for(let s of e){let o=s(i);if(o){r||(r=Object.assign({},i.props));let l=o[1],u=o[0];u.combine&&u.id in r&&(l=u.combine(r[u.id],l)),r[u.id]=l}}n.push(r?new qt(i.name,r,i.id,i.flags):i)}return new Qd(n)}}const $p=new WeakMap,_2=new WeakMap;var it;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(it||(it={}));class nt{constructor(e,n,i,r,s){if(this.type=e,this.children=n,this.positions=i,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=nc.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let i of this.children){let r=i.toString();r&&(n&&(n+=","),n+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new Jg(this.topNode,e)}cursorAt(e,n=0,i=0){let r=$p.get(this)||this.topNode,s=new Jg(r);return s.moveTo(e,n),$p.set(this,s._tree),s}get topNode(){return new dn(this,0,0,null)}resolve(e,n=0){let i=ed($p.get(this)||this.topNode,e,n,!1);return $p.set(this,i),i}resolveInner(e,n=0){let i=ed(_2.get(this)||this.topNode,e,n,!0);return _2.set(this,i),i}resolveStack(e,n=0){return XI(this,e,n)}iterate(e){let{enter:n,leave:i,from:r=0,to:s=this.length}=e,o=e.mode||0,l=(o&it.IncludeAnonymous)>0;for(let u=this.cursor(o|it.IncludeAnonymous);;){let f=!1;if(u.from<=s&&u.to>=r&&(!l&&u.type.isAnonymous||n(u)!==!1)){if(u.firstChild())continue;f=!0}for(;f&&i&&(l||!u.type.isAnonymous)&&i(u),!u.nextSibling();){if(!u.parent())return;f=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:n1(qt.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new nt(this.type,n,i,r,this.propValues),e.makeTree||((n,i,r)=>new nt(qt.none,n,i,r)))}static build(e){return ZI(e)}}nt.empty=new nt(qt.none,[],[],0);class e1{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e1(this.buffer,this.index)}}class ko{constructor(e,n,i){this.buffer=e,this.length=n,this.set=i}get type(){return qt.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],i=this.buffer[e+3],r=this.set.types[n],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,n,i,r,s){let{buffer:o}=this,l=-1;for(let u=e;u!=n&&!(TP(s,r,o[u+1],o[u+2])&&(l=u,i>0));u=o[u+3]);return l}slice(e,n,i){let r=this.buffer,s=new Uint16Array(n-e),o=0;for(let l=e,u=0;l<n;){s[u++]=r[l++],s[u++]=r[l++]-i;let f=s[u++]=r[l++]-i;s[u++]=r[l++]-e,o=Math.max(o,f)}return new ko(s,o,this.set)}}function TP(t,e,n,i){switch(t){case-2:return n<e;case-1:return i>=e&&n<e;case 0:return n<e&&i>e;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function ed(t,e,n,i){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let o=!i&&t instanceof dn&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=i?0:it.IgnoreOverlays;if(i)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof dn&&o.index<0&&((r=l.enter(e,n,s))===null||r===void 0?void 0:r.from)!=o.from&&(t=l);for(;;){let o=t.enter(e,n,s);if(!o)return t;t=o}}class CP{cursor(e=0){return new Jg(this,e)}getChild(e,n=null,i=null){let r=Q2(this,e,n,i);return r.length?r[0]:null}getChildren(e,n=null,i=null){return Q2(this,e,n,i)}resolve(e,n=0){return ed(this,e,n,!1)}resolveInner(e,n=0){return ed(this,e,n,!0)}matchContext(e){return Sx(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),i=this;for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(i=n,n=r.prevSibling):n=r}return i}get node(){return this}get next(){return this.parent}}class dn extends CP{constructor(e,n,i,r){super(),this._tree=e,this.from=n,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,i,r,s=0){for(let o=this;;){for(let{children:l,positions:u}=o._tree,f=n>0?l.length:-1;e!=f;e+=n){let h=l[e],p=u[e]+o.from,g;if(!(!(s&it.EnterBracketed&&h instanceof nt&&(g=nc.get(h))&&!g.overlay&&g.bracketed&&i>=p&&i<=p+h.length)&&!TP(r,i,p,p+h.length))){if(h instanceof ko){if(s&it.ExcludeBuffers)continue;let O=h.findChild(0,h.buffer.length,n,i-p,r);if(O>-1)return new Cr(new DI(o,h,e,p),null,O)}else if(s&it.IncludeAnonymous||!h.type.isAnonymous||t1(h)){let O;if(!(s&it.IgnoreMounts)&&(O=nc.get(h))&&!O.overlay)return new dn(O.tree,p,e,o);let v=new dn(h,p,e,o);return s&it.IncludeAnonymous||!v.type.isAnonymous?v:v.nextChild(n<0?h.children.length-1:0,n,i,r,s)}}}if(s&it.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,i=0){let r;if(!(i&it.IgnoreOverlays)&&(r=nc.get(this._tree))&&r.overlay){let s=e-this.from,o=i&it.EnterBracketed&&r.bracketed;for(let{from:l,to:u}of r.overlay)if((n>0||o?l<=s:l<s)&&(n<0||o?u>=s:u>s))return new dn(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Q2(t,e,n,i){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function Sx(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}class DI{constructor(e,n,i,r){this.parent=e,this.buffer=n,this.index=i,this.start=r}}class Cr extends CP{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,i){super(),this.context=e,this._parent=n,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.context.start,i);return s<0?null:new Cr(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,i=0){if(i&it.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new Cr(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Cr(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Cr(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];e.push(i.slice(r,s,o)),n.push(0)}return new nt(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function $P(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let o=t[s];(o.from>n.from||o.to<n.to)&&(n=o,e=s)}let i=n instanceof dn&&n.index<0?null:n.parent,r=t.slice();return i?r[e]=i:r.splice(e,1),new zI(r,n)}class zI{constructor(e,n){this.heads=e,this.node=n}get next(){return $P(this.heads)}}function XI(t,e,n){let i=t.resolveInner(e,n),r=null;for(let s=i instanceof dn?i:i.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(r||(r=[i])).push(o.resolve(e,n)),s=o}else{let o=nc.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new dn(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(ed(l,e,n,!1))}}return r?$P(r):i}class Jg{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~it.EnterBracketed,e instanceof dn)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof dn?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,i=this.mode){return this.buffer?i&it.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&it.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&it.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:i}=r)}else({index:n,_parent:i}=this._tree);for(;i;{index:n,_parent:i}=i)if(n>-1)for(let s=n+e,o=e<0?-1:i._tree.children.length;s!=o;s+=e){let l=i._tree.children[s];if(this.mode&it.IncludeAnonymous||l instanceof ko||!l.type.isAnonymous||t1(l))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r<this.stack.length;r++)n=new Cr(this.buffer,n,this.stack[r]);return this.bufferNode=new Cr(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&n&&n(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return Sx(this.node.parent,e);let{buffer:n}=this.buffer,{types:i}=n.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return Sx(this._tree,e,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function t1(t){return t.children.some(e=>e instanceof ko||!e.type.isAnonymous||t1(e))}function ZI(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:r=EP,reused:s=[],minRepeatType:o=i.types.length}=t,l=Array.isArray(n)?new e1(n,n.length):n,u=i.types,f=0,h=0;function p(_,Q,N,R,X,q){let{id:z,start:Z,end:F,size:M}=l,B=h,L=f;if(M<0)if(l.next(),M==-1){let P=s[z];N.push(P),R.push(Z-_);return}else if(M==-3){f=z;return}else if(M==-4){h=z;return}else throw new RangeError(`Unrecognized record size: ${M}`);let I=u[z],U,V,te=Z-_;if(F-Z<=r&&(V=S(l.pos-Q,X))){let P=new Uint16Array(V.size-V.skip),j=l.pos-V.size,Y=P.length;for(;l.pos>j;)Y=k(V.start,P,Y);U=new ko(P,F-V.start,i),te=V.start-_}else{let P=l.pos-M;l.next();let j=[],Y=[],G=z>=o?z:-1,J=0,ne=F;for(;l.pos>P;)G>=0&&l.id==G&&l.size>=0?(l.end<=ne-r&&(v(j,Y,Z,J,l.end,ne,G,B,L),J=j.length,ne=l.end),l.next()):q>2500?g(Z,P,j,Y):p(Z,P,j,Y,G,q+1);if(G>=0&&J>0&&J<j.length&&v(j,Y,Z,J,Z,ne,G,B,L),j.reverse(),Y.reverse(),G>-1&&J>0){let le=O(I,L);U=n1(I,j,Y,0,j.length,0,F-Z,le,le)}else U=x(I,j,Y,F-Z,B-F,L)}N.push(U),R.push(te)}function g(_,Q,N,R){let X=[],q=0,z=-1;for(;l.pos>Q;){let{id:Z,start:F,end:M,size:B}=l;if(B>4)l.next();else{if(z>-1&&F<z)break;z<0&&(z=M-r),X.push(Z,F,M),q++,l.next()}}if(q){let Z=new Uint16Array(q*4),F=X[X.length-2];for(let M=X.length-3,B=0;M>=0;M-=3)Z[B++]=X[M],Z[B++]=X[M+1]-F,Z[B++]=X[M+2]-F,Z[B++]=B;N.push(new ko(Z,X[2]-F,i)),R.push(F-_)}}function O(_,Q){return(N,R,X)=>{let q=0,z=N.length-1,Z,F;if(z>=0&&(Z=N[z])instanceof nt){if(!z&&Z.type==_&&Z.length==X)return Z;(F=Z.prop(Me.lookAhead))&&(q=R[z]+Z.length+F)}return x(_,N,R,X,q,Q)}}function v(_,Q,N,R,X,q,z,Z,F){let M=[],B=[];for(;_.length>R;)M.push(_.pop()),B.push(Q.pop()+N-X);_.push(x(i.types[z],M,B,q-X,Z-q,F)),Q.push(X-N)}function x(_,Q,N,R,X,q,z){if(q){let Z=[Me.contextHash,q];z=z?[Z].concat(z):[Z]}if(X>25){let Z=[Me.lookAhead,X];z=z?[Z].concat(z):[Z]}return new nt(_,Q,N,R,z)}function S(_,Q){let N=l.fork(),R=0,X=0,q=0,z=N.end-r,Z={size:0,start:0,skip:0};e:for(let F=N.pos-_;N.pos>F;){let M=N.size;if(N.id==Q&&M>=0){Z.size=R,Z.start=X,Z.skip=q,q+=4,R+=4,N.next();continue}let B=N.pos-M;if(M<0||B<F||N.start<z)break;let L=N.id>=o?4:0,I=N.start;for(N.next();N.pos>B;){if(N.size<0)if(N.size==-3||N.size==-4)L+=4;else break e;else N.id>=o&&(L+=4);N.next()}X=I,R+=M,q+=L}return(Q<0||R==_)&&(Z.size=R,Z.start=X,Z.skip=q),Z.size>4?Z:void 0}function k(_,Q,N){let{id:R,start:X,end:q,size:z}=l;if(l.next(),z>=0&&R<o){let Z=N;if(z>4){let F=l.pos-(z-4);for(;l.pos>F;)N=k(_,Q,N)}Q[--N]=Z,Q[--N]=q-_,Q[--N]=X-_,Q[--N]=R}else z==-3?f=R:z==-4&&(h=R);return N}let $=[],E=[];for(;l.pos>0;)p(t.start||0,t.bufferStart||0,$,E,-1,0);let T=(e=t.length)!==null&&e!==void 0?e:$.length?E[0]+$[0].length:0;return new nt(u[t.topID],$.reverse(),E.reverse(),T)}const A2=new WeakMap;function xg(t,e){if(!t.isAnonymous||e instanceof ko||e.type!=t)return 1;let n=A2.get(e);if(n==null){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof nt)){n=1;break}n+=xg(t,i)}A2.set(e,n)}return n}function n1(t,e,n,i,r,s,o,l,u){let f=0;for(let v=i;v<r;v++)f+=xg(t,e[v]);let h=Math.ceil(f*1.5/8),p=[],g=[];function O(v,x,S,k,$){for(let E=S;E<k;){let T=E,_=x[E],Q=xg(t,v[E]);for(E++;E<k;E++){let N=xg(t,v[E]);if(Q+N>=h)break;Q+=N}if(E==T+1){if(Q>h){let N=v[T];O(N.children,N.positions,0,N.children.length,x[T]+$);continue}p.push(v[T])}else{let N=x[E-1]+v[E-1].length-_;p.push(n1(t,v,x,T,E,_,N,null,u))}g.push(_+$-s)}}return O(e,n,i,r,0),(l||u)(p,g,o)}class _P{constructor(){this.map=new WeakMap}setBuffer(e,n,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(n,i)}getBuffer(e,n){let i=this.map.get(e);return i&&i.get(n)}set(e,n){e instanceof Cr?this.setBuffer(e.context.buffer,e.index,n):e instanceof dn&&this.map.set(e.tree,n)}get(e){return e instanceof Cr?this.getBuffer(e.context.buffer,e.index):e instanceof dn?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Os{constructor(e,n,i,r,s=!1,o=!1){this.from=e,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],i=!1){let r=[new Os(0,e.length,e,0,!1,i)];for(let s of n)s.to>e.length&&r.push(s);return r}static applyChanges(e,n,i=128){if(!n.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,u=0,f=0;;l++){let h=l<n.length?n[l]:null,p=h?h.fromA:1e9;if(p-u>=i)for(;o&&o.from<p;){let g=o;if(u>=g.from||p<=g.to||f){let O=Math.max(g.from,u)-f,v=Math.min(g.to,p)-f;g=O>=v?null:new Os(O,v,g.tree,g.offset+f,l>0,!!h)}if(g&&r.push(g),o.to>p)break;o=s<e.length?e[s++]:null}if(!h)break;u=h.toA,f=h.toA-h.toB}return r}}let i1=class{startParse(e,n,i){return typeof e=="string"&&(e=new BI(e)),i=i?i.length?i.map(r=>new wi(r.from,r.to)):[new wi(0,0)]:[new wi(0,e.length)],this.createParse(e,n||[],i)}parse(e,n,i){let r=this.startParse(e,n,i);for(;;){let s=r.advance();if(s)return s}}};class BI{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function QP(t){return(e,n,i,r)=>new GI(e,t,n,i,r)}class N2{constructor(e,n,i,r,s,o){this.parser=e,this.parse=n,this.overlay=i,this.bracketed=r,this.target=s,this.from=o}}function P2(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class II{constructor(e,n,i,r,s,o,l,u){this.parser=e,this.predicate=n,this.mounts=i,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=u,this.depth=0,this.ranges=[]}}const kx=new Me({perNode:!0});class GI{constructor(e,n,i,r,s){this.nest=n,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new nt(i.type,i.children,i.positions,i.length,i.propValues.concat([[kx,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[Me.mounted.id]=new nc(n,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new YI(this.fragments),n=null,i=null,r=new Jg(new dn(this.baseTree,this.ranges[0].from,0,null),it.IncludeAnonymous|it.IgnoreMounts);e:for(let s,o;;){let l=!0,u;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(n){let f=n.mounts.find(h=>h.frag.from<=r.from&&h.frag.to>=r.to&&h.mount.overlay);if(f)for(let h of f.mount.overlay){let p=h.from+f.pos,g=h.to+f.pos;p>=r.from&&g<=r.to&&!n.ranges.some(O=>O.from<g&&O.to>p)&&n.ranges.push({from:p,to:g})}}l=!1}else if(i&&(o=VI(i.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.from<r.to||!s.overlay)){r.tree||(UI(r),n&&n.depth++,i&&i.depth++);let f=e.findMounts(r.from,s.parser);if(typeof s.overlay=="function")n=new II(s.parser,s.overlay,f,this.inner.length,r.from,!!s.bracketed,r.tree,n);else{let h=M2(this.ranges,s.overlay||(r.from<r.to?[new wi(r.from,r.to)]:[]));h.length&&P2(h),(h.length||!s.overlay)&&this.inner.push(new N2(s.parser,h.length?s.parser.startParse(this.input,L2(f,h),h):s.parser.startParse(""),s.overlay?s.overlay.map(p=>new wi(p.from-r.from,p.to-r.from)):null,!!s.bracketed,r.tree,h.length?h[0].from:r.from)),s.overlay?h.length&&(i={ranges:h,depth:0,prev:i}):l=!1}}else if(n&&(u=n.predicate(r))&&(u===!0&&(u=new wi(r.from,r.to)),u.from<u.to)){let f=n.ranges.length-1;f>=0&&n.ranges[f].to==u.from?n.ranges[f]={from:n.ranges[f].from,to:u.to}:n.ranges.push(u)}if(l&&r.firstChild())n&&n.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(n&&!--n.depth){let f=M2(this.ranges,n.ranges);f.length&&(P2(f),this.inner.splice(n.index,0,new N2(n.parser,n.parser.startParse(this.input,L2(n.mounts,f),f),n.ranges.map(h=>new wi(h.from-n.start,h.to-n.start)),n.bracketed,n.target,f[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function VI(t,e,n){for(let i of t){if(i.from>=n)break;if(i.to>e)return i.from<=e&&i.to>=n?2:1}return 0}function R2(t,e,n,i,r,s){if(e<n){let o=t.buffer[e+1];i.push(t.slice(e,n,o)),r.push(o-s)}}function UI(t){let{node:e}=t,n=[],i=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let r=t.tree,s=r.children.indexOf(i),o=r.children[s],l=o.buffer,u=[s];function f(h,p,g,O,v,x){let S=n[x],k=[],$=[];R2(o,h,S,k,$,O);let E=l[S+1],T=l[S+2];u.push(k.length);let _=x?f(S+4,l[S+3],o.set.types[l[S]],E,T-E,x-1):e.toTree();return k.push(_),$.push(E-O),R2(o,l[S+3],p,k,$,O),new nt(g,k,$,v)}r.children[s]=f(0,l.length,qt.none,0,o.length,n.length-1);for(let h of u){let p=t.tree.children[h],g=t.tree.positions[h];t.yield(new dn(p,g+t.from,h,t._tree))}}class j2{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(it.IncludeAnonymous|it.IgnoreMounts)}moveTo(e){let{cursor:n}=this,i=e-this.offset;for(;!this.done&&n.from<i;)if(!(n.to>=e&&n.enter(i,1,it.IgnoreOverlays|it.ExcludeBuffers)))if(n.to<=e)n.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof nt)n=n.children[0];else break}return!1}}let YI=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(n=i.tree.prop(kx))!==null&&n!==void 0?n:i.to,this.inner=new j2(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(kx))!==null&&e!==void 0?e:n.to,this.inner=new j2(n.tree,-n.offset)}}findMounts(e,n){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(i=s.tree)===null||i===void 0?void 0:i.prop(Me.mounted);if(o&&o.parser==n)for(let l=this.fragI;l<this.fragments.length;l++){let u=this.fragments[l];if(u.from>=s.to)break;u.tree==this.curFrag.tree&&r.push({frag:u,pos:s.from-u.offset,mount:o})}}}return r}};function M2(t,e){let n=null,i=e;for(let r=1,s=0;r<t.length;r++){let o=t[r-1].to,l=t[r].from;for(;s<i.length;s++){let u=i[s];if(u.from>=l)break;u.to<=o||(n||(i=n=e.slice()),u.from<o?(n[s]=new wi(u.from,o),u.to>l&&n.splice(s+1,0,new wi(l,u.to))):u.to>l?n[s--]=new wi(l,u.to):n.splice(s--,1))}}return i}function qI(t,e,n,i){let r=0,s=0,o=!1,l=!1,u=-1e9,f=[];for(;;){let h=r==t.length?1e9:o?t[r].to:t[r].from,p=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let g=Math.max(u,n),O=Math.min(h,p,i);g<O&&f.push(new wi(g,O))}if(u=Math.min(h,p),u==1e9)break;h==u&&(o?(o=!1,r++):o=!0),p==u&&(l?(l=!1,s++):l=!0)}return f}function L2(t,e){let n=[];for(let{pos:i,mount:r,frag:s}of t){let o=i+(r.overlay?r.overlay[0].from:0),l=o+r.tree.length,u=Math.max(s.from,o),f=Math.min(s.to,l);if(r.overlay){let h=r.overlay.map(g=>new wi(g.from+i,g.to+i)),p=qI(e,h,u,f);for(let g=0,O=u;;g++){let v=g==p.length,x=v?f:p[g].from;if(x>O&&n.push(new Os(O,x,r.tree,-o,s.from>=O||s.openStart,s.to<=x||s.openEnd)),v)break;O=p[g].to}}else n.push(new Os(u,f,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return n}let WI=0,br=class Ex{constructor(e,n,i,r){this.name=e,this.set=n,this.base=i,this.modified=r,this.id=WI++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let i=typeof e=="string"?e:"?";if(e instanceof Ex&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let r=new Ex(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(e){let n=new em(e);return i=>i.modified.indexOf(n)>-1?i:em.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},FI=0;class em{constructor(e){this.name=e,this.instances=[],this.id=FI++}static get(e,n){if(!n.length)return e;let i=n[0].instances.find(l=>l.base==e&&HI(n,l.modified));if(i)return i;let r=[],s=new br(e.name,r,e,n);for(let l of n)l.instances.push(s);let o=KI(n);for(let l of e.set)if(!l.modified.length)for(let u of o)r.push(em.get(l,u));return s}}function HI(t,e){return t.length==e.length&&t.every((n,i)=>n==e[i])}function KI(t){let e=[[]];for(let n=0;n<t.length;n++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(t[n]));return e.sort((n,i)=>i.length-n.length)}function Na(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,l=r;for(let p=0;;){if(l=="..."&&p>0&&p+3==r.length){o=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!g)throw new RangeError("Invalid path: "+r);if(s.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),p+=g[0].length,p==r.length)break;let O=r[p++];if(p==r.length&&O=="!"){o=0;break}if(O!="/")throw new RangeError("Invalid path: "+r);l=r.slice(p)}let u=s.length-1,f=s[u];if(!f)throw new RangeError("Invalid path: "+r);let h=new td(i,o,u>0?s.slice(0,u):null);e[f]=h.sort(e[f])}}return AP.add(e)}const AP=new Me({combine(t,e){let n,i,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new td(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});class td{constructor(e,n,i,r){this.tags=e,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}td.empty=new td([],2,null);function NP(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let o of s.tag)n[o.id]=s.class;let{scope:i,all:r=null}=e||{};return{style:s=>{let o=r;for(let l of s)for(let u of l.set){let f=n[u.id];if(f){o=o?o+" "+f:f;break}}return o},scope:i}}function JI(t,e){let n=null;for(let i of t){let r=i.style(e);r&&(n=n?n+" "+r:r)}return n}function eG(t,e,n,i=0,r=t.length){let s=new tG(i,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),i,r,"",s.highlighters),s.flush(r)}class tG{constructor(e,n,i){this.at=e,this.highlighters=n,this.span=i,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,i,r,s){let{type:o,from:l,to:u}=e;if(l>=i||u<=n)return;o.isTop&&(s=this.highlighters.filter(O=>!O.scope||O.scope(o)));let f=r,h=nG(e)||td.empty,p=JI(s,h.tags);if(p&&(f&&(f+=" "),f+=p,h.mode==1&&(r+=(r?" ":"")+p)),this.startSpan(Math.max(n,l),f),h.opaque)return;let g=e.tree&&e.tree.prop(Me.mounted);if(g&&g.overlay){let O=e.node.enter(g.overlay[0].from+l,1),v=this.highlighters.filter(S=>!S.scope||S.scope(g.tree.type)),x=e.firstChild();for(let S=0,k=l;;S++){let $=S<g.overlay.length?g.overlay[S]:null,E=$?$.from+l:u,T=Math.max(n,k),_=Math.min(i,E);if(T<_&&x)for(;e.from<_&&(this.highlightRange(e,T,_,r,s),this.startSpan(Math.min(_,e.to),f),!(e.to>=E||!e.nextSibling())););if(!$||E>i)break;k=$.to+l,k>n&&(this.highlightRange(O.cursor(),Math.max(n,$.from+l),Math.min(i,k),"",v),this.startSpan(Math.min(i,k),f))}x&&e.parent()}else if(e.firstChild()){g&&(r="");do if(!(e.to<=n)){if(e.from>=i)break;this.highlightRange(e,n,i,r,s),this.startSpan(Math.min(i,e.to),f)}while(e.nextSibling());e.parent()}}}function nG(t){let e=t.type.prop(AP);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const ye=br.define,_p=ye(),uo=ye(),D2=ye(uo),z2=ye(uo),fo=ye(),Qp=ye(fo),O0=ye(fo),yr=ye(),Wo=ye(yr),gr=ye(),mr=ye(),Tx=ye(),lf=ye(Tx),Ap=ye(),W={comment:_p,lineComment:ye(_p),blockComment:ye(_p),docComment:ye(_p),name:uo,variableName:ye(uo),typeName:D2,tagName:ye(D2),propertyName:z2,attributeName:ye(z2),className:ye(uo),labelName:ye(uo),namespace:ye(uo),macroName:ye(uo),literal:fo,string:Qp,docString:ye(Qp),character:ye(Qp),attributeValue:ye(Qp),number:O0,integer:ye(O0),float:ye(O0),bool:ye(fo),regexp:ye(fo),escape:ye(fo),color:ye(fo),url:ye(fo),keyword:gr,self:ye(gr),null:ye(gr),atom:ye(gr),unit:ye(gr),modifier:ye(gr),operatorKeyword:ye(gr),controlKeyword:ye(gr),definitionKeyword:ye(gr),moduleKeyword:ye(gr),operator:mr,derefOperator:ye(mr),arithmeticOperator:ye(mr),logicOperator:ye(mr),bitwiseOperator:ye(mr),compareOperator:ye(mr),updateOperator:ye(mr),definitionOperator:ye(mr),typeOperator:ye(mr),controlOperator:ye(mr),punctuation:Tx,separator:ye(Tx),bracket:lf,angleBracket:ye(lf),squareBracket:ye(lf),paren:ye(lf),brace:ye(lf),content:yr,heading:Wo,heading1:ye(Wo),heading2:ye(Wo),heading3:ye(Wo),heading4:ye(Wo),heading5:ye(Wo),heading6:ye(Wo),contentSeparator:ye(yr),list:ye(yr),quote:ye(yr),emphasis:ye(yr),strong:ye(yr),link:ye(yr),monospace:ye(yr),strikethrough:ye(yr),inserted:ye(),deleted:ye(),changed:ye(),invalid:ye(),meta:Ap,documentMeta:ye(Ap),annotation:ye(Ap),processingInstruction:ye(Ap),definition:br.defineModifier("definition"),constant:br.defineModifier("constant"),function:br.defineModifier("function"),standard:br.defineModifier("standard"),local:br.defineModifier("local"),special:br.defineModifier("special")};for(let t in W){let e=W[t];e instanceof br&&(e.name=t)}NP([{tag:W.link,class:"tok-link"},{tag:W.heading,class:"tok-heading"},{tag:W.emphasis,class:"tok-emphasis"},{tag:W.strong,class:"tok-strong"},{tag:W.keyword,class:"tok-keyword"},{tag:W.atom,class:"tok-atom"},{tag:W.bool,class:"tok-bool"},{tag:W.url,class:"tok-url"},{tag:W.labelName,class:"tok-labelName"},{tag:W.inserted,class:"tok-inserted"},{tag:W.deleted,class:"tok-deleted"},{tag:W.literal,class:"tok-literal"},{tag:W.string,class:"tok-string"},{tag:W.number,class:"tok-number"},{tag:[W.regexp,W.escape,W.special(W.string)],class:"tok-string2"},{tag:W.variableName,class:"tok-variableName"},{tag:W.local(W.variableName),class:"tok-variableName tok-local"},{tag:W.definition(W.variableName),class:"tok-variableName tok-definition"},{tag:W.special(W.variableName),class:"tok-variableName2"},{tag:W.definition(W.propertyName),class:"tok-propertyName tok-definition"},{tag:W.typeName,class:"tok-typeName"},{tag:W.namespace,class:"tok-namespace"},{tag:W.className,class:"tok-className"},{tag:W.macroName,class:"tok-macroName"},{tag:W.propertyName,class:"tok-propertyName"},{tag:W.operator,class:"tok-operator"},{tag:W.comment,class:"tok-comment"},{tag:W.meta,class:"tok-meta"},{tag:W.invalid,class:"tok-invalid"},{tag:W.punctuation,class:"tok-punctuation"}]);var y0;const sa=new Me;function r1(t){return Ae.define({combine:t?e=>e.concat(t):void 0})}const s1=new Me;class Si{constructor(e,n,i=[],r=""){this.data=e,this.name=r,tt.prototype.hasOwnProperty("tree")||Object.defineProperty(tt.prototype,"tree",{get(){return At(this)}}),this.parser=n,this.extension=[yc.of(this),tt.languageData.of((s,o,l)=>{let u=X2(s,o,l),f=u.type.prop(sa);if(!f)return[];let h=s.facet(f),p=u.type.prop(s1);if(p){let g=u.resolve(o-u.from,l);for(let O of p)if(O.test(g,s)){let v=s.facet(O.facet);return O.type=="replace"?v:v.concat(h)}}return h})].concat(i)}isActiveAt(e,n,i=-1){return X2(e,n,i).type.prop(sa)==this.data}findRegions(e){let n=e.facet(yc);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(sa)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(Me.mounted);if(l){if(l.tree.prop(sa)==this.data){if(l.overlay)for(let u of l.overlay)i.push({from:u.from+o,to:u.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let u=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>u)return}}for(let u=0;u<s.children.length;u++){let f=s.children[u];f instanceof nt&&r(f,s.positions[u]+o)}};return r(At(e),0),i}get allowsNesting(){return!0}}Si.setState=wt.define();function X2(t,e,n){let i=t.facet(yc),r=At(t).topNode;if(!i||i.allowsNesting)for(let s=r;s;s=s.enter(e,n,it.ExcludeBuffers|it.EnterBracketed))s.type.isTop&&(r=s);return r}class ba extends Si{constructor(e,n,i){super(e,n,[],i),this.parser=n}static define(e){let n=r1(e.languageData);return new ba(n,e.parser.configure({props:[sa.add(i=>i.isTop?n:void 0)]}),e.name)}configure(e,n){return new ba(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function At(t){let e=t.field(Si.state,!1);return e?e.tree:nt.empty}class iG{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let i=this.cursorPos-this.string.length;return e<i||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-i,n-i)}}let cf=null;class nd{constructor(e,n,i=[],r,s,o,l,u){this.parser=e,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,n,i){return new nd(e,n,[],nt.empty,0,i,[],null)}startParse(){return this.parser.startParse(new iG(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=nt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(Os.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Os.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=cf;cf=this;try{return e()}finally{cf=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=Z2(e,n.from,n.to);return e}changes(e,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let u=[];if(e.iterChangedRanges((f,h,p,g)=>u.push({fromA:f,toA:h,fromB:p,toB:g})),i=Os.applyChanges(i,u),r=nt.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let f of this.skipped){let h=e.mapPos(f.from,1),p=e.mapPos(f.to,-1);h<p&&l.push({from:h,to:p})}}}return new nd(this.parser,n,i,r,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:s}=this.skipped[i];r<e.to&&s>e.from&&(this.fragments=Z2(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends i1{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let u=cf;if(u){for(let f of r)u.tempSkipped.push(f);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=o,new nt(qt.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return cf}}function Z2(t,e,n){return Os.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Oc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new Oc(n)}static init(e){let n=Math.min(3e3,e.doc.length),i=nd.create(e.facet(yc).parser,e,{from:0,to:n});return i.work(20,n)||i.takeTree(),new Oc(i)}}Si.state=Ts.define({create:Oc.init,update(t,e){for(let n of e.effects)if(n.is(Si.setState))return n.value;return e.startState.facet(yc)!=e.state.facet(yc)?Oc.init(e.state):t.apply(e)}});let PP=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(PP=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const v0=typeof navigator<"u"&&(!((y0=navigator.scheduling)===null||y0===void 0)&&y0.isInputPending)?()=>navigator.scheduling.isInputPending():null,rG=xs.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Si.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Si.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=PP(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,s=i.field(Si.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!v0?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<r&&i.doc.length>r+1e3,u=s.context.work(()=>v0&&v0()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(u||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Si.setState.of(new Oc(s.context))})),this.chunkBudget>0&&!(u&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Tr(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),yc=Ae.define({combine(t){return t.length?t[0]:null},enables:t=>[Si.state,rG,Ne.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class vc{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class tm{constructor(e,n,i,r,s,o=void 0){this.name=e,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:n,support:i}=e;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new tm(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,n,i)}static matchFilename(e,n){for(let r of e)if(r.filename&&r.filename.test(n))return r;let i=/\.([^.]+)$/.exec(n);if(i){for(let r of e)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(e,n,i=!0){n=n.toLowerCase();for(let r of e)if(r.alias.some(s=>s==n))return r;if(i)for(let r of e)for(let s of r.alias){let o=n.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(n[o-1])&&!/\w/.test(n[o+s.length])))return r}return null}}const sG=Ae.define(),Ad=Ae.define({combine:t=>{if(!t.length)return"  ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function nm(t){let e=t.facet(Ad);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function im(t,e){let n="",i=t.tabSize,r=t.facet(Ad)[0];if(r=="	"){for(;e>=i;)n+="	",e-=i;r=" "}for(let s=0;s<e;s++)n+=r;return n}function RP(t,e){t instanceof tt&&(t=new Vm(t));for(let i of t.state.facet(sG)){let r=i(t,e);if(r!==void 0)return r}let n=At(t.state);return n.length>=e?oG(t,n,e):null}class Vm{constructor(e,n={}){this.state=e,this.options=n,this.unit=nm(e)}lineAt(e,n=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(n<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,n);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.countColumn(i,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,n=e.length){return jr(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Ic=new Me;function oG(t,e,n){let i=e.resolveStack(n),r=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.from<i.node.from||o.to>i.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return jP(i,t,n)}function jP(t,e,n){for(let i=t;i;i=i.next){let r=lG(i.node);if(r)return r(o1.create(e,n,i))}return 0}function aG(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function lG(t){let e=t.type.prop(Ic);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(Me.closedBy))){let r=t.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>MP(o,!0,1,void 0,s&&!aG(o)?r.from:void 0)}return t.parent==null?cG:null}function cG(){return 0}class o1 extends Vm{constructor(e,n,i){super(e.state,e.options),this.base=e,this.pos=n,this.context=i}get node(){return this.context.node}static create(e,n,i){return new o1(e,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(uG(i,e))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return jP(this.context.next,this.base,this.pos)}}function uG(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function fG(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let u=e.childAfter(l);if(!u||u==i)return null;if(!u.type.isSkipped){if(u.from>=o)return null;let f=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+f}}l=u.to}}function Cx({closing:t,align:e=!0,units:n=1}){return i=>MP(i,e,n,t)}function MP(t,e,n,i,r){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==t.pos+o,u=e?fG(t):null;return u?l?t.column(u.from):t.column(u.to):t.baseIndent+(l?0:t.unit*n)}const dG=t=>t.baseIndent;function wg({except:t,units:e=1}={}){return n=>{let i=t&&t.test(n.textAfter);return n.baseIndent+(i?0:e*n.unit)}}const hG=Ae.define(),Gc=new Me;function a1(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}class Um{constructor(e,n){this.specs=e;let i;function r(l){let u=xo.newName();return(i||(i=Object.create(null)))["."+u]=l,u}const s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof Si?l=>l.prop(sa)==o.data:o?l=>l==o:void 0,this.style=NP(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new xo(i):null,this.themeType=n.themeType}static define(e,n){return new Um(e,n||{})}}const $x=Ae.define(),LP=Ae.define({combine(t){return t.length?[t[0]]:null}});function b0(t){let e=t.facet($x);return e.length?e:t.facet(LP)}function pG(t,e){let n=[mG],i;return t instanceof Um&&(t.module&&n.push(Ne.styleModule.of(t.module)),i=t.themeType),e?.fallback?n.push(LP.of(t)):i?n.push($x.computeN([Ne.darkTheme],r=>r.facet(Ne.darkTheme)==(i=="dark")?[t]:[])):n.push($x.of(t)),n}class gG{constructor(e){this.markCache=Object.create(null),this.tree=At(e.state),this.decorations=this.buildDeco(e,b0(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=At(e.state),i=b0(e.state),r=i!=b0(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!r&&n.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return vt.none;let i=new fc;for(let{from:r,to:s}of e.visibleRanges)eG(this.tree,n,(o,l,u)=>{i.add(o,l,this.markCache[u]||(this.markCache[u]=vt.mark({class:u})))},r,s);return i.finish()}}const mG=Bc.high(xs.fromClass(gG,{decorations:t=>t.decorations})),OG=Um.define([{tag:W.meta,color:"#404740"},{tag:W.link,textDecoration:"underline"},{tag:W.heading,textDecoration:"underline",fontWeight:"bold"},{tag:W.emphasis,fontStyle:"italic"},{tag:W.strong,fontWeight:"bold"},{tag:W.strikethrough,textDecoration:"line-through"},{tag:W.keyword,color:"#708"},{tag:[W.atom,W.bool,W.url,W.contentSeparator,W.labelName],color:"#219"},{tag:[W.literal,W.inserted],color:"#164"},{tag:[W.string,W.deleted],color:"#a11"},{tag:[W.regexp,W.escape,W.special(W.string)],color:"#e40"},{tag:W.definition(W.variableName),color:"#00f"},{tag:W.local(W.variableName),color:"#30a"},{tag:[W.typeName,W.namespace],color:"#085"},{tag:W.className,color:"#167"},{tag:[W.special(W.variableName),W.macroName],color:"#256"},{tag:W.definition(W.propertyName),color:"#00c"},{tag:W.comment,color:"#940"},{tag:W.invalid,color:"#f00"}]),yG=1e4,vG="()[]{}",DP=new Me;function _x(t,e,n){let i=t.prop(e<0?Me.openedBy:Me.closedBy);if(i)return i;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function Qx(t){let e=t.type.prop(DP);return e?e(t.node):t}function Gl(t,e,n,i={}){let r=i.maxScanDistance||yG,s=i.brackets||vG,o=At(t),l=o.resolveInner(e,n);for(let u=l;u;u=u.parent){let f=_x(u.type,n,s);if(f&&u.from<u.to){let h=Qx(u);if(h&&(n>0?e>=h.from&&e<h.to:e>h.from&&e<=h.to))return bG(t,e,n,u,h,f,s)}}return xG(t,e,n,o,l.type,r,s)}function bG(t,e,n,i,r,s,o){let l=i.parent,u={from:r.from,to:r.to},f=0,h=l?.cursor();if(h&&(n<0?h.childBefore(i.from):h.childAfter(i.to)))do if(n<0?h.to<=i.from:h.from>=i.to){if(f==0&&s.indexOf(h.type.name)>-1&&h.from<h.to){let p=Qx(h);return{start:u,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(_x(h.type,n,o))f++;else if(_x(h.type,-n,o)){if(f==0){let p=Qx(h);return{start:u,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}f--}}while(n<0?h.prevSibling():h.nextSibling());return{start:u,matched:!1}}function xG(t,e,n,i,r,s,o){if(n<0?!e:e==t.doc.length)return null;let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=o.indexOf(l);if(u<0||u%2==0!=n>0)return null;let f={from:n<0?e-1:e,to:n>0?e+1:e},h=t.doc.iterRange(e,n>0?t.doc.length:0),p=0;for(let g=0;!h.next().done&&g<=s;){let O=h.value;n<0&&(g+=O.length);let v=e+g*n;for(let x=n>0?0:O.length-1,S=n>0?O.length:-1;x!=S;x+=n){let k=o.indexOf(O[x]);if(!(k<0||i.resolveInner(v+x,1).type!=r))if(k%2==0==n>0)p++;else{if(p==1)return{start:f,end:{from:v+x,to:v+x+1},matched:k>>1==u>>1};p--}}n>0&&(g+=O.length)}return h.done?{start:f,matched:!1}:null}const wG=Object.create(null),B2=[qt.none],I2=[],G2=Object.create(null),SG=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])SG[t]=kG(wG,e);function x0(t,e){I2.indexOf(t)>-1||(I2.push(t),console.warn(e))}function kG(t,e){let n=[];for(let l of e.split(" ")){let u=[];for(let f of l.split(".")){let h=t[f]||W[f];h?typeof h=="function"?u.length?u=u.map(h):x0(f,`Modifier ${f} used at start of tag`):u.length?x0(f,`Tag ${f} used as modifier`):u=Array.isArray(h)?h:[h]:x0(f,`Unknown highlighting tag ${f}`)}for(let f of u)n.push(f)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=G2[r];if(s)return s.id;let o=G2[r]=qt.define({id:B2.length,name:i,props:[Na({[i]:n})]});return B2.push(o),o.id}Et.RTL,Et.LTR;class EG{constructor(e,n,i,r){this.state=e,this.pos=n,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=At(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),i=Math.max(n.from,this.pos-250),r=n.text.slice(i-n.from,this.pos-n.from),s=r.search(_G(e));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function V2(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function TG(t){let e=Object.create(null),n=Object.create(null);for(let{label:r}of t){e[r[0]]=!0;for(let s=1;s<r.length;s++)n[r[s]]=!0}let i=V2(e)+V2(n)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function CG(t){let e=t.map(r=>typeof r=="string"?{label:r}:r),[n,i]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:TG(e);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:n}:null}}function $G(t,e){return n=>{for(let i=At(n.state).resolveInner(n.pos,-1);i;i=i.parent){if(t.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(n)}}function _G(t,e){var n;let{source:i}=t,r=i[i.length-1]!="$";return r?new RegExp(`(?:${i})${r?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":""):t}const QG=Cs.define(),AG=Ne.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class NG{constructor(e,n,i,r){this.field=e,this.line=n,this.from=i,this.to=r}}class l1{constructor(e,n,i){this.field=e,this.from=n,this.to=i}map(e){let n=e.mapPos(this.from,-1,wn.TrackDel),i=e.mapPos(this.to,1,wn.TrackDel);return n==null||i==null?null:new l1(this.field,n,i)}}class c1{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let i=[],r=[n],s=e.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let u of this.lines){if(i.length){let f=o,h=/^\t*/.exec(u)[0].length;for(let p=0;p<h;p++)f+=e.facet(Ad);r.push(n+f.length-h),u=f+u.slice(h)}i.push(u),n+=u.length+1}let l=this.fieldPositions.map(u=>new l1(u.field,r[u.line]+u.from,r[u.line]+u.to));return{text:i,ranges:l}}static parse(e){let n=[],i=[],r=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,u=s[2]||s[3]||"",f=-1;l===0&&(l=1e9);let h=u.replace(/\\[{}]/g,p=>p[1]);for(let p=0;p<n.length;p++)(l!=null?n[p].seq==l:h&&n[p].name==h)&&(f=p);if(f<0){let p=0;for(;p<n.length&&(l==null||n[p].seq!=null&&n[p].seq<l);)p++;n.splice(p,0,{seq:l,name:h}),f=p;for(let g of r)g.field>=f&&g.field++}for(let p of r)if(p.line==i.length&&p.from>s.index){let g=s[2]?3+(s[1]||"").length:2;p.from-=g,p.to-=g}r.push(new NG(f,i.length,s.index,s.index+h.length)),o=o.slice(0,s.index)+u+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,u,f)=>{for(let h of r)h.line==i.length&&h.from>f&&(h.from--,h.to--);return u}),i.push(o)}return new c1(i,r)}}let PG=vt.widget({widget:new class extends Aa{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),RG=vt.mark({class:"cm-snippetField"});class Vc{constructor(e,n){this.ranges=e,this.active=n,this.deco=vt.set(e.map(i=>(i.from==i.to?PG:RG).range(i.from,i.to)),!0)}map(e){let n=[];for(let i of this.ranges){let r=i.map(e);if(!r)return null;n.push(r)}return new Vc(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(i=>i.field==this.active&&i.from<=n.from&&i.to>=n.to))}}const Nd=wt.define({map(t,e){return t&&t.map(e)}}),jG=wt.define(),id=Ts.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Nd))return n.value;if(n.is(jG)&&t)return new Vc(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>Ne.decorations.from(t,e=>e?e.deco:vt.none)});function u1(t,e){return pe.create(t.filter(n=>n.field==e).map(n=>pe.range(n.from,n.to)))}function MG(t){let e=c1.parse(t);return(n,i,r,s)=>{let{text:o,ranges:l}=e.instantiate(n.state,r),{main:u}=n.state.selection,f={changes:{from:r,to:s==u.from?u.to:s,insert:We.of(o)},scrollIntoView:!0,annotations:i?[QG.of(i),Bt.userEvent.of("input.complete")]:void 0};if(l.length&&(f.selection=u1(l,0)),l.some(h=>h.field>0)){let h=new Vc(l,0),p=f.effects=[Nd.of(h)];n.state.field(id,!1)===void 0&&p.push(wt.appendConfig.of([id,ZG,BG,AG]))}n.dispatch(n.state.update(f))}}function zP(t){return({state:e,dispatch:n})=>{let i=e.field(id,!1);if(!i||t<0&&i.active==0)return!1;let r=i.active+t,s=t>0&&!i.ranges.some(o=>o.field==r+t);return n(e.update({selection:u1(i.ranges,r),effects:Nd.of(s?null:new Vc(i.ranges,r)),scrollIntoView:!0})),!0}}const LG=({state:t,dispatch:e})=>t.field(id,!1)?(e(t.update({effects:Nd.of(null)})),!0):!1,DG=zP(1),zG=zP(-1),XG=[{key:"Tab",run:DG,shift:zG},{key:"Escape",run:LG}],U2=Ae.define({combine(t){return t.length?t[0]:XG}}),ZG=Bc.highest(Gm.compute([U2],t=>t.facet(U2)));function Ln(t,e){return{...e,apply:MG(t)}}const BG=Ne.domEventHandlers({mousedown(t,e){let n=e.state.field(id,!1),i;if(!n||(i=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let r=n.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==n.active?!1:(e.dispatch({selection:u1(n.ranges,r.field),effects:Nd.of(n.ranges.some(s=>s.field>r.field)?new Vc(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),XP=new class extends bo{};XP.startSide=1;XP.endSide=-1;class rm{static create(e,n,i,r,s){let o=r+(r<<8)+e+(n<<4)|0;return new rm(e,n,i,o,s,[],[])}constructor(e,n,i,r,s,o,l){this.type=e,this.value=n,this.from=i,this.hash=r,this.end=s,this.children=o,this.positions=l,this.hashProp=[[Me.contextHash,r]]}addChild(e,n){e.prop(Me.contextHash)!=this.hash&&(e=new nt(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(n)}toTree(e,n=this.end){let i=this.children.length-1;return i>=0&&(n=Math.max(n,this.positions[i]+this.children[i].length+this.from)),new nt(e.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(r,s,o)=>new nt(qt.none,r,s,o,this.hashProp)})}}var me;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(me||(me={}));class IG{constructor(e,n){this.start=e,this.content=n,this.marks=[],this.parsers=[]}}class GG{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return Xf(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,n=0,i=0){for(let r=n;r<e;r++)i+=this.text.charCodeAt(r)==9?4-i%4:1;return i}findColumn(e){let n=0;for(let i=0;n<this.text.length&&i<e;n++)i+=this.text.charCodeAt(n)==9?4-i%4:1;return n}scrub(){if(!this.baseIndent)return this.text;let e="";for(let n=0;n<this.basePos;n++)e+=" ";return e+this.text.slice(this.basePos)}}function Y2(t,e,n){if(n.pos==n.text.length||t!=e.block&&n.indent>=e.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let i=(t.type==me.OrderedList?h1:d1)(n,e,!1);return i>0&&(t.type!=me.BulletList||f1(n,e,!1)<0)&&n.text.charCodeAt(n.pos+i-1)==t.value}const ZP={[me.Blockquote](t,e,n){return n.next!=62?!1:(n.markers.push(qe(me.QuoteMark,e.lineStart+n.pos,e.lineStart+n.pos+1)),n.moveBase(n.pos+(Ai(n.text.charCodeAt(n.pos+1))?2:1)),t.end=e.lineStart+n.text.length,!0)},[me.ListItem](t,e,n){return n.indent<n.baseIndent+t.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+t.value),!0)},[me.OrderedList]:Y2,[me.BulletList]:Y2,[me.Document](){return!0}};function Ai(t){return t==32||t==9||t==10||t==13}function Xf(t,e=0){for(;e<t.length&&Ai(t.charCodeAt(e));)e++;return e}function q2(t,e,n){for(;e>n&&Ai(t.charCodeAt(e-1));)e--;return e}function BP(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let n=e;n<t.text.length;n++)if(t.text.charCodeAt(n)==96)return-1}return e}function IP(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function f1(t,e,n){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let i=1;for(let r=t.pos+1;r<t.text.length;r++){let s=t.text.charCodeAt(r);if(s==t.next)i++;else if(!Ai(s))return-1}return n&&t.next==45&&UP(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(FP.SetextHeading)>-1||i<3?-1:1}function GP(t,e){for(let n=t.stack.length-1;n>=0;n--)if(t.stack[n].type==e)return!0;return!1}function d1(t,e,n){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||Ai(t.text.charCodeAt(t.pos+1)))&&(!n||GP(e,me.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function h1(t,e,n){let i=t.pos,r=t.next;for(;r>=48&&r<=57;){i++;if(i==t.text.length)return-1;r=t.text.charCodeAt(i)}return i==t.pos||i>t.pos+9||r!=46&&r!=41||i<t.text.length-1&&!Ai(t.text.charCodeAt(i+1))||n&&!GP(e,me.OrderedList)&&(t.skipSpace(i+1)==t.text.length||i>t.pos+1||t.next!=49)?-1:i+1-t.pos}function VP(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let n=e-t.pos;return n>6?-1:n}function UP(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let n=e;for(;e<t.text.length&&Ai(t.text.charCodeAt(e));)e++;return e==t.text.length?n:-1}const Ax=/^[ \t]*$/,YP=/-->/,qP=/\?>/,Nx=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,YP],[/^\s*<\?/,qP],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,Ax],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,Ax]];function WP(t,e,n){if(t.next!=60)return-1;let i=t.text.slice(t.pos);for(let r=0,s=Nx.length-(n?1:0);r<s;r++)if(Nx[r][0].test(i))return r;return-1}function W2(t,e){let n=t.countIndent(e,t.pos,t.indent),i=t.countIndent(t.skipSpace(e),e,n);return i>=n+5?n+1:i}function so(t,e,n){let i=t.length-1;i>=0&&t[i].to==e&&t[i].type==me.CodeText?t[i].to=n:t.push(qe(me.CodeText,e,n))}const Np={LinkReference:void 0,IndentedCode(t,e){let n=e.baseIndent+4;if(e.indent<n)return!1;let i=e.findColumn(n),r=t.lineStart+i,s=t.lineStart+e.text.length,o=[],l=[];for(so(o,r,s);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){so(l,t.lineStart-1,t.lineStart);for(let u of e.markers)l.push(u)}else{if(e.indent<n)break;{if(l.length){for(let f of l)f.type==me.CodeText?so(o,f.from,f.to):o.push(f);l=[]}so(o,t.lineStart-1,t.lineStart);for(let f of e.markers)o.push(f);s=t.lineStart+e.text.length;let u=t.lineStart+e.findColumn(e.baseIndent+4);u<s&&so(o,u,s)}}return l.length&&(l=l.filter(u=>u.type!=me.CodeText),l.length&&(e.markers=l.concat(e.markers))),t.addNode(t.buffer.writeElements(o,-r).finish(me.CodeBlock,s-r),r),!0},FencedCode(t,e){let n=BP(e);if(n<0)return!1;let i=t.lineStart+e.pos,r=e.next,s=n-e.pos,o=e.skipSpace(n),l=q2(e.text,e.text.length,o),u=[qe(me.CodeMark,i,i+s)];o<l&&u.push(qe(me.CodeInfo,t.lineStart+o,t.lineStart+l));for(let f=!0,h=!0,p=!1;t.nextLine()&&e.depth>=t.stack.length;f=!1){let g=e.pos;if(e.indent-e.baseIndent<4)for(;g<e.text.length&&e.text.charCodeAt(g)==r;)g++;if(g-e.pos>=s&&e.skipSpace(g)==e.text.length){for(let O of e.markers)u.push(O);h&&p&&so(u,t.lineStart-1,t.lineStart),u.push(qe(me.CodeMark,t.lineStart+e.pos,t.lineStart+g)),t.nextLine();break}else{p=!0,f||(so(u,t.lineStart-1,t.lineStart),h=!1);for(let x of e.markers)u.push(x);let O=t.lineStart+e.basePos,v=t.lineStart+e.text.length;O<v&&(so(u,O,v),h=!1)}}return t.addNode(t.buffer.writeElements(u,-i).finish(me.FencedCode,t.prevLineEnd()-i),i),!0},Blockquote(t,e){let n=IP(e);return n<0?!1:(t.startContext(me.Blockquote,e.pos),t.addNode(me.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+n),null)},HorizontalRule(t,e){if(f1(e,t,!1)<0)return!1;let n=t.lineStart+e.pos;return t.nextLine(),t.addNode(me.HorizontalRule,n),!0},BulletList(t,e){let n=d1(e,t,!1);if(n<0)return!1;t.block.type!=me.BulletList&&t.startContext(me.BulletList,e.basePos,e.next);let i=W2(e,e.pos+1);return t.startContext(me.ListItem,e.basePos,i-e.baseIndent),t.addNode(me.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(i),null},OrderedList(t,e){let n=h1(e,t,!1);if(n<0)return!1;t.block.type!=me.OrderedList&&t.startContext(me.OrderedList,e.basePos,e.text.charCodeAt(e.pos+n-1));let i=W2(e,e.pos+n);return t.startContext(me.ListItem,e.basePos,i-e.baseIndent),t.addNode(me.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(i),null},ATXHeading(t,e){let n=VP(e);if(n<0)return!1;let i=e.pos,r=t.lineStart+i,s=q2(e.text,e.text.length,i),o=s;for(;o>i&&e.text.charCodeAt(o-1)==e.next;)o--;(o==s||o==i||!Ai(e.text.charCodeAt(o-1)))&&(o=e.text.length);let l=t.buffer.write(me.HeaderMark,0,n).writeElements(t.parser.parseInline(e.text.slice(i+n+1,o),r+n+1),-r);o<e.text.length&&l.write(me.HeaderMark,o-i,s-i);let u=l.finish(me.ATXHeading1-1+n,e.text.length-i);return t.nextLine(),t.addNode(u,r),!0},HTMLBlock(t,e){let n=WP(e,t,!1);if(n<0)return!1;let i=t.lineStart+e.pos,r=Nx[n][1],s=[],o=r!=Ax;for(;!r.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){o=!1;break}for(let f of e.markers)s.push(f)}o&&t.nextLine();let l=r==YP?me.CommentBlock:r==qP?me.ProcessingInstructionBlock:me.HTMLBlock,u=t.prevLineEnd();return t.addNode(t.buffer.writeElements(s,-i).finish(l,u-i),i),!0},SetextHeading:void 0};class VG{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,n,i){if(this.stage==-1)return!1;let r=i.content+`
`+n.scrub(),s=this.advance(r);return s>-1&&s<r.length?this.complete(e,i,s):!1}finish(e,n){return(this.stage==2||this.stage==3)&&Xf(n.content,this.pos)==n.content.length?this.complete(e,n,n.content.length):!1}complete(e,n,i){return e.addLeafElement(n,qe(me.LinkReference,this.start,this.start+i,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(sR(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(qe(me.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(iR(e,Xf(e,this.pos),this.start)))return-1}else if(this.stage==2){let n=Xf(e,this.pos),i=0;if(n>this.pos){let r=rR(e,n,this.start);if(r){let s=w0(e,r.to-this.start);s>0&&(this.nextStage(r),i=s)}}return i||(i=w0(e,this.pos)),i>0&&i<e.length?i:-1}else return w0(e,this.pos)}}}function w0(t,e){for(;e<t.length;e++){let n=t.charCodeAt(e);if(n==10)break;if(!Ai(n))return-1}return e}class UG{nextLine(e,n,i){let r=n.depth<e.stack.length?-1:UP(n),s=n.next;if(r<0)return!1;let o=qe(me.HeaderMark,e.lineStart+n.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(i,qe(s==61?me.SetextHeading1:me.SetextHeading2,i.start,e.prevLineEnd(),[...e.parser.parseInline(i.content,i.start),o])),!0}finish(){return!1}}const FP={LinkReference(t,e){return e.content.charCodeAt(0)==91?new VG(e):null},SetextHeading(){return new UG}},YG=[(t,e)=>VP(e)>=0,(t,e)=>BP(e)>=0,(t,e)=>IP(e)>=0,(t,e)=>d1(e,t,!0)>=0,(t,e)=>h1(e,t,!0)>=0,(t,e)=>f1(e,t,!0)>=0,(t,e)=>WP(e,t,!0)>=0],qG={text:"",end:0};class WG{constructor(e,n,i,r){this.parser=e,this.input=n,this.ranges=r,this.line=new GG,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=rm.create(me.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=i.length?new KG(i,n):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let i=0;;){let r=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;i<e.markers.length&&(!r||e.markers[i].from<r.end);){let s=e.markers[i++];this.addNode(s.type,s.from,s.to)}if(!r)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let i of this.parser.blockParsers)if(i){let r=i(this,e);if(r!=!1){if(r==!0)return null;e.forward();continue e}}break}let n=new IG(this.lineStart+e.pos,e.text.slice(e.pos));for(let i of this.parser.leafBlockParsers)if(i){let r=i(this,n);r&&n.parsers.push(r)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let i of this.parser.endLeafBlock)if(i(this,e,n))break e}for(let i of n.parsers)if(i.nextLine(this,e,n))return null;n.content+=`
`+e.scrub();for(let i of e.markers)n.marks.push(i)}return this.finishLeaf(n),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let n=this.fragments.takeNodes(this);return n?(this.absoluteLineStart+=n,this.lineStart=oR(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let n=qG;if(n.end=e,e>=this.to)n.text="";else if(n.text=this.lineChunkAt(e),n.end+=n.text.length,this.ranges.length>1){let i=this.absoluteLineStart,r=this.rangeI;for(;this.ranges[r].to<n.end;){r++;let s=this.ranges[r].from,o=this.lineChunkAt(s);n.end=s+o.length,n.text=n.text.slice(0,this.ranges[r-1].to-i)+o,i=n.end-n.text.length}}return n}readLine(){let{line:e}=this,{text:n,end:i}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=i,e.reset(n);e.depth<this.stack.length;e.depth++){let r=this.stack[e.depth],s=this.parser.skipContextMarkup[r.type];if(!s)throw new Error("Unhandled block context "+me[r.type]);let o=this.line.markers.length;if(!s(r,this,e)){this.line.markers.length>o&&(r.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let n=this.input.chunk(e),i;if(this.input.lineChunks)i=n==`
`?"":n;else{let r=n.indexOf(`
`);i=r<0?n:n.slice(0,r)}return e+i.length>this.to?i.slice(0,this.to-e):i}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,n,i=0){this.block=rm.create(e,i,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,n,i=0){this.startContext(this.parser.getNodeType(e),n,i)}addNode(e,n,i){typeof e=="number"&&(e=new nt(this.parser.nodeSet.types[e],bc,bc,(i??this.prevLineEnd())-n)),this.block.addChild(e,n-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,n){this.addNode(this.buffer.writeElements(Rx(n.children,e.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let e=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(e.toTree(this.parser.nodeSet),e.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?HP(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let i of e.parsers)if(i.finish(this,e))return;let n=Rx(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(n,-e.start).finish(me.Paragraph,e.content.length),e.start)}elt(e,n,i,r){return typeof e=="string"?qe(this.parser.getNodeType(e),n,i,r):new eR(e,n)}get buffer(){return new JP(this.parser.nodeSet)}}function HP(t,e,n,i,r){let s=t[e].to,o=[],l=[],u=n.from+i;function f(h,p){for(;p?h>=s:h>s;){let g=t[e+1].from-s;i+=g,h+=g,e++,s=t[e].to}}for(let h=n.firstChild;h;h=h.nextSibling){f(h.from+i,!0);let p=h.from+i,g,O=r.get(h.tree);O?g=O:h.to+i>s?(g=HP(t,e,h,i,r),f(h.to+i,!1)):g=h.toTree(),o.push(g),l.push(p-u)}return f(n.to+i,!1),new nt(n.type,o,l,n.to+i-u,n.tree?n.tree.propValues:void 0)}class Ym extends i1{constructor(e,n,i,r,s,o,l,u,f){super(),this.nodeSet=e,this.blockParsers=n,this.leafBlockParsers=i,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=l,this.inlineNames=u,this.wrappers=f,this.nodeTypes=Object.create(null);for(let h of e.types)this.nodeTypes[h.name]=h.id}createParse(e,n,i){let r=new WG(this,e,n,i);for(let s of this.wrappers)r=s(r,e,n,i);return r}configure(e){let n=Px(e);if(!n)return this;let{nodeSet:i,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),u=this.inlineParsers.slice(),f=this.inlineNames.slice(),h=this.endLeafBlock.slice(),p=this.wrappers;if(uf(n.defineNodes)){r=Object.assign({},r);let g=i.types.slice(),O;for(let v of n.defineNodes){let{name:x,block:S,composite:k,style:$}=typeof v=="string"?{name:v}:v;if(g.some(_=>_.name==x))continue;k&&(r[g.length]=(_,Q,N)=>k(Q,N,_.value));let E=g.length,T=k?["Block","BlockContext"]:S?E>=me.ATXHeading1&&E<=me.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;g.push(qt.define({id:E,name:x,props:T&&[[Me.group,T]]})),$&&(O||(O={}),Array.isArray($)||$ instanceof br?O[x]=$:Object.assign(O,$))}i=new Qd(g),O&&(i=i.extend(Na(O)))}if(uf(n.props)&&(i=i.extend(...n.props)),uf(n.remove))for(let g of n.remove){let O=this.blockNames.indexOf(g),v=this.inlineNames.indexOf(g);O>-1&&(s[O]=o[O]=void 0),v>-1&&(u[v]=void 0)}if(uf(n.parseBlock))for(let g of n.parseBlock){let O=l.indexOf(g.name);if(O>-1)s[O]=g.parse,o[O]=g.leaf;else{let v=g.before?Pp(l,g.before):g.after?Pp(l,g.after)+1:l.length-1;s.splice(v,0,g.parse),o.splice(v,0,g.leaf),l.splice(v,0,g.name)}g.endLeaf&&h.push(g.endLeaf)}if(uf(n.parseInline))for(let g of n.parseInline){let O=f.indexOf(g.name);if(O>-1)u[O]=g.parse;else{let v=g.before?Pp(f,g.before):g.after?Pp(f,g.after)+1:f.length-1;u.splice(v,0,g.parse),f.splice(v,0,g.name)}}return n.wrap&&(p=p.concat(n.wrap)),new Ym(i,s,o,l,h,r,u,f,p)}getNodeType(e){let n=this.nodeTypes[e];if(n==null)throw new RangeError(`Unknown node type '${e}'`);return n}parseInline(e,n){let i=new p1(this,e,n);e:for(let r=n;r<i.end;){let s=i.char(r);for(let o of this.inlineParsers)if(o){let l=o(i,s,r);if(l>=0){r=l;continue e}}r++}return i.resolveMarkers(0)}}function uf(t){return t!=null&&t.length>0}function Px(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=Px(t[0]);if(t.length==1)return e;let n=Px(t.slice(1));if(!n||!e)return e||n;let i=(o,l)=>(o||bc).concat(l||bc),r=e.wrap,s=n.wrap;return{props:i(e.props,n.props),defineNodes:i(e.defineNodes,n.defineNodes),parseBlock:i(e.parseBlock,n.parseBlock),parseInline:i(e.parseInline,n.parseInline),remove:i(e.remove,n.remove),wrap:r?s?(o,l,u,f)=>r(s(o,l,u,f),l,u,f):r:s}}function Pp(t,e){let n=t.indexOf(e);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return n}let KP=[qt.none];for(let t=1,e;e=me[t];t++)KP[t]=qt.define({id:t,name:e,props:t>=me.Escape?[]:[[Me.group,t in ZP?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const bc=[];class JP{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,n,i,r=0){return this.content.push(e,n,i,4+r*4),this}writeElements(e,n=0){for(let i of e)i.writeTo(this,n);return this}finish(e,n){return nt.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:n})}}let rd=class{constructor(e,n,i,r=bc){this.type=e,this.from=n,this.to=i,this.children=r}writeTo(e,n){let i=e.content.length;e.writeElements(this.children,n),e.content.push(this.type,this.from+n,this.to+n,e.content.length+4-i)}toTree(e){return new JP(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class eR{constructor(e,n){this.tree=e,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return bc}writeTo(e,n){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function qe(t,e,n,i){return new rd(t,e,n,i)}const tR={resolve:"Emphasis",mark:"EmphasisMark"},nR={resolve:"Emphasis",mark:"EmphasisMark"},ea={},sm={};class ii{constructor(e,n,i,r){this.type=e,this.from=n,this.to=i,this.side=r}}const F2="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let sd=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{sd=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const S0={Escape(t,e,n){if(e!=92||n==t.end-1)return-1;let i=t.char(n+1);for(let r=0;r<F2.length;r++)if(F2.charCodeAt(r)==i)return t.append(qe(me.Escape,n,n+2));return-1},Entity(t,e,n){if(e!=38)return-1;let i=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(n+1,n+31));return i?t.append(qe(me.Entity,n,n+1+i[0].length)):-1},InlineCode(t,e,n){if(e!=96||n&&t.char(n-1)==96)return-1;let i=n+1;for(;i<t.end&&t.char(i)==96;)i++;let r=i-n,s=0;for(;i<t.end;i++)if(t.char(i)==96){if(s++,s==r&&t.char(i+1)!=96)return t.append(qe(me.InlineCode,n,i+1,[qe(me.CodeMark,n,n+r),qe(me.CodeMark,i+1-r,i+1)]))}else s=0;return-1},HTMLTag(t,e,n){if(e!=60||n==t.end-1)return-1;let i=t.slice(n+1,t.end),r=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(i);if(r)return t.append(qe(me.Autolink,n,n+1+r[0].length,[qe(me.LinkMark,n,n+1),qe(me.URL,n+1,n+r[0].length),qe(me.LinkMark,n+r[0].length,n+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(i);if(s)return t.append(qe(me.Comment,n,n+1+s[0].length));let o=/^\?[^]*?\?>/.exec(i);if(o)return t.append(qe(me.ProcessingInstruction,n,n+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return l?t.append(qe(me.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(t,e,n){if(e!=95&&e!=42)return-1;let i=n+1;for(;t.char(i)==e;)i++;let r=t.slice(n-1,n),s=t.slice(i,i+1),o=sd.test(r),l=sd.test(s),u=/\s|^$/.test(r),f=/\s|^$/.test(s),h=!f&&(!l||u||o),p=!u&&(!o||f||l),g=h&&(e==42||!p||o),O=p&&(e==42||!h||l);return t.append(new ii(e==95?tR:nR,n,i,(g?1:0)|(O?2:0)))},HardBreak(t,e,n){if(e==92&&t.char(n+1)==10)return t.append(qe(me.HardBreak,n,n+2));if(e==32){let i=n+1;for(;t.char(i)==32;)i++;if(t.char(i)==10&&i>=n+2)return t.append(qe(me.HardBreak,n,i+1))}return-1},Link(t,e,n){return e==91?t.append(new ii(ea,n,n+1,1)):-1},Image(t,e,n){return e==33&&t.char(n+1)==91?t.append(new ii(sm,n,n+2,1)):-1},LinkEnd(t,e,n){if(e!=93)return-1;for(let i=t.parts.length-1;i>=0;i--){let r=t.parts[i];if(r instanceof ii&&(r.type==ea||r.type==sm)){if(!r.side||t.skipSpace(r.to)==n&&!/[(\[]/.test(t.slice(n+1,n+2)))return t.parts[i]=null,-1;let s=t.takeContent(i),o=t.parts[i]=FG(t,s,r.type==ea?me.Link:me.Image,r.from,n+1);if(r.type==ea)for(let l=0;l<i;l++){let u=t.parts[l];u instanceof ii&&u.type==ea&&(u.side=0)}return o.to}}return-1}};function FG(t,e,n,i,r){let{text:s}=t,o=t.char(r),l=r;if(e.unshift(qe(me.LinkMark,i,i+(n==me.Image?2:1))),e.push(qe(me.LinkMark,r-1,r)),o==40){let u=t.skipSpace(r+1),f=iR(s,u-t.offset,t.offset),h;f&&(u=t.skipSpace(f.to),u!=f.to&&(h=rR(s,u-t.offset,t.offset),h&&(u=t.skipSpace(h.to)))),t.char(u)==41&&(e.push(qe(me.LinkMark,r,r+1)),l=u+1,f&&e.push(f),h&&e.push(h),e.push(qe(me.LinkMark,u,l)))}else if(o==91){let u=sR(s,r-t.offset,t.offset,!1);u&&(e.push(u),l=u.to)}return qe(n,i,l,e)}function iR(t,e,n){if(t.charCodeAt(e)==60){for(let r=e+1;r<t.length;r++){let s=t.charCodeAt(r);if(s==62)return qe(me.URL,e+n,r+1+n);if(s==60||s==10)return!1}return null}else{let r=0,s=e;for(let o=!1;s<t.length;s++){let l=t.charCodeAt(s);if(Ai(l))break;if(o)o=!1;else if(l==40)r++;else if(l==41){if(!r)break;r--}else l==92&&(o=!0)}return s>e?qe(me.URL,e+n,s+n):s==t.length?null:!1}}function rR(t,e,n){let i=t.charCodeAt(e);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=e+1,o=!1;s<t.length;s++){let l=t.charCodeAt(s);if(o)o=!1;else{if(l==r)return qe(me.LinkTitle,e+n,s+1+n);l==92&&(o=!0)}}return null}function sR(t,e,n,i){for(let r=!1,s=e+1,o=Math.min(t.length,s+999);s<o;s++){let l=t.charCodeAt(s);if(r)r=!1;else{if(l==93)return i?!1:qe(me.LinkLabel,e+n,s+1+n);if(i&&!Ai(l)&&(i=!1),l==91)return!1;l==92&&(r=!0)}}return null}class p1{constructor(e,n,i){this.parser=e,this.text=n,this.offset=i,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,n){return this.text.slice(e-this.offset,n-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,n,i,r,s){return this.append(new ii(e,n,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let n=this.parts[e];if(n instanceof ii&&(n.type==ea||n.type==sm))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let i=e;i<this.parts.length;i++){let r=this.parts[i];if(!(r instanceof ii&&r.type.resolve&&r.side&2))continue;let s=r.type==tR||r.type==nR,o=r.to-r.from,l,u=i-1;for(;u>=e;u--){let x=this.parts[u];if(x instanceof ii&&x.side&1&&x.type==r.type&&!(s&&(r.side&1||x.side&2)&&(x.to-x.from+o)%3==0&&((x.to-x.from)%3||o%3))){l=x;break}}if(!l)continue;let f=r.type.resolve,h=[],p=l.from,g=r.to;if(s){let x=Math.min(2,l.to-l.from,o);p=l.to-x,g=r.from+x,f=x==1?"Emphasis":"StrongEmphasis"}l.type.mark&&h.push(this.elt(l.type.mark,p,l.to));for(let x=u+1;x<i;x++)this.parts[x]instanceof rd&&h.push(this.parts[x]),this.parts[x]=null;r.type.mark&&h.push(this.elt(r.type.mark,r.from,g));let O=this.elt(f,p,g,h);this.parts[u]=s&&l.from!=p?new ii(l.type,l.from,p,l.side):null,(this.parts[i]=s&&r.to!=g?new ii(r.type,g,r.to,r.side):null)?this.parts.splice(i,0,O):this.parts[i]=O}let n=[];for(let i=e;i<this.parts.length;i++){let r=this.parts[i];r instanceof rd&&n.push(r)}return n}findOpeningDelimiter(e){for(let n=this.parts.length-1;n>=0;n--){let i=this.parts[n];if(i instanceof ii&&i.type==e&&i.side&1)return n}return null}takeContent(e){let n=this.resolveMarkers(e);return this.parts.length=e,n}getDelimiterAt(e){let n=this.parts[e];return n instanceof ii?n:null}skipSpace(e){return Xf(this.text,e-this.offset)+this.offset}elt(e,n,i,r){return typeof e=="string"?qe(this.parser.getNodeType(e),n,i,r):new eR(e,n)}}p1.linkStart=ea;p1.imageStart=sm;function Rx(t,e){if(!e.length)return t;if(!t.length)return e;let n=t.slice(),i=0;for(let r of e){for(;i<n.length&&n[i].to<r.to;)i++;if(i<n.length&&n[i].from<r.from){let s=n[i];s instanceof rd&&(n[i]=new rd(s.type,s.from,s.to,Rx(s.children,[r])))}else n.splice(i++,0,r)}return n}const HG=[me.CodeBlock,me.ListItem,me.OrderedList,me.BulletList];let KG=class{constructor(e,n){this.fragments=e,this.input=n,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,n){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=`
`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=e+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=n;if(!i.childAfter(r))return!1}}matches(e){let n=this.cursor.tree;return n&&n.prop(Me.contextHash)==e}takeNodes(e){let n=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,l=e.block.children.length,u=o,f=l;for(;;){if(n.to-i>r){if(n.type.isAnonymous&&n.firstChild())continue;break}let h=oR(n.from-i,e.ranges);if(n.to-i<=e.ranges[e.rangeI].to)e.addNode(n.tree,h);else{let p=new nt(e.parser.nodeSet.types[me.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(p,n.tree),e.addNode(p,h)}if(n.type.is("Block")&&(HG.indexOf(n.type.id)<0?(o=n.to-i,l=e.block.children.length):(o=u,l=f),u=n.to-i,f=e.block.children.length),!n.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-s}};function oR(t,e){let n=t;for(let i=1;i<e.length;i++){let r=e[i-1].to,s=e[i].from;r<t&&(n-=s-r)}return n}const JG=Na({"Blockquote/...":W.quote,HorizontalRule:W.contentSeparator,"ATXHeading1/... SetextHeading1/...":W.heading1,"ATXHeading2/... SetextHeading2/...":W.heading2,"ATXHeading3/...":W.heading3,"ATXHeading4/...":W.heading4,"ATXHeading5/...":W.heading5,"ATXHeading6/...":W.heading6,"Comment CommentBlock":W.comment,Escape:W.escape,Entity:W.character,"Emphasis/...":W.emphasis,"StrongEmphasis/...":W.strong,"Link/... Image/...":W.link,"OrderedList/... BulletList/...":W.list,"BlockQuote/...":W.quote,"InlineCode CodeText":W.monospace,"URL Autolink":W.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":W.processingInstruction,"CodeInfo LinkLabel":W.labelName,LinkTitle:W.string,Paragraph:W.content}),eV=new Ym(new Qd(KP).extend(JG),Object.keys(Np).map(t=>Np[t]),Object.keys(Np).map(t=>FP[t]),Object.keys(Np),YG,ZP,Object.keys(S0).map(t=>S0[t]),Object.keys(S0),[]);function tV(t,e,n){let i=[];for(let r=t.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:n;if(o>s&&i.push({from:s,to:o}),!r)break;s=r.to}return i}function nV(t){let{codeParser:e,htmlParser:n}=t;return{wrap:QP((r,s)=>{let o=r.type.id;if(e&&(o==me.CodeBlock||o==me.FencedCode)){let l="";if(o==me.FencedCode){let f=r.node.getChild(me.CodeInfo);f&&(l=s.read(f.from,f.to))}let u=e(l);if(u)return{parser:u,overlay:f=>f.type.id==me.CodeText,bracketed:o==me.FencedCode}}else if(n&&(o==me.HTMLBlock||o==me.HTMLTag||o==me.CommentBlock))return{parser:n,overlay:tV(r.node,r.from,r.to)};return null})}}const iV={resolve:"Strikethrough",mark:"StrikethroughMark"},rV={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":W.strikethrough}},{name:"StrikethroughMark",style:W.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,n){if(e!=126||t.char(n+1)!=126||t.char(n+2)==126)return-1;let i=t.slice(n-1,n),r=t.slice(n+2,n+3),s=/\s|^$/.test(i),o=/\s|^$/.test(r),l=sd.test(i),u=sd.test(r);return t.addDelimiter(iV,n,n+2,!o&&(!u||s||l),!s&&(!l||o||u))},after:"Emphasis"}]};function Zf(t,e,n=0,i,r=0){let s=0,o=!0,l=-1,u=-1,f=!1,h=()=>{i.push(t.elt("TableCell",r+l,r+u,t.parser.parseInline(e.slice(l,u),r+l)))};for(let p=n;p<e.length;p++){let g=e.charCodeAt(p);g==124&&!f?((!o||l>-1)&&s++,o=!1,i&&(l>-1&&h(),i.push(t.elt("TableDelimiter",p+r,p+r+1))),l=u=-1):(f||g!=32&&g!=9)&&(l<0&&(l=p),u=p+1),f=!f&&g==92}return l>-1&&(s++,i&&h()),s}function H2(t,e){for(let n=e;n<t.length;n++){let i=t.charCodeAt(n);if(i==124)return!0;i==92&&n++}return!1}const aR=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class K2{constructor(){this.rows=null}nextLine(e,n,i){if(this.rows==null){this.rows=!1;let r;if((n.next==45||n.next==58||n.next==124)&&aR.test(r=n.text.slice(n.pos))){let s=[];Zf(e,i.content,0,s,i.start)==Zf(e,r,0)&&(this.rows=[e.elt("TableHeader",i.start,i.start+i.content.length,s),e.elt("TableDelimiter",e.lineStart+n.pos,e.lineStart+n.text.length)])}}else if(this.rows){let r=[];Zf(e,n.text,n.pos,r,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+n.pos,e.lineStart+n.text.length,r))}return!1}finish(e,n){return this.rows?(e.addLeafElement(n,e.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const sV={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":W.heading}},"TableRow",{name:"TableCell",style:W.content},{name:"TableDelimiter",style:W.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return H2(e.content,0)?new K2:null},endLeaf(t,e,n){if(n.parsers.some(r=>r instanceof K2)||!H2(e.text,e.basePos))return!1;let i=t.peekLine();return aR.test(i)&&Zf(t,e.text,e.basePos)==Zf(t,i,e.basePos)},before:"SetextHeading"}]};class oV{nextLine(){return!1}finish(e,n){return e.addLeafElement(n,e.elt("Task",n.start,n.start+n.content.length,[e.elt("TaskMarker",n.start,n.start+3),...e.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const aV={defineNodes:[{name:"Task",block:!0,style:W.list},{name:"TaskMarker",style:W.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new oV:null},after:"SetextHeading"}]},J2=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,e$=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,lV=/[\w-]+\.[\w-]+($|[/:])/,t$=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,n$=/\/[a-zA-Z\d@.]+/gy;function i$(t,e,n,i){let r=0;for(let s=e;s<n;s++)t[s]==i&&r++;return r}function cV(t,e){e$.lastIndex=e;let n=e$.exec(t);if(!n||lV.exec(n[0])[0].indexOf("_")>-1)return-1;let i=e+n[0].length;for(;;){let r=t[i-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&i$(t,e,i,")")>i$(t,e,i,"("))i--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,i))))i=e+s.index;else break}return i}function r$(t,e){t$.lastIndex=e;let n=t$.exec(t);if(!n)return-1;let i=n[0][n[0].length-1];return i=="_"||i=="-"?-1:e+n[0].length-(i=="."?1:0)}const uV={parseInline:[{name:"Autolink",parse(t,e,n){let i=n-t.offset;if(i&&/\w/.test(t.text[i-1]))return-1;J2.lastIndex=i;let r=J2.exec(t.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=cV(t.text,i+r[0].length),s>-1&&t.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(i,s));s=i+o[0].length}}else r[3]?s=r$(t.text,i):(s=r$(t.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(n$.lastIndex=s,r=n$.exec(t.text),r&&(s=r.index+r[0].length)));return s<0?-1:(t.addElement(t.elt("URL",n,s+t.offset)),s+t.offset)}}]},fV=[sV,aV,rV,uV];function lR(t,e,n){return(i,r,s)=>{if(r!=t||i.char(s+1)==t)return-1;let o=[i.elt(n,s,s+1)];for(let l=s+1;l<i.end;l++){let u=i.char(l);if(u==t)return i.addElement(i.elt(e,s,l+1,o.concat(i.elt(n,l,l+1))));if(u==92&&o.push(i.elt("Escape",l,l+++2)),Ai(u))break}return-1}}const dV={defineNodes:[{name:"Superscript",style:W.special(W.content)},{name:"SuperscriptMark",style:W.processingInstruction}],parseInline:[{name:"Superscript",parse:lR(94,"Superscript","SuperscriptMark")}]},hV={defineNodes:[{name:"Subscript",style:W.special(W.content)},{name:"SubscriptMark",style:W.processingInstruction}],parseInline:[{name:"Subscript",parse:lR(126,"Subscript","SubscriptMark")}]},pV={defineNodes:[{name:"Emoji",style:W.character}],parseInline:[{name:"Emoji",parse(t,e,n){let i;return e!=58||!(i=/^[a-zA-Z_0-9]+:/.exec(t.slice(n+1,t.end)))?-1:t.addElement(t.elt("Emoji",n,n+1+i[0].length))}}]};var s$={};class om{constructor(e,n,i,r,s,o,l,u,f,h=0,p){this.p=e,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=u,this.curContext=f,this.lookAhead=h,this.parent=p}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,i=0){let r=e.parser.context;return new om(e,[],n,i,i,0,[],0,r?new o$(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let i=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(r);if(l&&(this.score+=l),i==0){r<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let u=this.stack.length-(i-1)*3-(e&262144?6:0),f=u?this.stack[u-2]:this.p.ranges[0].from;r<s.minRepeatTerm&&f==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let h=this.reducePos-f;h>=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(f==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSize<h&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=f,this.p.lastBigReductionSize=h));let p=u?this.stack[u-1]:0,g=this.bufferBase+this.buffer.length-p;if(r<s.minRepeatTerm||e&131072){let O=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,f,O,g+4,!0)}if(e&262144)this.state=this.stack[u];else{let O=this.stack[u-3];this.state=s.getGoto(O,r,!0)}for(;this.stack.length>u;)this.stack.pop();this.reduceContext(r,f)}storeNode(e,n,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this.buffer.length;if(o>0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let u=o;u>0&&this.buffer[u-2]>i;u-=4)if(this.buffer[u-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(e,n,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}else this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4)}apply(e,n,i,r){e&65536?this.reduce(e):this.shift(e,n,i,r)}useNode(e,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(n&&e.buffer[n-4]==0&&(n-=4);n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let i=e.buffer.slice(n),r=e.bufferBase+n;for(;e&&r==e.bufferBase;)e=e.parent;return new om(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new gV(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(i==0)return!1;if((i&65536)==0)return!0;n.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,o;s<n.length;s+=2)(o=n[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&r.push(n[s],o);if(this.stack.length<120)for(let s=0;r.length<8&&s<n.length;s+=2){let o=n[s+1];r.some((l,u)=>u&1&&l==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r<n.length&&i.length<4;r+=2){let s=n[r+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(n[r],this.pos),o.reducePos=this.pos,o.score-=200,i.push(o)}return i}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let i=n>>19,r=n&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let u=o&65535,f=this.stack.length-l*3;if(f>=0&&e.getGoto(this.stack[f],u,!1)>=0)return l<<19|65536|u}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new o$(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class o${constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class gV{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class am{constructor(e,n,i){this.stack=e,this.pos=n,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new am(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new am(this.stack,this.pos,this.index)}}function $f(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let i=0,r=0;i<t.length;){let s=0;for(;;){let o=t.charCodeAt(i++),l=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let u=o-32;if(u>=46&&(u-=46,l=!0),s+=u,l)break;s*=46}n?n[r++]=s:n=new e(s)}return n}class Sg{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const a$=new Sg;class mV{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=a$,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let i=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<i.from;){if(!r)return null;let o=this.ranges[--r];s-=i.from-o.to,i=o}for(;n<0?s>i.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,i,r;if(n>=0&&n<this.chunk.length)i=this.pos+e,r=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(i=s,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=i;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=a$,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,n)))}return i}}class ic{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:i}=n.p;cR(this.data,e,n,this.id,i.data,i.tokenPrecTable)}}ic.prototype.contextual=ic.prototype.fallback=ic.prototype.extend=!1;class lm{constructor(e,n,i){this.precTable=n,this.elseToken=i,this.data=typeof e=="string"?$f(e):e}token(e,n){let i=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(cR(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}}lm.prototype.contextual=ic.prototype.fallback=ic.prototype.extend=!1;class on{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function cR(t,e,n,i,r,s){let o=0,l=1<<i,{dialect:u}=n.p.parser;e:for(;(l&t[o])!=0;){let f=t[o+1];for(let O=o+3;O<f;O+=2)if((t[O+1]&l)>0){let v=t[O];if(u.allows(v)&&(e.token.value==-1||e.token.value==v||OV(v,e.token.value,r,s))){e.acceptToken(v);break}}let h=e.next,p=0,g=t[o+2];if(e.next<0&&g>p&&t[f+g*3-3]==65535){o=t[f+g*3-1];continue e}for(;p<g;){let O=p+g>>1,v=f+O+(O<<1),x=t[v],S=t[v+1]||65536;if(h<x)g=O;else if(h>=S)p=O+1;else{o=t[v+2],e.advance();continue e}}break}}function l$(t,e,n){for(let i=e,r;(r=t[i])!=65535;i++)if(r==n)return i-e;return-1}function OV(t,e,n,i){let r=l$(n,i,e);return r<0||l$(n,i,t)<r}const Jn=typeof process<"u"&&s$&&/\bparse\b/.test(s$.LOG);let k0=null;function c$(t,e,n){let i=t.cursor(it.IncludeAnonymous);for(i.moveTo(e);;)if(!(n<0?i.childBefore(e):i.childAfter(e)))for(;;){if((n<0?i.to<e:i.from>e)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(t.length,Math.max(i.from+1,e+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:t.length}}class yV{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?c$(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?c$(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let i=this.trees[n],r=this.index[n];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=i.children[r],o=this.start[n]+i.positions[r];if(o>e)return this.nextStart=o,null;if(s instanceof nt){if(o==e){if(o<this.safeFrom)return null;let l=o+s.length;if(l<=this.safeTo){let u=s.prop(Me.lookAhead);if(!u||l+u<this.fragment.to)return s}}this.index[n]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}}class vV{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Sg)}getActions(e){let n=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,u=0;for(let f=0;f<s.length;f++){if((1<<f&o)==0)continue;let h=s[f],p=this.tokens[f];if(!(i&&!h.fallback)&&((h.contextual||p.start!=e.pos||p.mask!=o||p.context!=l)&&(this.updateCachedToken(p,h,e),p.mask=o,p.context=l),p.lookAhead>p.end+25&&(u=Math.max(p.lookAhead,u)),p.value!=0)){let g=n;if(p.extended>-1&&(n=this.addActions(e,p.extended,p.end,n)),n=this.addActions(e,p.value,p.end,n),!h.extend&&(i=p,n>g))break}}for(;this.actions.length>n;)this.actions.pop();return u&&e.setLookAhead(u),!i&&e.pos==this.stream.end&&(i=new Sg,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,n=this.addActions(e,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Sg,{pos:i,p:r}=e;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(e,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let l=s.specializers[o](this.stream.read(e.start,e.end),i);if(l>=0&&i.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,n,i,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=n,this.actions[r++]=i,r}addActions(e,n,i,r){let{state:s}=e,{parser:o}=e.p,{data:l}=o;for(let u=0;u<2;u++)for(let f=o.stateSlot(s,u?2:1);;f+=3){if(l[f]==65535)if(l[f+1]==1)f=cs(l,f+2);else{r==0&&l[f+1]==2&&(r=this.putAction(cs(l,f+2),n,i,r));break}l[f]==n&&(r=this.putAction(cs(l,f+1),n,i,r))}return r}}class bV{constructor(e,n,i,r){this.parser=e,this.input=n,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new mV(n,r),this.tokens=new vV(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[om.start(this,e.top[0],s)],this.fragments=i.length&&this.stream.end-s>e.bufferLength*4?new yV(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>n)i.push(l);else{if(this.advanceStack(l,i,e))continue;{r||(r=[],s=[]),r.push(l);let u=this.tokens.getMainToken(l);s.push(u.value,u.end)}}break}}if(!i.length){let o=r&&wV(r);if(o)return Jn&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Jn&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return Jn&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,u)=>u.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o<i.length-1;o++){let l=i[o];for(let u=o+1;u<i.length;u++){let f=i[u];if(l.sameState(f)||l.buffer.length>500&&f.buffer.length>500)if((l.score-f.score||l.buffer.length-f.buffer.length)>0)i.splice(u--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o<i.length;o++)i[o].pos<this.minStackPos&&(this.minStackPos=i[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,i){let r=e.pos,{parser:s}=this,o=Jn?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let f=e.curContext&&e.curContext.tracker.strict,h=f?e.curContext.hash:0;for(let p=this.fragments.nodeAt(r);p;){let g=this.parser.nodeSet.types[p.type.id]==p.type?s.getGoto(e.state,p.type.id):-1;if(g>-1&&p.length&&(!f||(p.prop(Me.contextHash)||0)==h))return e.useNode(p,g),Jn&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(p.type.id)})`),!0;if(!(p instanceof nt)||p.children.length==0||p.positions[0]>0)break;let O=p.children[0];if(O instanceof nt&&p.positions[0]==0)p=O;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Jn&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let u=this.tokens.getActions(e);for(let f=0;f<u.length;){let h=u[f++],p=u[f++],g=u[f++],O=f==u.length||!i,v=O?e:e.split(),x=this.tokens.mainToken;if(v.apply(h,p,x?x.start:v.pos,g),Jn&&console.log(o+this.stackID(v)+` (via ${(h&65536)==0?"shift":`reduce of ${s.getName(h&65535)}`} for ${s.getName(p)} @ ${r}${v==e?"":", split"})`),O)return!0;v.pos>r?n.push(v):i.push(v)}return!1}advanceFully(e,n){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return u$(e,n),!0}}runRecovery(e,n,i){let r=null,s=!1;for(let o=0;o<e.length;o++){let l=e[o],u=n[o<<1],f=n[(o<<1)+1],h=Jn?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Jn&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let p=l.split(),g=h;for(let O=0;O<10&&p.forceReduce()&&(Jn&&console.log(g+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,i));O++)Jn&&(g=this.stackID(p)+" -> ");for(let O of l.recoverByInsert(u))Jn&&console.log(h+this.stackID(O)+" (via recover-insert)"),this.advanceFully(O,i);this.stream.end>l.pos?(f==l.pos&&(f++,u=0),l.recoverByDelete(u,f),Jn&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(u)})`),u$(l,i)):(!r||r.score<p.score)&&(r=p)}return r}stackToTree(e){return e.close(),nt.build({buffer:am.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(k0||(k0=new WeakMap)).get(e);return n||k0.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function u$(t,e){for(let n=0;n<e.length;n++){let i=e[n];if(i.pos==t.pos&&i.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class xV{constructor(e,n,i){this.source=e,this.flags=n,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}}const E0=t=>t;class g1{constructor(e){this.start=e.start,this.shift=e.shift||E0,this.reduce=e.reduce||E0,this.reuse=e.reuse||E0,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class xa extends i1{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;l<e.repeatNodeCount;l++)n.push("");let i=Object.keys(e.topRules).map(l=>e.topRules[l][1]),r=[];for(let l=0;l<n.length;l++)r.push([]);function s(l,u,f){r[l].push([u,u.deserialize(String(f))])}if(e.nodeProps)for(let l of e.nodeProps){let u=l[0];typeof u=="string"&&(u=Me[u]);for(let f=1;f<l.length;){let h=l[f++];if(h>=0)s(h,u,l[f++]);else{let p=l[f+-h];for(let g=-h;g>0;g--)s(l[f++],u,p);f++}}}this.nodeSet=new Qd(n.map((l,u)=>qt.define({name:u>=this.minRepeatTerm?void 0:l,id:u,props:r[u],top:i.indexOf(u)>-1,error:u==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(u)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=EP;let o=$f(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(f$),this.states=$f(e.states,Uint32Array),this.data=$f(e.stateData),this.goto=$f(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new ic(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,i){let r=new bV(this,e,n,i);for(let s of this.wrappers)r=s(r,e,n,i);return r}getGoto(e,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],l=o&1,u=r[s++];if(l&&i)return u;for(let f=s+(o>>1);s<f;s++)if(r[s]==e)return u;if(l)return-1}}hasAction(e,n){let i=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),o;;s+=3){if((o=i[s])==65535)if(i[s+1]==1)o=i[s=cs(i,s+2)];else{if(i[s+1]==2)return cs(i,s+2);break}if(o==n||o==0)return cs(i,s+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,i=>i==n?!0:null)}allActions(e,n){let i=this.stateSlot(e,4),r=i?n(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=cs(this.data,s+2);else break;r=n(cs(this.data,s+1))}return r}nextStates(e){let n=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=cs(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(e){let n=Object.assign(Object.create(xa.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=i}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=f$(o),o})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;s<n.length;s++)if(!i[s])for(let o=this.dialects[n[s]],l;(l=this.data[o++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new xV(e,i,r)}static deserialize(e){return new xa(e)}}function cs(t,e){return t[e]|t[e+1]<<16}function wV(t){let e=null;for(let n of t){let i=n.p.stoppedAt;(n.pos==n.p.stream.end||i!=null&&n.pos>i)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function f$(t){if(t.external){let e=t.extend?1:0;return(n,i)=>t.external(n,i)<<1|e}return t.get}const SV=55,kV=1,EV=56,TV=2,CV=57,$V=3,d$=4,_V=5,m1=6,uR=7,fR=8,dR=9,hR=10,QV=11,AV=12,NV=13,T0=58,PV=14,RV=15,h$=59,pR=21,jV=23,gR=24,MV=25,jx=27,mR=28,LV=29,DV=32,zV=35,XV=37,ZV=38,BV=0,IV=1,GV={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},VV={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},p$={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function UV(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let g$=null,m$=null,O$=0;function Mx(t,e){let n=t.pos+e;if(O$==n&&m$==t)return g$;let i=t.peek(e),r="";for(;UV(i);)r+=String.fromCharCode(i),i=t.peek(++e);return m$=t,O$=n,g$=r?r.toLowerCase():i==YV||i==qV?void 0:null}const OR=60,cm=62,O1=47,YV=63,qV=33,WV=45;function y$(t,e){this.name=t,this.parent=e}const FV=[m1,hR,uR,fR,dR],HV=new g1({start:null,shift(t,e,n,i){return FV.indexOf(e)>-1?new y$(Mx(i,1)||"",t):t},reduce(t,e){return e==pR&&t?t.parent:t},reuse(t,e,n,i){let r=e.type.id;return r==m1||r==XV?new y$(Mx(i,1)||"",t):t},strict:!1}),KV=new on((t,e)=>{if(t.next!=OR){t.next<0&&e.context&&t.acceptToken(T0);return}t.advance();let n=t.next==O1;n&&t.advance();let i=Mx(t,0);if(i===void 0)return;if(!i)return t.acceptToken(n?RV:PV);let r=e.context?e.context.name:null;if(n){if(i==r)return t.acceptToken(QV);if(r&&VV[r])return t.acceptToken(T0,-2);if(e.dialectEnabled(BV))return t.acceptToken(AV);for(let s=e.context;s;s=s.parent)if(s.name==i)return;t.acceptToken(NV)}else{if(i=="script")return t.acceptToken(uR);if(i=="style")return t.acceptToken(fR);if(i=="textarea")return t.acceptToken(dR);if(GV.hasOwnProperty(i))return t.acceptToken(hR);r&&p$[r]&&p$[r][i]?t.acceptToken(T0,-1):t.acceptToken(m1)}},{contextual:!0}),JV=new on(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(h$);break}if(t.next==WV)e++;else if(t.next==cm&&e>=2){n>=3&&t.acceptToken(h$,-2);break}else e=0;t.advance()}});function e6(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const t6=new on((t,e)=>{if(t.next==O1&&t.peek(1)==cm){let n=e.dialectEnabled(IV)||e6(e.context);t.acceptToken(n?_V:d$,2)}else t.next==cm&&t.acceptToken(d$,1)});function y1(t,e,n){let i=2+t.length;return new on(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==OR||s==1&&r.next==O1||s>=2&&s<i&&r.next==t.charCodeAt(s-2))s++,o++;else if(s==i&&r.next==cm){l>o?r.acceptToken(e,-o):r.acceptToken(n,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=o=0;r.advance()}})}const n6=y1("script",SV,kV),i6=y1("style",EV,TV),r6=y1("textarea",CV,$V),s6=Na({"Text RawText IncompleteTag IncompleteCloseTag":W.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":W.angleBracket,TagName:W.tagName,"MismatchedCloseTag/TagName":[W.tagName,W.invalid],AttributeName:W.attributeName,"AttributeValue UnquotedAttributeValue":W.attributeValue,Is:W.definitionOperator,"EntityReference CharacterReference":W.character,Comment:W.blockComment,ProcessingInst:W.processingInstruction,DoctypeDecl:W.documentMeta}),o6=xa.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO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geO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:HV,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[s6],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=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!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[n6,i6,r6,t6,KV,JV,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function yR(t,e){let n=Object.create(null);for(let i of t.getChildren(gR)){let r=i.getChild(MV),s=i.getChild(jx)||i.getChild(mR);r&&(n[e.read(r.from,r.to)]=s?s.type.id==jx?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return n}function v$(t,e){let n=t.getChild(jV);return n?e.read(n.from,n.to):" "}function C0(t,e,n){let i;for(let r of n)if(!r.attrs||r.attrs(i||(i=yR(t.node.parent.firstChild,e))))return{parser:r.parser,bracketed:!0};return null}function vR(t=[],e=[]){let n=[],i=[],r=[],s=[];for(let l of t)(l.tag=="script"?n:l.tag=="style"?i:l.tag=="textarea"?r:s).push(l);let o=e.length?Object.create(null):null;for(let l of e)(o[l.name]||(o[l.name]=[])).push(l);return QP((l,u)=>{let f=l.type.id;if(f==LV)return C0(l,u,n);if(f==DV)return C0(l,u,i);if(f==zV)return C0(l,u,r);if(f==pR&&s.length){let h=l.node,p=h.firstChild,g=p&&v$(p,u),O;if(g){for(let v of s)if(v.tag==g&&(!v.attrs||v.attrs(O||(O=yR(p,u))))){let x=h.lastChild,S=x.type.id==ZV?x.from:h.to;if(S>p.to)return{parser:v.parser,overlay:[{from:p.to,to:S}]}}}}if(o&&f==gR){let h=l.node,p;if(p=h.firstChild){let g=o[u.read(p.from,p.to)];if(g)for(let O of g){if(O.tagName&&O.tagName!=v$(h.parent,u))continue;let v=h.lastChild;if(v.type.id==jx){let x=v.from+1,S=v.lastChild,k=v.to-(S&&S.isError?0:1);if(k>x)return{parser:O.parser,overlay:[{from:x,to:k}],bracketed:!0}}else if(v.type.id==mR)return{parser:O.parser,overlay:[{from:v.from,to:v.to}]}}}}return null})}const a6=135,b$=1,l6=136,c6=137,bR=2,u6=138,f6=3,d6=4,xR=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],h6=58,p6=40,wR=95,g6=91,kg=45,m6=46,O6=35,y6=37,v6=38,b6=92,x6=10,w6=42;function od(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function v1(t){return t>=48&&t<=57}function x$(t){return v1(t)||t>=97&&t<=102||t>=65&&t<=70}const SR=(t,e,n)=>(i,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:u}=i;if(od(u)||u==kg||u==wR||s&&v1(u))!s&&(u!=kg||l>0)&&(s=!0),o===l&&u==kg&&o++,i.advance();else if(u==b6&&i.peek(1)!=x6){if(i.advance(),x$(i.next)){do i.advance();while(x$(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(o==2&&r.canShift(bR)?e:u==p6?n:t);break}}},S6=new on(SR(l6,bR,c6),{contextual:!0}),k6=new on(SR(u6,f6,d6),{contextual:!0}),E6=new on(t=>{if(xR.includes(t.peek(-1))){let{next:e}=t;(od(e)||e==wR||e==O6||e==m6||e==w6||e==g6||e==h6&&od(t.peek(1))||e==kg||e==v6)&&t.acceptToken(a6)}}),T6=new on(t=>{if(!xR.includes(t.peek(-1))){let{next:e}=t;if(e==y6&&(t.advance(),t.acceptToken(b$)),od(e)){do t.advance();while(od(t.next)||v1(t.next));t.acceptToken(b$)}}}),C6=Na({"AtKeyword import charset namespace keyframes media supports font-feature-values":W.definitionKeyword,"from to selector scope MatchFlag":W.keyword,NamespaceName:W.namespace,KeyframeName:W.labelName,KeyframeRangeName:W.operatorKeyword,TagName:W.tagName,ClassName:W.className,PseudoClassName:W.constant(W.className),IdName:W.labelName,"FeatureName PropertyName":W.propertyName,AttributeName:W.attributeName,NumberLiteral:W.number,KeywordQuery:W.keyword,UnaryQueryOp:W.operatorKeyword,"CallTag ValueName FontName":W.atom,VariableName:W.variableName,Callee:W.operatorKeyword,Unit:W.unit,"UniversalSelector NestingSelector":W.definitionOperator,"MatchOp CompareOp":W.compareOperator,"ChildOp SiblingOp, LogicOp":W.logicOperator,BinOp:W.arithmeticOperator,Important:W.modifier,Comment:W.blockComment,ColorLiteral:W.color,"ParenthesizedContent StringLiteral":W.string,":":W.punctuation,"PseudoOp #":W.derefOperator,"; , |":W.separator,"( )":W.paren,"[ ]":W.squareBracket,"{ }":W.brace}),$6={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},_6={__proto__:null,or:104,and:104,not:112,only:112,layer:186},Q6={__proto__:null,selector:118,layer:182},A6={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,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#n!RQ!yeQ$d!qR%q$e",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:159,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[C6],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R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=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[E6,T6,S6,k6,1,2,3,4,new lm("m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~",28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:t=>$6[t]||-1},{term:138,get:t=>_6[t]||-1},{term:4,get:t=>Q6[t]||-1},{term:28,get:t=>A6[t]||-1},{term:136,get:t=>N6[t]||-1}],tokenPrec:2256});let $0=null;function _0(){if(!$0&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let i in t)i!="cssText"&&i!="cssFloat"&&typeof t[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),n.has(i)||(e.push(i),n.add(i)));$0=e.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return $0||[]}const w$=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),S$=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),R6=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),j6=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),ss=/^(\w[\w-]*|-\w[\w-]*|)$/,M6=/^-(-[\w-]*)?$/;function L6(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let i=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return i?.name!="Callee"?!1:e.sliceString(i.from,i.to)=="var"}const k$=new _P,D6=["Declaration"];function z6(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function kR(t,e,n){if(e.to-e.from>4096){let i=k$.get(e);if(i)return i;let r=[],s=new Set,o=e.cursor(it.IncludeAnonymous);if(o.firstChild())do for(let l of kR(t,o.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return k$.set(e,r),r}else{let i=[],r=new Set;return e.cursor().iterate(s=>{var o;if(n(s)&&s.matchContext(D6)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=t.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:"variable"}))}}),i}}const X6=t=>e=>{let{state:n,pos:i}=e,r=At(n).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&n.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:_0(),validFor:ss};if(r.name=="ValueName")return{from:r.from,options:S$,validFor:ss};if(r.name=="PseudoClassName")return{from:r.from,options:w$,validFor:ss};if(t(r)||(e.explicit||s)&&L6(r,n.doc))return{from:t(r)||s?r.from:i,options:kR(n.doc,z6(r),t),validFor:M6};if(r.name=="TagName"){for(let{parent:u}=r;u;u=u.parent)if(u.name=="Block")return{from:r.from,options:_0(),validFor:ss};return{from:r.from,options:R6,validFor:ss}}if(r.name=="AtKeyword")return{from:r.from,options:j6,validFor:ss};if(!e.explicit)return null;let o=r.resolve(i),l=o.childBefore(i);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:i,options:w$,validFor:ss}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:i,options:S$,validFor:ss}:o.name=="Block"||o.name=="Styles"?{from:i,options:_0(),validFor:ss}:null},Z6=X6(t=>t.name=="VariableName"),um=ba.define({name:"css",parser:P6.configure({props:[Ic.add({Declaration:wg()}),Gc.add({"Block KeyframeList":a1})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function B6(){return new vc(um,um.data.of({autocomplete:Z6}))}const I6=316,G6=317,E$=1,V6=2,U6=3,Y6=4,q6=318,W6=320,F6=321,H6=5,K6=6,J6=0,Lx=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],ER=125,eU=59,Dx=47,tU=42,nU=43,iU=45,rU=60,sU=44,oU=63,aU=46,lU=91,cU=new g1({start:!1,shift(t,e){return e==H6||e==K6||e==W6?t:e==F6},strict:!1}),uU=new on((t,e)=>{let{next:n}=t;(n==ER||n==-1||e.context)&&t.acceptToken(q6)},{contextual:!0,fallback:!0}),fU=new on((t,e)=>{let{next:n}=t,i;Lx.indexOf(n)>-1||n==Dx&&((i=t.peek(1))==Dx||i==tU)||n!=ER&&n!=eU&&n!=-1&&!e.context&&t.acceptToken(I6)},{contextual:!0}),dU=new on((t,e)=>{t.next==lU&&!e.context&&t.acceptToken(G6)},{contextual:!0}),hU=new on((t,e)=>{let{next:n}=t;if(n==nU||n==iU){if(t.advance(),n==t.next){t.advance();let i=!e.context&&e.canShift(E$);t.acceptToken(i?E$:V6)}}else n==oU&&t.peek(1)==aU&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(U6))},{contextual:!0});function Q0(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const pU=new on((t,e)=>{if(t.next!=rU||!e.dialectEnabled(J6)||(t.advance(),t.next==Dx))return;let n=0;for(;Lx.indexOf(t.next)>-1;)t.advance(),n++;if(Q0(t.next,!0)){for(t.advance(),n++;Q0(t.next,!1);)t.advance(),n++;for(;Lx.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==sU)return;for(let i=0;;i++){if(i==7){if(!Q0(t.next,!0))return;break}if(t.next!="extends".charCodeAt(i))break;t.advance(),n++}}t.acceptToken(Y6,-n)}),gU=Na({"get set async static":W.modifier,"for while do if else switch try catch finally return throw break continue default case defer":W.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":W.operatorKeyword,"let var const using function class extends":W.definitionKeyword,"import export from":W.moduleKeyword,"with debugger new":W.keyword,TemplateString:W.special(W.string),super:W.atom,BooleanLiteral:W.bool,this:W.self,null:W.null,Star:W.modifier,VariableName:W.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":W.function(W.variableName),VariableDefinition:W.definition(W.variableName),Label:W.labelName,PropertyName:W.propertyName,PrivatePropertyName:W.special(W.propertyName),"CallExpression/MemberExpression/PropertyName":W.function(W.propertyName),"FunctionDeclaration/VariableDefinition":W.function(W.definition(W.variableName)),"ClassDeclaration/VariableDefinition":W.definition(W.className),"NewExpression/VariableName":W.className,PropertyDefinition:W.definition(W.propertyName),PrivatePropertyDefinition:W.definition(W.special(W.propertyName)),UpdateOp:W.updateOperator,"LineComment Hashbang":W.lineComment,BlockComment:W.blockComment,Number:W.number,String:W.string,Escape:W.escape,ArithOp:W.arithmeticOperator,LogicOp:W.logicOperator,BitOp:W.bitwiseOperator,CompareOp:W.compareOperator,RegExp:W.regexp,Equals:W.definitionOperator,Arrow:W.function(W.punctuation),": Spread":W.punctuation,"( )":W.paren,"[ ]":W.squareBracket,"{ }":W.brace,"InterpolationStart InterpolationEnd":W.special(W.brace),".":W.derefOperator,", ;":W.separator,"@":W.meta,TypeName:W.typeName,TypeDefinition:W.definition(W.typeName),"type enum interface implements namespace module declare":W.definitionKeyword,"abstract global Privacy readonly override":W.modifier,"is keyof unique infer asserts":W.operatorKeyword,JSXAttributeValue:W.attributeValue,JSXText:W.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":W.angleBracket,"JSXIdentifier JSXNameSpacedName":W.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":W.attributeName,"JSXBuiltin/JSXIdentifier":W.standard(W.tagName)}),mU={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},OU={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},yU={__proto__:null,"<":193},vU=xa.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#Dv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Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:cU,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[gU],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr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V$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[fU,dU,hU,pU,2,3,4,5,6,7,8,9,10,11,12,13,14,uU,new lm("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new lm("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>mU[t]||-1},{term:343,get:t=>OU[t]||-1},{term:95,get:t=>yU[t]||-1}],tokenPrec:15201}),TR=[Ln("function ${name}(${params}) {\n	${}\n}",{label:"function",detail:"definition",type:"keyword"}),Ln("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n	${}\n}",{label:"for",detail:"loop",type:"keyword"}),Ln("for (let ${name} of ${collection}) {\n	${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Ln("do {\n	${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Ln("while (${}) {\n	${}\n}",{label:"while",detail:"loop",type:"keyword"}),Ln(`try {
	\${}
} catch (\${error}) {
	\${}
}`,{label:"try",detail:"/ catch block",type:"keyword"}),Ln("if (${}) {\n	${}\n}",{label:"if",detail:"block",type:"keyword"}),Ln(`if (\${}) {
	\${}
} else {
	\${}
}`,{label:"if",detail:"/ else block",type:"keyword"}),Ln(`class \${name} {
	constructor(\${params}) {
		\${}
	}
}`,{label:"class",detail:"definition",type:"keyword"}),Ln('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Ln('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],bU=TR.concat([Ln("interface ${name} {\n	${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Ln("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Ln("enum ${name} {\n	${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),T$=new _P,CR=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function ff(t){return(e,n)=>{let i=e.node.getChild("VariableDefinition");return i&&n(i,t),!0}}const xU=["FunctionDeclaration"],wU={FunctionDeclaration:ff("function"),ClassDeclaration:ff("class"),ClassExpression:()=>!0,EnumDeclaration:ff("constant"),TypeAliasDeclaration:ff("type"),NamespaceDeclaration:ff("namespace"),VariableDefinition(t,e){t.matchContext(xU)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function $R(t,e){let n=T$.get(e);if(n)return n;let i=[],r=!0;function s(o,l){let u=t.sliceString(o.from,o.to);i.push({label:u,type:l})}return e.cursor(it.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=wU[o.name];if(l&&l(o,s)||CR.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of $R(t,o.node))i.push(l);return!1}}),T$.set(e,i),i}const C$=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,_R=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function SU(t){let e=At(t.state).resolveInner(t.pos,-1);if(_R.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&C$.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let i=[];for(let r=e;r;r=r.parent)CR.has(r.name)&&(i=i.concat($R(t.state.doc,r)));return{options:i,from:n?e.from:t.pos,validFor:C$}}const Ar=ba.define({name:"javascript",parser:vU.configure({props:[Ic.add({IfStatement:wg({except:/^\s*({|else\b)/}),TryStatement:wg({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:dG,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:i?1:2)*t.unit},Block:Cx({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":wg({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),Gc.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":a1,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let n=t.lastChild;return{from:e.to,to:n.type.isError?t.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let n=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,i=t.lastChild;return!n||n.type.isError?null:{from:n.to,to:i.type.isError?t.to:i.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),QR={test:t=>/^JSX/.test(t.name),facet:r1({commentTokens:{block:{open:"{/*",close:"*/}"}}})},AR=Ar.configure({dialect:"ts"},"typescript"),NR=Ar.configure({dialect:"jsx",props:[s1.add(t=>t.isTop?[QR]:void 0)]}),PR=Ar.configure({dialect:"jsx ts",props:[s1.add(t=>t.isTop?[QR]:void 0)]},"typescript");let RR=t=>({label:t,type:"keyword"});const jR="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(RR),kU=jR.concat(["declare","implements","private","protected","public"].map(RR));function EU(t={}){let e=t.jsx?t.typescript?PR:NR:t.typescript?AR:Ar,n=t.typescript?bU.concat(kU):TR.concat(jR);return new vc(e,[Ar.data.of({autocomplete:$G(_R,CG(n))}),Ar.data.of({autocomplete:SU}),t.jsx?$U:[]])}function TU(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function $$(t,e,n=t.length){for(let i=e?.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return t.sliceString(i.from,Math.min(i.to,n));return""}const CU=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),$U=Ne.inputHandler.of((t,e,n,i,r)=>{if((CU?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||i!=">"&&i!="/"||!Ar.isActiveAt(t.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(u=>{var f;let{head:h}=u,p=At(o).resolveInner(h-1,-1),g;if(p.name=="JSXStartTag"&&(p=p.parent),!(o.doc.sliceString(h-1,h)!=i||p.name=="JSXAttributeValue"&&p.to>h)){if(i==">"&&p.name=="JSXFragmentTag")return{range:u,changes:{from:h,insert:"</>"}};if(i=="/"&&p.name=="JSXStartCloseTag"){let O=p.parent,v=O.parent;if(v&&O.from==h-2&&((g=$$(o.doc,v.firstChild,h))||((f=v.firstChild)===null||f===void 0?void 0:f.name)=="JSXFragmentTag")){let x=`${g}>`;return{range:pe.cursor(h+x.length,-1),changes:{from:h,insert:x}}}}else if(i==">"){let O=TU(p);if(O&&O.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(h,h+2))&&(g=$$(o.doc,O,h)))return{range:u,changes:{from:h,insert:`</${g}>`}}}}return{range:u}});return l.changes.empty?!1:(t.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),df=["_blank","_self","_top","_parent"],A0=["ascii","utf-8","utf-16","latin1","latin1"],N0=["get","post","put","delete"],P0=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],ei=["true","false"],$e={},_U={a:{attrs:{href:null,ping:null,type:null,media:null,target:df,hreflang:null}},abbr:$e,address:$e,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:$e,aside:$e,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:$e,base:{attrs:{href:null,target:df}},bdi:$e,bdo:$e,blockquote:{attrs:{cite:null}},body:$e,br:$e,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:P0,formmethod:N0,formnovalidate:["novalidate"],formtarget:df,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:$e,center:$e,cite:$e,code:$e,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:$e,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:$e,div:$e,dl:$e,dt:$e,em:$e,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:$e,figure:$e,footer:$e,form:{attrs:{action:null,name:null,"accept-charset":A0,autocomplete:["on","off"],enctype:P0,method:N0,novalidate:["novalidate"],target:df}},h1:$e,h2:$e,h3:$e,h4:$e,h5:$e,h6:$e,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:$e,hgroup:$e,hr:$e,html:{attrs:{manifest:null}},i:$e,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:P0,formmethod:N0,formnovalidate:["novalidate"],formtarget:df,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:$e,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:$e,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:$e,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:A0,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:$e,noscript:$e,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:$e,param:{attrs:{name:null,value:null}},pre:$e,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:$e,rt:$e,ruby:$e,samp:$e,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:A0}},section:$e,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:$e,source:{attrs:{src:null,type:null,media:null}},span:$e,strong:$e,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:$e,summary:$e,sup:$e,table:$e,tbody:$e,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:$e,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:$e,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:$e,time:{attrs:{datetime:null}},title:$e,tr:$e,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:$e,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:$e},MR={accesskey:null,class:null,contenteditable:ei,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:ei,autocorrect:ei,autocapitalize:ei,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":ei,"aria-autocomplete":["inline","list","both","none"],"aria-busy":ei,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":ei,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":ei,"aria-hidden":ei,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":ei,"aria-multiselectable":ei,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":ei,"aria-relevant":null,"aria-required":ei,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},LR="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of LR)MR[t]=null;let ad=class{constructor(e,n){this.tags={..._U,...e},this.globalAttrs={...MR,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};ad.default=new ad;function xc(t,e,n=t.length){if(!e)return"";let i=e.firstChild,r=i&&i.getChild("TagName");return r?t.sliceString(r.from,Math.min(r.to,n)):""}function wc(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function DR(t,e,n){let i=n.tags[xc(t,wc(e))];return i?.children||n.allTags}function b1(t,e){let n=[];for(let i=wc(e);i&&!i.type.isTop;i=wc(i.parent)){let r=xc(t,i);if(r&&i.lastChild.name=="CloseTag")break;r&&n.indexOf(r)<0&&(e.name=="EndTag"||e.from>=i.firstChild.to)&&n.push(r)}return n}const zR=/^[:\-\.\w\u00b7-\uffff]*$/;function _$(t,e,n,i,r){let s=/\s*>/.test(t.sliceDoc(r,r+5))?"":">",o=wc(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:DR(t.doc,o,e).map(l=>({label:l,type:"type"})).concat(b1(t.doc,n).map((l,u)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Q$(t,e,n,i){let r=/\s*>/.test(t.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:b1(t.doc,e).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:zR}}function QU(t,e,n,i){let r=[],s=0;for(let o of DR(t.doc,n,e))r.push({label:"<"+o,type:"type"});for(let o of b1(t.doc,n))r.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function AU(t,e,n,i,r){let s=wc(n),o=s?e.tags[xc(t.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],u=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:i,to:r,options:u.map(f=>({label:f,type:"property"})),validFor:zR}}function NU(t,e,n,i,r){var s;let o=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],u;if(o){let f=t.sliceDoc(o.from,o.to),h=e.globalAttrs[f];if(!h){let p=wc(n),g=p?e.tags[xc(t.doc,p)]:null;h=g?.attrs&&g.attrs[f]}if(h){let p=t.sliceDoc(i,r).toLowerCase(),g='"',O='"';/^['"]/.test(p)?(u=p[0]=='"'?/^[^"]*$/:/^[^']*$/,g="",O=t.sliceDoc(r,r+1)==p[0]?"":p[0],p=p.slice(1),i++):u=/^[^\s<>='"]*$/;for(let v of h)l.push({label:v,apply:g+v+O,type:"constant"})}}return{from:i,to:r,options:l,validFor:u}}function XR(t,e){let{state:n,pos:i}=e,r=At(n).resolveInner(i,-1),s=r.resolve(i);for(let o=i,l;s==r&&(l=r.childBefore(o));){let u=l.lastChild;if(!u||!u.type.isError||u.from<u.to)break;s=r=l,o=u.from}return r.name=="TagName"?r.parent&&/CloseTag$/.test(r.parent.name)?Q$(n,r,r.from,i):_$(n,t,r,r.from,i):r.name=="StartTag"||r.name=="IncompleteTag"?_$(n,t,r,i,i):r.name=="StartCloseTag"||r.name=="IncompleteCloseTag"?Q$(n,r,i,i):r.name=="OpenTag"||r.name=="SelfClosingTag"||r.name=="AttributeName"?AU(n,t,r,r.name=="AttributeName"?r.from:i,i):r.name=="Is"||r.name=="AttributeValue"||r.name=="UnquotedAttributeValue"?NU(n,t,r,r.name=="Is"?i:r.from,i):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?QU(n,t,r,i):null}function PU(t){return XR(ad.default,t)}function RU(t){let{extraTags:e,extraGlobalAttributes:n}=t,i=n||e?new ad(e,n):ad.default;return r=>XR(i,r)}const jU=Ar.parser.configure({top:"SingleExpression"}),ZR=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:AR.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:NR.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:PR.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:jU},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:Ar.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:um.parser}],BR=[{name:"style",parser:um.parser.configure({top:"Styles"})}].concat(LR.map(t=>({name:t,parser:Ar.parser}))),IR=ba.define({name:"html",parser:o6.configure({props:[Ic.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e=null,n;for(let i=t.node;;){let r=i.lastChild;if(!r||r.name!="Element"||r.to!=i.to)break;e=i=r}return e&&!((n=e.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),Gc.add({Element(t){let e=t.firstChild,n=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:n.name=="CloseTag"?n.from:t.to}}}),DP.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Eg=IR.configure({wrap:vR(ZR,BR)});function MU(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=vR((t.nestedLanguages||[]).concat(ZR),(t.nestedAttributes||[]).concat(BR)));let i=n?IR.configure({wrap:n,dialect:e}):e?Eg.configure({dialect:e}):Eg;return new vc(i,[Eg.data.of({autocomplete:RU(t)}),t.autoCloseTags!==!1?LU:[],EU().support,B6().support])}const A$=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),LU=Ne.inputHandler.of((t,e,n,i,r)=>{if(t.composing||t.state.readOnly||e!=n||i!=">"&&i!="/"||!Eg.isActiveAt(t.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(u=>{var f,h,p;let g=o.doc.sliceString(u.from-1,u.to)==i,{head:O}=u,v=At(o).resolveInner(O,-1),x;if(g&&i==">"&&v.name=="EndTag"){let S=v.parent;if(((h=(f=S.parent)===null||f===void 0?void 0:f.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(x=xc(o.doc,S.parent,O))&&!A$.has(x)){let k=O+(o.doc.sliceString(O,O+1)===">"?1:0),$=`</${x}>`;return{range:u,changes:{from:O,to:k,insert:$}}}}else if(g&&i=="/"&&v.name=="IncompleteCloseTag"){let S=v.parent;if(v.from==O-2&&((p=S.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(x=xc(o.doc,S,O))&&!A$.has(x)){let k=O+(o.doc.sliceString(O,O+1)===">"?1:0),$=`${x}>`;return{range:pe.cursor(O+$.length,-1),changes:{from:O,to:k,insert:$}}}}return{range:u}});return l.changes.empty?!1:(t.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),GR=r1({commentTokens:{block:{open:"<!--",close:"-->"}}}),VR=new Me,UR=eV.configure({props:[Gc.add(t=>!t.is("Block")||t.is("Document")||zx(t)!=null||DU(t)?void 0:(e,n)=>({from:n.doc.lineAt(e.from).to,to:e.to})),VR.add(zx),Ic.add({Document:()=>null}),sa.add({Document:GR})]});function zx(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function DU(t){return t.name=="OrderedList"||t.name=="BulletList"}function zU(t,e){let n=t;for(;;){let i=n.nextSibling,r;if(!i||(r=zx(i.type))!=null&&r<=e)break;n=i}return n.to}const XU=hG.of((t,e,n)=>{for(let i=At(t).resolveInner(n,-1);i&&!(i.from<e);i=i.parent){let r=i.type.prop(VR);if(r==null)continue;let s=zU(i,r);if(s>n)return{from:n,to:s}}return null});function x1(t){return new Si(GR,t,[],"markdown")}const ZU=x1(UR),BU=UR.configure([fV,hV,dV,pV,{props:[Gc.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),fm=x1(BU);function IU(t,e){return n=>{if(n&&t){let i=null;if(n=/\S*/.exec(n)[0],typeof t=="function"?i=t(n):i=tm.matchLanguageName(t,n,!0),i instanceof tm)return i.support?i.support.language.parser:nd.getSkippingParser(i.load());if(i)return i.parser}return e?e.parser:null}}let R0=class{constructor(e,n,i,r,s,o,l){this.node=e,this.from=n,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(e,n=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;i.length<e;)i+=" ";return i}else{for(let r=this.to-this.from-i.length-this.spaceAfter.length;r>0;r--)i+=" ";return i+(n?this.spaceAfter:"")}}marker(e,n){let i=this.node.name=="OrderedList"?String(+qR(this.item,e)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function YR(t,e){let n=[],i=[];for(let r=t;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&n.push(r)}for(let r=n.length-1;r>=0;r--){let s=n[r],o,l=e.lineAt(s.from),u=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(u))))i.push(new R0(s,u,u+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(u)))){let f=o[3],h=o[0].length;f.length>=4&&(f=f.slice(0,f.length-4),h-=4),i.push(new R0(s.parent,u,u+h,o[1],f,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(u)))){let f=o[4],h=o[0].length;f.length>4&&(f=f.slice(0,f.length-4),h-=4);let p=o[2];o[3]&&(p+=o[3].replace(/[xX]/," ")),i.push(new R0(s.parent,u,u+h,o[1],f,p,s))}}return i}function qR(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function j0(t,e,n,i=0){for(let r=-1,s=t;;){if(s.name=="ListItem"){let l=qR(s,e),u=+l[2];if(r>=0){if(u!=r+1)return;n.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+i)})}r=u}let o=s.nextSibling;if(!o)break;s=o}}function w1(t,e){let n=/^[ \t]*/.exec(t)[0].length;if(!n||e.facet(Ad)!="	")return t;let i=jr(t,4,n),r="";for(let s=i;s>0;)s>=4?(r+="	",s-=4):(r+=" ",s--);return r+t.slice(n)}const GU=(t={})=>({state:e,dispatch:n})=>{let i=At(e),{doc:r}=e,s=null,o=e.changeByRange(l=>{if(!l.empty||!fm.isActiveAt(e,l.from,-1)&&!fm.isActiveAt(e,l.from,1))return s={range:l};let u=l.from,f=r.lineAt(u),h=YR(i.resolveInner(u,-1),r);for(;h.length&&h[h.length-1].from>u-f.from;)h.pop();if(!h.length)return s={range:l};let p=h[h.length-1];if(p.to-p.spaceAfter.length>u-f.from)return s={range:l};let g=u>=p.to-p.spaceAfter.length&&!/\S/.test(f.text.slice(p.to));if(p.item&&g){let k=p.node.firstChild,$=p.node.getChild("ListItem","ListItem");if(k.to>=u||$&&$.to<u||f.from>0&&!/[^\s>]/.test(r.lineAt(f.from-1).text)||t.nonTightLists===!1){let E=h.length>1?h[h.length-2]:null,T,_="";E&&E.item?(T=f.from+E.from,_=E.marker(r,1)):T=f.from+(E?E.to:0);let Q=[{from:T,to:u,insert:_}];return p.node.name=="OrderedList"&&j0(p.item,r,Q,-2),E&&E.node.name=="OrderedList"&&j0(E.item,r,Q),{range:pe.cursor(T+_.length),changes:Q}}else{let E=P$(h,e,f);return{range:pe.cursor(u+E.length+1),changes:{from:f.from,insert:E+e.lineBreak}}}}if(p.node.name=="Blockquote"&&g&&f.from){let k=r.lineAt(f.from-1),$=/>\s*$/.exec(k.text);if($&&$.index==p.from){let E=e.changes([{from:k.from+$.index,to:k.to},{from:f.from+p.from,to:f.to}]);return{range:l.map(E),changes:E}}}let O=[];p.node.name=="OrderedList"&&j0(p.item,r,O);let v=p.item&&p.item.from<f.from,x="";if(!v||/^[\s\d.)\-+*>]*/.exec(f.text)[0].length>=p.to)for(let k=0,$=h.length-1;k<=$;k++)x+=k==$&&!v?h[k].marker(r,1):h[k].blank(k<$?jr(f.text,4,h[k+1].from)-x.length:null);let S=u;for(;S>f.from&&/\s/.test(f.text.charAt(S-f.from-1));)S--;return x=w1(x,e),UU(p.node,e.doc)&&(x=P$(h,e,f)+e.lineBreak+x),O.push({from:S,to:u,insert:e.lineBreak+x}),{range:pe.cursor(S+x.length+1),changes:O}});return s?!1:(n(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},VU=GU();function N$(t){return t.name=="QuoteMark"||t.name=="ListMark"}function UU(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let n=t.firstChild,i=t.getChild("ListItem","ListItem");if(!i)return!1;let r=e.lineAt(n.to),s=e.lineAt(i.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1)<s.number}function P$(t,e,n){let i="";for(let r=0,s=t.length-2;r<=s;r++)i+=t[r].blank(r<s?jr(n.text,4,t[r+1].from)-i.length:null,r<s);return w1(i,e)}function YU(t,e){let n=t.resolveInner(e,-1),i=e;N$(n)&&(i=n.from,n=n.parent);for(let r;r=n.childBefore(i);)if(N$(r))i=r.from;else if(r.name=="OrderedList"||r.name=="BulletList")n=r.lastChild,i=n.to;else break;return n}const qU=({state:t,dispatch:e})=>{let n=At(t),i=null,r=t.changeByRange(s=>{let o=s.from,{doc:l}=t;if(s.empty&&fm.isActiveAt(t,s.from)){let u=l.lineAt(o),f=YR(YU(n,o),l);if(f.length){let h=f[f.length-1],p=h.to-h.spaceAfter.length+(h.spaceAfter?1:0);if(o-u.from>p&&!/\S/.test(u.text.slice(p,o-u.from)))return{range:pe.cursor(u.from+p),changes:{from:u.from+p,to:o}};if(o-u.from==p&&(!h.item||u.from<=h.item.from||!/\S/.test(u.text.slice(0,h.to)))){let g=u.from+h.from;if(h.item&&h.node.from<h.item.from&&/\S/.test(u.text.slice(h.from,h.to))){let O=h.blank(jr(u.text,4,h.to)-jr(u.text,4,h.from));return g==u.from&&(O=w1(O,t)),{range:pe.cursor(g+O.length),changes:{from:g,to:u.from+h.to,insert:O}}}if(g<o)return{range:pe.cursor(g),changes:{from:g,to:o}}}}}return i={range:s}});return i?!1:(e(t.update(r,{scrollIntoView:!0,userEvent:"delete"})),!0)},WU=[{key:"Enter",run:VU},{key:"Backspace",run:qU}],WR=MU({matchClosingTags:!1});function FU(t={}){let{codeLanguages:e,defaultCodeLanguage:n,addKeymap:i=!0,base:{parser:r}=ZU,completeHTMLTags:s=!0,pasteURLAsLink:o=!0,htmlTagLanguage:l=WR}=t;if(!(r instanceof Ym))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let u=t.extensions?[t.extensions]:[],f=[l.support,XU],h;o&&f.push(eY),n instanceof vc?(f.push(n.support),h=n.language):n&&(h=n);let p=e||h?IU(e,h):void 0;u.push(nV({codeParser:p,htmlParser:l.language.parser})),i&&f.push(Bc.high(Gm.of(WU)));let g=x1(r.configure(u));return s&&f.push(g.data.of({autocomplete:HU})),new vc(g,f)}function HU(t){let{state:e,pos:n}=t,i=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(n-25,n));if(!i)return null;let r=At(e).resolveInner(n,-1);for(;r&&!r.type.isTop;){if(r.name=="CodeBlock"||r.name=="FencedCode"||r.name=="ProcessingInstructionBlock"||r.name=="CommentBlock"||r.name=="Link"||r.name=="Image")return null;r=r.parent}return{from:n-i[0].length,to:n,options:KU(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let M0=null;function KU(){if(M0)return M0;let t=PU(new EG(tt.create({extensions:WR}),0,!0));return M0=t?t.options:[]}const JU=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,eY=Ne.domEventHandlers({paste:(t,e)=>{var n;let{main:i}=e.state.selection;if(i.empty)return!1;let r=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!fm.isActiveAt(e.state,i.from,1)))return!1;let s=At(e.state),o=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||JU.test(l.name))&&(o=!0)},leave:l=>{l.to<i.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:i.from,insert:"["},{from:i.to,insert:`](${r})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),Dl=63,R$=64,tY=1,nY=2,FR=3,iY=4,HR=5,rY=6,sY=7,KR=65,oY=66,aY=8,lY=9,cY=10,uY=11,fY=12,JR=13,dY=19,hY=20,pY=29,gY=33,mY=34,OY=47,yY=0,S1=1,Xx=2,ld=3,Zx=4;class ta{constructor(e,n,i){this.parent=e,this.depth=n,this.type=i,this.hash=(e?e.hash+e.hash<<8:0)+n+(n<<4)+i}}ta.top=new ta(null,-1,yY);function Bf(t,e){for(let n=0,i=e-t.pos-1;;i--,n++){let r=t.peek(i);if(ws(r)||r==-1)return n}}function Bx(t){return t==32||t==9}function ws(t){return t==10||t==13}function ej(t){return Bx(t)||ws(t)}function oa(t){return t<0||ej(t)}const vY=new g1({start:ta.top,reduce(t,e){return t.type==ld&&(e==hY||e==mY)?t.parent:t},shift(t,e,n,i){if(e==FR)return new ta(t,Bf(i,i.pos),S1);if(e==KR||e==HR)return new ta(t,Bf(i,i.pos),Xx);if(e==Dl)return t.parent;if(e==dY||e==gY)return new ta(t,0,ld);if(e==JR&&t.type==Zx)return t.parent;if(e==OY){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new ta(t,t.depth+ +r[0],Zx)}return t},hash(t){return t.hash}});function Sc(t,e,n=0){return t.peek(n)==e&&t.peek(n+1)==e&&t.peek(n+2)==e&&oa(t.peek(n+3))}const bY=new on((t,e)=>{if(t.next==-1&&e.canShift(R$))return t.acceptToken(R$);let n=t.peek(-1);if((ws(n)||n<0)&&e.context.type!=ld){if(Sc(t,45))if(e.canShift(Dl))t.acceptToken(Dl);else return t.acceptToken(tY,3);if(Sc(t,46))if(e.canShift(Dl))t.acceptToken(Dl);else return t.acceptToken(nY,3);let i=0;for(;t.next==32;)i++,t.advance();(i<e.context.depth||i==e.context.depth&&e.context.type==S1&&(t.next!=45||!oa(t.peek(1))))&&t.next!=-1&&!ws(t.next)&&t.next!=35&&t.acceptToken(Dl,-i)}},{contextual:!0}),xY=new on((t,e)=>{if(e.context.type==ld){t.next==63&&(t.advance(),oa(t.next)&&t.acceptToken(sY));return}if(t.next==45)t.advance(),oa(t.next)&&t.acceptToken(e.context.type==S1&&e.context.depth==Bf(t,t.pos-1)?iY:FR);else if(t.next==63)t.advance(),oa(t.next)&&t.acceptToken(e.context.type==Xx&&e.context.depth==Bf(t,t.pos-1)?rY:HR);else{let n=t.pos;for(;;)if(Bx(t.next)){if(t.pos==n)return;t.advance()}else if(t.next==33)tj(t);else if(t.next==38)Ix(t);else if(t.next==42){Ix(t);break}else if(t.next==39||t.next==34){if(k1(t,!0))break;return}else if(t.next==91||t.next==123){if(!SY(t))return;break}else{nj(t,!0,!1,0);break}for(;Bx(t.next);)t.advance();if(t.next==58){if(t.pos==n&&e.canShift(pY))return;let i=t.peek(1);oa(i)&&t.acceptTokenTo(e.context.type==Xx&&e.context.depth==Bf(t,n)?oY:KR,n)}}},{contextual:!0});function wY(t){return t>32&&t<127&&t!=34&&t!=37&&t!=44&&t!=60&&t!=62&&t!=92&&t!=94&&t!=96&&t!=123&&t!=124&&t!=125}function j$(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function M$(t,e){return t.next==37?(t.advance(),j$(t.next)&&t.advance(),j$(t.next)&&t.advance(),!0):wY(t.next)||e&&t.next==44?(t.advance(),!0):!1}function tj(t){if(t.advance(),t.next==60){for(t.advance();;)if(!M$(t,!0)){t.next==62&&t.advance();break}}else for(;M$(t,!1););}function Ix(t){for(t.advance();!oa(t.next)&&dm(t.next)!="f";)t.advance()}function k1(t,e){let n=t.next,i=!1,r=t.pos;for(t.advance();;){let s=t.next;if(s<0)break;if(t.advance(),s==n)if(s==39)if(t.next==39)t.advance();else break;else break;else if(s==92&&n==34)t.next>=0&&t.advance();else if(ws(s)){if(e)return!1;i=!0}else if(e&&t.pos>=r+1024)return!1}return!i}function SY(t){for(let e=[],n=t.pos+1024;;)if(t.next==91||t.next==123)e.push(t.next),t.advance();else if(t.next==39||t.next==34){if(!k1(t,!0))return!1}else if(t.next==93||t.next==125){if(e[e.length-1]!=t.next-2)return!1;if(e.pop(),t.advance(),!e.length)return!0}else{if(t.next<0||t.pos>n||ws(t.next))return!1;t.advance()}}const kY="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function dm(t){return t<33?"u":t>125?"s":kY[t-33]}function L0(t,e){let n=dm(t);return n!="u"&&!(e&&n=="f")}function nj(t,e,n,i){if(dm(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&L0(t.peek(1),n))t.advance();else return!1;let r=t.pos;for(;;){let s=t.next,o=0,l=i+1;for(;ej(s);){if(ws(s)){if(e)return!1;l=0}else l++;s=t.peek(++o)}if(!(s>=0&&(s==58?L0(t.peek(o+1),n):s==35?t.peek(o-1)!=32:L0(s,n)))||!n&&l<=i||l==0&&!n&&(Sc(t,45,o)||Sc(t,46,o)))break;if(e&&dm(s)=="f")return!1;for(let f=o;f>=0;f--)t.advance();if(e&&t.pos>r+1024)return!1}return!0}const EY=new on((t,e)=>{if(t.next==33)tj(t),t.acceptToken(fY);else if(t.next==38||t.next==42){let n=t.next==38?cY:uY;Ix(t),t.acceptToken(n)}else t.next==39||t.next==34?(k1(t,!1),t.acceptToken(lY)):nj(t,!1,e.context.type==ld,e.context.depth)&&t.acceptToken(aY)}),TY=new on((t,e)=>{let n=e.context.type==Zx?e.context.depth:-1,i=t.pos;e:for(;;){let r=0,s=t.next;for(;s==32;)s=t.peek(++r);if(!r&&(Sc(t,45,r)||Sc(t,46,r))||!ws(s)&&(n<0&&(n=Math.max(e.context.depth+1,r)),r<n))break;for(;;){if(t.next<0)break e;let o=ws(t.next);if(t.advance(),o)continue e;i=t.pos}}t.acceptTokenTo(JR,i)}),CY=Na({DirectiveName:W.keyword,DirectiveContent:W.attributeValue,"DirectiveEnd DocEnd":W.meta,QuotedLiteral:W.string,BlockLiteralHeader:W.special(W.string),BlockLiteralContent:W.content,Literal:W.content,"Key/Literal Key/QuotedLiteral":W.definition(W.propertyName),"Anchor Alias":W.labelName,Tag:W.typeName,Comment:W.lineComment,": , -":W.separator,"?":W.punctuation,"[ ]":W.squareBracket,"{ }":W.brace}),$Y=xa.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2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|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:vY,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[CY],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[bY,xY,EY,TY,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),_Y=ba.define({name:"yaml",parser:$Y.configure({props:[Ic.add({Stream:t=>{for(let e=t.node.resolve(t.pos,-1);e&&e.to>=t.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return t.baseIndentFor(e);if(e.name=="BlockLiteral")return t.baseIndentFor(e)+t.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return t.column(e.firstChild.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let n=t.column(e.from,1);if(n==t.lineIndent(e.from,1))return n;if(e.to>t.pos)return null}}return null},FlowMapping:Cx({closing:"}"}),FlowSequence:Cx({closing:"]"})}),Gc.add({"FlowMapping FlowSequence":a1,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function QY(){return new vc(_Y)}const AY=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=T1(t.state,n.from);return i.line?NY(t):i.block?RY(t):!1};function E1(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(i(n.update(r)),!0):!1}}const NY=E1(LY,0),PY=E1(ij,0),RY=E1((t,e)=>ij(t,e,MY(e)),0);function T1(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const hf=50;function jY(t,{open:e,close:n},i,r){let s=t.sliceDoc(i-hf,i),o=t.sliceDoc(r,r+hf),l=/\s*$/.exec(s)[0].length,u=/^\s*/.exec(o)[0].length,f=s.length-l;if(s.slice(f-e.length,f)==e&&o.slice(u,u+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+u,margin:u&&1}};let h,p;r-i<=2*hf?h=p=t.sliceDoc(i,r):(h=t.sliceDoc(i,i+hf),p=t.sliceDoc(r-hf,r));let g=/^\s*/.exec(h)[0].length,O=/\s*$/.exec(p)[0].length,v=p.length-O-n.length;return h.slice(g,g+e.length)==e&&p.slice(v,v+n.length)==n?{open:{pos:i+g+e.length,margin:/\s/.test(h.charAt(g+e.length))?1:0},close:{pos:r-O-n.length,margin:/\s/.test(p.charAt(v-1))?1:0}}:null}function MY(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function ij(t,e,n=e.selection.ranges){let i=n.map(s=>T1(e,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>jY(e,i[o],s.from,s.to));if(t!=2&&!r.every(s=>s))return{changes:e.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(t!=1&&r.some(s=>s)){let s=[];for(let o=0,l;o<r.length;o++)if(l=r[o]){let u=i[o],{open:f,close:h}=l;s.push({from:f.pos-u.open.length,to:f.pos+f.margin},{from:h.pos-h.margin,to:h.pos+u.close.length})}return{changes:s}}return null}function LY(t,e,n=e.selection.ranges){let i=[],r=-1;e:for(let{from:s,to:o}of n){let l=i.length,u=1e9,f;for(let h=s;h<=o;){let p=e.doc.lineAt(h);if(f==null&&(f=T1(e,p.from).line,!f))continue e;if(p.from>r&&(s==o||o>p.from)){r=p.from;let g=/^\s*/.exec(p.text)[0].length,O=g==p.length,v=p.text.slice(g,g+f.length)==f?g:-1;g<p.text.length&&g<u&&(u=g),i.push({line:p,comment:v,token:f,indent:g,empty:O,single:!1})}h=p.to+1}if(u<1e9)for(let h=l;h<i.length;h++)i[h].indent<i[h].line.text.length&&(i[h].indent=u);i.length==l+1&&(i[l].single=!0)}if(t!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:u,indent:f,empty:h,single:p}of i)(p||!h)&&s.push({from:l.from+f,insert:u+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:u}of i)if(l>=0){let f=o.from+l,h=f+u.length;o.text[h-o.from]==" "&&h++,s.push({from:f,to:h})}return{changes:s}}return null}const Gx=Cs.define(),DY=Cs.define(),zY=Ae.define(),rj=Ae.define({combine(t){return Zw(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,r)=>e(i,r)||n(i,r)})}}),sj=Ts.define({create(){return $r.empty},update(t,e){let n=e.state.facet(rj),i=e.annotation(Gx);if(i){let u=Zn.fromTransaction(e,i.selection),f=i.side,h=f==0?t.undone:t.done;return u?h=hm(h,h.length,n.minDepth,u):h=lj(h,e.startState.selection),new $r(f==0?i.rest:h,f==0?h:i.rest)}let r=e.annotation(DY);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(Bt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=Zn.fromTransaction(e),o=e.annotation(Bt.time),l=e.annotation(Bt.userEvent);return s?t=t.addChanges(s,o,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,n.newGroupDelay)),(r=="full"||r=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new $r(t.done.map(Zn.fromJSON),t.undone.map(Zn.fromJSON))}});function XY(t={}){return[sj,rj.of(t),Ne.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?oj:e.inputType=="historyRedo"?Vx:null;return i?(e.preventDefault(),i(n)):!1}})]}function qm(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(sj,!1);if(!r)return!1;let s=r.pop(t,n,e);return s?(i(s),!0):!1}}const oj=qm(0,!1),Vx=qm(1,!1),ZY=qm(0,!0),BY=qm(1,!0);class Zn{constructor(e,n,i,r,s){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new Zn(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new Zn(e.changes&&Ut.fromJSON(e.changes),[],e.mapped&&Qr.fromJSON(e.mapped),e.startSelection&&pe.fromJSON(e.startSelection),e.selectionsAfter.map(pe.fromJSON))}static fromTransaction(e,n){let i=ki;for(let r of e.startState.facet(zY)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new Zn(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,ki)}static selection(e){return new Zn(void 0,ki,void 0,void 0,e)}}function hm(t,e,n,i){let r=e+1>n+20?e-n-1:0,s=t.slice(r,e);return s.push(i),s}function IY(t,e){let n=[],i=!1;return t.iterChangedRanges((r,s)=>n.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let u=0;u<n.length;){let f=n[u++],h=n[u++];l>=f&&o<=h&&(i=!0)}}),i}function GY(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function aj(t,e){return t.length?e.length?t.concat(e):t:e}const ki=[],VY=200;function lj(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-VY));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),hm(t,t.length-1,1e9,n.setSelAfter(i)))}else return[Zn.selection([e])]}function UY(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function D0(t,e){if(!t.length)return t;let n=t.length,i=ki;for(;n;){let r=YY(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=t.slice(0,n);return s[n-1]=r,s}else e=r.mapped,n--,i=r.selectionsAfter}return i.length?[Zn.selection(i)]:ki}function YY(t,e,n){let i=aj(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):ki,n);if(!t.changes)return Zn.selection(i);let r=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new Zn(r,wt.mapEffects(t.effects,e),o,t.startSelection.map(s),i)}const qY=/^(input\.type|delete)($|\.)/;class $r{constructor(e,n,i=0,r=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new $r(this.done,this.undone):this}addChanges(e,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||qY.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,IY(l.changes,e.changes))||i=="input.type.compose")?o=hm(o,o.length-1,r.minDepth,new Zn(e.changes.compose(l.changes),aj(wt.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,ki)):o=hm(o,o.length,r.minDepth,e),new $r(o,ki,n,i)}addSelection(e,n,i,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:ki;return s.length>0&&n-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&GY(s[s.length-1],e)?this:new $r(lj(this.done,e),this.undone,n,i)}addMapping(e){return new $r(D0(this.done,e),D0(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(i&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Gx.of({side:e,rest:UY(r),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=r.length==1?ki:r.slice(0,r.length-1);return s.mapped&&(l=D0(l,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Gx.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}$r.empty=new $r(ki,ki);const WY=[{key:"Mod-z",run:oj,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Vx,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Vx,preventDefault:!0},{key:"Mod-u",run:ZY,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:BY,preventDefault:!0}];function Uc(t,e){return pe.create(t.ranges.map(e),t.mainIndex)}function er(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function tr({state:t,dispatch:e},n){let i=Uc(t.selection,n);return i.eq(t.selection,!0)?!1:(e(er(t,i)),!0)}function Wm(t,e){return pe.cursor(e?t.to:t.from)}function cj(t,e){return tr(t,n=>n.empty?t.moveByChar(n,e):Wm(n,e))}function pn(t){return t.textDirectionAt(t.state.selection.main.head)==Et.LTR}const uj=t=>cj(t,!pn(t)),fj=t=>cj(t,pn(t));function dj(t,e){return tr(t,n=>n.empty?t.moveByGroup(n,e):Wm(n,e))}const FY=t=>dj(t,!pn(t)),HY=t=>dj(t,pn(t));function KY(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Fm(t,e,n){let i=At(t).resolveInner(e.head),r=n?Me.closedBy:Me.openedBy;for(let u=e.head;;){let f=n?i.childAfter(u):i.childBefore(u);if(!f)break;KY(t,f,r)?i=f:u=n?f.to:f.from}let s=i.type.prop(r),o,l;return s&&(o=n?Gl(t,i.from,1):Gl(t,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,pe.cursor(l,n?-1:1)}const JY=t=>tr(t,e=>Fm(t.state,e,!pn(t))),eq=t=>tr(t,e=>Fm(t.state,e,pn(t)));function hj(t,e){return tr(t,n=>{if(!n.empty)return Wm(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}const pj=t=>hj(t,!1),gj=t=>hj(t,!0);function mj(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,r;if(e){for(let s of t.state.facet(Ne.scrollMargins)){let o=s(t);o?.top&&(n=Math.max(o?.top,n)),o?.bottom&&(i=Math.max(o?.bottom,i))}r=t.scrollDOM.clientHeight-n-i}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function Oj(t,e){let n=mj(t),{state:i}=t,r=Uc(i.selection,o=>o.empty?t.moveVertically(o,e,n.height):Wm(o,e));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(i.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),u=l.top+n.marginTop,f=l.bottom-n.marginBottom;o&&o.top>u&&o.bottom<f&&(s=Ne.scrollIntoView(r.main.head,{y:"start",yMargin:o.top-u}))}return t.dispatch(er(i,r),{effects:s}),!0}const L$=t=>Oj(t,!1),Ux=t=>Oj(t,!0);function Co(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=pe.cursor(i.from+s))}return r}const tq=t=>tr(t,e=>Co(t,e,!0)),nq=t=>tr(t,e=>Co(t,e,!1)),iq=t=>tr(t,e=>Co(t,e,!pn(t))),rq=t=>tr(t,e=>Co(t,e,pn(t))),sq=t=>tr(t,e=>pe.cursor(t.lineBlockAt(e.head).from,1)),oq=t=>tr(t,e=>pe.cursor(t.lineBlockAt(e.head).to,-1));function aq(t,e,n){let i=!1,r=Uc(t.selection,s=>{let o=Gl(t,s.head,-1)||Gl(t,s.head,1)||s.head>0&&Gl(t,s.head-1,1)||s.head<t.doc.length&&Gl(t,s.head+1,-1);if(!o||!o.end)return s;i=!0;let l=o.start.from==s.head?o.end.to:o.end.from;return pe.cursor(l)});return i?(e(er(t,r)),!0):!1}const lq=({state:t,dispatch:e})=>aq(t,e);function Ni(t,e){let n=Uc(t.state.selection,i=>{let r=e(i);return pe.range(i.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(er(t.state,n)),!0)}function yj(t,e){return Ni(t,n=>t.moveByChar(n,e))}const vj=t=>yj(t,!pn(t)),bj=t=>yj(t,pn(t));function xj(t,e){return Ni(t,n=>t.moveByGroup(n,e))}const cq=t=>xj(t,!pn(t)),uq=t=>xj(t,pn(t)),fq=t=>Ni(t,e=>Fm(t.state,e,!pn(t))),dq=t=>Ni(t,e=>Fm(t.state,e,pn(t)));function wj(t,e){return Ni(t,n=>t.moveVertically(n,e))}const Sj=t=>wj(t,!1),kj=t=>wj(t,!0);function Ej(t,e){return Ni(t,n=>t.moveVertically(n,e,mj(t).height))}const D$=t=>Ej(t,!1),z$=t=>Ej(t,!0),hq=t=>Ni(t,e=>Co(t,e,!0)),pq=t=>Ni(t,e=>Co(t,e,!1)),gq=t=>Ni(t,e=>Co(t,e,!pn(t))),mq=t=>Ni(t,e=>Co(t,e,pn(t))),Oq=t=>Ni(t,e=>pe.cursor(t.lineBlockAt(e.head).from)),yq=t=>Ni(t,e=>pe.cursor(t.lineBlockAt(e.head).to)),X$=({state:t,dispatch:e})=>(e(er(t,{anchor:0})),!0),Z$=({state:t,dispatch:e})=>(e(er(t,{anchor:t.doc.length})),!0),B$=({state:t,dispatch:e})=>(e(er(t,{anchor:t.selection.main.anchor,head:0})),!0),I$=({state:t,dispatch:e})=>(e(er(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),vq=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),bq=({state:t,dispatch:e})=>{let n=Hm(t).map(({from:i,to:r})=>pe.range(i,Math.min(r+1,t.doc.length)));return e(t.update({selection:pe.create(n),userEvent:"select"})),!0},xq=({state:t,dispatch:e})=>{let n=Uc(t.selection,i=>{let r=At(t),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return pe.range(l.to,l.from)}return i});return n.eq(t.selection)?!1:(e(er(t,n)),!0)};function Tj(t,e){let{state:n}=t,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(e?o.to<t.state.doc.length:o.from>0)for(let l=s;;){let u=t.moveVertically(l,e);if(u.head<o.from||u.head>o.to){r.some(f=>f.head==u.head)||r.push(u);break}else{if(u.head==l.head)break;l=u}}}return r.length==i.ranges.length?!1:(t.dispatch(er(n,pe.create(r,r.length-1))),!0)}const wq=t=>Tj(t,!1),Sq=t=>Tj(t,!0),kq=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=pe.create([n.main]):n.main.empty||(i=pe.create([pe.cursor(n.main.head)])),i?(e(er(t,i)),!0):!1};function Pd(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let u=e(s);u<o?(n="delete.backward",u=Rp(t,u,!1)):u>o&&(n="delete.forward",u=Rp(t,u,!0)),o=Math.min(o,u),l=Math.max(l,u)}else o=Rp(t,o,!1),l=Rp(t,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:pe.cursor(o,o<s.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Ne.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Rp(t,e,n){if(t instanceof Ne)for(let i of t.state.facet(Ne.atomicRanges).map(r=>r(t)))i.between(e,e,(r,s)=>{r<e&&s>e&&(e=n?s:r)});return e}const Cj=(t,e,n)=>Pd(t,i=>{let r=i.from,{state:s}=t,o=s.doc.lineAt(r),l,u;if(n&&!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,r-o.from))){if(l[l.length-1]=="	")return r-1;let f=jr(l,s.tabSize),h=f%nm(s)||nm(s);for(let p=0;p<h&&l[l.length-1-p]==" ";p++)r--;u=r}else u=un(o.text,r-o.from,e,e)+o.from,u==r&&o.number!=(e?s.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(u-o.from,r-o.from))&&(u=un(o.text,u-o.from,!1,!1)+o.from);return u}),Yx=t=>Cj(t,!1,!0),$j=t=>Cj(t,!0,!1),_j=(t,e)=>Pd(t,n=>{let i=n.head,{state:r}=t,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(e?s.to:s.from)){i==n.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let u=un(s.text,i-s.from,e)+s.from,f=s.text.slice(Math.min(i,u)-s.from,Math.max(i,u)-s.from),h=o(f);if(l!=null&&h!=l)break;(f!=" "||i!=n.head)&&(l=h),i=u}return i}),Qj=t=>_j(t,!1),Eq=t=>_j(t,!0),Tq=t=>Pd(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),Cq=t=>Pd(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),$q=t=>Pd(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),_q=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:We.of(["",""])},range:pe.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Qq=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let r=i.from,s=t.doc.lineAt(r),o=r==s.from?r-1:un(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:un(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:t.doc.slice(r,l).append(t.doc.slice(o,r))},range:pe.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Hm(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),s=t.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=t.doc.lineAt(i.to-1)),n>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return e}function Aj(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let s of Hm(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let u of s.ranges)r.push(pe.range(Math.min(t.doc.length,u.anchor+l),Math.min(t.doc.length,u.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let u of s.ranges)r.push(pe.range(u.anchor-l,u.head-l))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:pe.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Aq=({state:t,dispatch:e})=>Aj(t,e,!1),Nq=({state:t,dispatch:e})=>Aj(t,e,!0);function Nj(t,e,n){if(t.readOnly)return!1;let i=[];for(let s of Hm(t))n?i.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):i.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let r=t.changes(i);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Pq=({state:t,dispatch:e})=>Nj(t,e,!1),Rq=({state:t,dispatch:e})=>Nj(t,e,!0),jq=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Hm(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),i=Uc(e.selection,r=>{let s;if(t.lineWrapping){let o=t.lineBlockAt(r.head),l=t.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,s)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Mq(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=At(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(Me.closedBy))&&s.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const G$=Pj(!1),Lq=Pj(!0);function Pj(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),u=!t&&s==o&&Mq(e,s);t&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let f=new Vm(e,{simulateBreak:s,simulateDoubleBreak:!!u}),h=RP(f,s);for(h==null&&(h=jr(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;u?{from:s,to:o}=u:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let p=["",im(e,h)];return u&&p.push(im(e,f.lineIndent(l.from,-1))),{changes:{from:s,to:o,insert:We.of(p)},range:pe.cursor(s+1+p[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function C1(t,e){let n=-1;return t.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let l=t.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(e(l,r,i),n=l.number),o=l.to+1}let s=t.changes(r);return{changes:r,range:pe.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const Dq=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new Vm(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=C1(t,(s,o,l)=>{let u=RP(i,s.from);if(u==null)return;/\S/.test(s.text)||(u=0);let f=/^\s*/.exec(s.text)[0],h=im(t,u);(f!=h||l.from<s.from+f.length)&&(n[s.from]=u,o.push({from:s.from,to:s.from+f.length,insert:h}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},zq=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(C1(t,(n,i)=>{i.push({from:n.from,insert:t.facet(Ad)})}),{userEvent:"input.indent"})),!0),Xq=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(C1(t,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=jr(r,t.tabSize),o=0,l=im(t,Math.max(0,s-nm(t)));for(;o<r.length&&o<l.length&&r.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:n.from+o,to:n.from+r.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),Zq=t=>(t.setTabFocusMode(),!0),Bq=[{key:"Ctrl-b",run:uj,shift:vj,preventDefault:!0},{key:"Ctrl-f",run:fj,shift:bj},{key:"Ctrl-p",run:pj,shift:Sj},{key:"Ctrl-n",run:gj,shift:kj},{key:"Ctrl-a",run:sq,shift:Oq},{key:"Ctrl-e",run:oq,shift:yq},{key:"Ctrl-d",run:$j},{key:"Ctrl-h",run:Yx},{key:"Ctrl-k",run:Tq},{key:"Ctrl-Alt-h",run:Qj},{key:"Ctrl-o",run:_q},{key:"Ctrl-t",run:Qq},{key:"Ctrl-v",run:Ux}],Iq=[{key:"ArrowLeft",run:uj,shift:vj,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:FY,shift:cq,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:iq,shift:gq,preventDefault:!0},{key:"ArrowRight",run:fj,shift:bj,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:HY,shift:uq,preventDefault:!0},{mac:"Cmd-ArrowRight",run:rq,shift:mq,preventDefault:!0},{key:"ArrowUp",run:pj,shift:Sj,preventDefault:!0},{mac:"Cmd-ArrowUp",run:X$,shift:B$},{mac:"Ctrl-ArrowUp",run:L$,shift:D$},{key:"ArrowDown",run:gj,shift:kj,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Z$,shift:I$},{mac:"Ctrl-ArrowDown",run:Ux,shift:z$},{key:"PageUp",run:L$,shift:D$},{key:"PageDown",run:Ux,shift:z$},{key:"Home",run:nq,shift:pq,preventDefault:!0},{key:"Mod-Home",run:X$,shift:B$},{key:"End",run:tq,shift:hq,preventDefault:!0},{key:"Mod-End",run:Z$,shift:I$},{key:"Enter",run:G$,shift:G$},{key:"Mod-a",run:vq},{key:"Backspace",run:Yx,shift:Yx,preventDefault:!0},{key:"Delete",run:$j,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Qj,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Eq,preventDefault:!0},{mac:"Mod-Backspace",run:Cq,preventDefault:!0},{mac:"Mod-Delete",run:$q,preventDefault:!0}].concat(Bq.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Gq=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:JY,shift:fq},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:eq,shift:dq},{key:"Alt-ArrowUp",run:Aq},{key:"Shift-Alt-ArrowUp",run:Pq},{key:"Alt-ArrowDown",run:Nq},{key:"Shift-Alt-ArrowDown",run:Rq},{key:"Mod-Alt-ArrowUp",run:wq},{key:"Mod-Alt-ArrowDown",run:Sq},{key:"Escape",run:kq},{key:"Mod-Enter",run:Lq},{key:"Alt-l",mac:"Ctrl-l",run:bq},{key:"Mod-i",run:xq,preventDefault:!0},{key:"Mod-[",run:Xq},{key:"Mod-]",run:zq},{key:"Mod-Alt-\\",run:Dq},{key:"Shift-Mod-k",run:jq},{key:"Shift-Mod-\\",run:lq},{key:"Mod-/",run:AY},{key:"Alt-A",run:PY},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Zq}].concat(Iq),Vq=[QI(),XY(),xI(),pG(OG,{fallback:!0}),Gm.of([...Gq,...WY])],Uq=Ne.theme({"&":{backgroundColor:"var(--color-surface)",color:"var(--color-canvas-fg)",fontSize:"13px",borderRadius:"10px"},"&.cm-focused":{outline:"none"},".cm-content":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace",padding:"14px 16px",caretColor:"var(--color-canvas-fg)"},".cm-cursor":{borderLeftColor:"var(--color-canvas-fg)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, ::selection":{backgroundColor:"color-mix(in srgb, var(--color-accent) 18%, transparent)"},".cm-scroller":{borderRadius:"10px"}});function V$(t){return t==="markdown"?FU():t==="yaml"?QY():[]}function Km({value:t,onChange:e,lang:n,ariaLabel:i,minHeight:r=320}){const s=C.useRef(null),o=C.useRef(null),l=C.useRef(new Td),u=C.useRef(e);u.current=e;const f=C.useRef(t);return C.useEffect(()=>{if(!s.current)return;const h=new Ne({parent:s.current,state:tt.create({doc:t,extensions:[Vq,Ne.lineWrapping,Uq,l.current.of(V$(n)),Ne.updateListener.of(p=>{if(!p.docChanged)return;const g=p.state.doc.toString();f.current=g,u.current(g)})]})});return o.current=h,()=>{h.destroy(),o.current=null}},[]),C.useEffect(()=>{const h=o.current;h&&h.dispatch({effects:l.current.reconfigure(V$(n))})},[n]),C.useEffect(()=>{const h=o.current;if(!h||t===f.current)return;const p=h.state.doc.toString();p!==t&&(f.current=t,h.dispatch({changes:{from:0,to:p.length,insert:t}}))},[t]),y.jsx("div",{ref:s,role:"textbox","aria-label":i,className:"rounded-[10px]",style:{background:"var(--color-surface)",minHeight:r}})}function U$({title:t,mine:e,other:n}){const i=e.split(`
`),r=n.split(`
`);return y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("div",{className:"text-caption font-medium",style:{color:"var(--color-muted)"},children:t}),y.jsx("pre",{className:"mt-1 max-h-72 overflow-auto rounded-[6px] p-2 text-caption",style:{background:"var(--color-canvas)",color:"var(--color-canvas-fg)"},children:i.map((s,o)=>y.jsx("div",{style:s!==(r[o]??"")?{background:"color-mix(in srgb, var(--color-accent) 14%, transparent)"}:void 0,children:s===""?" ":s},o))})]})}function Jm({mine:t,theirs:e,saving:n,onLoadLatest:i,onKeepMine:r}){return y.jsxs("div",{className:"mt-4 rounded-[10px] p-4",style:{background:"var(--color-surface)"},children:[y.jsx("div",{className:"text-body font-medium",children:"This file changed since you opened it, likely by an agent. Review the diff."}),y.jsxs("div",{className:"mt-3 flex flex-col gap-3 sm:flex-row",children:[y.jsx(U$,{title:"Your edit",mine:t,other:e}),y.jsx(U$,{title:"On disk now",mine:e,other:t})]}),y.jsxs("div",{className:"mt-3 flex gap-2",children:[y.jsx("button",{type:"button",className:"rounded-[6px] border px-3 py-1.5 text-secondary font-medium",style:{borderColor:"var(--color-accent)",color:"var(--color-accent)"},onClick:i,children:"Load the latest version"}),y.jsx("button",{type:"button",disabled:n,className:"rounded-[6px] border px-3 py-1.5 text-secondary font-medium disabled:opacity-50",style:{borderColor:"var(--color-border)",color:"var(--color-muted)"},onClick:r,children:"Keep mine and overwrite"})]})]})}function nr({children:t,onDone:e}){const[n,i]=C.useState(!1);return C.useEffect(()=>{const r=setTimeout(()=>i(!0),4e3),s=setTimeout(()=>e?.(),4250);return()=>{clearTimeout(r),clearTimeout(s)}},[]),y.jsxs("div",{className:"flex items-center gap-2 text-secondary",style:{color:"var(--color-canvas-fg)",opacity:n?0:1,transition:"opacity 250ms ease-out"},children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 rounded-full",style:{background:"var(--color-accent)"}}),y.jsx("span",{children:t})]})}const z0=[{name:"tickets.yaml",label:"Tickets",what:"Where this team's tickets come from and how they move."},{name:"branches.yaml",label:"Branches",what:"How branches are named and where changes start."},{name:"commits.yaml",label:"Commits",what:"How commit messages are written."},{name:"pull-requests.yaml",label:"Pull requests",what:"How pull requests are opened."},{name:"enforcement.yaml",label:"Enforcement",what:"How strictly paqad holds everyone to these rules."},{name:"design-sign-off.yaml",label:"Design sign-off",what:"A short design of each change for the team to sign off before the build starts."}];function pm(t,e){return t.filter(n=>n.file===e)}function Yq(t,e){return pm(e.errors,t).length>0?"error":pm(e.warnings,t).length>0?"warning":e.changedOutside.includes(t)?"changed-outside":"ok"}function qq(t){return`${t} was changed outside the git-workflow skill. Ask your agent to review it with the git-workflow skill.`}const Wq="Saved. paqad checks the next turn, commit and pull request against it.",Fq={error:"var(--color-mod-red)",warning:"var(--color-mod-amber)","changed-outside":"var(--color-mod-amber)",ok:"transparent"};function jp({issues:t,color:e}){return t.length===0?null:y.jsx("div",{className:"mt-4 flex flex-col gap-1.5",children:t.map(n=>y.jsxs("div",{className:"flex items-baseline gap-2 text-secondary",children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 shrink-0 translate-y-[-1px] rounded-full",style:{background:e}}),y.jsx("span",{children:n.message})]},n.path+n.message))})}function Hq(){const[t,e]=C.useState(null),[n,i]=C.useState(null),[r,s]=C.useState(null),[o,l]=C.useState(null),[u,f]=C.useState(!1),[h,p]=C.useState("tickets.yaml"),[g,O]=C.useState({}),[v,x]=C.useState({}),[S,k]=C.useState({}),[$,E]=C.useState(0),[T,_]=C.useState(!1),[Q,N]=C.useState(null),[R,X]=C.useState(null),[q,z]=C.useState(null),[Z,F]=C.useState(!1),M=C.useCallback(()=>{fZ().then(P=>{e(P);const j={},Y={};for(const G of P.files)j[G.name]=G.content??"",Y[G.name]=G.hash;O(j),x(Y),k({}),E(G=>G+1)}).catch(P=>i(P instanceof Error?P.message:String(P)))},[]);C.useEffect(()=>{M(),_i().then(P=>{s(P.projectName),l(P.frameworkVersion)}).catch(()=>{})},[M]),C.useEffect(()=>{const P=new EventSource("/api/events");return P.addEventListener("open",()=>f(!0)),P.addEventListener("error",()=>f(!1)),()=>{P.close()}},[]);const B=g[h]??"",L=C.useCallback(P=>{if(T||!t)return;const j=h,Y=g[j]??"";_(!0),N(null),X(null),dZ(j,{content:Y,baseHash:P!==void 0?P:v[j]??null}).then(G=>{if(G.status==="ok"){x(J=>({...J,[j]:G.result.hash})),k(J=>({...J,[j]:!1})),e(J=>J&&{...J,resolved:G.result.resolved,warnings:G.result.warnings,errors:J.errors.filter(ne=>ne.file!==j),changedOutside:J.changedOutside.filter(ne=>ne!==j),files:J.files.map(ne=>ne.name===j?{...ne,exists:!0,content:Y,hash:G.result.hash}:ne)}),z(null),F(!0);return}if(G.status==="invalid"){N(G.issues);return}z({content:G.conflict.content??"",hash:G.conflict.hash})}).catch(G=>X(G instanceof Error?G.message:String(G))).finally(()=>_(!1))},[T,t,h,g,v]),I=C.useRef(L);I.current=L,C.useEffect(()=>{const P=j=>{(j.metaKey||j.ctrlKey)&&j.key.toLowerCase()==="s"&&(j.preventDefault(),I.current())};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[]);const U=P=>{p(P),N(null),X(null),z(null),F(!1),E(j=>j+1)},V=z0.find(P=>P.name===h)??z0[0],te=t?.files.find(P=>P.name===h)??null;return y.jsx(Qi,{projectName:r,frameworkVersion:o,sseLive:u,children:y.jsxs("div",{className:"mx-auto w-full max-w-4xl p-6",children:[y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx("h1",{className:"text-page font-semibold",children:"Git workflow"}),y.jsx(Zc,{managedBy:"you"})]}),y.jsx(Tn,{children:"This team's rules for tickets, branches, commits, pull requests and how strictly they're checked."}),n&&y.jsxs("div",{className:"mt-4 rounded-[10px] border p-4 text-secondary",style:{background:"var(--color-surface)",borderColor:"var(--color-mod-red)"},children:["Could not load the git workflow: ",n]}),!t&&!n&&y.jsx("div",{className:"mt-6 text-secondary",style:{color:"var(--color-muted)"},children:"Loading…"}),t&&y.jsxs(y.Fragment,{children:[y.jsx("div",{role:"tablist","aria-label":"Git workflow files",className:"mt-6 flex gap-1.5",children:z0.map(P=>{const j=Yq(P.name,t),Y=P.name===h;return y.jsxs("button",{type:"button",role:"tab","aria-selected":Y,className:"flex items-center gap-1.5 rounded-[6px] px-3 py-1.5 text-secondary",style:{background:Y?"var(--color-surface)":"transparent",fontWeight:Y?600:400},onClick:()=>U(P.name),children:[P.label,(j!=="ok"||S[P.name])&&y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 rounded-full",style:{background:S[P.name]?"var(--color-accent)":Fq[j]}})]},P.name)})}),y.jsxs("div",{className:"mt-3 text-secondary",style:{color:"var(--color-muted)"},children:[V.what," ",y.jsx("span",{className:"font-mono",children:te?.path??V.name}),te&&!te.exists&&" does not exist yet, so its defaults apply."]}),t.changedOutside.includes(h)&&y.jsx(jp,{issues:[{path:h,message:qq(h)}],color:"var(--color-mod-amber)"}),y.jsx(jp,{issues:pm(t.errors,h),color:"var(--color-mod-red)"}),y.jsx(jp,{issues:pm(t.warnings,h),color:"var(--color-mod-amber)"}),y.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2.5",children:[Z&&y.jsx(nr,{onDone:()=>F(!1),children:Wq}),y.jsx("button",{type:"button",disabled:T,className:"rounded-[6px] px-3.5 py-1.5 text-secondary font-medium disabled:opacity-50",style:{background:"var(--color-accent)",color:"#ffffff"},onClick:()=>L(),children:T?"Saving…":`Save ${h}`})]}),y.jsx("div",{className:"mt-3",children:y.jsx(Km,{value:B,onChange:P=>{O(j=>({...j,[h]:P})),k(j=>({...j,[h]:!0})),F(!1)},lang:"yaml",ariaLabel:`${h} YAML`,minHeight:420},`${h}-${$}`)}),Q&&y.jsx(jp,{issues:Q,color:"var(--color-mod-red)"}),R&&y.jsx("div",{className:"mt-4 text-secondary",style:{color:"var(--color-mod-red)"},children:R}),q&&y.jsx(Jm,{mine:B,theirs:q.content,saving:T,onLoadLatest:()=>{O(P=>({...P,[h]:q.content})),x(P=>({...P,[h]:q.hash})),k(P=>({...P,[h]:!1})),E(P=>P+1),z(null)},onKeepMine:()=>L(q.hash)})]})]})})}function Rd({what:t,why:e,actionLabel:n,onAction:i}){return y.jsxs("div",{className:"rounded-[10px] p-6",style:{background:"var(--color-surface)"},children:[y.jsx("div",{className:"text-body",style:{color:"var(--color-canvas-fg)"},children:t}),y.jsx("div",{className:"mt-2 text-secondary",style:{color:"var(--color-muted)"},children:e}),y.jsx("button",{type:"button",className:"mt-4 rounded-[6px] border px-3 py-1.5 text-secondary font-medium",style:{borderColor:"var(--color-accent)",color:"var(--color-accent)"},onClick:i,children:n})]})}const Y$=/^#([0-9a-fA-F]{3,8})$/;function Rj(t,e,n){if(!(t===null||typeof t!="object"||Array.isArray(t)))for(const[i,r]of Object.entries(t))typeof r=="string"||typeof r=="number"||typeof r=="boolean"?n.push({path:[...e,i],value:r}):r!==null&&typeof r=="object"&&!Array.isArray(r)&&Rj(r,[...e,i],n)}function Cl(t){const e=t.join(".");return e.endsWith(".$value")?e.slice(0,-7):e}function Kq(t,e,n){let i=t;for(const s of e.slice(0,-1)){const o=i[s];if(o===null||typeof o!="object"||Array.isArray(o))return;i=o}const r=e[e.length-1];r!==void 0&&(i[r]=n)}function Jq(t){const e=t.path[t.path.length-1]??"";return!e.startsWith("$")||e==="$value"}function e8({colors:t}){const e=t[0]??"var(--color-accent)",n=t[1]??"var(--color-muted)",i=t[2]??"var(--color-muted)";return y.jsxs("div",{className:"rounded-[10px] p-5",style:{background:"var(--color-surface)"},"aria-label":"Token preview",children:[y.jsx("div",{className:"text-caption font-medium",style:{color:"var(--color-muted)"},children:"Preview"}),y.jsxs("div",{className:"mt-3 rounded-[10px] p-4",style:{background:"var(--color-canvas)"},children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-2 w-2 rounded-full",style:{background:n}}),y.jsx("div",{className:"text-page font-semibold",style:{color:e},children:"A heading in your brand"})]}),y.jsx("div",{className:"mt-2 text-body",style:{color:"var(--color-canvas-fg)"},children:"Body copy at 15px so you can judge contrast against the canvas."}),y.jsx("div",{className:"mt-1 text-secondary",style:{color:i},children:"Secondary copy at 13px in your third color."}),y.jsx("button",{type:"button",className:"mt-4 rounded-[6px] px-3.5 py-1.5 text-secondary font-medium",style:{background:e,color:"#ffffff"},children:"A primary button"})]})]})}function t8(){const[t,e]=C.useState(null),[n,i]=C.useState(null),[r,s]=C.useState(null),[o,l]=C.useState(null),[u,f]=C.useState(!1),[h,p]=C.useState(!1),[g,O]=C.useState(""),[v,x]=C.useState(null),[S,k]=C.useState(0),[$,E]=C.useState("structured"),[T,_]=C.useState(!1),[Q,N]=C.useState(!1),[R,X]=C.useState(null),[q,z]=C.useState(null),[Z,F]=C.useState(null),[M,B]=C.useState(null),[L,I]=C.useState(null);C.useEffect(()=>{vZ().then(H=>{e(H),x(H.file.hash);const ce=H.file.content??`{}
`;O(ce),k(be=>be+1),H.file.exists&&!H.placeholder&&p(!0)}).catch(H=>i(H instanceof Error?H.message:String(H))),_i().then(H=>{s(H.projectName),l(H.frameworkVersion)}).catch(()=>{})},[]),C.useEffect(()=>{const H=new EventSource("/api/events");return H.addEventListener("open",()=>f(!0)),H.addEventListener("error",()=>f(!1)),()=>{H.close()}},[]);let U=null;try{const H=JSON.parse(g);H!==null&&typeof H=="object"&&!Array.isArray(H)&&(U=H)}catch{U=null}const V=[];U!==null&&Rj(U,[],V);const te=V.filter(H=>typeof H.value=="string"&&Y$.test(H.value)),P=V.filter(H=>!(typeof H.value=="string"&&Y$.test(H.value))&&Jq(H)),j=te.slice(0,3).map(H=>String(H.value)),Y=()=>{_(!0),B(null)},G=(H,ce)=>{if(U===null)return;const be=JSON.parse(JSON.stringify(U));Kq(be,H,ce),O(JSON.stringify(be,null,2)+`
`),k(Se=>Se+1),Y()},J=C.useCallback(H=>{Q||!h||(N(!0),X(null),z(null),I(null),bZ({content:g,baseHash:H!==void 0?H:v}).then(ce=>{if(ce.status==="ok"){x(ce.result.hash),e(Se=>Se&&{...Se,placeholder:!1,file:{...Se.file,exists:!0,content:g,hash:ce.result.hash}}),F(null),_(!1);const be=ce.result.regenerated.length;B(be===0?"Saved.":"Saved. "+be+" derived "+(be===1?"doc":"docs")+" refreshed."),ce.result.regenerationError!==void 0&&I("Saved, but the derived docs could not be rebuilt: "+ce.result.regenerationError);return}if(ce.status==="invalid"){X(ce.issues);return}F({content:ce.conflict.content??"",hash:ce.conflict.hash})}).catch(ce=>{z(ce instanceof Error?ce.message:String(ce))}).finally(()=>N(!1)))},[Q,h,g,v]),ne=C.useRef(J);ne.current=J,C.useEffect(()=>{const H=ce=>{(ce.metaKey||ce.ctrlKey)&&ce.key.toLowerCase()==="s"&&(ce.preventDefault(),ne.current())};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[]);const le={background:"var(--color-canvas)",borderColor:"var(--color-border)",color:"var(--color-canvas-fg)"};return y.jsx(Qi,{projectName:r,frameworkVersion:o,sseLive:u,children:y.jsxs("div",{className:"mx-auto w-full max-w-4xl p-6",children:[y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx("h1",{className:"text-page font-semibold",children:"Design tokens"}),y.jsx(Zc,{managedBy:"you"})]}),y.jsx(Tn,{children:"One palette every screen draws from."}),n&&y.jsxs("div",{className:"mt-4 rounded-[10px] border p-4 text-secondary",style:{background:"var(--color-surface)",borderColor:"var(--color-mod-red)"},children:["Could not load the tokens: ",n]}),!t&&!n&&y.jsx("div",{className:"mt-6 text-secondary",style:{color:"var(--color-muted)"},children:"Loading…"}),t&&!h&&y.jsx("div",{className:"mt-6",children:y.jsx(Rd,{what:t.file.exists?"Design tokens are still the placeholder.":"No design tokens yet.",why:"Fill them and the AI builds UI that matches your brand.",actionLabel:"Start from the current file",onAction:()=>{p(!0),_(!0)}})}),t&&h&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"mt-6 flex items-center justify-between gap-3",children:[y.jsx("button",{type:"button","aria-pressed":$==="raw",className:"rounded-[6px] px-2.5 py-1.5 text-secondary font-medium",style:{color:$==="raw"?"var(--color-accent)":"var(--color-muted)",background:$==="raw"?"var(--color-surface)":"transparent"},onClick:()=>E(H=>H==="raw"?"structured":"raw"),children:"Raw JSON"}),y.jsxs("div",{className:"flex items-center gap-2.5",children:[M!==null&&y.jsx(nr,{onDone:()=>B(null),children:M}),T&&M===null&&y.jsx("span",{title:"Unsaved changes","aria-label":"Unsaved changes",className:"inline-block h-1.5 w-1.5 rounded-full",style:{background:"var(--color-accent)"}}),y.jsx("button",{type:"button",disabled:Q,className:"rounded-[6px] px-3.5 py-1.5 text-secondary font-medium disabled:opacity-50",style:{background:"var(--color-accent)",color:"#ffffff"},onClick:()=>J(),children:Q?"Saving…":"Save"})]})]}),$==="raw"&&y.jsxs("div",{className:"mt-4",children:[y.jsx(Km,{value:g,onChange:H=>{O(H),Y()},lang:"plain",ariaLabel:"Raw design tokens JSON",minHeight:420},S),U===null&&y.jsx("div",{className:"mt-2 text-secondary",style:{color:"var(--color-mod-red)"},children:"Not valid JSON yet. The structured view returns once this parses."})]}),$==="structured"&&y.jsxs("div",{className:"mt-4 grid gap-4 lg:grid-cols-[1.5fr_1fr]",children:[y.jsxs("div",{className:"min-w-0",children:[U===null&&y.jsx("div",{className:"rounded-[10px] p-4 text-secondary",style:{background:"var(--color-surface)",color:"var(--color-muted)"},children:"The file is not valid JSON. Fix it in the raw view first."}),U!==null&&te.length===0&&P.length===0&&y.jsx("div",{className:"rounded-[10px] p-4 text-secondary",style:{background:"var(--color-surface)",color:"var(--color-muted)"},children:"No token values yet. Add them in the raw JSON view and the swatches appear here."}),U!==null&&te.length>0&&y.jsxs("div",{className:"rounded-[10px] p-4",style:{background:"var(--color-surface)"},children:[y.jsx("div",{className:"text-caption font-medium",style:{color:"var(--color-muted)"},children:"Colors"}),y.jsx("div",{className:"mt-3 grid gap-x-4 gap-y-2 sm:grid-cols-2",children:te.map(H=>{const ce=H.path.join(".");return y.jsxs("div",{className:"flex items-center gap-2.5",children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-5 w-5 shrink-0 rounded-[6px]",style:{background:String(H.value),border:"1px solid var(--color-border)"}}),y.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-caption",style:{color:"var(--color-muted)"},title:Cl(H.path),children:Cl(H.path)}),y.jsx("input",{type:"text","aria-label":"Color "+Cl(H.path),className:"w-24 shrink-0 rounded-[6px] border px-2 py-1 font-mono text-caption",style:le,value:String(H.value),onChange:be=>G(H.path,be.target.value)})]},ce)})})]}),U!==null&&P.length>0&&y.jsxs("div",{className:"mt-4 rounded-[10px] p-4",style:{background:"var(--color-surface)"},children:[y.jsx("div",{className:"text-caption font-medium",style:{color:"var(--color-muted)"},children:"Other values"}),y.jsx("div",{className:"mt-3 grid gap-x-4 gap-y-2 sm:grid-cols-2",children:P.map(H=>{const ce=H.path.join(".");return y.jsxs("div",{className:"flex items-center gap-2.5",children:[y.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-caption",style:{color:"var(--color-muted)"},title:Cl(H.path),children:Cl(H.path)}),y.jsx("input",{type:"text","aria-label":"Value "+Cl(H.path),className:"w-36 shrink-0 rounded-[6px] border px-2 py-1 font-mono text-caption",style:le,value:String(H.value),onChange:be=>{const Se=be.target.value;if(typeof H.value=="number"){const he=Number(Se);G(H.path,Number.isFinite(he)?he:Se)}else typeof H.value=="boolean"?G(H.path,Se==="true"):G(H.path,Se)}})]},ce)})})]})]}),y.jsx(e8,{colors:j})]}),L!==null&&y.jsx("div",{className:"mt-4 text-secondary",style:{color:"var(--color-muted)"},children:L}),R&&R.length>0&&y.jsx("div",{className:"mt-4 flex flex-col gap-1.5",children:R.map(H=>y.jsxs("div",{className:"flex items-baseline gap-2 text-secondary",children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 shrink-0 translate-y-[-1px] rounded-full",style:{background:"var(--color-mod-red)"}}),y.jsx("span",{style:{color:"var(--color-muted)"},children:H.path}),y.jsx("span",{children:H.message})]},H.path+H.message))}),q&&y.jsx("div",{className:"mt-4 text-secondary",style:{color:"var(--color-mod-red)"},children:q}),Z&&y.jsx(Jm,{mine:g,theirs:Z.content,saving:Q,onLoadLatest:()=>{O(Z.content),x(Z.hash),k(H=>H+1),F(null),_(!1)},onKeepMine:()=>J(Z.hash)})]})]})})}const q$=t=>{let e;const n=new Set,i=(f,h)=>{const p=typeof f=="function"?f(e):f;if(!Object.is(p,e)){const g=e;e=h??(typeof p!="object"||p===null)?p:Object.assign({},e,p),n.forEach(O=>O(e,g))}},r=()=>e,l={setState:i,getState:r,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f))},u=e=t(i,r,l);return l},n8=(t=>t?q$(t):q$),i8=t=>t;function r8(t,e=i8){const n=Bl.useSyncExternalStore(t.subscribe,Bl.useCallback(()=>e(t.getState()),[t,e]),Bl.useCallback(()=>e(t.getInitialState()),[t,e]));return Bl.useDebugValue(n),n}const W$=t=>{const e=n8(t),n=i=>r8(e,i);return Object.assign(n,e),n},s8=(t=>t?W$(t):W$),je=s8(t=>({graph:null,loading:!0,error:null,selectedNode:null,selectedDetail:null,detailLoading:!1,search:{query:"",matches:[],index:0},similarity:{threshold:.75,loading:!1,edges:[],capped:!1,error:null},overlay:"health",setOverlay:e=>t({overlay:e}),aiActivity:!0,setAiActivity:e=>t({aiActivity:e}),activityByModule:{},setActivityByModule:e=>t({activityByModule:e}),disclosure:"working",setDisclosure:e=>t({disclosure:e}),layers:{modules:!0,files:!1,chunks:!1,symbols:!1,contains:!1,imports:!1,similar:!1},theme:typeof window<"u"?Zg():"auto",setGraph:e=>t({graph:e}),setLoading:e=>t({loading:e}),setError:e=>t({error:e}),selectNode:e=>t({selectedNode:e,selectedDetail:null,detailLoading:!!e}),setDetail:e=>t({selectedDetail:e,detailLoading:!1}),setDetailLoading:e=>t({detailLoading:e}),toggleLayer:e=>t(n=>({layers:{...n.layers,[e]:!n.layers[e]}})),setLayers:e=>t({layers:e}),setTheme:e=>{aN(e),t({theme:e})},setSearchQuery:e=>t(n=>({search:{...n.search,query:e}})),setSearchMatches:e=>t(n=>({search:{...n.search,matches:e,index:(e.length>0,0)}})),setSearchIndex:e=>t(n=>({search:{...n.search,index:e}})),setSimilarityThreshold:e=>t(n=>({similarity:{...n.similarity,threshold:e}})),setSimilarityLoading:e=>t(n=>({similarity:{...n.similarity,loading:e}})),setSimilarityResult:(e,n)=>t(i=>({similarity:{...i.similarity,edges:e,capped:n,loading:!1,error:null}})),setSimilarityError:e=>t(n=>({similarity:{...n.similarity,error:e,loading:!1}}))}));function o8(t){return t==null?"—":t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`}const a8={module:"Area",file:"File",chunk:"Section",symbol:"Symbol"},F$={green:"var(--color-mod-green)",amber:"var(--color-mod-amber)",red:"var(--color-mod-red)",unknown:"var(--color-muted)"},H$={green:"Checks are passing and nothing is flagged here.",amber:"Some checks are flagged here.",red:"Open risk has been flagged here.",unknown:"This area has not been measured yet."},K$={green:"Nothing to do.",amber:"Review this area with your team and clear the flagged checks.",red:"Prioritise this area. Open risk needs a fix before more changes land.",unknown:"Run paqad-ai onboard to measure this area."};function l8(){const t=je(l=>l.selectedNode),e=je(l=>l.selectedDetail),n=je(l=>l.detailLoading),i=je(l=>l.setDetail),r=je(l=>l.setDetailLoading),s=je(l=>l.graph),o=C.useMemo(()=>{const l=new Map;for(const u of s?.nodes??[])l.set(u.id,u);return l},[s]);return C.useEffect(()=>{if(!t)return;let l=!1;return r(!0),PZ(t.id).then(u=>{l||i(u)}).catch(()=>{l||i(null)}),()=>{l=!0}},[t,i,r]),t?y.jsxs("aside",{className:"absolute right-3 top-3 w-96 max-h-[calc(100%-1.5rem)] overflow-auto rounded-lg border p-4 text-sm shadow-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:[y.jsxs("header",{children:[y.jsx("div",{className:"text-[10px] uppercase tracking-wide",style:{color:"var(--color-muted)"},children:a8[t.type]}),y.jsx("div",{className:"font-medium break-words",children:t.label})]}),n&&y.jsx("div",{className:"mt-2 text-xs",style:{color:"var(--color-muted)"},children:"loading…"}),e&&!n&&y.jsx(d8,{detail:e,nodesById:o})]}):null}function Mp({label:t,children:e}){return y.jsxs("section",{children:[y.jsx("div",{className:"text-[10px] uppercase tracking-wide",style:{color:"var(--color-muted)"},children:t}),y.jsx("div",{className:"mt-0.5",children:e})]})}function c8(t,e){if(t.node.type==="module")return t.node.attributes.health_tier??"unknown";let n=e.get(t.node.id),i=0;for(;n&&n.type!=="module"&&i<10;)n=n.parent_id?e.get(n.parent_id):void 0,i+=1;return n?.type==="module"?n.attributes.health_tier??"unknown":"unknown"}function u8(t,e){if(t.node.type==="module")return t.node.id;let n=e.get(t.node.id),i=0;for(;n&&n.type!=="module"&&i<10;)n=n.parent_id?e.get(n.parent_id):void 0,i+=1;return n?.type==="module"?n.id:null}function f8(t){const e=t.node;switch(e.type){case"module":{const n=t.children.length;return`An area of your codebase, holding ${n} ${n===1?"file":"files"}.`}case"file":{const n=e.attributes.language?`${e.attributes.language} `:"",i=t.parent?.label??"an unassigned";return`A ${n}source file in the ${i} area.`}case"chunk":return`A section of the file ${t.parent?.label??"(unknown)"}.`;case"symbol":return`${e.attributes.exported?"An exported":"An internal"} symbol in ${t.parent?.label??"(unknown)"}.`;default:return"Part of your codebase."}}function d8({detail:t,nodesById:e}){const n=je(h=>h.activityByModule),i=je(h=>h.disclosure),r=c8(t,e),s=t.node.type==="module",o=i==="shareable",l=u8(t,e),u=l?n[l]:void 0,f=r==="amber"||r==="red";return y.jsxs("div",{className:"mt-3 space-y-4",children:[y.jsx(Mp,{label:"What it is",children:y.jsx("p",{children:f8(t)})}),y.jsxs(Mp,{label:"How it is doing",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{background:F$[r]??F$.unknown}}),y.jsx("span",{className:"font-medium",children:zZ(r)})]}),!(o&&f)&&y.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--color-muted)"},children:H$[r]??H$.unknown})]}),y.jsx(Mp,{label:"What the AI changed",children:u?y.jsxs(y.Fragment,{children:[y.jsxs("p",{children:["AI changed this ",new Date(u.lastChange).toLocaleDateString(),". Verified by"," ",u.checks," ",u.checks===1?"check":"checks",".",u.acceptedBy&&!o?` Accepted by ${u.acceptedBy}.`:""]}),y.jsx("button",{type:"button",className:"mt-1 text-xs",style:{color:"var(--color-accent)"},onClick:()=>window.open("/api/snapshot/receipt/"+encodeURIComponent(u.receiptHash),"_blank","noopener"),children:"View the receipt"})]}):y.jsx("p",{className:"text-xs",style:{color:"var(--color-muted)"},children:"No recent AI changes recorded for this area."})}),y.jsx(Mp,{label:"What to do",children:o&&f?y.jsx("p",{children:"Details available in the working view."}):y.jsx("p",{children:K$[r]??K$.unknown})}),s&&y.jsx("button",{type:"button",className:"rounded border px-2 py-1 text-xs font-medium",style:{borderColor:"var(--color-accent)",color:"var(--color-accent)"},onClick:()=>window.open("/api/snapshot/module/"+encodeURIComponent(t.node.id),"_blank","noopener"),children:"Share snapshot"}),!o&&y.jsxs("details",{className:"rounded border pt-0",style:{borderColor:"var(--color-border)"},children:[y.jsx("summary",{className:"cursor-pointer px-2 py-1.5 text-[10px] uppercase tracking-wide",style:{color:"var(--color-muted)"},children:"For engineers"}),y.jsx("div",{className:"space-y-3 px-2 pb-2",children:y.jsx(h8,{detail:t})})]})]})}function rn({k:t,v:e}){return y.jsxs("div",{className:"flex justify-between gap-3 text-xs",children:[y.jsx("span",{style:{color:"var(--color-muted)"},children:t}),y.jsx("span",{className:"text-right break-words",children:e})]})}function h8({detail:t}){const e=t.node;return y.jsxs(y.Fragment,{children:[y.jsx(rn,{k:"id",v:e.id}),e.type==="module"&&y.jsx(p8,{detail:t}),e.type==="file"&&y.jsx(g8,{detail:t}),e.type==="chunk"&&y.jsx(m8,{detail:t}),e.type==="symbol"&&y.jsx(O8,{detail:t})]})}function p8({detail:t}){const e=t.node.attributes;return y.jsxs(y.Fragment,{children:[y.jsx(rn,{k:"files",v:t.children.length}),y.jsx(rn,{k:"health tier",v:e.health_tier??"—"}),y.jsx(rn,{k:"defects",v:e.defect_count??"—"}),y.jsx(rn,{k:"risk floor",v:e.risk_floor??"—"}),y.jsx(rn,{k:"complexity correction",v:e.complexity_correction??"—"}),y.jsx("div",{className:"mt-1 max-h-40 overflow-auto text-xs",children:t.children.slice(0,200).map(n=>y.jsx("div",{className:"truncate",children:n.label},n.id))})]})}function g8({detail:t}){const e=t.node.attributes;return y.jsxs(y.Fragment,{children:[y.jsx(rn,{k:"module",v:t.parent?.label??"(none)"}),y.jsx(rn,{k:"language",v:e.language??"—"}),y.jsx(rn,{k:"size",v:o8(e.size_bytes)}),y.jsx(rn,{k:"symbols",v:e.symbol_count??0}),y.jsx(rn,{k:"chunks",v:t.children.filter(n=>n.type==="chunk").length}),y.jsx(J$,{title:"imports → (outgoing)",entries:t.imports_out??[]}),y.jsx(J$,{title:"imports ← (incoming)",entries:t.imports_in??[]})]})}function J$({title:t,entries:e}){return e.length===0?null:y.jsxs("div",{className:"mt-1",children:[y.jsxs("div",{className:"text-[10px] uppercase tracking-wide",style:{color:"var(--color-muted)"},children:[t," · ",e.length]}),y.jsx("ul",{className:"mt-1 max-h-40 overflow-auto text-xs",children:e.slice(0,200).map(n=>y.jsxs("li",{className:"truncate",children:[n.file_id.replace(/^file:/,""),n.module_id&&y.jsxs("span",{style:{color:"var(--color-muted)"},children:[" ","· ",n.module_id.replace(/^module:/,"")]})]},n.file_id))})]})}function m8({detail:t}){const[e,n]=C.useState(null),[i,r]=C.useState(!1),s=t.chunk_content_preview??"",o=t.chunk_truncated??!1;return y.jsxs(y.Fragment,{children:[y.jsx(rn,{k:"file",v:t.parent?.label??"—"}),y.jsx(rn,{k:"index",v:t.node.attributes.chunk_index??"—"}),y.jsx(rn,{k:"kind",v:t.node.attributes.ast_node_type??"—"}),y.jsx(rn,{k:"hash",v:(t.node.attributes.content_hash??"").slice(0,12)}),y.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded border p-2 text-[11px] leading-snug",style:{background:"var(--color-canvas)",borderColor:"var(--color-border)"},children:e??s}),o&&!e&&y.jsx("button",{type:"button",disabled:i,onClick:async()=>{r(!0);try{const l=await RZ(t.node.id);n(l.content)}finally{r(!1)}},className:"mt-1 rounded border px-2 py-0.5 text-[11px]",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:i?"loading…":"show full section"})]})}function O8({detail:t}){return y.jsxs(y.Fragment,{children:[y.jsx(rn,{k:"file",v:t.parent?.label??"—"}),y.jsx(rn,{k:"exported",v:t.node.attributes.exported?"yes":"no"})]})}var Lp={exports:{}},e_;function y8(){if(e_)return Lp.exports;e_=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(_,Q,N){return Function.prototype.apply.call(_,Q,N)},n;t&&typeof t.ownKeys=="function"?n=t.ownKeys:Object.getOwnPropertySymbols?n=function(_){return Object.getOwnPropertyNames(_).concat(Object.getOwnPropertySymbols(_))}:n=function(_){return Object.getOwnPropertyNames(_)};function i(T){console&&console.warn&&console.warn(T)}var r=Number.isNaN||function(_){return _!==_};function s(){s.init.call(this)}Lp.exports=s,Lp.exports.once=k,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function l(T){if(typeof T!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof T)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(T){if(typeof T!="number"||T<0||r(T))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+T+".");o=T}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(_){if(typeof _!="number"||_<0||r(_))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+_+".");return this._maxListeners=_,this};function u(T){return T._maxListeners===void 0?s.defaultMaxListeners:T._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(_){for(var Q=[],N=1;N<arguments.length;N++)Q.push(arguments[N]);var R=_==="error",X=this._events;if(X!==void 0)R=R&&X.error===void 0;else if(!R)return!1;if(R){var q;if(Q.length>0&&(q=Q[0]),q instanceof Error)throw q;var z=new Error("Unhandled error."+(q?" ("+q.message+")":""));throw z.context=q,z}var Z=X[_];if(Z===void 0)return!1;if(typeof Z=="function")e(Z,this,Q);else for(var F=Z.length,M=v(Z,F),N=0;N<F;++N)e(M[N],this,Q);return!0};function f(T,_,Q,N){var R,X,q;if(l(Q),X=T._events,X===void 0?(X=T._events=Object.create(null),T._eventsCount=0):(X.newListener!==void 0&&(T.emit("newListener",_,Q.listener?Q.listener:Q),X=T._events),q=X[_]),q===void 0)q=X[_]=Q,++T._eventsCount;else if(typeof q=="function"?q=X[_]=N?[Q,q]:[q,Q]:N?q.unshift(Q):q.push(Q),R=u(T),R>0&&q.length>R&&!q.warned){q.warned=!0;var z=new Error("Possible EventEmitter memory leak detected. "+q.length+" "+String(_)+" listeners added. Use emitter.setMaxListeners() to increase limit");z.name="MaxListenersExceededWarning",z.emitter=T,z.type=_,z.count=q.length,i(z)}return T}s.prototype.addListener=function(_,Q){return f(this,_,Q,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(_,Q){return f(this,_,Q,!0)};function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(T,_,Q){var N={fired:!1,wrapFn:void 0,target:T,type:_,listener:Q},R=h.bind(N);return R.listener=Q,N.wrapFn=R,R}s.prototype.once=function(_,Q){return l(Q),this.on(_,p(this,_,Q)),this},s.prototype.prependOnceListener=function(_,Q){return l(Q),this.prependListener(_,p(this,_,Q)),this},s.prototype.removeListener=function(_,Q){var N,R,X,q,z;if(l(Q),R=this._events,R===void 0)return this;if(N=R[_],N===void 0)return this;if(N===Q||N.listener===Q)--this._eventsCount===0?this._events=Object.create(null):(delete R[_],R.removeListener&&this.emit("removeListener",_,N.listener||Q));else if(typeof N!="function"){for(X=-1,q=N.length-1;q>=0;q--)if(N[q]===Q||N[q].listener===Q){z=N[q].listener,X=q;break}if(X<0)return this;X===0?N.shift():x(N,X),N.length===1&&(R[_]=N[0]),R.removeListener!==void 0&&this.emit("removeListener",_,z||Q)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(_){var Q,N,R;if(N=this._events,N===void 0)return this;if(N.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):N[_]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete N[_]),this;if(arguments.length===0){var X=Object.keys(N),q;for(R=0;R<X.length;++R)q=X[R],q!=="removeListener"&&this.removeAllListeners(q);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(Q=N[_],typeof Q=="function")this.removeListener(_,Q);else if(Q!==void 0)for(R=Q.length-1;R>=0;R--)this.removeListener(_,Q[R]);return this};function g(T,_,Q){var N=T._events;if(N===void 0)return[];var R=N[_];return R===void 0?[]:typeof R=="function"?Q?[R.listener||R]:[R]:Q?S(R):v(R,R.length)}s.prototype.listeners=function(_){return g(this,_,!0)},s.prototype.rawListeners=function(_){return g(this,_,!1)},s.listenerCount=function(T,_){return typeof T.listenerCount=="function"?T.listenerCount(_):O.call(T,_)},s.prototype.listenerCount=O;function O(T){var _=this._events;if(_!==void 0){var Q=_[T];if(typeof Q=="function")return 1;if(Q!==void 0)return Q.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function v(T,_){for(var Q=new Array(_),N=0;N<_;++N)Q[N]=T[N];return Q}function x(T,_){for(;_+1<T.length;_++)T[_]=T[_+1];T.pop()}function S(T){for(var _=new Array(T.length),Q=0;Q<_.length;++Q)_[Q]=T[Q].listener||T[Q];return _}function k(T,_){return new Promise(function(Q,N){function R(q){T.removeListener(_,X),N(q)}function X(){typeof T.removeListener=="function"&&T.removeListener("error",R),Q([].slice.call(arguments))}E(T,_,X,{once:!0}),_!=="error"&&$(T,R,{once:!0})})}function $(T,_,Q){typeof T.on=="function"&&E(T,"error",_,Q)}function E(T,_,Q,N){if(typeof T.on=="function")N.once?T.once(_,Q):T.on(_,Q);else if(typeof T.addEventListener=="function")T.addEventListener(_,function R(X){N.once&&T.removeEventListener(_,R),Q(X)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof T)}return Lp.exports}var jj=y8(),X0,t_;function $1(){if(t_)return X0;t_=1;function t(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=function(){return this}),t.of=function(){var e=arguments,n=e.length,i=0;return new t(function(){return i>=n?{done:!0}:{done:!1,value:e[i++]}})},t.empty=function(){var e=new t(function(){return{done:!0}});return e},t.fromSequence=function(e){var n=0,i=e.length;return new t(function(){return n>=i?{done:!0}:{done:!1,value:e[n++]}})},t.is=function(e){return e instanceof t?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},X0=t,X0}var v8=$1();const Ci=Dc(v8);var Dp={},n_;function b8(){return n_||(n_=1,Dp.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",Dp.SYMBOL_SUPPORT=typeof Symbol<"u"),Dp}var Z0,i_;function Mj(){if(i_)return Z0;i_=1;var t=$1(),e=b8(),n=e.ARRAY_BUFFER_SUPPORT,i=e.SYMBOL_SUPPORT;function r(s){return typeof s=="string"||Array.isArray(s)||n&&ArrayBuffer.isView(s)?t.fromSequence(s):typeof s!="object"||s===null?null:i&&typeof s[Symbol.iterator]=="function"?s[Symbol.iterator]():typeof s.next=="function"?s:null}return Z0=function(o){var l=r(o);if(!l)throw new Error("obliterator: target is not iterable nor a valid iterator.");return l},Z0}var B0,r_;function x8(){if(r_)return B0;r_=1;var t=Mj();return B0=function(n,i){for(var r=arguments.length>1?i:1/0,s=r!==1/0?new Array(r):[],o,l=0,u=t(n);;){if(l===r)return s;if(o=u.next(),o.done)return l!==i&&(s.length=l),s;s[l++]=o.value}},B0}var w8=x8();const Lj=Dc(w8);var I0,s_;function S8(){if(s_)return I0;s_=1;var t=$1(),e=Mj();return I0=function(){var i=arguments,r=null,s=-1;return new t(function(){var l=null;do{if(r===null){if(s++,s>=i.length)return{done:!0};r=e(i[s])}if(l=r.next(),l.done===!0){r=null;continue}break}while(!0);return l})},I0}var k8=S8();const ys=Dc(k8);function E8(){const t=arguments[0];for(let e=1,n=arguments.length;e<n;e++)if(arguments[e])for(const i in arguments[e])t[i]=arguments[e][i];return t}let Yt=E8;typeof Object.assign=="function"&&(Yt=Object.assign);function Ei(t,e,n,i){const r=t._nodes.get(e);let s=null;return r&&(i==="mixed"?s=r.out&&r.out[n]||r.undirected&&r.undirected[n]:i==="directed"?s=r.out&&r.out[n]:s=r.undirected&&r.undirected[n]),s}function sn(t){return typeof t=="object"&&t!==null}function Dj(t){let e;for(e in t)return!1;return!0}function vi(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:!0,value:n})}function Xi(t,e,n){const i={enumerable:!0,configurable:!0};typeof n=="function"?i.get=n:(i.value=n,i.writable=!1),Object.defineProperty(t,e,i)}function o_(t){return!(!sn(t)||t.attributes&&!Array.isArray(t.attributes))}function T8(){let t=Math.floor(Math.random()*256)&255;return()=>t++}class _1 extends Error{constructor(e){super(),this.name="GraphError",this.message=e}}class xe extends _1{constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,xe.prototype.constructor)}}class Oe extends _1{constructor(e){super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Oe.prototype.constructor)}}class Re extends _1{constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Re.prototype.constructor)}}function zj(t,e){this.key=t,this.attributes=e,this.clear()}zj.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function Xj(t,e){this.key=t,this.attributes=e,this.clear()}Xj.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function Zj(t,e){this.key=t,this.attributes=e,this.clear()}Zj.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Yc(t,e,n,i,r){this.key=e,this.attributes=r,this.undirected=t,this.source=n,this.target=i}Yc.prototype.attach=function(){let t="out",e="in";this.undirected&&(t=e="undirected");const n=this.source.key,i=this.target.key;this.source[t][i]=this,!(this.undirected&&n===i)&&(this.target[e][n]=this)};Yc.prototype.attachMulti=function(){let t="out",e="in";const n=this.source.key,i=this.target.key;this.undirected&&(t=e="undirected");const r=this.source[t],s=r[i];if(typeof s>"u"){r[i]=this,this.undirected&&n===i||(this.target[e][n]=this);return}s.previous=this,this.next=s,r[i]=this,this.target[e][n]=this};Yc.prototype.detach=function(){const t=this.source.key,e=this.target.key;let n="out",i="in";this.undirected&&(n=i="undirected"),delete this.source[n][e],delete this.target[i][t]};Yc.prototype.detachMulti=function(){const t=this.source.key,e=this.target.key;let n="out",i="in";this.undirected&&(n=i="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][e],delete this.target[i][t]):(this.next.previous=void 0,this.source[n][e]=this.next,this.target[i][t]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const Bj=0,Ij=1,C8=2,Gj=3;function $s(t,e,n,i,r,s,o){let l,u,f,h;if(i=""+i,n===Bj){if(l=t._nodes.get(i),!l)throw new Oe(`Graph.${e}: could not find the "${i}" node in the graph.`);f=r,h=s}else if(n===Gj){if(r=""+r,u=t._edges.get(r),!u)throw new Oe(`Graph.${e}: could not find the "${r}" edge in the graph.`);const p=u.source.key,g=u.target.key;if(i===p)l=u.target;else if(i===g)l=u.source;else throw new Oe(`Graph.${e}: the "${i}" node is not attached to the "${r}" edge (${p}, ${g}).`);f=s,h=o}else{if(u=t._edges.get(i),!u)throw new Oe(`Graph.${e}: could not find the "${i}" edge in the graph.`);n===Ij?l=u.source:l=u.target,f=r,h=s}return[l,f,h]}function $8(t,e,n){t.prototype[e]=function(i,r,s){const[o,l]=$s(this,e,n,i,r,s);return o.attributes[l]}}function _8(t,e,n){t.prototype[e]=function(i,r){const[s]=$s(this,e,n,i,r);return s.attributes}}function Q8(t,e,n){t.prototype[e]=function(i,r,s){const[o,l]=$s(this,e,n,i,r,s);return o.attributes.hasOwnProperty(l)}}function A8(t,e,n){t.prototype[e]=function(i,r,s,o){const[l,u,f]=$s(this,e,n,i,r,s,o);return l.attributes[u]=f,this.emit("nodeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:u}),this}}function N8(t,e,n){t.prototype[e]=function(i,r,s,o){const[l,u,f]=$s(this,e,n,i,r,s,o);if(typeof f!="function")throw new xe(`Graph.${e}: updater should be a function.`);const h=l.attributes,p=f(h[u]);return h[u]=p,this.emit("nodeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:u}),this}}function P8(t,e,n){t.prototype[e]=function(i,r,s){const[o,l]=$s(this,e,n,i,r,s);return delete o.attributes[l],this.emit("nodeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:l}),this}}function R8(t,e,n){t.prototype[e]=function(i,r,s){const[o,l]=$s(this,e,n,i,r,s);if(!sn(l))throw new xe(`Graph.${e}: provided attributes are not a plain object.`);return o.attributes=l,this.emit("nodeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function j8(t,e,n){t.prototype[e]=function(i,r,s){const[o,l]=$s(this,e,n,i,r,s);if(!sn(l))throw new xe(`Graph.${e}: provided attributes are not a plain object.`);return Yt(o.attributes,l),this.emit("nodeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:l}),this}}function M8(t,e,n){t.prototype[e]=function(i,r,s){const[o,l]=$s(this,e,n,i,r,s);if(typeof l!="function")throw new xe(`Graph.${e}: provided updater is not a function.`);return o.attributes=l(o.attributes),this.emit("nodeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const L8=[{name:t=>`get${t}Attribute`,attacher:$8},{name:t=>`get${t}Attributes`,attacher:_8},{name:t=>`has${t}Attribute`,attacher:Q8},{name:t=>`set${t}Attribute`,attacher:A8},{name:t=>`update${t}Attribute`,attacher:N8},{name:t=>`remove${t}Attribute`,attacher:P8},{name:t=>`replace${t}Attributes`,attacher:R8},{name:t=>`merge${t}Attributes`,attacher:j8},{name:t=>`update${t}Attributes`,attacher:M8}];function D8(t){L8.forEach(function({name:e,attacher:n}){n(t,e("Node"),Bj),n(t,e("Source"),Ij),n(t,e("Target"),C8),n(t,e("Opposite"),Gj)})}function z8(t,e,n){t.prototype[e]=function(i,r){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Re(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Re(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+i,l=""+r;if(r=arguments[2],s=Ei(this,o,l,n),!s)throw new Oe(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new Re(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,s=this._edges.get(i),!s)throw new Oe(`Graph.${e}: could not find the "${i}" edge in the graph.`)}return s.attributes[r]}}function X8(t,e,n){t.prototype[e]=function(i){let r;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Re(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Re(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+i,o=""+arguments[1];if(r=Ei(this,s,o,n),!r)throw new Oe(`Graph.${e}: could not find an edge for the given path ("${s}" - "${o}").`)}else{if(n!=="mixed")throw new Re(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,r=this._edges.get(i),!r)throw new Oe(`Graph.${e}: could not find the "${i}" edge in the graph.`)}return r.attributes}}function Z8(t,e,n){t.prototype[e]=function(i,r){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Re(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Re(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+i,l=""+r;if(r=arguments[2],s=Ei(this,o,l,n),!s)throw new Oe(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new Re(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,s=this._edges.get(i),!s)throw new Oe(`Graph.${e}: could not find the "${i}" edge in the graph.`)}return s.attributes.hasOwnProperty(r)}}function B8(t,e,n){t.prototype[e]=function(i,r,s){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Re(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Re(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+i,u=""+r;if(r=arguments[2],s=arguments[3],o=Ei(this,l,u,n),!o)throw new Oe(`Graph.${e}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Re(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,o=this._edges.get(i),!o)throw new Oe(`Graph.${e}: could not find the "${i}" edge in the graph.`)}return o.attributes[r]=s,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}function I8(t,e,n){t.prototype[e]=function(i,r,s){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Re(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Re(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+i,u=""+r;if(r=arguments[2],s=arguments[3],o=Ei(this,l,u,n),!o)throw new Oe(`Graph.${e}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Re(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,o=this._edges.get(i),!o)throw new Oe(`Graph.${e}: could not find the "${i}" edge in the graph.`)}if(typeof s!="function")throw new xe(`Graph.${e}: updater should be a function.`);return o.attributes[r]=s(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}function G8(t,e,n){t.prototype[e]=function(i,r){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Re(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Re(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+i,l=""+r;if(r=arguments[2],s=Ei(this,o,l,n),!s)throw new Oe(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new Re(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,s=this._edges.get(i),!s)throw new Oe(`Graph.${e}: could not find the "${i}" edge in the graph.`)}return delete s.attributes[r],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:r}),this}}function V8(t,e,n){t.prototype[e]=function(i,r){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Re(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Re(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+i,l=""+r;if(r=arguments[2],s=Ei(this,o,l,n),!s)throw new Oe(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new Re(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,s=this._edges.get(i),!s)throw new Oe(`Graph.${e}: could not find the "${i}" edge in the graph.`)}if(!sn(r))throw new xe(`Graph.${e}: provided attributes are not a plain object.`);return s.attributes=r,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function U8(t,e,n){t.prototype[e]=function(i,r){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Re(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Re(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+i,l=""+r;if(r=arguments[2],s=Ei(this,o,l,n),!s)throw new Oe(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new Re(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,s=this._edges.get(i),!s)throw new Oe(`Graph.${e}: could not find the "${i}" edge in the graph.`)}if(!sn(r))throw new xe(`Graph.${e}: provided attributes are not a plain object.`);return Yt(s.attributes,r),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:r}),this}}function Y8(t,e,n){t.prototype[e]=function(i,r){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Re(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Re(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+i,l=""+r;if(r=arguments[2],s=Ei(this,o,l,n),!s)throw new Oe(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new Re(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,s=this._edges.get(i),!s)throw new Oe(`Graph.${e}: could not find the "${i}" edge in the graph.`)}if(typeof r!="function")throw new xe(`Graph.${e}: provided updater is not a function.`);return s.attributes=r(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const q8=[{name:t=>`get${t}Attribute`,attacher:z8},{name:t=>`get${t}Attributes`,attacher:X8},{name:t=>`has${t}Attribute`,attacher:Z8},{name:t=>`set${t}Attribute`,attacher:B8},{name:t=>`update${t}Attribute`,attacher:I8},{name:t=>`remove${t}Attribute`,attacher:G8},{name:t=>`replace${t}Attributes`,attacher:V8},{name:t=>`merge${t}Attributes`,attacher:U8},{name:t=>`update${t}Attributes`,attacher:Y8}];function W8(t){q8.forEach(function({name:e,attacher:n}){n(t,e("Edge"),"mixed"),n(t,e("DirectedEdge"),"directed"),n(t,e("UndirectedEdge"),"undirected")})}const F8=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function H8(t,e,n,i){let r=!1;for(const s in e){if(s===i)continue;const o=e[s];if(r=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),t&&r)return o.key}}function K8(t,e,n,i){let r,s,o,l=!1;for(const u in e)if(u!==i){r=e[u];do{if(s=r.source,o=r.target,l=n(r.key,r.attributes,s.key,o.key,s.attributes,o.attributes,r.undirected),t&&l)return r.key;r=r.next}while(r!==void 0)}}function G0(t,e){const n=Object.keys(t),i=n.length;let r,s=0;return new Ci(function(){do if(r)r=r.next;else{if(s>=i)return{done:!0};const l=n[s++];if(l===e){r=void 0;continue}r=t[l]}while(!r);return{done:!1,value:{edge:r.key,attributes:r.attributes,source:r.source.key,target:r.target.key,sourceAttributes:r.source.attributes,targetAttributes:r.target.attributes,undirected:r.undirected}}})}function J8(t,e,n,i){const r=e[n];if(!r)return;const s=r.source,o=r.target;if(i(r.key,r.attributes,s.key,o.key,s.attributes,o.attributes,r.undirected)&&t)return r.key}function e9(t,e,n,i){let r=e[n];if(!r)return;let s=!1;do{if(s=i(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected),t&&s)return r.key;r=r.next}while(r!==void 0)}function V0(t,e){let n=t[e];return n.next!==void 0?new Ci(function(){if(!n)return{done:!0};const i={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:i}}):Ci.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function t9(t,e){if(t.size===0)return[];if(e==="mixed"||e===t.type)return typeof Array.from=="function"?Array.from(t._edges.keys()):Lj(t._edges.keys(),t._edges.size);const n=e==="undirected"?t.undirectedSize:t.directedSize,i=new Array(n),r=e==="undirected",s=t._edges.values();let o=0,l,u;for(;l=s.next(),l.done!==!0;)u=l.value,u.undirected===r&&(i[o++]=u.key);return i}function Vj(t,e,n,i){if(e.size===0)return;const r=n!=="mixed"&&n!==e.type,s=n==="undirected";let o,l,u=!1;const f=e._edges.values();for(;o=f.next(),o.done!==!0;){if(l=o.value,r&&l.undirected!==s)continue;const{key:h,attributes:p,source:g,target:O}=l;if(u=i(h,p,g.key,O.key,g.attributes,O.attributes,l.undirected),t&&u)return h}}function n9(t,e){if(t.size===0)return Ci.empty();const n=e!=="mixed"&&e!==t.type,i=e==="undirected",r=t._edges.values();return new Ci(function(){let o,l;for(;;){if(o=r.next(),o.done)return o;if(l=o.value,!(n&&l.undirected!==i))break}return{value:{edge:l.key,attributes:l.attributes,source:l.source.key,target:l.target.key,sourceAttributes:l.source.attributes,targetAttributes:l.target.attributes,undirected:l.undirected},done:!1}})}function Q1(t,e,n,i,r,s){const o=e?K8:H8;let l;if(n!=="undirected"&&(i!=="out"&&(l=o(t,r.in,s),t&&l)||i!=="in"&&(l=o(t,r.out,s,i?void 0:r.key),t&&l))||n!=="directed"&&(l=o(t,r.undirected,s),t&&l))return l}function i9(t,e,n,i){const r=[];return Q1(!1,t,e,n,i,function(s){r.push(s)}),r}function r9(t,e,n){let i=Ci.empty();return t!=="undirected"&&(e!=="out"&&typeof n.in<"u"&&(i=ys(i,G0(n.in))),e!=="in"&&typeof n.out<"u"&&(i=ys(i,G0(n.out,e?void 0:n.key)))),t!=="directed"&&typeof n.undirected<"u"&&(i=ys(i,G0(n.undirected))),i}function A1(t,e,n,i,r,s,o){const l=n?e9:J8;let u;if(e!=="undirected"&&(typeof r.in<"u"&&i!=="out"&&(u=l(t,r.in,s,o),t&&u)||typeof r.out<"u"&&i!=="in"&&(i||r.key!==s)&&(u=l(t,r.out,s,o),t&&u))||e!=="directed"&&typeof r.undirected<"u"&&(u=l(t,r.undirected,s,o),t&&u))return u}function s9(t,e,n,i,r){const s=[];return A1(!1,t,e,n,i,r,function(o){s.push(o)}),s}function o9(t,e,n,i){let r=Ci.empty();return t!=="undirected"&&(typeof n.in<"u"&&e!=="out"&&i in n.in&&(r=ys(r,V0(n.in,i))),typeof n.out<"u"&&e!=="in"&&i in n.out&&(e||n.key!==i)&&(r=ys(r,V0(n.out,i)))),t!=="directed"&&typeof n.undirected<"u"&&i in n.undirected&&(r=ys(r,V0(n.undirected,i))),r}function a9(t,e){const{name:n,type:i,direction:r}=e;t.prototype[n]=function(s,o){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return[];if(!arguments.length)return t9(this,i);if(arguments.length===1){s=""+s;const l=this._nodes.get(s);if(typeof l>"u")throw new Oe(`Graph.${n}: could not find the "${s}" node in the graph.`);return i9(this.multi,i==="mixed"?this.type:i,r,l)}if(arguments.length===2){s=""+s,o=""+o;const l=this._nodes.get(s);if(!l)throw new Oe(`Graph.${n}:  could not find the "${s}" source node in the graph.`);if(!this._nodes.has(o))throw new Oe(`Graph.${n}:  could not find the "${o}" target node in the graph.`);return s9(i,this.multi,r,l,o)}throw new xe(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function l9(t,e){const{name:n,type:i,direction:r}=e,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(f,h,p){if(!(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)){if(arguments.length===1)return p=f,Vj(!1,this,i,p);if(arguments.length===2){f=""+f,p=h;const g=this._nodes.get(f);if(typeof g>"u")throw new Oe(`Graph.${s}: could not find the "${f}" node in the graph.`);return Q1(!1,this.multi,i==="mixed"?this.type:i,r,g,p)}if(arguments.length===3){f=""+f,h=""+h;const g=this._nodes.get(f);if(!g)throw new Oe(`Graph.${s}:  could not find the "${f}" source node in the graph.`);if(!this._nodes.has(h))throw new Oe(`Graph.${s}:  could not find the "${h}" target node in the graph.`);return A1(!1,i,this.multi,r,g,h,p)}throw new xe(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const o="map"+n[0].toUpperCase()+n.slice(1);t.prototype[o]=function(){const f=Array.prototype.slice.call(arguments),h=f.pop();let p;if(f.length===0){let g=0;i!=="directed"&&(g+=this.undirectedSize),i!=="undirected"&&(g+=this.directedSize),p=new Array(g);let O=0;f.push((v,x,S,k,$,E,T)=>{p[O++]=h(v,x,S,k,$,E,T)})}else p=[],f.push((g,O,v,x,S,k,$)=>{p.push(h(g,O,v,x,S,k,$))});return this[s].apply(this,f),p};const l="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[l]=function(){const f=Array.prototype.slice.call(arguments),h=f.pop(),p=[];return f.push((g,O,v,x,S,k,$)=>{h(g,O,v,x,S,k,$)&&p.push(g)}),this[s].apply(this,f),p};const u="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(){let f=Array.prototype.slice.call(arguments);if(f.length<2||f.length>4)throw new xe(`Graph.${u}: invalid number of arguments (expecting 2, 3 or 4 and got ${f.length}).`);if(typeof f[f.length-1]=="function"&&typeof f[f.length-2]!="function")throw new xe(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let h,p;f.length===2?(h=f[0],p=f[1],f=[]):f.length===3?(h=f[1],p=f[2],f=[f[0]]):f.length===4&&(h=f[2],p=f[3],f=[f[0],f[1]]);let g=p;return f.push((O,v,x,S,k,$,E)=>{g=h(g,O,v,x,S,k,$,E)}),this[s].apply(this,f),g}}function c9(t,e){const{name:n,type:i,direction:r}=e,s="find"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(u,f,h){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return!1;if(arguments.length===1)return h=u,Vj(!0,this,i,h);if(arguments.length===2){u=""+u,h=f;const p=this._nodes.get(u);if(typeof p>"u")throw new Oe(`Graph.${s}: could not find the "${u}" node in the graph.`);return Q1(!0,this.multi,i==="mixed"?this.type:i,r,p,h)}if(arguments.length===3){u=""+u,f=""+f;const p=this._nodes.get(u);if(!p)throw new Oe(`Graph.${s}:  could not find the "${u}" source node in the graph.`);if(!this._nodes.has(f))throw new Oe(`Graph.${s}:  could not find the "${f}" target node in the graph.`);return A1(!0,i,this.multi,r,p,f,h)}throw new xe(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const o="some"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(){const u=Array.prototype.slice.call(arguments),f=u.pop();return u.push((p,g,O,v,x,S,k)=>f(p,g,O,v,x,S,k)),!!this[s].apply(this,u)};const l="every"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[l]=function(){const u=Array.prototype.slice.call(arguments),f=u.pop();return u.push((p,g,O,v,x,S,k)=>!f(p,g,O,v,x,S,k)),!this[s].apply(this,u)}}function u9(t,e){const{name:n,type:i,direction:r}=e,s=n.slice(0,-1)+"Entries";t.prototype[s]=function(o,l){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return Ci.empty();if(!arguments.length)return n9(this,i);if(arguments.length===1){o=""+o;const u=this._nodes.get(o);if(!u)throw new Oe(`Graph.${s}: could not find the "${o}" node in the graph.`);return r9(i,r,u)}if(arguments.length===2){o=""+o,l=""+l;const u=this._nodes.get(o);if(!u)throw new Oe(`Graph.${s}:  could not find the "${o}" source node in the graph.`);if(!this._nodes.has(l))throw new Oe(`Graph.${s}:  could not find the "${l}" target node in the graph.`);return o9(i,r,u,l)}throw new xe(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function f9(t){F8.forEach(e=>{a9(t,e),l9(t,e),c9(t,e),u9(t,e)})}const d9=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function eO(){this.A=null,this.B=null}eO.prototype.wrap=function(t){this.A===null?this.A=t:this.B===null&&(this.B=t)};eO.prototype.has=function(t){return this.A!==null&&t in this.A||this.B!==null&&t in this.B};function pf(t,e,n,i,r){for(const s in i){const o=i[s],l=o.source,u=o.target,f=l===n?u:l;if(e&&e.has(f.key))continue;const h=r(f.key,f.attributes);if(t&&h)return f.key}}function N1(t,e,n,i,r){if(e!=="mixed"){if(e==="undirected")return pf(t,null,i,i.undirected,r);if(typeof n=="string")return pf(t,null,i,i[n],r)}const s=new eO;let o;if(e!=="undirected"){if(n!=="out"){if(o=pf(t,null,i,i.in,r),t&&o)return o;s.wrap(i.in)}if(n!=="in"){if(o=pf(t,s,i,i.out,r),t&&o)return o;s.wrap(i.out)}}if(e!=="directed"&&(o=pf(t,s,i,i.undirected,r),t&&o))return o}function h9(t,e,n){if(t!=="mixed"){if(t==="undirected")return Object.keys(n.undirected);if(typeof e=="string")return Object.keys(n[e])}const i=[];return N1(!1,t,e,n,function(r){i.push(r)}),i}function gf(t,e,n){const i=Object.keys(n),r=i.length;let s=0;return new Ci(function(){let l=null;do{if(s>=r)return t&&t.wrap(n),{done:!0};const u=n[i[s++]],f=u.source,h=u.target;if(l=f===e?h:f,t&&t.has(l.key)){l=null;continue}}while(l===null);return{done:!1,value:{neighbor:l.key,attributes:l.attributes}}})}function p9(t,e,n){if(t!=="mixed"){if(t==="undirected")return gf(null,n,n.undirected);if(typeof e=="string")return gf(null,n,n[e])}let i=Ci.empty();const r=new eO;return t!=="undirected"&&(e!=="out"&&(i=ys(i,gf(r,n,n.in))),e!=="in"&&(i=ys(i,gf(r,n,n.out)))),t!=="directed"&&(i=ys(i,gf(r,n,n.undirected))),i}function g9(t,e){const{name:n,type:i,direction:r}=e;t.prototype[n]=function(s){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return[];s=""+s;const o=this._nodes.get(s);if(typeof o>"u")throw new Oe(`Graph.${n}: could not find the "${s}" node in the graph.`);return h9(i==="mixed"?this.type:i,r,o)}}function m9(t,e){const{name:n,type:i,direction:r}=e,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(f,h){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return;f=""+f;const p=this._nodes.get(f);if(typeof p>"u")throw new Oe(`Graph.${s}: could not find the "${f}" node in the graph.`);N1(!1,i==="mixed"?this.type:i,r,p,h)};const o="map"+n[0].toUpperCase()+n.slice(1);t.prototype[o]=function(f,h){const p=[];return this[s](f,(g,O)=>{p.push(h(g,O))}),p};const l="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[l]=function(f,h){const p=[];return this[s](f,(g,O)=>{h(g,O)&&p.push(g)}),p};const u="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(f,h,p){if(arguments.length<3)throw new xe(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let g=p;return this[s](f,(O,v)=>{g=h(g,O,v)}),g}}function O9(t,e){const{name:n,type:i,direction:r}=e,s=n[0].toUpperCase()+n.slice(1,-1),o="find"+s;t.prototype[o]=function(f,h){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return;f=""+f;const p=this._nodes.get(f);if(typeof p>"u")throw new Oe(`Graph.${o}: could not find the "${f}" node in the graph.`);return N1(!0,i==="mixed"?this.type:i,r,p,h)};const l="some"+s;t.prototype[l]=function(f,h){return!!this[o](f,h)};const u="every"+s;t.prototype[u]=function(f,h){return!this[o](f,(g,O)=>!h(g,O))}}function y9(t,e){const{name:n,type:i,direction:r}=e,s=n.slice(0,-1)+"Entries";t.prototype[s]=function(o){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return Ci.empty();o=""+o;const l=this._nodes.get(o);if(typeof l>"u")throw new Oe(`Graph.${s}: could not find the "${o}" node in the graph.`);return p9(i==="mixed"?this.type:i,r,l)}}function v9(t){d9.forEach(e=>{g9(t,e),m9(t,e),O9(t,e),y9(t,e)})}function zp(t,e,n,i,r){const s=i._nodes.values(),o=i.type;let l,u,f,h,p,g;for(;l=s.next(),l.done!==!0;){let O=!1;if(u=l.value,o!=="undirected"){h=u.out;for(f in h){p=h[f];do g=p.target,O=!0,r(u.key,g.key,u.attributes,g.attributes,p.key,p.attributes,p.undirected),p=p.next;while(p)}}if(o!=="directed"){h=u.undirected;for(f in h)if(!(e&&u.key>f)){p=h[f];do g=p.target,g.key!==f&&(g=p.source),O=!0,r(u.key,g.key,u.attributes,g.attributes,p.key,p.attributes,p.undirected),p=p.next;while(p)}}n&&!O&&r(u.key,null,u.attributes,null,null,null,null)}}function b9(t,e){const n={key:t};return Dj(e.attributes)||(n.attributes=Yt({},e.attributes)),n}function x9(t,e,n){const i={key:e,source:n.source.key,target:n.target.key};return Dj(n.attributes)||(i.attributes=Yt({},n.attributes)),t==="mixed"&&n.undirected&&(i.undirected=!0),i}function w9(t){if(!sn(t))throw new xe('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in t))throw new xe("Graph.import: serialized node is missing its key.");if("attributes"in t&&(!sn(t.attributes)||t.attributes===null))throw new xe("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function S9(t){if(!sn(t))throw new xe('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in t))throw new xe("Graph.import: serialized edge is missing its source.");if(!("target"in t))throw new xe("Graph.import: serialized edge is missing its target.");if("attributes"in t&&(!sn(t.attributes)||t.attributes===null))throw new xe("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in t&&typeof t.undirected!="boolean")throw new xe("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const k9=T8(),E9=new Set(["directed","undirected","mixed"]),a_=new Set(["domain","_events","_eventsCount","_maxListeners"]),T9=[{name:t=>`${t}Edge`,generateKey:!0},{name:t=>`${t}DirectedEdge`,generateKey:!0,type:"directed"},{name:t=>`${t}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:t=>`${t}EdgeWithKey`},{name:t=>`${t}DirectedEdgeWithKey`,type:"directed"},{name:t=>`${t}UndirectedEdgeWithKey`,type:"undirected"}],C9={allowSelfLoops:!0,multi:!1,type:"mixed"};function $9(t,e,n){if(n&&!sn(n))throw new xe(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(e=""+e,n=n||{},t._nodes.has(e))throw new Re(`Graph.addNode: the "${e}" node already exist in the graph.`);const i=new t.NodeDataClass(e,n);return t._nodes.set(e,i),t.emit("nodeAdded",{key:e,attributes:n}),i}function l_(t,e,n){const i=new t.NodeDataClass(e,n);return t._nodes.set(e,i),t.emit("nodeAdded",{key:e,attributes:n}),i}function Uj(t,e,n,i,r,s,o,l){if(!i&&t.type==="undirected")throw new Re(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(i&&t.type==="directed")throw new Re(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(l&&!sn(l))throw new xe(`Graph.${e}: invalid attributes. Expecting an object but got "${l}"`);if(s=""+s,o=""+o,l=l||{},!t.allowSelfLoops&&s===o)throw new Re(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const u=t._nodes.get(s),f=t._nodes.get(o);if(!u)throw new Oe(`Graph.${e}: source node "${s}" not found.`);if(!f)throw new Oe(`Graph.${e}: target node "${o}" not found.`);const h={key:null,undirected:i,source:s,target:o,attributes:l};if(n)r=t._edgeKeyGenerator();else if(r=""+r,t._edges.has(r))throw new Re(`Graph.${e}: the "${r}" edge already exists in the graph.`);if(!t.multi&&(i?typeof u.undirected[o]<"u":typeof u.out[o]<"u"))throw new Re(`Graph.${e}: an edge linking "${s}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const p=new Yc(i,r,u,f,l);t._edges.set(r,p);const g=s===o;return i?(u.undirectedDegree++,f.undirectedDegree++,g&&(u.undirectedLoops++,t._undirectedSelfLoopCount++)):(u.outDegree++,f.inDegree++,g&&(u.directedLoops++,t._directedSelfLoopCount++)),t.multi?p.attachMulti():p.attach(),i?t._undirectedSize++:t._directedSize++,h.key=r,t.emit("edgeAdded",h),r}function _9(t,e,n,i,r,s,o,l,u){if(!i&&t.type==="undirected")throw new Re(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(i&&t.type==="directed")throw new Re(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(l){if(u){if(typeof l!="function")throw new xe(`Graph.${e}: invalid updater function. Expecting a function but got "${l}"`)}else if(!sn(l))throw new xe(`Graph.${e}: invalid attributes. Expecting an object but got "${l}"`)}s=""+s,o=""+o;let f;if(u&&(f=l,l=void 0),!t.allowSelfLoops&&s===o)throw new Re(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let h=t._nodes.get(s),p=t._nodes.get(o),g,O;if(!n&&(g=t._edges.get(r),g)){if((g.source.key!==s||g.target.key!==o)&&(!i||g.source.key!==o||g.target.key!==s))throw new Re(`Graph.${e}: inconsistency detected when attempting to merge the "${r}" edge with "${s}" source & "${o}" target vs. ("${g.source.key}", "${g.target.key}").`);O=g}if(!O&&!t.multi&&h&&(O=i?h.undirected[o]:h.out[o]),O){const $=[O.key,!1,!1,!1];if(u?!f:!l)return $;if(u){const E=O.attributes;O.attributes=f(E),t.emit("edgeAttributesUpdated",{type:"replace",key:O.key,attributes:O.attributes})}else Yt(O.attributes,l),t.emit("edgeAttributesUpdated",{type:"merge",key:O.key,attributes:O.attributes,data:l});return $}l=l||{},u&&f&&(l=f(l));const v={key:null,undirected:i,source:s,target:o,attributes:l};if(n)r=t._edgeKeyGenerator();else if(r=""+r,t._edges.has(r))throw new Re(`Graph.${e}: the "${r}" edge already exists in the graph.`);let x=!1,S=!1;h||(h=l_(t,s,{}),x=!0,s===o&&(p=h,S=!0)),p||(p=l_(t,o,{}),S=!0),g=new Yc(i,r,h,p,l),t._edges.set(r,g);const k=s===o;return i?(h.undirectedDegree++,p.undirectedDegree++,k&&(h.undirectedLoops++,t._undirectedSelfLoopCount++)):(h.outDegree++,p.inDegree++,k&&(h.directedLoops++,t._directedSelfLoopCount++)),t.multi?g.attachMulti():g.attach(),i?t._undirectedSize++:t._directedSize++,v.key=r,t.emit("edgeAdded",v),[r,!0,x,S]}function $l(t,e){t._edges.delete(e.key);const{source:n,target:i,attributes:r}=e,s=e.undirected,o=n===i;s?(n.undirectedDegree--,i.undirectedDegree--,o&&(n.undirectedLoops--,t._undirectedSelfLoopCount--)):(n.outDegree--,i.inDegree--,o&&(n.directedLoops--,t._directedSelfLoopCount--)),t.multi?e.detachMulti():e.detach(),s?t._undirectedSize--:t._directedSize--,t.emit("edgeDropped",{key:e.key,attributes:r,source:n.key,target:i.key,undirected:s})}class dt extends jj.EventEmitter{constructor(e){if(super(),e=Yt({},C9,e),typeof e.multi!="boolean")throw new xe(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!E9.has(e.type))throw new xe(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new xe(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const n=e.type==="mixed"?zj:e.type==="directed"?Xj:Zj;vi(this,"NodeDataClass",n);const i="geid_"+k9()+"_";let r=0;const s=()=>{let o;do o=i+r++;while(this._edges.has(o));return o};vi(this,"_attributes",{}),vi(this,"_nodes",new Map),vi(this,"_edges",new Map),vi(this,"_directedSize",0),vi(this,"_undirectedSize",0),vi(this,"_directedSelfLoopCount",0),vi(this,"_undirectedSelfLoopCount",0),vi(this,"_edgeKeyGenerator",s),vi(this,"_options",e),a_.forEach(o=>vi(this,o,this[o])),Xi(this,"order",()=>this._nodes.size),Xi(this,"size",()=>this._edges.size),Xi(this,"directedSize",()=>this._directedSize),Xi(this,"undirectedSize",()=>this._undirectedSize),Xi(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Xi(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Xi(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Xi(this,"multi",this._options.multi),Xi(this,"type",this._options.type),Xi(this,"allowSelfLoops",this._options.allowSelfLoops),Xi(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,n){if(this.type==="undirected")return!1;if(arguments.length===1){const i=""+e,r=this._edges.get(i);return!!r&&!r.undirected}else if(arguments.length===2){e=""+e,n=""+n;const i=this._nodes.get(e);return i?i.out.hasOwnProperty(n):!1}throw new xe(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,n){if(this.type==="directed")return!1;if(arguments.length===1){const i=""+e,r=this._edges.get(i);return!!r&&r.undirected}else if(arguments.length===2){e=""+e,n=""+n;const i=this._nodes.get(e);return i?i.undirected.hasOwnProperty(n):!1}throw new xe(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,n){if(arguments.length===1){const i=""+e;return this._edges.has(i)}else if(arguments.length===2){e=""+e,n=""+n;const i=this._nodes.get(e);return i?typeof i.out<"u"&&i.out.hasOwnProperty(n)||typeof i.undirected<"u"&&i.undirected.hasOwnProperty(n):!1}throw new xe(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,n){if(this.type==="undirected")return;if(e=""+e,n=""+n,this.multi)throw new Re("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const i=this._nodes.get(e);if(!i)throw new Oe(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(n))throw new Oe(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const r=i.out&&i.out[n]||void 0;if(r)return r.key}undirectedEdge(e,n){if(this.type==="directed")return;if(e=""+e,n=""+n,this.multi)throw new Re("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const i=this._nodes.get(e);if(!i)throw new Oe(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(n))throw new Oe(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const r=i.undirected&&i.undirected[n]||void 0;if(r)return r.key}edge(e,n){if(this.multi)throw new Re("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,n=""+n;const i=this._nodes.get(e);if(!i)throw new Oe(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(n))throw new Oe(`Graph.edge: could not find the "${n}" target node in the graph.`);const r=i.out&&i.out[n]||i.undirected&&i.undirected[n]||void 0;if(r)return r.key}areDirectedNeighbors(e,n){e=""+e,n=""+n;const i=this._nodes.get(e);if(!i)throw new Oe(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:n in i.in||n in i.out}areOutNeighbors(e,n){e=""+e,n=""+n;const i=this._nodes.get(e);if(!i)throw new Oe(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:n in i.out}areInNeighbors(e,n){e=""+e,n=""+n;const i=this._nodes.get(e);if(!i)throw new Oe(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:n in i.in}areUndirectedNeighbors(e,n){e=""+e,n=""+n;const i=this._nodes.get(e);if(!i)throw new Oe(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:n in i.undirected}areNeighbors(e,n){e=""+e,n=""+n;const i=this._nodes.get(e);if(!i)throw new Oe(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(n in i.in||n in i.out)||this.type!=="directed"&&n in i.undirected}areInboundNeighbors(e,n){e=""+e,n=""+n;const i=this._nodes.get(e);if(!i)throw new Oe(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&n in i.in||this.type!=="directed"&&n in i.undirected}areOutboundNeighbors(e,n){e=""+e,n=""+n;const i=this._nodes.get(e);if(!i)throw new Oe(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&n in i.out||this.type!=="directed"&&n in i.undirected}inDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let i=0;return this.type!=="directed"&&(i+=n.undirectedDegree),this.type!=="undirected"&&(i+=n.inDegree),i}outboundDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let i=0;return this.type!=="directed"&&(i+=n.undirectedDegree),this.type!=="undirected"&&(i+=n.outDegree),i}degree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.degree: could not find the "${e}" node in the graph.`);let i=0;return this.type!=="directed"&&(i+=n.undirectedDegree),this.type!=="undirected"&&(i+=n.inDegree+n.outDegree),i}inDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let i=0,r=0;return this.type!=="directed"&&(i+=n.undirectedDegree,r+=n.undirectedLoops*2),this.type!=="undirected"&&(i+=n.inDegree,r+=n.directedLoops),i-r}outboundDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let i=0,r=0;return this.type!=="directed"&&(i+=n.undirectedDegree,r+=n.undirectedLoops*2),this.type!=="undirected"&&(i+=n.outDegree,r+=n.directedLoops),i-r}degreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let i=0,r=0;return this.type!=="directed"&&(i+=n.undirectedDegree,r+=n.undirectedLoops*2),this.type!=="undirected"&&(i+=n.inDegree+n.outDegree,r+=n.directedLoops*2),i-r}source(e){e=""+e;const n=this._edges.get(e);if(!n)throw new Oe(`Graph.source: could not find the "${e}" edge in the graph.`);return n.source.key}target(e){e=""+e;const n=this._edges.get(e);if(!n)throw new Oe(`Graph.target: could not find the "${e}" edge in the graph.`);return n.target.key}extremities(e){e=""+e;const n=this._edges.get(e);if(!n)throw new Oe(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(e,n){e=""+e,n=""+n;const i=this._edges.get(n);if(!i)throw new Oe(`Graph.opposite: could not find the "${n}" edge in the graph.`);const r=i.source.key,s=i.target.key;if(e===r)return s;if(e===s)return r;throw new Oe(`Graph.opposite: the "${e}" node is not attached to the "${n}" edge (${r}, ${s}).`)}hasExtremity(e,n){e=""+e,n=""+n;const i=this._edges.get(e);if(!i)throw new Oe(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return i.source.key===n||i.target.key===n}isUndirected(e){e=""+e;const n=this._edges.get(e);if(!n)throw new Oe(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return n.undirected}isDirected(e){e=""+e;const n=this._edges.get(e);if(!n)throw new Oe(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!n.undirected}isSelfLoop(e){e=""+e;const n=this._edges.get(e);if(!n)throw new Oe(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return n.source===n.target}addNode(e,n){return $9(this,e,n).key}mergeNode(e,n){if(n&&!sn(n))throw new xe(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);e=""+e,n=n||{};let i=this._nodes.get(e);return i?(n&&(Yt(i.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:i.attributes,data:n})),[e,!1]):(i=new this.NodeDataClass(e,n),this._nodes.set(e,i),this.emit("nodeAdded",{key:e,attributes:n}),[e,!0])}updateNode(e,n){if(n&&typeof n!="function")throw new xe(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);e=""+e;let i=this._nodes.get(e);if(i){if(n){const s=i.attributes;i.attributes=n(s),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:i.attributes})}return[e,!1]}const r=n?n({}):{};return i=new this.NodeDataClass(e,r),this._nodes.set(e,i),this.emit("nodeAdded",{key:e,attributes:r}),[e,!0]}dropNode(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new Oe(`Graph.dropNode: could not find the "${e}" node in the graph.`);let i;if(this.type!=="undirected"){for(const r in n.out){i=n.out[r];do $l(this,i),i=i.next;while(i)}for(const r in n.in){i=n.in[r];do $l(this,i),i=i.next;while(i)}}if(this.type!=="directed")for(const r in n.undirected){i=n.undirected[r];do $l(this,i),i=i.next;while(i)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:n.attributes})}dropEdge(e){let n;if(arguments.length>1){const i=""+arguments[0],r=""+arguments[1];if(n=Ei(this,i,r,this.type),!n)throw new Oe(`Graph.dropEdge: could not find the "${i}" -> "${r}" edge in the graph.`)}else if(e=""+e,n=this._edges.get(e),!n)throw new Oe(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return $l(this,n),this}dropDirectedEdge(e,n){if(arguments.length<2)throw new Re("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Re("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,n=""+n;const i=Ei(this,e,n,"directed");if(!i)throw new Oe(`Graph.dropDirectedEdge: could not find a "${e}" -> "${n}" edge in the graph.`);return $l(this,i),this}dropUndirectedEdge(e,n){if(arguments.length<2)throw new Re("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Re("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const i=Ei(this,e,n,"undirected");if(!i)throw new Oe(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${n}" edge in the graph.`);return $l(this,i),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let n;for(;n=e.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,n){return this._attributes[e]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,n){if(typeof n!="function")throw new xe("Graph.updateAttribute: updater should be a function.");const i=this._attributes[e];return this._attributes[e]=n(i),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!sn(e))throw new xe("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!sn(e))throw new xe("Graph.mergeAttributes: provided attributes are not a plain object.");return Yt(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")throw new xe("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,n){if(typeof e!="function")throw new xe("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!o_(n))throw new xe("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const i=this._nodes.values();let r,s;for(;r=i.next(),r.done!==!0;)s=r.value,s.attributes=e(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(e,n){if(typeof e!="function")throw new xe("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!o_(n))throw new xe("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const i=this._edges.values();let r,s,o,l;for(;r=i.next(),r.done!==!0;)s=r.value,o=s.source,l=s.target,s.attributes=e(s.key,s.attributes,o.key,l.key,o.attributes,l.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new xe("Graph.forEachAdjacencyEntry: expecting a callback.");zp(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new xe("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");zp(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!="function")throw new xe("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");zp(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new xe("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");zp(!1,!0,!0,this,e)}nodes(){return typeof Array.from=="function"?Array.from(this._nodes.keys()):Lj(this._nodes.keys(),this._nodes.size)}forEachNode(e){if(typeof e!="function")throw new xe("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let i,r;for(;i=n.next(),i.done!==!0;)r=i.value,e(r.key,r.attributes)}findNode(e){if(typeof e!="function")throw new xe("Graph.findNode: expecting a callback.");const n=this._nodes.values();let i,r;for(;i=n.next(),i.done!==!0;)if(r=i.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!="function")throw new xe("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let i,r;const s=new Array(this.order);let o=0;for(;i=n.next(),i.done!==!0;)r=i.value,s[o++]=e(r.key,r.attributes);return s}someNode(e){if(typeof e!="function")throw new xe("Graph.someNode: expecting a callback.");const n=this._nodes.values();let i,r;for(;i=n.next(),i.done!==!0;)if(r=i.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new xe("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let i,r;for(;i=n.next(),i.done!==!0;)if(r=i.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new xe("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let i,r;const s=[];for(;i=n.next(),i.done!==!0;)r=i.value,e(r.key,r.attributes)&&s.push(r.key);return s}reduceNodes(e,n){if(typeof e!="function")throw new xe("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new xe("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let i=n;const r=this._nodes.values();let s,o;for(;s=r.next(),s.done!==!0;)o=s.value,i=e(i,o.key,o.attributes);return i}nodeEntries(){const e=this._nodes.values();return new Ci(()=>{const n=e.next();if(n.done)return n;const i=n.value;return{value:{node:i.key,attributes:i.attributes},done:!1}})}export(){const e=new Array(this._nodes.size);let n=0;this._nodes.forEach((r,s)=>{e[n++]=b9(s,r)});const i=new Array(this._edges.size);return n=0,this._edges.forEach((r,s)=>{i[n++]=x9(this.type,s,r)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:i}}import(e,n=!1){if(e instanceof dt)return e.forEachNode((u,f)=>{n?this.mergeNode(u,f):this.addNode(u,f)}),e.forEachEdge((u,f,h,p,g,O,v)=>{n?v?this.mergeUndirectedEdgeWithKey(u,h,p,f):this.mergeDirectedEdgeWithKey(u,h,p,f):v?this.addUndirectedEdgeWithKey(u,h,p,f):this.addDirectedEdgeWithKey(u,h,p,f)}),this;if(!sn(e))throw new xe("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!sn(e.attributes))throw new xe("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let i,r,s,o,l;if(e.nodes){if(s=e.nodes,!Array.isArray(s))throw new xe("Graph.import: invalid nodes. Expecting an array.");for(i=0,r=s.length;i<r;i++){o=s[i],w9(o);const{key:u,attributes:f}=o;n?this.mergeNode(u,f):this.addNode(u,f)}}if(e.edges){let u=!1;if(this.type==="undirected"&&(u=!0),s=e.edges,!Array.isArray(s))throw new xe("Graph.import: invalid edges. Expecting an array.");for(i=0,r=s.length;i<r;i++){l=s[i],S9(l);const{source:f,target:h,attributes:p,undirected:g=u}=l;let O;"key"in l?(O=n?g?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:g?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,O.call(this,l.key,f,h,p)):(O=n?g?this.mergeUndirectedEdge:this.mergeDirectedEdge:g?this.addUndirectedEdge:this.addDirectedEdge,O.call(this,f,h,p))}}return this}nullCopy(e){const n=new dt(Yt({},this._options,e));return n.replaceAttributes(Yt({},this.getAttributes())),n}emptyCopy(e){const n=this.nullCopy(e);return this._nodes.forEach((i,r)=>{const s=Yt({},i.attributes);i=new n.NodeDataClass(r,s),n._nodes.set(r,i)}),n}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new Re(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new Re("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new Re("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const n=this.emptyCopy(e),i=this._edges.values();let r,s;for(;r=i.next(),r.done!==!0;)s=r.value,Uj(n,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,Yt({},s.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((s,o)=>{e[o]=s.attributes});const n={},i={};this._edges.forEach((s,o)=>{const l=s.undirected?"--":"->";let u="",f=s.source.key,h=s.target.key,p;s.undirected&&f>h&&(p=f,f=h,h=p);const g=`(${f})${l}(${h})`;o.startsWith("geid_")?this.multi&&(typeof i[g]>"u"?i[g]=0:i[g]++,u+=`${i[g]}. `):u+=`[${o}]: `,u+=g,n[u]=s.attributes});const r={};for(const s in this)this.hasOwnProperty(s)&&!a_.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(r[s]=this[s]);return r.attributes=this._attributes,r.nodes=e,r.edges=n,vi(r,"constructor",this.constructor),r}}typeof Symbol<"u"&&(dt.prototype[Symbol.for("nodejs.util.inspect.custom")]=dt.prototype.inspect);T9.forEach(t=>{["add","merge","update"].forEach(e=>{const n=t.name(e),i=e==="add"?Uj:_9;t.generateKey?dt.prototype[n]=function(r,s,o){return i(this,n,!0,(t.type||this.type)==="undirected",null,r,s,o,e==="update")}:dt.prototype[n]=function(r,s,o,l){return i(this,n,!1,(t.type||this.type)==="undirected",r,s,o,l,e==="update")}})});D8(dt);W8(dt);f9(dt);v9(dt);class Yj extends dt{constructor(e){const n=Yt({type:"directed"},e);if("multi"in n&&n.multi!==!1)throw new xe("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new xe('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class qj extends dt{constructor(e){const n=Yt({type:"undirected"},e);if("multi"in n&&n.multi!==!1)throw new xe("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new xe('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class Wj extends dt{constructor(e){const n=Yt({multi:!0},e);if("multi"in n&&n.multi!==!0)throw new xe("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class Fj extends dt{constructor(e){const n=Yt({type:"directed",multi:!0},e);if("multi"in n&&n.multi!==!0)throw new xe("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new xe('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class Hj extends dt{constructor(e){const n=Yt({type:"undirected",multi:!0},e);if("multi"in n&&n.multi!==!0)throw new xe("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new xe('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function qc(t){t.from=function(e,n){const i=Yt({},e.options,n),r=new t(i);return r.import(e),r}}qc(dt);qc(Yj);qc(qj);qc(Wj);qc(Fj);qc(Hj);dt.Graph=dt;dt.DirectedGraph=Yj;dt.UndirectedGraph=qj;dt.MultiGraph=Wj;dt.MultiDirectedGraph=Fj;dt.MultiUndirectedGraph=Hj;dt.InvalidArgumentsGraphError=xe;dt.NotFoundGraphError=Oe;dt.UsageGraphError=Re;function Q9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function If(t){var e=Q9(t,"string");return typeof e=="symbol"?e:e+""}function gn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c_(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,If(i.key),i)}}function mn(t,e,n){return e&&c_(t.prototype,e),n&&c_(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function kc(t){return kc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kc(t)}function Kj(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kj=function(){return!!t})()}function A9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function N9(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return A9(t)}function Pi(t,e,n){return e=kc(e),N9(t,Kj()?Reflect.construct(e,n||[],kc(t).constructor):e.apply(t,n))}function qx(t,e){return qx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},qx(t,e)}function Ri(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qx(t,e)}function P9(t){if(Array.isArray(t))return t}function R9(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,r,s,o,l=[],u=!0,f=!1;try{if(s=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=s.call(n)).done)&&(l.push(i.value),l.length!==e);u=!0);}catch(h){f=!0,r=h}finally{try{if(!u&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw r}}return l}}function Wx(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Jj(t,e){if(t){if(typeof t=="string")return Wx(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wx(t,e):void 0}}function j9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ec(t,e){return P9(t)||R9(t,e)||Jj(t,e)||j9()}var U0={black:"#000000",silver:"#C0C0C0",gray:"#808080",grey:"#808080",white:"#FFFFFF",maroon:"#800000",red:"#FF0000",purple:"#800080",fuchsia:"#FF00FF",green:"#008000",lime:"#00FF00",olive:"#808000",yellow:"#FFFF00",navy:"#000080",blue:"#0000FF",teal:"#008080",aqua:"#00FFFF",darkblue:"#00008B",mediumblue:"#0000CD",darkgreen:"#006400",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",rebeccapurple:"#663399",mediumaquamarine:"#66CDAA",dimgray:"#696969",dimgrey:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",slategrey:"#708090",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370DB",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",palevioletred:"#DB7093",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",lightyellow:"#FFFFE0",ivory:"#FFFFF0"},eM=new Int8Array(4),Y0=new Int32Array(eM.buffer,0,1),M9=new Float32Array(eM.buffer,0,1),L9=/^\s*rgba?\s*\(/,D9=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function z9(t){var e=0,n=0,i=0,r=1;if(t[0]==="#")t.length===4?(e=parseInt(t.charAt(1)+t.charAt(1),16),n=parseInt(t.charAt(2)+t.charAt(2),16),i=parseInt(t.charAt(3)+t.charAt(3),16)):(e=parseInt(t.charAt(1)+t.charAt(2),16),n=parseInt(t.charAt(3)+t.charAt(4),16),i=parseInt(t.charAt(5)+t.charAt(6),16)),t.length===9&&(r=parseInt(t.charAt(7)+t.charAt(8),16)/255);else if(L9.test(t)){var s=t.match(D9);s&&(e=+s[1],n=+s[2],i=+s[3],s[4]&&(r=+s[4]))}return{r:e,g:n,b:i,a:r}}var rc={};for(var Xp in U0)rc[Xp]=jd(U0[Xp]),rc[U0[Xp]]=rc[Xp];function tM(t,e,n,i,r){return Y0[0]=i<<24|n<<16|e<<8|t,Y0[0]=Y0[0]&4278190079,M9[0]}function jd(t){if(t=t.toLowerCase(),typeof rc[t]<"u")return rc[t];var e=z9(t),n=e.r,i=e.g,r=e.b,s=e.a;s=s*255|0;var o=tM(n,i,r,s);return rc[t]=o,o}var q0={};function nM(t){if(typeof q0[t]<"u")return q0[t];var e=(t&16711680)>>>16,n=(t&65280)>>>8,i=t&255,r=255,s=tM(e,n,i,r);return q0[t]=s,s}function u_(t,e,n,i){return n+(e<<8)+(t<<16)}function f_(t,e,n,i,r,s){var o=Math.floor(n/s*r),l=Math.floor(t.drawingBufferHeight/s-i/s*r),u=new Uint8Array(4);t.bindFramebuffer(t.FRAMEBUFFER,e),t.readPixels(o,l,1,1,t.RGBA,t.UNSIGNED_BYTE,u);var f=Ec(u,4),h=f[0],p=f[1],g=f[2],O=f[3];return[h,p,g,O]}function ge(t,e,n){return(e=If(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function Ce(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?d_(Object(n),!0).forEach(function(i){ge(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d_(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function X9(t,e){for(;!{}.hasOwnProperty.call(t,e)&&(t=kc(t))!==null;);return t}function Fx(){return Fx=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=X9(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Fx.apply(null,arguments)}function iM(t,e,n,i){var r=Fx(kc(t.prototype),e,n);return typeof r=="function"?function(s){return r.apply(n,s)}:r}function Z9(t){return t.normalized?1:t.size}function W0(t){var e=0;return t.forEach(function(n){return e+=Z9(n)}),e}function rM(t,e,n){var i=t==="VERTEX"?e.VERTEX_SHADER:e.FRAGMENT_SHADER,r=e.createShader(i);if(r===null)throw new Error("loadShader: error while creating the shader");e.shaderSource(r,n),e.compileShader(r);var s=e.getShaderParameter(r,e.COMPILE_STATUS);if(!s){var o=e.getShaderInfoLog(r);throw e.deleteShader(r),new Error(`loadShader: error while compiling the shader:
`.concat(o,`
`).concat(n))}return r}function B9(t,e){return rM("VERTEX",t,e)}function I9(t,e){return rM("FRAGMENT",t,e)}function G9(t,e){var n=t.createProgram();if(n===null)throw new Error("loadProgram: error while creating the program.");var i,r;for(i=0,r=e.length;i<r;i++)t.attachShader(n,e[i]);t.linkProgram(n);var s=t.getProgramParameter(n,t.LINK_STATUS);if(!s){var o=t.getProgramInfoLog(n);throw t.deleteProgram(n),new Error("loadProgram: error while linking the program: ".concat(o))}return n}function h_(t){var e=t.gl,n=t.buffer,i=t.program,r=t.vertexShader,s=t.fragmentShader;e.deleteShader(r),e.deleteShader(s),e.deleteProgram(i),e.deleteBuffer(n)}var p_=`#define PICKING_MODE
`,V9=ge(ge(ge(ge(ge(ge(ge(ge({},WebGL2RenderingContext.BOOL,1),WebGL2RenderingContext.BYTE,1),WebGL2RenderingContext.UNSIGNED_BYTE,1),WebGL2RenderingContext.SHORT,2),WebGL2RenderingContext.UNSIGNED_SHORT,2),WebGL2RenderingContext.INT,4),WebGL2RenderingContext.UNSIGNED_INT,4),WebGL2RenderingContext.FLOAT,4),sM=(function(){function t(e,n,i){gn(this,t),ge(this,"array",new Float32Array),ge(this,"constantArray",new Float32Array),ge(this,"capacity",0),ge(this,"verticesCount",0);var r=this.getDefinition();if(this.VERTICES=r.VERTICES,this.VERTEX_SHADER_SOURCE=r.VERTEX_SHADER_SOURCE,this.FRAGMENT_SHADER_SOURCE=r.FRAGMENT_SHADER_SOURCE,this.UNIFORMS=r.UNIFORMS,this.ATTRIBUTES=r.ATTRIBUTES,this.METHOD=r.METHOD,this.CONSTANT_ATTRIBUTES="CONSTANT_ATTRIBUTES"in r?r.CONSTANT_ATTRIBUTES:[],this.CONSTANT_DATA="CONSTANT_DATA"in r?r.CONSTANT_DATA:[],this.isInstanced="CONSTANT_ATTRIBUTES"in r,this.ATTRIBUTES_ITEMS_COUNT=W0(this.ATTRIBUTES),this.STRIDE=this.VERTICES*this.ATTRIBUTES_ITEMS_COUNT,this.renderer=i,this.normalProgram=this.getProgramInfo("normal",e,r.VERTEX_SHADER_SOURCE,r.FRAGMENT_SHADER_SOURCE,null),this.pickProgram=n?this.getProgramInfo("pick",e,p_+r.VERTEX_SHADER_SOURCE,p_+r.FRAGMENT_SHADER_SOURCE,n):null,this.isInstanced){var s=W0(this.CONSTANT_ATTRIBUTES);if(this.CONSTANT_DATA.length!==this.VERTICES)throw new Error("Program: error while getting constant data (expected ".concat(this.VERTICES," items, received ").concat(this.CONSTANT_DATA.length," instead)"));this.constantArray=new Float32Array(this.CONSTANT_DATA.length*s);for(var o=0;o<this.CONSTANT_DATA.length;o++){var l=this.CONSTANT_DATA[o];if(l.length!==s)throw new Error("Program: error while getting constant data (one vector has ".concat(l.length," items instead of ").concat(s,")"));for(var u=0;u<l.length;u++)this.constantArray[o*s+u]=l[u]}this.STRIDE=this.ATTRIBUTES_ITEMS_COUNT}}return mn(t,[{key:"kill",value:function(){h_(this.normalProgram),this.pickProgram&&(h_(this.pickProgram),this.pickProgram=null)}},{key:"getProgramInfo",value:function(n,i,r,s,o){var l=this.getDefinition(),u=i.createBuffer();if(u===null)throw new Error("Program: error while creating the WebGL buffer.");var f=B9(i,r),h=I9(i,s),p=G9(i,[f,h]),g={};l.UNIFORMS.forEach(function(x){var S=i.getUniformLocation(p,x);S&&(g[x]=S)});var O={};l.ATTRIBUTES.forEach(function(x){O[x.name]=i.getAttribLocation(p,x.name)});var v;if("CONSTANT_ATTRIBUTES"in l&&(l.CONSTANT_ATTRIBUTES.forEach(function(x){O[x.name]=i.getAttribLocation(p,x.name)}),v=i.createBuffer(),v===null))throw new Error("Program: error while creating the WebGL constant buffer.");return{name:n,program:p,gl:i,frameBuffer:o,buffer:u,constantBuffer:v||{},uniformLocations:g,attributeLocations:O,isPicking:n==="pick",vertexShader:f,fragmentShader:h}}},{key:"bindProgram",value:function(n){var i=this,r=0,s=n.gl,o=n.buffer;this.isInstanced?(s.bindBuffer(s.ARRAY_BUFFER,n.constantBuffer),r=0,this.CONSTANT_ATTRIBUTES.forEach(function(l){return r+=i.bindAttribute(l,n,r,!1)}),s.bufferData(s.ARRAY_BUFFER,this.constantArray,s.STATIC_DRAW),s.bindBuffer(s.ARRAY_BUFFER,n.buffer),r=0,this.ATTRIBUTES.forEach(function(l){return r+=i.bindAttribute(l,n,r,!0)}),s.bufferData(s.ARRAY_BUFFER,this.array,s.DYNAMIC_DRAW)):(s.bindBuffer(s.ARRAY_BUFFER,o),r=0,this.ATTRIBUTES.forEach(function(l){return r+=i.bindAttribute(l,n,r)}),s.bufferData(s.ARRAY_BUFFER,this.array,s.DYNAMIC_DRAW)),s.bindBuffer(s.ARRAY_BUFFER,null)}},{key:"unbindProgram",value:function(n){var i=this;this.isInstanced?(this.CONSTANT_ATTRIBUTES.forEach(function(r){return i.unbindAttribute(r,n,!1)}),this.ATTRIBUTES.forEach(function(r){return i.unbindAttribute(r,n,!0)})):this.ATTRIBUTES.forEach(function(r){return i.unbindAttribute(r,n)})}},{key:"bindAttribute",value:function(n,i,r,s){var o=V9[n.type];if(typeof o!="number")throw new Error('Program.bind: yet unsupported attribute type "'.concat(n.type,'"'));var l=i.attributeLocations[n.name],u=i.gl;if(l!==-1){u.enableVertexAttribArray(l);var f=this.isInstanced?(s?this.ATTRIBUTES_ITEMS_COUNT:W0(this.CONSTANT_ATTRIBUTES))*Float32Array.BYTES_PER_ELEMENT:this.ATTRIBUTES_ITEMS_COUNT*Float32Array.BYTES_PER_ELEMENT;if(u.vertexAttribPointer(l,n.size,n.type,n.normalized||!1,f,r),this.isInstanced&&s)if(u instanceof WebGL2RenderingContext)u.vertexAttribDivisor(l,1);else{var h=u.getExtension("ANGLE_instanced_arrays");h&&h.vertexAttribDivisorANGLE(l,1)}}return n.size*o}},{key:"unbindAttribute",value:function(n,i,r){var s=i.attributeLocations[n.name],o=i.gl;if(s!==-1&&(o.disableVertexAttribArray(s),this.isInstanced&&r))if(o instanceof WebGL2RenderingContext)o.vertexAttribDivisor(s,0);else{var l=o.getExtension("ANGLE_instanced_arrays");l&&l.vertexAttribDivisorANGLE(s,0)}}},{key:"reallocate",value:function(n){n!==this.capacity&&(this.capacity=n,this.verticesCount=this.VERTICES*n,this.array=new Float32Array(this.isInstanced?this.capacity*this.ATTRIBUTES_ITEMS_COUNT:this.verticesCount*this.ATTRIBUTES_ITEMS_COUNT))}},{key:"hasNothingToRender",value:function(){return this.verticesCount===0}},{key:"renderProgram",value:function(n,i){var r=i.gl,s=i.program;r.enable(r.BLEND),r.useProgram(s),this.setUniforms(n,i),this.drawWebGL(this.METHOD,i)}},{key:"render",value:function(n){this.hasNothingToRender()||(this.pickProgram&&(this.pickProgram.gl.viewport(0,0,n.width*n.pixelRatio/n.downSizingRatio,n.height*n.pixelRatio/n.downSizingRatio),this.bindProgram(this.pickProgram),this.renderProgram(Ce(Ce({},n),{},{pixelRatio:n.pixelRatio/n.downSizingRatio}),this.pickProgram),this.unbindProgram(this.pickProgram)),this.normalProgram.gl.viewport(0,0,n.width*n.pixelRatio,n.height*n.pixelRatio),this.bindProgram(this.normalProgram),this.renderProgram(n,this.normalProgram),this.unbindProgram(this.normalProgram))}},{key:"drawWebGL",value:function(n,i){var r=i.gl,s=i.frameBuffer;if(r.bindFramebuffer(r.FRAMEBUFFER,s),!this.isInstanced)r.drawArrays(n,0,this.verticesCount);else if(r instanceof WebGL2RenderingContext)r.drawArraysInstanced(n,0,this.VERTICES,this.capacity);else{var o=r.getExtension("ANGLE_instanced_arrays");o&&o.drawArraysInstancedANGLE(n,0,this.VERTICES,this.capacity)}}}])})(),U9=(function(t){function e(){return gn(this,e),Pi(this,e,arguments)}return Ri(e,t),mn(e,[{key:"kill",value:function(){iM(e,"kill",this)([])}},{key:"process",value:function(i,r,s){var o=r*this.STRIDE;if(s.hidden){for(var l=o+this.STRIDE;o<l;o++)this.array[o]=0;return}return this.processVisibleItem(nM(i),o,s)}}])})(sM),P1=(function(t){function e(){var n;gn(this,e);for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return n=Pi(this,e,[].concat(r)),ge(n,"drawLabel",void 0),n}return Ri(e,t),mn(e,[{key:"kill",value:function(){iM(e,"kill",this)([])}},{key:"process",value:function(i,r,s,o,l){var u=r*this.STRIDE;if(l.hidden||s.hidden||o.hidden){for(var f=u+this.STRIDE;u<f;u++)this.array[u]=0;return}return this.processVisibleItem(nM(i),u,s,o,l)}}])})(sM);function Y9(t,e){return(function(){function n(i,r,s){gn(this,n),ge(this,"drawLabel",e),this.programs=t.map(function(o){return new o(i,r,s)})}return mn(n,[{key:"reallocate",value:function(r){this.programs.forEach(function(s){return s.reallocate(r)})}},{key:"process",value:function(r,s,o,l,u){this.programs.forEach(function(f){return f.process(r,s,o,l,u)})}},{key:"render",value:function(r){this.programs.forEach(function(s){return s.render(r)})}},{key:"kill",value:function(){this.programs.forEach(function(r){return r.kill()})}}])})()}function q9(t,e,n,i,r){var s=r.edgeLabelSize,o=r.edgeLabelFont,l=r.edgeLabelWeight,u=r.edgeLabelColor.attribute?e[r.edgeLabelColor.attribute]||r.edgeLabelColor.color||"#000":r.edgeLabelColor.color,f=e.label;if(f){t.fillStyle=u,t.font="".concat(l," ").concat(s,"px ").concat(o);var h=n.size,p=i.size,g=n.x,O=n.y,v=i.x,x=i.y,S=(g+v)/2,k=(O+x)/2,$=v-g,E=x-O,T=Math.sqrt($*$+E*E);if(!(T<h+p)){g+=$*h/T,O+=E*h/T,v-=$*p/T,x-=E*p/T,S=(g+v)/2,k=(O+x)/2,$=v-g,E=x-O,T=Math.sqrt($*$+E*E);var _=t.measureText(f).width;if(_>T){var Q="…";for(f=f+Q,_=t.measureText(f).width;_>T&&f.length>1;)f=f.slice(0,-2)+Q,_=t.measureText(f).width;if(f.length<4)return}var N;$>0?E>0?N=Math.acos($/T):N=Math.asin(E/T):E>0?N=Math.acos($/T)+Math.PI:N=Math.asin($/T)+Math.PI/2,t.save(),t.translate(S,k),t.rotate(N),t.fillText(f,-_/2,e.size/2+s),t.restore()}}}function oM(t,e,n){if(e.label){var i=n.labelSize,r=n.labelFont,s=n.labelWeight,o=n.labelColor.attribute?e[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;t.fillStyle=o,t.font="".concat(s," ").concat(i,"px ").concat(r),t.fillText(e.label,e.x+e.size+3,e.y+i/3)}}function W9(t,e,n){var i=n.labelSize,r=n.labelFont,s=n.labelWeight;t.font="".concat(s," ").concat(i,"px ").concat(r),t.fillStyle="#FFF",t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=8,t.shadowColor="#000";var o=2;if(typeof e.label=="string"){var l=t.measureText(e.label).width,u=Math.round(l+5),f=Math.round(i+2*o),h=Math.max(e.size,i/2)+o,p=Math.asin(f/2/h),g=Math.sqrt(Math.abs(Math.pow(h,2)-Math.pow(f/2,2)));t.beginPath(),t.moveTo(e.x+g,e.y+f/2),t.lineTo(e.x+h+u,e.y+f/2),t.lineTo(e.x+h+u,e.y-f/2),t.lineTo(e.x+g,e.y-f/2),t.arc(e.x,e.y,h,p,-p),t.closePath(),t.fill()}else t.beginPath(),t.arc(e.x,e.y,e.size+o,0,Math.PI*2),t.closePath(),t.fill();t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,oM(t,e,n)}var F9=`
precision highp float;

varying vec4 v_color;
varying vec2 v_diffVector;
varying float v_radius;

uniform float u_correctionRatio;

const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);

void main(void) {
  float border = u_correctionRatio * 2.0;
  float dist = length(v_diffVector) - v_radius + border;

  // No antialiasing for picking mode:
  #ifdef PICKING_MODE
  if (dist > border)
    gl_FragColor = transparent;
  else
    gl_FragColor = v_color;

  #else
  float t = 0.0;
  if (dist > border)
    t = 1.0;
  else if (dist > 0.0)
    t = dist / border;

  gl_FragColor = mix(v_color, transparent, t);
  #endif
}
`,H9=F9,K9=`
attribute vec4 a_id;
attribute vec4 a_color;
attribute vec2 a_position;
attribute float a_size;
attribute float a_angle;

uniform mat3 u_matrix;
uniform float u_sizeRatio;
uniform float u_correctionRatio;

varying vec4 v_color;
varying vec2 v_diffVector;
varying float v_radius;
varying float v_border;

const float bias = 255.0 / 254.0;

void main() {
  float size = a_size * u_correctionRatio / u_sizeRatio * 4.0;
  vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle));
  vec2 position = a_position + diffVector;
  gl_Position = vec4(
    (u_matrix * vec3(position, 1)).xy,
    0,
    1
  );

  v_diffVector = diffVector;
  v_radius = size / 2.0;

  #ifdef PICKING_MODE
  // For picking mode, we use the ID as the color:
  v_color = a_id;
  #else
  // For normal mode, we use the color:
  v_color = a_color;
  #endif

  v_color.a *= bias;
}
`,J9=K9,aM=WebGLRenderingContext,g_=aM.UNSIGNED_BYTE,F0=aM.FLOAT,e7=["u_sizeRatio","u_correctionRatio","u_matrix"],tO=(function(t){function e(){return gn(this,e),Pi(this,e,arguments)}return Ri(e,t),mn(e,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:J9,FRAGMENT_SHADER_SOURCE:H9,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:e7,ATTRIBUTES:[{name:"a_position",size:2,type:F0},{name:"a_size",size:1,type:F0},{name:"a_color",size:4,type:g_,normalized:!0},{name:"a_id",size:4,type:g_,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:F0}],CONSTANT_DATA:[[e.ANGLE_1],[e.ANGLE_2],[e.ANGLE_3]]}}},{key:"processVisibleItem",value:function(i,r,s){var o=this.array,l=jd(s.color);o[r++]=s.x,o[r++]=s.y,o[r++]=s.size,o[r++]=l,o[r++]=i}},{key:"setUniforms",value:function(i,r){var s=r.gl,o=r.uniformLocations,l=o.u_sizeRatio,u=o.u_correctionRatio,f=o.u_matrix;s.uniform1f(u,i.correctionRatio),s.uniform1f(l,i.sizeRatio),s.uniformMatrix3fv(f,!1,i.matrix)}}])})(U9);ge(tO,"ANGLE_1",0);ge(tO,"ANGLE_2",2*Math.PI/3);ge(tO,"ANGLE_3",4*Math.PI/3);var t7=`
precision mediump float;

varying vec4 v_color;

void main(void) {
  gl_FragColor = v_color;
}
`,n7=t7,i7=`
attribute vec2 a_position;
attribute vec2 a_normal;
attribute float a_radius;
attribute vec3 a_barycentric;

#ifdef PICKING_MODE
attribute vec4 a_id;
#else
attribute vec4 a_color;
#endif

uniform mat3 u_matrix;
uniform float u_sizeRatio;
uniform float u_correctionRatio;
uniform float u_minEdgeThickness;
uniform float u_lengthToThicknessRatio;
uniform float u_widenessToThicknessRatio;

varying vec4 v_color;

const float bias = 255.0 / 254.0;

void main() {
  float minThickness = u_minEdgeThickness;

  float normalLength = length(a_normal);
  vec2 unitNormal = a_normal / normalLength;

  // These first computations are taken from edge.vert.glsl and
  // edge.clamped.vert.glsl. Please read it to get better comments on what's
  // happening:
  float pixelsThickness = max(normalLength / u_sizeRatio, minThickness);
  float webGLThickness = pixelsThickness * u_correctionRatio;
  float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio;
  float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
  float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio;

  float da = a_barycentric.x;
  float db = a_barycentric.y;
  float dc = a_barycentric.z;

  vec2 delta = vec2(
      da * (webGLNodeRadius * unitNormal.y)
    + db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x)
    + dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x),

      da * (-webGLNodeRadius * unitNormal.x)
    + db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y)
    + dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y)
  );

  vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;

  gl_Position = vec4(position, 0, 1);

  #ifdef PICKING_MODE
  // For picking mode, we use the ID as the color:
  v_color = a_id;
  #else
  // For normal mode, we use the color:
  v_color = a_color;
  #endif

  v_color.a *= bias;
}
`,r7=i7,lM=WebGLRenderingContext,m_=lM.UNSIGNED_BYTE,Zp=lM.FLOAT,s7=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],cM={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function uM(t){var e=Ce(Ce({},cM),{});return(function(n){function i(){return gn(this,i),Pi(this,i,arguments)}return Ri(i,n),mn(i,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:r7,FRAGMENT_SHADER_SOURCE:n7,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:s7,ATTRIBUTES:[{name:"a_position",size:2,type:Zp},{name:"a_normal",size:2,type:Zp},{name:"a_radius",size:1,type:Zp},{name:"a_color",size:4,type:m_,normalized:!0},{name:"a_id",size:4,type:m_,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Zp}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(s,o,l,u,f){if(e.extremity==="source"){var h=[u,l];l=h[0],u=h[1]}var p=f.size||1,g=u.size||1,O=l.x,v=l.y,x=u.x,S=u.y,k=jd(f.color),$=x-O,E=S-v,T=$*$+E*E,_=0,Q=0;T&&(T=1/Math.sqrt(T),_=-E*T*p,Q=$*T*p);var N=this.array;N[o++]=x,N[o++]=S,N[o++]=-_,N[o++]=-Q,N[o++]=g,N[o++]=k,N[o++]=s}},{key:"setUniforms",value:function(s,o){var l=o.gl,u=o.uniformLocations,f=u.u_matrix,h=u.u_sizeRatio,p=u.u_correctionRatio,g=u.u_minEdgeThickness,O=u.u_lengthToThicknessRatio,v=u.u_widenessToThicknessRatio;l.uniformMatrix3fv(f,!1,s.matrix),l.uniform1f(h,s.sizeRatio),l.uniform1f(p,s.correctionRatio),l.uniform1f(g,s.minEdgeThickness),l.uniform1f(O,e.lengthToThicknessRatio),l.uniform1f(v,e.widenessToThicknessRatio)}}])})(P1)}uM();var o7=`
precision mediump float;

varying vec4 v_color;
varying vec2 v_normal;
varying float v_thickness;
varying float v_feather;

const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);

void main(void) {
  // We only handle antialiasing for normal mode:
  #ifdef PICKING_MODE
  gl_FragColor = v_color;
  #else
  float dist = length(v_normal) * v_thickness;

  float t = smoothstep(
    v_thickness - v_feather,
    v_thickness,
    dist
  );

  gl_FragColor = mix(v_color, transparent, t);
  #endif
}
`,fM=o7,a7=`
attribute vec4 a_id;
attribute vec4 a_color;
attribute vec2 a_normal;
attribute float a_normalCoef;
attribute vec2 a_positionStart;
attribute vec2 a_positionEnd;
attribute float a_positionCoef;
attribute float a_radius;
attribute float a_radiusCoef;

uniform mat3 u_matrix;
uniform float u_zoomRatio;
uniform float u_sizeRatio;
uniform float u_pixelRatio;
uniform float u_correctionRatio;
uniform float u_minEdgeThickness;
uniform float u_lengthToThicknessRatio;
uniform float u_feather;

varying vec4 v_color;
varying vec2 v_normal;
varying float v_thickness;
varying float v_feather;

const float bias = 255.0 / 254.0;

void main() {
  float minThickness = u_minEdgeThickness;

  float radius = a_radius * a_radiusCoef;
  vec2 normal = a_normal * a_normalCoef;
  vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;

  float normalLength = length(normal);
  vec2 unitNormal = normal / normalLength;

  // These first computations are taken from edge.vert.glsl. Please read it to
  // get better comments on what's happening:
  float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
  float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;

  // Here, we move the point to leave space for the arrow head:
  float direction = sign(radius);
  float webGLNodeRadius = direction * radius * 2.0 * u_correctionRatio / u_sizeRatio;
  float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;

  vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (webGLNodeRadius + webGLArrowHeadLength);

  // Here is the proper position of the vertex
  gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + compensationVector, 1)).xy, 0, 1);

  v_thickness = webGLThickness / u_zoomRatio;

  v_normal = unitNormal;

  v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;

  #ifdef PICKING_MODE
  // For picking mode, we use the ID as the color:
  v_color = a_id;
  #else
  // For normal mode, we use the color:
  v_color = a_color;
  #endif

  v_color.a *= bias;
}
`,l7=a7,dM=WebGLRenderingContext,O_=dM.UNSIGNED_BYTE,Fo=dM.FLOAT,c7=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],u7={lengthToThicknessRatio:cM.lengthToThicknessRatio};function hM(t){var e=Ce(Ce({},u7),{});return(function(n){function i(){return gn(this,i),Pi(this,i,arguments)}return Ri(i,n),mn(i,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:l7,FRAGMENT_SHADER_SOURCE:fM,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:c7,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Fo},{name:"a_positionEnd",size:2,type:Fo},{name:"a_normal",size:2,type:Fo},{name:"a_color",size:4,type:O_,normalized:!0},{name:"a_id",size:4,type:O_,normalized:!0},{name:"a_radius",size:1,type:Fo}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Fo},{name:"a_normalCoef",size:1,type:Fo},{name:"a_radiusCoef",size:1,type:Fo}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(s,o,l,u,f){var h=f.size||1,p=l.x,g=l.y,O=u.x,v=u.y,x=jd(f.color),S=O-p,k=v-g,$=u.size||1,E=S*S+k*k,T=0,_=0;E&&(E=1/Math.sqrt(E),T=-k*E*h,_=S*E*h);var Q=this.array;Q[o++]=p,Q[o++]=g,Q[o++]=O,Q[o++]=v,Q[o++]=T,Q[o++]=_,Q[o++]=x,Q[o++]=s,Q[o++]=$}},{key:"setUniforms",value:function(s,o){var l=o.gl,u=o.uniformLocations,f=u.u_matrix,h=u.u_zoomRatio,p=u.u_feather,g=u.u_pixelRatio,O=u.u_correctionRatio,v=u.u_sizeRatio,x=u.u_minEdgeThickness,S=u.u_lengthToThicknessRatio;l.uniformMatrix3fv(f,!1,s.matrix),l.uniform1f(h,s.zoomRatio),l.uniform1f(v,s.sizeRatio),l.uniform1f(O,s.correctionRatio),l.uniform1f(g,s.pixelRatio),l.uniform1f(p,s.antiAliasingFeather),l.uniform1f(x,s.minEdgeThickness),l.uniform1f(S,e.lengthToThicknessRatio)}}])})(P1)}hM();function f7(t){return Y9([hM(),uM()])}var d7=f7(),h7=d7,p7=`
attribute vec4 a_id;
attribute vec4 a_color;
attribute vec2 a_normal;
attribute float a_normalCoef;
attribute vec2 a_positionStart;
attribute vec2 a_positionEnd;
attribute float a_positionCoef;

uniform mat3 u_matrix;
uniform float u_sizeRatio;
uniform float u_zoomRatio;
uniform float u_pixelRatio;
uniform float u_correctionRatio;
uniform float u_minEdgeThickness;
uniform float u_feather;

varying vec4 v_color;
varying vec2 v_normal;
varying float v_thickness;
varying float v_feather;

const float bias = 255.0 / 254.0;

void main() {
  float minThickness = u_minEdgeThickness;

  vec2 normal = a_normal * a_normalCoef;
  vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;

  float normalLength = length(normal);
  vec2 unitNormal = normal / normalLength;

  // We require edges to be at least "minThickness" pixels thick *on screen*
  // (so we need to compensate the size ratio):
  float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);

  // Then, we need to retrieve the normalized thickness of the edge in the WebGL
  // referential (in a ([0, 1], [0, 1]) space), using our "magic" correction
  // ratio:
  float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;

  // Here is the proper position of the vertex
  gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness, 1)).xy, 0, 1);

  // For the fragment shader though, we need a thickness that takes the "magic"
  // correction ratio into account (as in webGLThickness), but so that the
  // antialiasing effect does not depend on the zoom level. So here's yet
  // another thickness version:
  v_thickness = webGLThickness / u_zoomRatio;

  v_normal = unitNormal;

  v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;

  #ifdef PICKING_MODE
  // For picking mode, we use the ID as the color:
  v_color = a_id;
  #else
  // For normal mode, we use the color:
  v_color = a_color;
  #endif

  v_color.a *= bias;
}
`,g7=p7,pM=WebGLRenderingContext,y_=pM.UNSIGNED_BYTE,mf=pM.FLOAT,m7=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],O7=(function(t){function e(){return gn(this,e),Pi(this,e,arguments)}return Ri(e,t),mn(e,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:g7,FRAGMENT_SHADER_SOURCE:fM,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:m7,ATTRIBUTES:[{name:"a_positionStart",size:2,type:mf},{name:"a_positionEnd",size:2,type:mf},{name:"a_normal",size:2,type:mf},{name:"a_color",size:4,type:y_,normalized:!0},{name:"a_id",size:4,type:y_,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:mf},{name:"a_normalCoef",size:1,type:mf}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(i,r,s,o,l){var u=l.size||1,f=s.x,h=s.y,p=o.x,g=o.y,O=jd(l.color),v=p-f,x=g-h,S=v*v+x*x,k=0,$=0;S&&(S=1/Math.sqrt(S),k=-x*S*u,$=v*S*u);var E=this.array;E[r++]=f,E[r++]=h,E[r++]=p,E[r++]=g,E[r++]=k,E[r++]=$,E[r++]=O,E[r++]=i}},{key:"setUniforms",value:function(i,r){var s=r.gl,o=r.uniformLocations,l=o.u_matrix,u=o.u_zoomRatio,f=o.u_feather,h=o.u_pixelRatio,p=o.u_correctionRatio,g=o.u_sizeRatio,O=o.u_minEdgeThickness;s.uniformMatrix3fv(l,!1,i.matrix),s.uniform1f(u,i.zoomRatio),s.uniform1f(g,i.sizeRatio),s.uniform1f(p,i.correctionRatio),s.uniform1f(h,i.pixelRatio),s.uniform1f(f,i.antiAliasingFeather),s.uniform1f(O,i.minEdgeThickness)}}])})(P1),R1=(function(t){function e(){var n;return gn(this,e),n=Pi(this,e),n.rawEmitter=n,n}return Ri(e,t),mn(e)})(jj.EventEmitter),H0,v_;function y7(){return v_||(v_=1,H0=function(e){return e!==null&&typeof e=="object"&&typeof e.addUndirectedEdgeWithKey=="function"&&typeof e.dropNode=="function"&&typeof e.multi=="boolean"}),H0}var v7=y7();const b7=Dc(v7);var x7=function(e){return e},w7=function(e){return e*e},S7=function(e){return e*(2-e)},k7=function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},E7=function(e){return e*e*e},T7=function(e){return--e*e*e+1},C7=function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},$7={linear:x7,quadraticIn:w7,quadraticOut:S7,quadraticInOut:k7,cubicIn:E7,cubicOut:T7,cubicInOut:C7},_7={easing:"quadraticInOut",duration:150};function Bi(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Bp(t,e,n){return t[0]=e,t[4]=typeof n=="number"?n:e,t}function b_(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[3]=-n,t[4]=i,t}function x_(t,e,n){return t[6]=e,t[7]=n,t}function oo(t,e){var n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],l=t[5],u=t[6],f=t[7],h=t[8],p=e[0],g=e[1],O=e[2],v=e[3],x=e[4],S=e[5],k=e[6],$=e[7],E=e[8];return t[0]=p*n+g*s+O*u,t[1]=p*i+g*o+O*f,t[2]=p*r+g*l+O*h,t[3]=v*n+x*s+S*u,t[4]=v*i+x*o+S*f,t[5]=v*r+x*l+S*h,t[6]=k*n+$*s+E*u,t[7]=k*i+$*o+E*f,t[8]=k*r+$*l+E*h,t}function Hx(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=t[0],r=t[1],s=t[3],o=t[4],l=t[6],u=t[7],f=e.x,h=e.y;return{x:f*i+h*s+l*n,y:f*r+h*o+u*n}}function Q7(t,e){var n=t.height/t.width,i=e.height/e.width;return n<1&&i>1||n>1&&i<1?1:Math.min(Math.max(i,1/i),Math.max(1/n,n))}function Of(t,e,n,i,r){var s=t.angle,o=t.ratio,l=t.x,u=t.y,f=e.width,h=e.height,p=Bi(),g=Math.min(f,h)-2*i,O=Q7(e,n);return r?(oo(p,x_(Bi(),l,u)),oo(p,Bp(Bi(),o)),oo(p,b_(Bi(),s)),oo(p,Bp(Bi(),f/g/2/O,h/g/2/O))):(oo(p,Bp(Bi(),2*(g/f)*O,2*(g/h)*O)),oo(p,b_(Bi(),-s)),oo(p,Bp(Bi(),1/o)),oo(p,x_(Bi(),-l,-u))),p}function A7(t,e,n){var i=Hx(t,{x:Math.cos(e.angle),y:Math.sin(e.angle)},0),r=i.x,s=i.y;return 1/Math.sqrt(Math.pow(r,2)+Math.pow(s,2))/n.width}function N7(t){if(!t.order)return{x:[0,1],y:[0,1]};var e=1/0,n=-1/0,i=1/0,r=-1/0;return t.forEachNode(function(s,o){var l=o.x,u=o.y;l<e&&(e=l),l>n&&(n=l),u<i&&(i=u),u>r&&(r=u)}),{x:[e,n],y:[i,r]}}function P7(t){if(!b7(t))throw new Error("Sigma: invalid graph instance.");t.forEachNode(function(e,n){if(!Number.isFinite(n.x)||!Number.isFinite(n.y))throw new Error("Sigma: Coordinates of node ".concat(e," are invalid. A node must have a numeric 'x' and 'y' attribute."))})}function R7(t,e,n){var i=document.createElement(t);if(e)for(var r in e)i.style[r]=e[r];if(n)for(var s in n)i.setAttribute(s,n[s]);return i}function w_(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function S_(t,e,n){return n.sort(function(i,r){var s=e(i)||0,o=e(r)||0;return s<o?-1:s>o?1:0})}function k_(t){var e=Ec(t.x,2),n=e[0],i=e[1],r=Ec(t.y,2),s=r[0],o=r[1],l=Math.max(i-n,o-s),u=(i+n)/2,f=(o+s)/2;(l===0||Math.abs(l)===1/0||isNaN(l))&&(l=1),isNaN(u)&&(u=0),isNaN(f)&&(f=0);var h=function(g){return{x:.5+(g.x-u)/l,y:.5+(g.y-f)/l}};return h.applyTo=function(p){p.x=.5+(p.x-u)/l,p.y=.5+(p.y-f)/l},h.inverse=function(p){return{x:u+l*(p.x-.5),y:f+l*(p.y-.5)}},h.ratio=l,h}function Kx(t){"@babel/helpers - typeof";return Kx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kx(t)}function E_(t,e){var n=e.size;if(n!==0){var i=t.length;t.length+=n;var r=0;e.forEach(function(s){t[i+r]=s,r++})}}function K0(t){t=t||{};for(var e=0,n=arguments.length<=1?0:arguments.length-1;e<n;e++){var i=e+1<1||arguments.length<=e+1?void 0:arguments[e+1];i&&Object.assign(t,i)}return t}var j1={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,renderEdgeLabels:!1,enableEdgeEvents:!1,defaultNodeColor:"#999",defaultNodeType:"circle",defaultEdgeColor:"#ccc",defaultEdgeType:"line",labelFont:"Arial",labelSize:14,labelWeight:"normal",labelColor:{color:"#000"},edgeLabelFont:"Arial",edgeLabelSize:14,edgeLabelWeight:"normal",edgeLabelColor:{attribute:"color"},stagePadding:30,defaultDrawEdgeLabel:q9,defaultDrawNodeLabel:oM,defaultDrawNodeHover:W9,minEdgeThickness:1.7,antiAliasingFeather:1,dragTimeout:100,draggedEventsTolerance:3,inertiaDuration:200,inertiaRatio:3,zoomDuration:250,zoomingRatio:1.7,doubleClickTimeout:300,doubleClickZoomingRatio:2.2,doubleClickZoomingDuration:200,tapMoveTolerance:10,zoomToSizeRatioFunction:Math.sqrt,itemSizesReference:"screen",autoRescale:!0,autoCenter:!0,labelDensity:1,labelGridCellSize:100,labelRenderedSizeThreshold:6,nodeReducer:null,edgeReducer:null,zIndex:!1,minCameraRatio:null,maxCameraRatio:null,enableCameraZooming:!0,enableCameraPanning:!0,enableCameraRotation:!0,cameraPanBoundaries:null,allowInvalidContainer:!1,nodeProgramClasses:{},nodeHoverProgramClasses:{},edgeProgramClasses:{}},j7={circle:tO},M7={arrow:h7,line:O7};function J0(t){if(typeof t.labelDensity!="number"||t.labelDensity<0)throw new Error("Settings: invalid `labelDensity`. Expecting a positive number.");var e=t.minCameraRatio,n=t.maxCameraRatio;if(typeof e=="number"&&typeof n=="number"&&n<e)throw new Error("Settings: invalid camera ratio boundaries. Expecting `maxCameraRatio` to be greater than `minCameraRatio`.")}function L7(t){var e=K0({},j1,t);return e.nodeProgramClasses=K0({},j7,e.nodeProgramClasses),e.edgeProgramClasses=K0({},M7,e.edgeProgramClasses),e}var Ip=1.5,T_=(function(t){function e(){var n;return gn(this,e),n=Pi(this,e),ge(n,"x",.5),ge(n,"y",.5),ge(n,"angle",0),ge(n,"ratio",1),ge(n,"minRatio",null),ge(n,"maxRatio",null),ge(n,"enabledZooming",!0),ge(n,"enabledPanning",!0),ge(n,"enabledRotation",!0),ge(n,"clean",null),ge(n,"nextFrame",null),ge(n,"previousState",null),ge(n,"enabled",!0),n.previousState=n.getState(),n}return Ri(e,t),mn(e,[{key:"enable",value:function(){return this.enabled=!0,this}},{key:"disable",value:function(){return this.enabled=!1,this}},{key:"getState",value:function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}}},{key:"hasState",value:function(i){return this.x===i.x&&this.y===i.y&&this.ratio===i.ratio&&this.angle===i.angle}},{key:"getPreviousState",value:function(){var i=this.previousState;return i?{x:i.x,y:i.y,angle:i.angle,ratio:i.ratio}:null}},{key:"getBoundedRatio",value:function(i){var r=i;return typeof this.minRatio=="number"&&(r=Math.max(r,this.minRatio)),typeof this.maxRatio=="number"&&(r=Math.min(r,this.maxRatio)),r}},{key:"validateState",value:function(i){var r={};return this.enabledPanning&&typeof i.x=="number"&&(r.x=i.x),this.enabledPanning&&typeof i.y=="number"&&(r.y=i.y),this.enabledZooming&&typeof i.ratio=="number"&&(r.ratio=this.getBoundedRatio(i.ratio)),this.enabledRotation&&typeof i.angle=="number"&&(r.angle=i.angle),this.clean?this.clean(Ce(Ce({},this.getState()),r)):r}},{key:"isAnimated",value:function(){return!!this.nextFrame}},{key:"setState",value:function(i){if(!this.enabled)return this;this.previousState=this.getState();var r=this.validateState(i);return typeof r.x=="number"&&(this.x=r.x),typeof r.y=="number"&&(this.y=r.y),typeof r.ratio=="number"&&(this.ratio=r.ratio),typeof r.angle=="number"&&(this.angle=r.angle),this.hasState(this.previousState)||this.emit("updated",this.getState()),this}},{key:"updateState",value:function(i){return this.setState(i(this.getState())),this}},{key:"animate",value:function(i){var r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(!o)return new Promise(function(O){return r.animate(i,s,O)});if(this.enabled){var l=Ce(Ce({},_7),s),u=this.validateState(i),f=typeof l.easing=="function"?l.easing:$7[l.easing],h=Date.now(),p=this.getState(),g=function(){var v=(Date.now()-h)/l.duration;if(v>=1){r.nextFrame=null,r.setState(u),r.animationCallback&&(r.animationCallback.call(null),r.animationCallback=void 0);return}var x=f(v),S={};typeof u.x=="number"&&(S.x=p.x+(u.x-p.x)*x),typeof u.y=="number"&&(S.y=p.y+(u.y-p.y)*x),r.enabledRotation&&typeof u.angle=="number"&&(S.angle=p.angle+(u.angle-p.angle)*x),typeof u.ratio=="number"&&(S.ratio=p.ratio+(u.ratio-p.ratio)*x),r.setState(S),r.nextFrame=requestAnimationFrame(g)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(g)):g(),this.animationCallback=o}}},{key:"animatedZoom",value:function(i){return i?typeof i=="number"?this.animate({ratio:this.ratio/i}):this.animate({ratio:this.ratio/(i.factor||Ip)},i):this.animate({ratio:this.ratio/Ip})}},{key:"animatedUnzoom",value:function(i){return i?typeof i=="number"?this.animate({ratio:this.ratio*i}):this.animate({ratio:this.ratio*(i.factor||Ip)},i):this.animate({ratio:this.ratio*Ip})}},{key:"animatedReset",value:function(i){return this.animate({x:.5,y:.5,ratio:1,angle:0},i)}},{key:"copy",value:function(){return e.from(this.getState())}}],[{key:"from",value:function(i){var r=new e;return r.setState(i)}}])})(R1);function Yi(t,e){var n=e.getBoundingClientRect();return{x:t.clientX-n.left,y:t.clientY-n.top}}function as(t,e){var n=Ce(Ce({},Yi(t,e)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:t});return n}function yf(t){var e="x"in t?t:Ce(Ce({},t.touches[0]||t.previousTouches[0]),{},{original:t.original,sigmaDefaultPrevented:t.sigmaDefaultPrevented,preventSigmaDefault:function(){t.sigmaDefaultPrevented=!0,e.sigmaDefaultPrevented=!0}});return e}function D7(t,e){return Ce(Ce({},as(t,e)),{},{delta:gM(t)})}var z7=2;function Tg(t){for(var e=[],n=0,i=Math.min(t.length,z7);n<i;n++)e.push(t[n]);return e}function vf(t,e,n){var i={touches:Tg(t.touches).map(function(r){return Yi(r,n)}),previousTouches:e.map(function(r){return Yi(r,n)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){i.sigmaDefaultPrevented=!0},original:t};return i}function gM(t){if(typeof t.deltaY<"u")return t.deltaY*-3/360;if(typeof t.detail<"u")return t.detail/-9;throw new Error("Captor: could not extract delta from event.")}var mM=(function(t){function e(n,i){var r;return gn(this,e),r=Pi(this,e),r.container=n,r.renderer=i,r}return Ri(e,t),mn(e)})(R1),X7=["doubleClickTimeout","doubleClickZoomingDuration","doubleClickZoomingRatio","dragTimeout","draggedEventsTolerance","inertiaDuration","inertiaRatio","zoomDuration","zoomingRatio"],Z7=X7.reduce(function(t,e){return Ce(Ce({},t),{},ge({},e,j1[e]))},{}),B7=(function(t){function e(n,i){var r;return gn(this,e),r=Pi(this,e,[n,i]),ge(r,"enabled",!0),ge(r,"draggedEvents",0),ge(r,"downStartTime",null),ge(r,"lastMouseX",null),ge(r,"lastMouseY",null),ge(r,"isMouseDown",!1),ge(r,"isMoving",!1),ge(r,"movingTimeout",null),ge(r,"startCameraState",null),ge(r,"clicks",0),ge(r,"doubleClickTimeout",null),ge(r,"currentWheelDirection",0),ge(r,"settings",Z7),r.handleClick=r.handleClick.bind(r),r.handleRightClick=r.handleRightClick.bind(r),r.handleDown=r.handleDown.bind(r),r.handleUp=r.handleUp.bind(r),r.handleMove=r.handleMove.bind(r),r.handleWheel=r.handleWheel.bind(r),r.handleLeave=r.handleLeave.bind(r),r.handleEnter=r.handleEnter.bind(r),n.addEventListener("click",r.handleClick,{capture:!1}),n.addEventListener("contextmenu",r.handleRightClick,{capture:!1}),n.addEventListener("mousedown",r.handleDown,{capture:!1}),n.addEventListener("wheel",r.handleWheel,{capture:!1}),n.addEventListener("mouseleave",r.handleLeave,{capture:!1}),n.addEventListener("mouseenter",r.handleEnter,{capture:!1}),document.addEventListener("mousemove",r.handleMove,{capture:!1}),document.addEventListener("mouseup",r.handleUp,{capture:!1}),r}return Ri(e,t),mn(e,[{key:"kill",value:function(){var i=this.container;i.removeEventListener("click",this.handleClick),i.removeEventListener("contextmenu",this.handleRightClick),i.removeEventListener("mousedown",this.handleDown),i.removeEventListener("wheel",this.handleWheel),i.removeEventListener("mouseleave",this.handleLeave),i.removeEventListener("mouseenter",this.handleEnter),document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("mouseup",this.handleUp)}},{key:"handleClick",value:function(i){var r=this;if(this.enabled){if(this.clicks++,this.clicks===2)return this.clicks=0,typeof this.doubleClickTimeout=="number"&&(clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null),this.handleDoubleClick(i);setTimeout(function(){r.clicks=0,r.doubleClickTimeout=null},this.settings.doubleClickTimeout),this.draggedEvents<this.settings.draggedEventsTolerance&&this.emit("click",as(i,this.container))}}},{key:"handleRightClick",value:function(i){this.enabled&&this.emit("rightClick",as(i,this.container))}},{key:"handleDoubleClick",value:function(i){if(this.enabled){i.preventDefault(),i.stopPropagation();var r=as(i,this.container);if(this.emit("doubleClick",r),!r.sigmaDefaultPrevented){var s=this.renderer.getCamera(),o=s.getBoundedRatio(s.getState().ratio/this.settings.doubleClickZoomingRatio);s.animate(this.renderer.getViewportZoomedState(Yi(i,this.container),o),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}}},{key:"handleDown",value:function(i){if(this.enabled){if(i.button===0){this.startCameraState=this.renderer.getCamera().getState();var r=Yi(i,this.container),s=r.x,o=r.y;this.lastMouseX=s,this.lastMouseY=o,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",as(i,this.container))}}},{key:"handleUp",value:function(i){var r=this;if(!(!this.enabled||!this.isMouseDown)){var s=this.renderer.getCamera();this.isMouseDown=!1,typeof this.movingTimeout=="number"&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var o=Yi(i,this.container),l=o.x,u=o.y,f=s.getState(),h=s.getPreviousState()||{x:0,y:0};this.isMoving?s.animate({x:f.x+this.settings.inertiaRatio*(f.x-h.x),y:f.y+this.settings.inertiaRatio*(f.y-h.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"}):(this.lastMouseX!==l||this.lastMouseY!==u)&&s.setState({x:f.x,y:f.y}),this.isMoving=!1,setTimeout(function(){var p=r.draggedEvents>0;r.draggedEvents=0,p&&r.renderer.getSetting("hideEdgesOnMove")&&r.renderer.refresh()},0),this.emit("mouseup",as(i,this.container))}}},{key:"handleMove",value:function(i){var r=this;if(this.enabled){var s=as(i,this.container);if(this.emit("mousemovebody",s),(i.target===this.container||i.composedPath()[0]===this.container)&&this.emit("mousemove",s),!s.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){r.movingTimeout=null,r.isMoving=!1},this.settings.dragTimeout);var o=this.renderer.getCamera(),l=Yi(i,this.container),u=l.x,f=l.y,h=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),p=this.renderer.viewportToFramedGraph({x:u,y:f}),g=h.x-p.x,O=h.y-p.y,v=o.getState(),x=v.x+g,S=v.y+O;o.setState({x,y:S}),this.lastMouseX=u,this.lastMouseY=f,i.preventDefault(),i.stopPropagation()}}}},{key:"handleLeave",value:function(i){this.emit("mouseleave",as(i,this.container))}},{key:"handleEnter",value:function(i){this.emit("mouseenter",as(i,this.container))}},{key:"handleWheel",value:function(i){var r=this,s=this.renderer.getCamera();if(!(!this.enabled||!s.enabledZooming)){var o=gM(i);if(o){var l=D7(i,this.container);if(this.emit("wheel",l),l.sigmaDefaultPrevented){i.preventDefault(),i.stopPropagation();return}var u=s.getState().ratio,f=o>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,h=s.getBoundedRatio(u*f),p=o>0?1:-1,g=Date.now();u!==h&&(i.preventDefault(),i.stopPropagation(),!(this.currentWheelDirection===p&&this.lastWheelTriggerTime&&g-this.lastWheelTriggerTime<this.settings.zoomDuration/5)&&(s.animate(this.renderer.getViewportZoomedState(Yi(i,this.container),h),{easing:"quadraticOut",duration:this.settings.zoomDuration},function(){r.currentWheelDirection=0}),this.currentWheelDirection=p,this.lastWheelTriggerTime=g))}}}},{key:"setSettings",value:function(i){this.settings=i}}])})(mM),I7=["dragTimeout","inertiaDuration","inertiaRatio","doubleClickTimeout","doubleClickZoomingRatio","doubleClickZoomingDuration","tapMoveTolerance"],G7=I7.reduce(function(t,e){return Ce(Ce({},t),{},ge({},e,j1[e]))},{}),V7=(function(t){function e(n,i){var r;return gn(this,e),r=Pi(this,e,[n,i]),ge(r,"enabled",!0),ge(r,"isMoving",!1),ge(r,"hasMoved",!1),ge(r,"touchMode",0),ge(r,"startTouchesPositions",[]),ge(r,"lastTouches",[]),ge(r,"lastTap",null),ge(r,"settings",G7),r.handleStart=r.handleStart.bind(r),r.handleLeave=r.handleLeave.bind(r),r.handleMove=r.handleMove.bind(r),n.addEventListener("touchstart",r.handleStart,{capture:!1}),n.addEventListener("touchcancel",r.handleLeave,{capture:!1}),document.addEventListener("touchend",r.handleLeave,{capture:!1,passive:!1}),document.addEventListener("touchmove",r.handleMove,{capture:!1,passive:!1}),r}return Ri(e,t),mn(e,[{key:"kill",value:function(){var i=this.container;i.removeEventListener("touchstart",this.handleStart),i.removeEventListener("touchcancel",this.handleLeave),document.removeEventListener("touchend",this.handleLeave),document.removeEventListener("touchmove",this.handleMove)}},{key:"getDimensions",value:function(){return{width:this.container.offsetWidth,height:this.container.offsetHeight}}},{key:"handleStart",value:function(i){var r=this;if(this.enabled){i.preventDefault();var s=Tg(i.touches);if(this.touchMode=s.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=s.map(function(O){return Yi(O,r.container)}),this.touchMode===2){var o=Ec(this.startTouchesPositions,2),l=o[0],u=l.x,f=l.y,h=o[1],p=h.x,g=h.y;this.startTouchesAngle=Math.atan2(g-f,p-u),this.startTouchesDistance=Math.sqrt(Math.pow(p-u,2)+Math.pow(g-f,2))}this.emit("touchdown",vf(i,this.lastTouches,this.container)),this.lastTouches=s,this.lastTouchesPositions=this.startTouchesPositions}}},{key:"handleLeave",value:function(i){if(!(!this.enabled||!this.startTouchesPositions.length)){switch(i.cancelable&&i.preventDefault(),this.movingTimeout&&(this.isMoving=!1,clearTimeout(this.movingTimeout)),this.touchMode){case 2:if(i.touches.length===1){this.handleStart(i),i.preventDefault();break}case 1:if(this.isMoving){var r=this.renderer.getCamera(),s=r.getState(),o=r.getPreviousState()||{x:0,y:0};r.animate({x:s.x+this.settings.inertiaRatio*(s.x-o.x),y:s.y+this.settings.inertiaRatio*(s.y-o.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0;break}if(this.emit("touchup",vf(i,this.lastTouches,this.container)),!i.touches.length){var l=Yi(this.lastTouches[0],this.container),u=this.startTouchesPositions[0],f=Math.pow(l.x-u.x,2)+Math.pow(l.y-u.y,2);if(!i.touches.length&&f<Math.pow(this.settings.tapMoveTolerance,2))if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var h=vf(i,this.lastTouches,this.container);if(this.emit("doubletap",h),this.lastTap=null,!h.sigmaDefaultPrevented){var p=this.renderer.getCamera(),g=p.getBoundedRatio(p.getState().ratio/this.settings.doubleClickZoomingRatio);p.animate(this.renderer.getViewportZoomedState(l,g),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}else{var O=vf(i,this.lastTouches,this.container);this.emit("tap",O),this.lastTap={time:Date.now(),position:O.touches[0]||O.previousTouches[0]}}}this.lastTouches=Tg(i.touches),this.startTouchesPositions=[]}}},{key:"handleMove",value:function(i){var r=this;if(!(!this.enabled||!this.startTouchesPositions.length)){i.preventDefault();var s=Tg(i.touches),o=s.map(function(P){return Yi(P,r.container)}),l=this.lastTouches;this.lastTouches=s,this.lastTouchesPositions=o;var u=vf(i,l,this.container);if(this.emit("touchmove",u),!u.sigmaDefaultPrevented&&(this.hasMoved||(this.hasMoved=o.some(function(P,j){var Y=r.startTouchesPositions[j];return Y&&(P.x!==Y.x||P.y!==Y.y)})),!!this.hasMoved)){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){r.isMoving=!1},this.settings.dragTimeout);var f=this.renderer.getCamera(),h=this.startCameraState,p=this.renderer.getSetting("stagePadding");switch(this.touchMode){case 1:{var g=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),O=g.x,v=g.y,x=this.renderer.viewportToFramedGraph(o[0]),S=x.x,k=x.y;f.setState({x:h.x+O-S,y:h.y+v-k});break}case 2:{var $={x:.5,y:.5,angle:0,ratio:1},E=o[0],T=E.x,_=E.y,Q=o[1],N=Q.x,R=Q.y,X=Math.atan2(R-_,N-T)-this.startTouchesAngle,q=Math.hypot(R-_,N-T)/this.startTouchesDistance,z=f.getBoundedRatio(h.ratio/q);$.ratio=z,$.angle=h.angle+X;var Z=this.getDimensions(),F=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:h}),M=Math.min(Z.width,Z.height)-2*p,B=M/Z.width,L=M/Z.height,I=z/M,U=T-M/2/B,V=_-M/2/L,te=[U*Math.cos(-$.angle)-V*Math.sin(-$.angle),V*Math.cos(-$.angle)+U*Math.sin(-$.angle)];U=te[0],V=te[1],$.x=F.x-U*I,$.y=F.y+V*I,f.setState($);break}}}}}},{key:"setSettings",value:function(i){this.settings=i}}])})(mM);function U7(t){if(Array.isArray(t))return Wx(t)}function Y7(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function q7(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C_(t){return U7(t)||Y7(t)||Jj(t)||q7()}function W7(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}function eb(t,e){if(t==null)return{};var n,i,r=W7(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}var $_=(function(){function t(e,n){gn(this,t),this.key=e,this.size=n}return mn(t,null,[{key:"compare",value:function(n,i){return n.size>i.size?-1:n.size<i.size||n.key>i.key?1:-1}}])})(),__=(function(){function t(){gn(this,t),ge(this,"width",0),ge(this,"height",0),ge(this,"cellSize",0),ge(this,"columns",0),ge(this,"rows",0),ge(this,"cells",{})}return mn(t,[{key:"resizeAndClear",value:function(n,i){this.width=n.width,this.height=n.height,this.cellSize=i,this.columns=Math.ceil(n.width/i),this.rows=Math.ceil(n.height/i),this.cells={}}},{key:"getIndex",value:function(n){var i=Math.floor(n.x/this.cellSize),r=Math.floor(n.y/this.cellSize);return r*this.columns+i}},{key:"add",value:function(n,i,r){var s=new $_(n,i),o=this.getIndex(r),l=this.cells[o];l||(l=[],this.cells[o]=l),l.push(s)}},{key:"organize",value:function(){for(var n in this.cells){var i=this.cells[n];i.sort($_.compare)}}},{key:"getLabelsToDisplay",value:function(n,i){var r=this.cellSize*this.cellSize,s=r/n/n,o=s*i/r,l=Math.ceil(o),u=[];for(var f in this.cells)for(var h=this.cells[f],p=0;p<Math.min(l,h.length);p++)u.push(h[p].key);return u}}])})();function F7(t){var e=t.graph,n=t.hoveredNode,i=t.highlightedNodes,r=t.displayedNodeLabels,s=[];return e.forEachEdge(function(o,l,u,f){(u===n||f===n||i.has(u)||i.has(f)||r.has(u)&&r.has(f))&&s.push(o)}),s}var Q_=150,A_=50,ds=Object.prototype.hasOwnProperty;function H7(t,e,n){if(!ds.call(n,"x")||!ds.call(n,"y"))throw new Error('Sigma: could not find a valid position (x, y) for node "'.concat(e,'". All your nodes must have a number "x" and "y". Maybe your forgot to apply a layout or your "nodeReducer" is not returning the correct data?'));return n.color||(n.color=t.defaultNodeColor),!n.label&&n.label!==""&&(n.label=null),n.label!==void 0&&n.label!==null?n.label=""+n.label:n.label=null,n.size||(n.size=2),ds.call(n,"hidden")||(n.hidden=!1),ds.call(n,"highlighted")||(n.highlighted=!1),ds.call(n,"forceLabel")||(n.forceLabel=!1),(!n.type||n.type==="")&&(n.type=t.defaultNodeType),n.zIndex||(n.zIndex=0),n}function K7(t,e,n){return n.color||(n.color=t.defaultEdgeColor),n.label||(n.label=""),n.size||(n.size=.5),ds.call(n,"hidden")||(n.hidden=!1),ds.call(n,"forceLabel")||(n.forceLabel=!1),(!n.type||n.type==="")&&(n.type=t.defaultEdgeType),n.zIndex||(n.zIndex=0),n}var J7=(function(t){function e(n,i){var r,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(gn(this,e),r=Pi(this,e),ge(r,"elements",{}),ge(r,"canvasContexts",{}),ge(r,"webGLContexts",{}),ge(r,"pickingLayers",new Set),ge(r,"textures",{}),ge(r,"frameBuffers",{}),ge(r,"activeListeners",{}),ge(r,"labelGrid",new __),ge(r,"nodeDataCache",{}),ge(r,"edgeDataCache",{}),ge(r,"nodeProgramIndex",{}),ge(r,"edgeProgramIndex",{}),ge(r,"nodesWithForcedLabels",new Set),ge(r,"edgesWithForcedLabels",new Set),ge(r,"nodeExtent",{x:[0,1],y:[0,1]}),ge(r,"nodeZExtent",[1/0,-1/0]),ge(r,"edgeZExtent",[1/0,-1/0]),ge(r,"matrix",Bi()),ge(r,"invMatrix",Bi()),ge(r,"correctionRatio",1),ge(r,"customBBox",null),ge(r,"normalizationFunction",k_({x:[0,1],y:[0,1]})),ge(r,"graphToViewportRatio",1),ge(r,"itemIDsIndex",{}),ge(r,"nodeIndices",{}),ge(r,"edgeIndices",{}),ge(r,"width",0),ge(r,"height",0),ge(r,"pixelRatio",w_()),ge(r,"pickingDownSizingRatio",2*r.pixelRatio),ge(r,"displayedNodeLabels",new Set),ge(r,"displayedEdgeLabels",new Set),ge(r,"highlightedNodes",new Set),ge(r,"hoveredNode",null),ge(r,"hoveredEdge",null),ge(r,"renderFrame",null),ge(r,"renderHighlightedNodesFrame",null),ge(r,"needToProcess",!1),ge(r,"checkEdgesEventsFrame",null),ge(r,"nodePrograms",{}),ge(r,"nodeHoverPrograms",{}),ge(r,"edgePrograms",{}),r.settings=L7(s),J0(r.settings),P7(n),!(i instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");r.graph=n,r.container=i,r.createWebGLContext("edges",{picking:s.enableEdgeEvents}),r.createCanvasContext("edgeLabels"),r.createWebGLContext("nodes",{picking:!0}),r.createCanvasContext("labels"),r.createCanvasContext("hovers"),r.createWebGLContext("hoverNodes"),r.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),r.resize();for(var o in r.settings.nodeProgramClasses)r.registerNodeProgram(o,r.settings.nodeProgramClasses[o],r.settings.nodeHoverProgramClasses[o]);for(var l in r.settings.edgeProgramClasses)r.registerEdgeProgram(l,r.settings.edgeProgramClasses[l]);return r.camera=new T_,r.bindCameraHandlers(),r.mouseCaptor=new B7(r.elements.mouse,r),r.mouseCaptor.setSettings(r.settings),r.touchCaptor=new V7(r.elements.mouse,r),r.touchCaptor.setSettings(r.settings),r.bindEventHandlers(),r.bindGraphHandlers(),r.handleSettingsUpdate(),r.refresh(),r}return Ri(e,t),mn(e,[{key:"registerNodeProgram",value:function(i,r,s){return this.nodePrograms[i]&&this.nodePrograms[i].kill(),this.nodeHoverPrograms[i]&&this.nodeHoverPrograms[i].kill(),this.nodePrograms[i]=new r(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[i]=new(s||r)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(i,r){return this.edgePrograms[i]&&this.edgePrograms[i].kill(),this.edgePrograms[i]=new r(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(i){if(this.nodePrograms[i]){var r=this.nodePrograms,s=r[i],o=eb(r,[i].map(If));s.kill(),this.nodePrograms=o}if(this.nodeHoverPrograms[i]){var l=this.nodeHoverPrograms,u=l[i],f=eb(l,[i].map(If));u.kill(),this.nodePrograms=f}return this}},{key:"unregisterEdgeProgram",value:function(i){if(this.edgePrograms[i]){var r=this.edgePrograms,s=r[i],o=eb(r,[i].map(If));s.kill(),this.edgePrograms=o}return this}},{key:"resetWebGLTexture",value:function(i){var r=this.webGLContexts[i],s=this.frameBuffers[i],o=this.textures[i];o&&r.deleteTexture(o);var l=r.createTexture();return r.bindFramebuffer(r.FRAMEBUFFER,s),r.bindTexture(r.TEXTURE_2D,l),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,this.width,this.height,0,r.RGBA,r.UNSIGNED_BYTE,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,l,0),this.textures[i]=l,this}},{key:"bindCameraHandlers",value:function(){var i=this;return this.activeListeners.camera=function(){i.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(i){var r=i.x,s=i.y,o=f_(this.webGLContexts.nodes,this.frameBuffers.nodes,r,s,this.pixelRatio,this.pickingDownSizingRatio),l=u_.apply(void 0,C_(o)),u=this.itemIDsIndex[l];return u&&u.type==="node"?u.id:null}},{key:"bindEventHandlers",value:function(){var i=this;this.activeListeners.handleResize=function(){i.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(s){var o=yf(s),l={event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}},u=i.getNodeAtPosition(o);if(u&&i.hoveredNode!==u&&!i.nodeDataCache[u].hidden){i.hoveredNode&&i.emit("leaveNode",Ce(Ce({},l),{},{node:i.hoveredNode})),i.hoveredNode=u,i.emit("enterNode",Ce(Ce({},l),{},{node:u})),i.scheduleHighlightedNodesRender();return}if(i.hoveredNode&&i.getNodeAtPosition(o)!==i.hoveredNode){var f=i.hoveredNode;i.hoveredNode=null,i.emit("leaveNode",Ce(Ce({},l),{},{node:f})),i.scheduleHighlightedNodesRender();return}if(i.settings.enableEdgeEvents){var h=i.hoveredNode?null:i.getEdgeAtPoint(l.event.x,l.event.y);h!==i.hoveredEdge&&(i.hoveredEdge&&i.emit("leaveEdge",Ce(Ce({},l),{},{edge:i.hoveredEdge})),h&&i.emit("enterEdge",Ce(Ce({},l),{},{edge:h})),i.hoveredEdge=h)}},this.activeListeners.handleMoveBody=function(s){var o=yf(s);i.emit("moveBody",{event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(s){var o=yf(s),l={event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}};i.hoveredNode&&(i.emit("leaveNode",Ce(Ce({},l),{},{node:i.hoveredNode})),i.scheduleHighlightedNodesRender()),i.settings.enableEdgeEvents&&i.hoveredEdge&&(i.emit("leaveEdge",Ce(Ce({},l),{},{edge:i.hoveredEdge})),i.scheduleHighlightedNodesRender()),i.emit("leaveStage",Ce({},l))},this.activeListeners.handleEnter=function(s){var o=yf(s),l={event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}};i.emit("enterStage",Ce({},l))};var r=function(o){return function(l){var u=yf(l),f={event:u,preventSigmaDefault:function(){u.preventSigmaDefault()}},h=i.getNodeAtPosition(u);if(h)return i.emit("".concat(o,"Node"),Ce(Ce({},f),{},{node:h}));if(i.settings.enableEdgeEvents){var p=i.getEdgeAtPoint(u.x,u.y);if(p)return i.emit("".concat(o,"Edge"),Ce(Ce({},f),{},{edge:p}))}return i.emit("".concat(o,"Stage"),f)}};return this.activeListeners.handleClick=r("click"),this.activeListeners.handleRightClick=r("rightClick"),this.activeListeners.handleDoubleClick=r("doubleClick"),this.activeListeners.handleWheel=r("wheel"),this.activeListeners.handleDown=r("down"),this.activeListeners.handleUp=r("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var i=this,r=this.graph,s=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(o){var l,u=(l=o.hints)===null||l===void 0?void 0:l.attributes;i.graph.forEachNode(function(h){return i.updateNode(h)});var f=!u||u.some(function(h){return s.has(h)});i.refresh({partialGraph:{nodes:r.nodes()},skipIndexation:!f,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(o){var l,u=(l=o.hints)===null||l===void 0?void 0:l.attributes;i.graph.forEachEdge(function(h){return i.updateEdge(h)});var f=u&&["zIndex","type"].some(function(h){return u?.includes(h)});i.refresh({partialGraph:{edges:r.edges()},skipIndexation:!f,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(o){var l=o.key;i.addNode(l),i.refresh({partialGraph:{nodes:[l]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(o){var l=o.key;i.refresh({partialGraph:{nodes:[l]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(o){var l=o.key;i.removeNode(l),i.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(o){var l=o.key;i.addEdge(l),i.refresh({partialGraph:{edges:[l]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(o){var l=o.key;i.refresh({partialGraph:{edges:[l]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(o){var l=o.key;i.removeEdge(l),i.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){i.clearEdgeState(),i.clearEdgeIndices(),i.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){i.clearEdgeState(),i.clearNodeState(),i.clearEdgeIndices(),i.clearNodeIndices(),i.refresh({schedule:!0})},r.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),r.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),r.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),r.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),r.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),r.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),r.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),r.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),r.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),r.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var i=this.graph;i.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),i.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),i.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),i.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),i.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),i.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),i.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),i.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),i.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),i.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(i,r){var s=f_(this.webGLContexts.edges,this.frameBuffers.edges,i,r,this.pixelRatio,this.pickingDownSizingRatio),o=u_.apply(void 0,C_(s)),l=this.itemIDsIndex[o];return l&&l.type==="edge"?l.id:null}},{key:"process",value:function(){var i=this;this.emit("beforeProcess");var r=this.graph,s=this.settings,o=this.getDimensions();if(this.nodeExtent=N7(this.graph),!this.settings.autoRescale){var l=o.width,u=o.height,f=this.nodeExtent,h=f.x,p=f.y;this.nodeExtent={x:[(h[0]+h[1])/2-l/2,(h[0]+h[1])/2+l/2],y:[(p[0]+p[1])/2-u/2,(p[0]+p[1])/2+u/2]}}this.normalizationFunction=k_(this.customBBox||this.nodeExtent);var g=new T_,O=Of(g.getState(),o,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(o,s.labelGridCellSize);for(var v={},x={},S={},k={},$=1,E=r.nodes(),T=0,_=E.length;T<_;T++){var Q=E[T],N=this.nodeDataCache[Q],R=r.getNodeAttributes(Q);N.x=R.x,N.y=R.y,this.normalizationFunction.applyTo(N),typeof N.label=="string"&&!N.hidden&&this.labelGrid.add(Q,N.size,this.framedGraphToViewport(N,{matrix:O})),v[N.type]=(v[N.type]||0)+1}this.labelGrid.organize();for(var X in this.nodePrograms){if(!ds.call(this.nodePrograms,X))throw new Error('Sigma: could not find a suitable program for node type "'.concat(X,'"!'));this.nodePrograms[X].reallocate(v[X]||0),v[X]=0}this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1]&&(E=S_(this.nodeZExtent,function(J){return i.nodeDataCache[J].zIndex},E));for(var q=0,z=E.length;q<z;q++){var Z=E[q];x[Z]=$,k[x[Z]]={type:"node",id:Z},$++;var F=this.nodeDataCache[Z];this.addNodeToProgram(Z,x[Z],v[F.type]++)}for(var M={},B=r.edges(),L=0,I=B.length;L<I;L++){var U=B[L],V=this.edgeDataCache[U];M[V.type]=(M[V.type]||0)+1}this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(B=S_(this.edgeZExtent,function(J){return i.edgeDataCache[J].zIndex},B));for(var te in this.edgePrograms){if(!ds.call(this.edgePrograms,te))throw new Error('Sigma: could not find a suitable program for edge type "'.concat(te,'"!'));this.edgePrograms[te].reallocate(M[te]||0),M[te]=0}for(var P=0,j=B.length;P<j;P++){var Y=B[P];S[Y]=$,k[S[Y]]={type:"edge",id:Y},$++;var G=this.edgeDataCache[Y];this.addEdgeToProgram(Y,S[Y],M[G.type]++)}return this.itemIDsIndex=k,this.nodeIndices=x,this.edgeIndices=S,this.emit("afterProcess"),this}},{key:"handleSettingsUpdate",value:function(i){var r=this,s=this.settings;if(this.camera.minRatio=s.minCameraRatio,this.camera.maxRatio=s.maxCameraRatio,this.camera.enabledZooming=s.enableCameraZooming,this.camera.enabledPanning=s.enableCameraPanning,this.camera.enabledRotation=s.enableCameraRotation,s.cameraPanBoundaries?this.camera.clean=function(h){return r.cleanCameraState(h,s.cameraPanBoundaries&&Kx(s.cameraPanBoundaries)==="object"?s.cameraPanBoundaries:{})}:this.camera.clean=null,this.camera.setState(this.camera.validateState(this.camera.getState())),i){if(i.edgeProgramClasses!==s.edgeProgramClasses){for(var o in s.edgeProgramClasses)s.edgeProgramClasses[o]!==i.edgeProgramClasses[o]&&this.registerEdgeProgram(o,s.edgeProgramClasses[o]);for(var l in i.edgeProgramClasses)s.edgeProgramClasses[l]||this.unregisterEdgeProgram(l)}if(i.nodeProgramClasses!==s.nodeProgramClasses||i.nodeHoverProgramClasses!==s.nodeHoverProgramClasses){for(var u in s.nodeProgramClasses)(s.nodeProgramClasses[u]!==i.nodeProgramClasses[u]||s.nodeHoverProgramClasses[u]!==i.nodeHoverProgramClasses[u])&&this.registerNodeProgram(u,s.nodeProgramClasses[u],s.nodeHoverProgramClasses[u]);for(var f in i.nodeProgramClasses)s.nodeProgramClasses[f]||this.unregisterNodeProgram(f)}}return this.mouseCaptor.setSettings(this.settings),this.touchCaptor.setSettings(this.settings),this}},{key:"cleanCameraState",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.tolerance,o=s===void 0?0:s,l=r.boundaries,u=Ce({},i),f=l||this.nodeExtent,h=Ec(f.x,2),p=h[0],g=h[1],O=Ec(f.y,2),v=O[0],x=O[1],S=[this.graphToViewport({x:p,y:v},{cameraState:i}),this.graphToViewport({x:g,y:v},{cameraState:i}),this.graphToViewport({x:p,y:x},{cameraState:i}),this.graphToViewport({x:g,y:x},{cameraState:i})],k=1/0,$=-1/0,E=1/0,T=-1/0;S.forEach(function(M){var B=M.x,L=M.y;k=Math.min(k,B),$=Math.max($,B),E=Math.min(E,L),T=Math.max(T,L)});var _=$-k,Q=T-E,N=this.getDimensions(),R=N.width,X=N.height,q=0,z=0;if(_>=R?$<R-o?q=$-(R-o):k>o&&(q=k-o):$>R+o?q=$-(R+o):k<-o&&(q=k+o),Q>=X?T<X-o?z=T-(X-o):E>o&&(z=E-o):T>X+o?z=T-(X+o):E<-o&&(z=E+o),q||z){var Z=this.viewportToFramedGraph({x:0,y:0},{cameraState:i}),F=this.viewportToFramedGraph({x:q,y:z},{cameraState:i});q=F.x-Z.x,z=F.y-Z.y,u.x+=q,u.y+=z}return u}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var i=this.camera.getState(),r=this.labelGrid.getLabelsToDisplay(i.ratio,this.settings.labelDensity);E_(r,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var s=this.canvasContexts.labels,o=0,l=r.length;o<l;o++){var u=r[o],f=this.nodeDataCache[u];if(!this.displayedNodeLabels.has(u)&&!f.hidden){var h=this.framedGraphToViewport(f),p=h.x,g=h.y,O=this.scaleSize(f.size);if(!(!f.forceLabel&&O<this.settings.labelRenderedSizeThreshold)&&!(p<-Q_||p>this.width+Q_||g<-A_||g>this.height+A_)){this.displayedNodeLabels.add(u);var v=this.settings.defaultDrawNodeLabel,x=this.nodePrograms[f.type],S=x?.drawLabel||v;S(s,Ce(Ce({key:u},f),{},{size:O,x:p,y:g}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var i=this.canvasContexts.edgeLabels;i.clearRect(0,0,this.width,this.height);var r=F7({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});E_(r,this.edgesWithForcedLabels);for(var s=new Set,o=0,l=r.length;o<l;o++){var u=r[o],f=this.graph.extremities(u),h=this.nodeDataCache[f[0]],p=this.nodeDataCache[f[1]],g=this.edgeDataCache[u];if(!s.has(u)&&!(g.hidden||h.hidden||p.hidden)){var O=this.settings.defaultDrawEdgeLabel,v=this.edgePrograms[g.type],x=v?.drawLabel||O;x(i,Ce(Ce({key:u},g),{},{size:this.scaleSize(g.size)}),Ce(Ce(Ce({key:f[0]},h),this.framedGraphToViewport(h)),{},{size:this.scaleSize(h.size)}),Ce(Ce(Ce({key:f[1]},p),this.framedGraphToViewport(p)),{},{size:this.scaleSize(p.size)}),this.settings),s.add(u)}}return this.displayedEdgeLabels=s,this}},{key:"renderHighlightedNodes",value:function(){var i=this,r=this.canvasContexts.hovers;r.clearRect(0,0,this.width,this.height);var s=function(O){var v=i.nodeDataCache[O],x=i.framedGraphToViewport(v),S=x.x,k=x.y,$=i.scaleSize(v.size),E=i.settings.defaultDrawNodeHover,T=i.nodePrograms[v.type],_=T?.drawHover||E;_(r,Ce(Ce({key:O},v),{},{size:$,x:S,y:k}),i.settings)},o=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&o.push(this.hoveredNode),this.highlightedNodes.forEach(function(g){g!==i.hoveredNode&&o.push(g)}),o.forEach(function(g){return s(g)});var l={};o.forEach(function(g){var O=i.nodeDataCache[g].type;l[O]=(l[O]||0)+1});for(var u in this.nodeHoverPrograms)this.nodeHoverPrograms[u].reallocate(l[u]||0),l[u]=0;o.forEach(function(g){var O=i.nodeDataCache[g];i.nodeHoverPrograms[O.type].process(0,l[O.type]++,O)}),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var f=this.getRenderParams();for(var h in this.nodeHoverPrograms){var p=this.nodeHoverPrograms[h];p.render(f)}}},{key:"scheduleHighlightedNodesRender",value:function(){var i=this;this.renderHighlightedNodesFrame||this.renderFrame||(this.renderHighlightedNodesFrame=requestAnimationFrame(function(){i.renderHighlightedNodesFrame=null,i.renderHighlightedNodes(),i.renderEdgeLabels()}))}},{key:"render",value:function(){var i=this;this.emit("beforeRender");var r=function(){return i.emit("afterRender"),i};if(this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.resize(),this.needToProcess&&this.process(),this.needToProcess=!1,this.clear(),this.pickingLayers.forEach(function(S){return i.resetWebGLTexture(S)}),!this.graph.order)return r();var s=this.mouseCaptor,o=this.camera.isAnimated()||s.isMoving||s.draggedEvents||s.currentWheelDirection,l=this.camera.getState(),u=this.getDimensions(),f=this.getGraphDimensions(),h=this.getStagePadding();this.matrix=Of(l,u,f,h),this.invMatrix=Of(l,u,f,h,!0),this.correctionRatio=A7(this.matrix,l,u),this.graphToViewportRatio=this.getGraphToViewportRatio();var p=this.getRenderParams();for(var g in this.nodePrograms){var O=this.nodePrograms[g];O.render(p)}if(!this.settings.hideEdgesOnMove||!o)for(var v in this.edgePrograms){var x=this.edgePrograms[v];x.render(p)}return this.settings.hideLabelsOnMove&&o||(this.renderLabels(),this.renderEdgeLabels(),this.renderHighlightedNodes()),r()}},{key:"addNode",value:function(i){var r=Object.assign({},this.graph.getNodeAttributes(i));this.settings.nodeReducer&&(r=this.settings.nodeReducer(i,r));var s=H7(this.settings,i,r);this.nodeDataCache[i]=s,this.nodesWithForcedLabels.delete(i),s.forceLabel&&!s.hidden&&this.nodesWithForcedLabels.add(i),this.highlightedNodes.delete(i),s.highlighted&&!s.hidden&&this.highlightedNodes.add(i),this.settings.zIndex&&(s.zIndex<this.nodeZExtent[0]&&(this.nodeZExtent[0]=s.zIndex),s.zIndex>this.nodeZExtent[1]&&(this.nodeZExtent[1]=s.zIndex))}},{key:"updateNode",value:function(i){this.addNode(i);var r=this.nodeDataCache[i];this.normalizationFunction.applyTo(r)}},{key:"removeNode",value:function(i){delete this.nodeDataCache[i],delete this.nodeProgramIndex[i],this.highlightedNodes.delete(i),this.hoveredNode===i&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(i)}},{key:"addEdge",value:function(i){var r=Object.assign({},this.graph.getEdgeAttributes(i));this.settings.edgeReducer&&(r=this.settings.edgeReducer(i,r));var s=K7(this.settings,i,r);this.edgeDataCache[i]=s,this.edgesWithForcedLabels.delete(i),s.forceLabel&&!s.hidden&&this.edgesWithForcedLabels.add(i),this.settings.zIndex&&(s.zIndex<this.edgeZExtent[0]&&(this.edgeZExtent[0]=s.zIndex),s.zIndex>this.edgeZExtent[1]&&(this.edgeZExtent[1]=s.zIndex))}},{key:"updateEdge",value:function(i){this.addEdge(i)}},{key:"removeEdge",value:function(i){delete this.edgeDataCache[i],delete this.edgeProgramIndex[i],this.hoveredEdge===i&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(i)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new __,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0],this.highlightedNodes=new Set}},{key:"clearEdgeIndices",value:function(){this.edgeDataCache={},this.edgeProgramIndex={},this.edgesWithForcedLabels=new Set,this.edgeZExtent=[1/0,-1/0]}},{key:"clearIndices",value:function(){this.clearEdgeIndices(),this.clearNodeIndices()}},{key:"clearNodeState",value:function(){this.displayedNodeLabels=new Set,this.highlightedNodes=new Set,this.hoveredNode=null}},{key:"clearEdgeState",value:function(){this.displayedEdgeLabels=new Set,this.highlightedNodes=new Set,this.hoveredEdge=null}},{key:"clearState",value:function(){this.clearEdgeState(),this.clearNodeState()}},{key:"addNodeToProgram",value:function(i,r,s){var o=this.nodeDataCache[i],l=this.nodePrograms[o.type];if(!l)throw new Error('Sigma: could not find a suitable program for node type "'.concat(o.type,'"!'));l.process(r,s,o),this.nodeProgramIndex[i]=s}},{key:"addEdgeToProgram",value:function(i,r,s){var o=this.edgeDataCache[i],l=this.edgePrograms[o.type];if(!l)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(o.type,'"!'));var u=this.graph.extremities(i),f=this.nodeDataCache[u[0]],h=this.nodeDataCache[u[1]];l.process(r,s,f,h,o),this.edgeProgramIndex[i]=s}},{key:"getRenderParams",value:function(){return{matrix:this.matrix,invMatrix:this.invMatrix,width:this.width,height:this.height,pixelRatio:this.pixelRatio,zoomRatio:this.camera.ratio,cameraAngle:this.camera.angle,sizeRatio:1/this.scaleSize(),correctionRatio:this.correctionRatio,downSizingRatio:this.pickingDownSizingRatio,minEdgeThickness:this.settings.minEdgeThickness,antiAliasingFeather:this.settings.antiAliasingFeather}}},{key:"getStagePadding",value:function(){var i=this.settings,r=i.stagePadding,s=i.autoRescale;return s&&r||0}},{key:"createLayer",value:function(i,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[i])throw new Error('Sigma: a layer named "'.concat(i,'" already exists'));var o=R7(r,{position:"absolute"},{class:"sigma-".concat(i)});return s.style&&Object.assign(o.style,s.style),this.elements[i]=o,"beforeLayer"in s&&s.beforeLayer?this.elements[s.beforeLayer].before(o):"afterLayer"in s&&s.afterLayer?this.elements[s.afterLayer].after(o):this.container.appendChild(o),o}},{key:"createCanvas",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(i,"canvas",r)}},{key:"createCanvasContext",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this.createCanvas(i,r),o={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[i]=s.getContext("2d",o),this}},{key:"createWebGLContext",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r?.canvas||this.createCanvas(i,r);r.hidden&&s.remove();var o=Ce({preserveDrawingBuffer:!1,antialias:!1},r),l;l=s.getContext("webgl2",o),l||(l=s.getContext("webgl",o)),l||(l=s.getContext("experimental-webgl",o));var u=l;if(this.webGLContexts[i]=u,u.blendFunc(u.ONE,u.ONE_MINUS_SRC_ALPHA),r.picking){this.pickingLayers.add(i);var f=u.createFramebuffer();if(!f)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(i));this.frameBuffers[i]=f}return u}},{key:"killLayer",value:function(i){var r=this.elements[i];if(!r)throw new Error("Sigma: cannot kill layer ".concat(i,", which does not exist"));if(this.webGLContexts[i]){var s,o=this.webGLContexts[i];(s=o.getExtension("WEBGL_lose_context"))===null||s===void 0||s.loseContext(),delete this.webGLContexts[i]}else this.canvasContexts[i]&&delete this.canvasContexts[i];return r.remove(),delete this.elements[i],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(i){this.unbindCameraHandlers(),this.camera=i,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(i){i!==this.graph&&(this.hoveredNode&&!i.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!i.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=i,this.bindGraphHandlers(),this.refresh())}},{key:"getMouseCaptor",value:function(){return this.mouseCaptor}},{key:"getTouchCaptor",value:function(){return this.touchCaptor}},{key:"getDimensions",value:function(){return{width:this.width,height:this.height}}},{key:"getGraphDimensions",value:function(){var i=this.customBBox||this.nodeExtent;return{width:i.x[1]-i.x[0]||1,height:i.y[1]-i.y[0]||1}}},{key:"getNodeDisplayData",value:function(i){var r=this.nodeDataCache[i];return r?Object.assign({},r):void 0}},{key:"getEdgeDisplayData",value:function(i){var r=this.edgeDataCache[i];return r?Object.assign({},r):void 0}},{key:"getNodeDisplayedLabels",value:function(){return new Set(this.displayedNodeLabels)}},{key:"getEdgeDisplayedLabels",value:function(){return new Set(this.displayedEdgeLabels)}},{key:"getSettings",value:function(){return Ce({},this.settings)}},{key:"getSetting",value:function(i){return this.settings[i]}},{key:"setSetting",value:function(i,r){var s=Ce({},this.settings);return this.settings[i]=r,J0(this.settings),this.handleSettingsUpdate(s),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(i,r){return this.setSetting(i,r(this.settings[i])),this}},{key:"setSettings",value:function(i){var r=Ce({},this.settings);return this.settings=Ce(Ce({},this.settings),i),J0(this.settings),this.handleSettingsUpdate(r),this.scheduleRefresh(),this}},{key:"resize",value:function(i){var r=this.width,s=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=w_(),this.width===0)if(this.settings.allowInvalidContainer)this.width=1;else throw new Error("Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(this.height===0)if(this.settings.allowInvalidContainer)this.height=1;else throw new Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(!i&&r===this.width&&s===this.height)return this;for(var o in this.elements){var l=this.elements[o];l.style.width=this.width+"px",l.style.height=this.height+"px"}for(var u in this.canvasContexts)this.elements[u].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[u].setAttribute("height",this.height*this.pixelRatio+"px"),this.pixelRatio!==1&&this.canvasContexts[u].scale(this.pixelRatio,this.pixelRatio);for(var f in this.webGLContexts){this.elements[f].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[f].setAttribute("height",this.height*this.pixelRatio+"px");var h=this.webGLContexts[f];if(h.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(f)){var p=this.textures[f];p&&h.deleteTexture(p)}}return this.emit("resize"),this}},{key:"clear",value:function(){return this.emit("beforeClear"),this.webGLContexts.nodes.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.nodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.edges.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.edges.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this.emit("afterClear"),this}},{key:"refresh",value:function(i){var r=this,s=i?.skipIndexation!==void 0?i?.skipIndexation:!1,o=i?.schedule!==void 0?i.schedule:!1,l=!i||!i.partialGraph;if(l)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(T){return r.addNode(T)}),this.graph.forEachEdge(function(T){return r.addEdge(T)});else{for(var u,f,h=((u=i.partialGraph)===null||u===void 0?void 0:u.nodes)||[],p=0,g=h?.length||0;p<g;p++){var O=h[p];if(this.updateNode(O),s){var v=this.nodeProgramIndex[O];if(v===void 0)throw new Error('Sigma: node "'.concat(O,`" can't be repaint`));this.addNodeToProgram(O,this.nodeIndices[O],v)}}for(var x=(i==null||(f=i.partialGraph)===null||f===void 0?void 0:f.edges)||[],S=0,k=x.length;S<k;S++){var $=x[S];if(this.updateEdge($),s){var E=this.edgeProgramIndex[$];if(E===void 0)throw new Error('Sigma: edge "'.concat($,`" can't be repaint`));this.addEdgeToProgram($,this.edgeIndices[$],E)}}}return(l||!s)&&(this.needToProcess=!0),o?this.scheduleRender():this.render(),this}},{key:"scheduleRender",value:function(){var i=this;return this.renderFrame||(this.renderFrame=requestAnimationFrame(function(){i.render()})),this}},{key:"scheduleRefresh",value:function(i){return this.refresh(Ce(Ce({},i),{},{schedule:!0}))}},{key:"getViewportZoomedState",value:function(i,r){var s=this.camera.getState(),o=s.ratio,l=s.angle,u=s.x,f=s.y,h=this.settings,p=h.minCameraRatio,g=h.maxCameraRatio;typeof g=="number"&&(r=Math.min(r,g)),typeof p=="number"&&(r=Math.max(r,p));var O=r/o,v={x:this.width/2,y:this.height/2},x=this.viewportToFramedGraph(i),S=this.viewportToFramedGraph(v);return{angle:l,x:(x.x-S.x)*(1-O)+u,y:(x.y-S.y)*(1-O)+f,ratio:r}}},{key:"viewRectangle",value:function(){var i=this.viewportToFramedGraph({x:0,y:0}),r=this.viewportToFramedGraph({x:this.width,y:0}),s=this.viewportToFramedGraph({x:0,y:this.height});return{x1:i.x,y1:i.y,x2:r.x,y2:r.y,height:r.y-s.y}}},{key:"framedGraphToViewport",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=!!r.cameraState||!!r.viewportDimensions||!!r.graphDimensions,o=r.matrix?r.matrix:s?Of(r.cameraState||this.camera.getState(),r.viewportDimensions||this.getDimensions(),r.graphDimensions||this.getGraphDimensions(),r.padding||this.getStagePadding()):this.matrix,l=Hx(o,i);return{x:(1+l.x)*this.width/2,y:(1-l.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=!!r.cameraState||!!r.viewportDimensions||!r.graphDimensions,o=r.matrix?r.matrix:s?Of(r.cameraState||this.camera.getState(),r.viewportDimensions||this.getDimensions(),r.graphDimensions||this.getGraphDimensions(),r.padding||this.getStagePadding(),!0):this.invMatrix,l=Hx(o,{x:i.x/this.width*2-1,y:1-i.y/this.height*2});return isNaN(l.x)&&(l.x=0),isNaN(l.y)&&(l.y=0),l}},{key:"viewportToGraph",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(i,r))}},{key:"graphToViewport",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(i),r)}},{key:"getGraphToViewportRatio",value:function(){var i={x:0,y:0},r={x:1,y:1},s=Math.sqrt(Math.pow(i.x-r.x,2)+Math.pow(i.y-r.y,2)),o=this.graphToViewport(i),l=this.graphToViewport(r),u=Math.sqrt(Math.pow(o.x-l.x,2)+Math.pow(o.y-l.y,2));return u/s}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(i){return this.customBBox=i,this.scheduleRender(),this}},{key:"kill",value:function(){this.emit("kill"),this.removeAllListeners(),this.unbindCameraHandlers(),window.removeEventListener("resize",this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),this.unbindGraphHandlers(),this.clearIndices(),this.clearState(),this.nodeDataCache={},this.edgeDataCache={},this.highlightedNodes.clear(),this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.renderHighlightedNodesFrame&&(cancelAnimationFrame(this.renderHighlightedNodesFrame),this.renderHighlightedNodesFrame=null);for(var i=this.container;i.firstChild;)i.removeChild(i.firstChild);for(var r in this.nodePrograms)this.nodePrograms[r].kill();for(var s in this.nodeHoverPrograms)this.nodeHoverPrograms[s].kill();for(var o in this.edgePrograms)this.edgePrograms[o].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var l in this.elements)this.killLayer(l);this.canvasContexts={},this.webGLContexts={},this.elements={}}},{key:"scaleSize",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return i/this.settings.zoomToSizeRatioFunction(r)*(this.getSetting("itemSizesReference")==="positions"?r*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var i={};for(var r in this.elements)this.elements[r]instanceof HTMLCanvasElement&&(i[r]=this.elements[r]);return i}}])})(R1),eW=J7;function tW(t){const e=new Map,n=new Map;for(const i of t.nodes){if(i.type!=="file"||!i.parent_id)continue;const r=i.id.replace(/^file:/,"");e.set(r,i.parent_id);const s=r.split("/").pop();s&&n.set(s,i.parent_id),e.set(i.label,i.parent_id)}return{exact:e,base:n}}function nW(t,e){const n=new Set;for(const i of t){const r=e.exact.get(i.name)??e.exact.get(i.name.replace(/^\.?\//,""))??e.base.get(i.name.split("/").pop()??i.name);r&&n.add(r)}return n}function iW(t,e){if(!t)return{};const n=tW(t),i={};for(const r of e){if(!r.time_verified)continue;const s=Date.parse(r.time_verified);if(Number.isNaN(s))continue;const o=r.authorship?.accepting_human?.name??null,l=r.verification_result==="PASSED";for(const u of nW(r.subjects,n)){const f=i[u];f&&Date.parse(f.lastChange)>=s||(i[u]={moduleId:u,lastChange:r.time_verified,checks:r.checks.length,acceptedBy:o,verified:l,receiptHash:r.receipt_hash})}}return i}const rW=720*60*60*1e3;function sW(t,e){const n=Date.parse(t.lastChange);return!Number.isNaN(n)&&e-n<=rW}const _f={green:"#16a34a",amber:"#d97706",red:"#dc2626",unknown:"#94a3b8"},Vl="#94a3b8",N_="#64748b",oW="#0d9488",aW="#a78bfa",ti={r:250,g:250,b:250},us={defects:{r:220,g:38,b:38},risk:{r:217,g:119,b:6}},Cg={r:147,g:51,b:234};function Dn(t,e,n){const i=s=>Math.round(t[s]+(e[s]-t[s])*Math.max(0,Math.min(1,n)));return"#"+(i("r")<<16|i("g")<<8|i("b")).toString(16).padStart(6,"0")}function lW(t,e){const n=/^#([0-9a-f]{6})$/i.exec(t);if(!n)return t;const i=parseInt(n[1],16),r={r:i>>16&255,g:i>>8&255,b:i&255};return Dn(r,{r:255,g:255,b:255},e)}function OM(t){const e=new Map,n=new Map,i=new Map,r=new Map;for(const f of t.nodes)f.type==="file"&&f.parent_id&&e.set(f.parent_id,(e.get(f.parent_id)??0)+1);for(const f of t.nodes){if(f.type!=="module")continue;const h=e.get(f.id)??0,p=f.attributes.defect_count??0,g=h>0?p/h:p;n.set(f.id,g),f.attributes.risk_floor!=null&&i.set(f.id,f.attributes.risk_floor),f.attributes.complexity_correction!=null&&r.set(f.id,Math.abs(f.attributes.complexity_correction-1))}let s=0;for(const f of n.values())s=Math.max(s,Math.log1p(f));const o=Math.max(0,...Array.from(i.values())),l=Math.max(0,...Array.from(r.values())),u=new Map;for(const f of["none","health","defects","risk","complexity"]){const h=new Map;for(const p of t.nodes)p.type==="module"&&h.set(p.id,cW(p,f,{defectDensities:n,riskValues:i,complexityDeltas:r,maxDefectDensityLog:s,maxRisk:o,maxComplexityDelta:l}));u.set(f,h)}return{fileCounts:e,defectDensities:n,riskValues:i,complexityDeltas:r,maxDefectDensityLog:s,maxRisk:o,maxComplexityDelta:l,moduleColors:u}}function cW(t,e,n){if(e==="none")return Vl;if(e==="health")return _f[t.attributes.health_tier??"unknown"];if(e==="defects"){const i=n.defectDensities.get(t.id)??0;if(n.maxDefectDensityLog<=0)return Dn(ti,us.defects,0);const r=Math.log1p(i)/n.maxDefectDensityLog;return Dn(ti,us.defects,r)}if(e==="risk"){const i=n.riskValues.get(t.id);if(i==null)return Vl;const r=n.maxRisk>0?i/n.maxRisk:i;return Dn(ti,us.risk,r)}if(e==="complexity"){const i=n.complexityDeltas.get(t.id);if(i==null)return Vl;const r=n.maxComplexityDelta>0?i/n.maxComplexityDelta:0;return Dn(ti,Cg,r)}return Vl}function P_(t,e,n){if(t.type==="module")return n.moduleColors.get(e)?.get(t.id)??Vl;if(t.type==="file"){if(e==="none"||!t.parent_id)return N_;const i=n.moduleColors.get(e)?.get(t.parent_id)??N_;return lW(i,.45)}return t.type==="chunk"?oW:t.type==="symbol"?aW:Vl}function uW(t,e){if(t==="none")return null;if(t==="health")return{title:"Module health",stops:[{label:Ef.green,color:_f.green},{label:Ef.amber,color:_f.amber},{label:Ef.red,color:_f.red},{label:Ef.unknown,color:_f.unknown}]};if(t==="defects")return{title:"Defect density (log)",stops:[{label:"low",color:Dn(ti,us.defects,0)},{label:"mid",color:Dn(ti,us.defects,.5)},{label:"high",color:Dn(ti,us.defects,1)}]};if(t==="risk"){const n=e.maxRisk>0?e.maxRisk.toFixed(2):"—";return{title:"Risk floor",stops:[{label:"0.00",color:Dn(ti,us.risk,0)},{label:(Math.max(e.maxRisk,0)/2).toFixed(2),color:Dn(ti,us.risk,.5)},{label:n,color:Dn(ti,us.risk,1)}]}}if(t==="complexity"){const n=e.maxComplexityDelta>0?e.maxComplexityDelta.toFixed(2):"—";return{title:"|complexity − 1|",stops:[{label:"0.00",color:Dn(ti,Cg,0)},{label:(e.maxComplexityDelta/2).toFixed(2),color:Dn(ti,Cg,.5)},{label:n,color:Dn(ti,Cg,1)}]}}return null}function fW(t){switch(t){case"module":return 12;case"file":return 5;case"chunk":return 2;default:return 3}}function dW(t){return 10+Math.min(26,Math.sqrt(t)*4)}function hW(t){return t<=.22?2:t<=.55?1:0}function pW(t){let e=0;for(let n=0;n<t.length;n++)e=e*31+t.charCodeAt(n)|0;return e}function R_(t){const e=pW(t);return{x:((e&65535)/65535-.5)*100,y:((e>>>16&65535)/65535-.5)*100}}function gW(t,e,n){switch(t){case"module":return e.modules;case"file":return e.files||n>=1;case"chunk":return e.chunks||n>=2;case"symbol":return e.symbols||n>=2;default:return!0}}function mW(t,e,n){return t==="contains"?e.contains||n>=1:t==="imports"?e.imports||n>=1:t==="similar"?e.similar:t==="defines"?e.symbols||n>=2:!0}function tb(t,e,n){t.forEachNode((i,r)=>{t.setNodeAttribute(i,"hidden",!gW(r.nodeType,e,n))}),t.forEachEdge((i,r,s,o,l,u)=>{const f=!l.hidden&&!u.hidden;t.setEdgeAttribute(i,"hidden",!f||!mW(r.edgeType,e,n))})}function nb(t){const e=/^#([0-9a-f]{6})$/i.exec(t);if(!e)return"#cbd5e1";const n=parseInt(e[1],16),i=n>>16&255,r=n>>8&255,s=n&255,o=220,l=f=>Math.round(f*.25+o*.75);return"#"+(l(i)<<16|l(r)<<8|l(s)).toString(16).padStart(6,"0")}function OW({data:t}){const e=C.useRef(null),n=C.useRef(null),i=C.useRef(null),r=je(S=>S.selectNode),s=je(S=>S.layers),o=je(S=>S.search),l=je(S=>S.selectedNode),u=je(S=>S.similarity.edges),f=je(S=>S.overlay),h=je(S=>S.aiActivity),p=je(S=>S.activityByModule),g=C.useMemo(()=>OM(t),[t]),O=C.useRef(0),v=C.useRef(""),x=C.useRef(null);return C.useEffect(()=>{if(!e.current)return;const S=new dt({multi:!0,type:"mixed"}),k=new Map,$=new Map;for(const z of t.nodes)z.type==="file"&&z.parent_id&&$.set(z.parent_id,($.get(z.parent_id)??0)+1);for(const z of t.nodes){k.set(z.id,z);const Z=R_(z.id),F=P_(z,f,g);S.addNode(z.id,{x:Z.x,y:Z.y,size:z.type==="module"?dW($.get(z.id)??0):fW(z.type),label:z.label,color:F,baseColor:F,nodeType:z.type,hidden:!1})}for(const z of t.edges){if(!S.hasNode(z.source)||!S.hasNode(z.target))continue;const Z=z.type==="contains"?"#cbd5e1":z.type==="imports"?"#6366f1":z.type==="similar"?"#f97316":z.type==="defines"?"#a78bfa":"#a3a3a3";S.addEdgeWithKey(z.id,z.source,z.target,{size:z.type==="contains"?.4:.8,color:Z,baseColor:Z,edgeType:z.type,hidden:!0})}tb(S,s,O.current),i.current=S;const E=new eW(S,e.current,{allowInvalidContainer:!0,renderEdgeLabels:!1,defaultEdgeColor:"#cbd5e1",defaultNodeColor:"#64748b",labelDensity:.5,labelGridCellSize:100,labelRenderedSizeThreshold:6,minCameraRatio:.02,maxCameraRatio:50}),T=new ResizeObserver(()=>E.resize());T.observe(e.current),n.current=E,E.on("clickNode",({node:z})=>{const Z=k.get(z);Z&&r(Z)}),E.on("clickStage",()=>r(null));const _=E.getCamera(),Q=()=>{const z=hW(_.getState().ratio);if(z===O.current)return;O.current=z;const Z=i.current;Z&&(tb(Z,je.getState().layers,z),n.current?.refresh())};_.on("updated",Q);const N=new Worker(new URL("/assets/layout.worker-d99nkYfV.js",import.meta.url),{type:"module"}),R=t.nodes.map(z=>({id:z.id,...R_(z.id)})),X=t.edges.map(z=>({source:z.source,target:z.target}));N.onmessage=z=>{const Z=z.data.positions,F=i.current;if(F){if(F.forEachNode(M=>{const B=Z[M];B&&(F.setNodeAttribute(M,"x",B.x),F.setNodeAttribute(M,"y",B.y))}),n.current?.refresh(),x.current&&n.current){const M=x.current;n.current.getCamera().setState(M),x.current=null}N.terminate()}};const q={nodes:R,edges:X,iterations:Math.min(300,Math.max(50,Math.round(2e4/Math.max(1,t.nodes.length/100))))};return N.postMessage(q),()=>{try{const z=E.getCamera().getState();x.current={x:z.x,y:z.y,ratio:z.ratio,angle:z.angle}}catch{x.current=null}_.off("updated",Q),T.disconnect(),N.terminate(),E.kill(),n.current=null,i.current=null}},[t,r]),C.useEffect(()=>{const S=i.current;if(S){for(const k of t.nodes){if(!S.hasNode(k.id))continue;const $=P_(k,f,g);S.setNodeAttribute(k.id,"baseColor",$),S.setNodeAttribute(k.id,"color",$)}n.current?.refresh()}},[f,g,t]),C.useEffect(()=>{const S=i.current;S&&(tb(S,s,O.current),n.current?.refresh())},[s]),C.useEffect(()=>{const S=i.current;if(!S)return;const k=[];S.forEachEdge(($,E)=>{E.edgeType==="similar"&&k.push($)});for(const $ of k)S.dropEdge($);for(const $ of u){if(!S.hasNode($.source)||!S.hasNode($.target)||S.hasEdge($.id))continue;const E="#f97316";S.addEdgeWithKey($.id,$.source,$.target,{size:.8,color:E,baseColor:E,edgeType:"similar",hidden:!s.similar})}n.current?.refresh()},[u,s.similar]),C.useEffect(()=>{const S=i.current,k=n.current;if(!S||!k)return;const $=new Set(o.query.trim()?o.matches:[]),E=$.size>0||!!l,T=Date.now(),_=new Set;if(h&&!E)for(const N of Object.values(p))sW(N,T)&&_.add(N.moduleId);const Q=_.size>0;if(S.forEachNode((N,R)=>{const X=R.baseColor??R.color,q=R.nodeType;if(E){const z=$.has(N)||l?.id===N;S.setNodeAttribute(N,"color",z?X:nb(X)),S.setNodeAttribute(N,"highlighted",z)}else if(Q){const z=q!=="module"||_.has(N);S.setNodeAttribute(N,"color",z?X:nb(X)),S.setNodeAttribute(N,"highlighted",q==="module"&&_.has(N))}else S.setNodeAttribute(N,"color",X),S.setNodeAttribute(N,"highlighted",!1)}),S.forEachEdge((N,R)=>{const X=R.baseColor??R.color;S.setEdgeAttribute(N,"color",E?nb(X):X)}),k.refresh(),o.matches.length>0){const N=o.matches[o.index%o.matches.length],R=`${o.query}|${o.index}|${N}`;if(N&&S.hasNode(N)&&R!==v.current){v.current=R;const X=k.getNodeDisplayData(N);X&&k.getCamera().animate({x:X.x,y:X.y,ratio:.5},{duration:350})}}else o.query||v.current&&(v.current="",k.getCamera().animate({x:.5,y:.5,ratio:1,angle:0},{duration:300}))},[o,l,h,p]),y.jsx("div",{ref:e,style:{position:"absolute",inset:0,width:"100%",height:"100%"}})}function yW(t){const e={green:0,amber:0,red:0,unknown:0,measured:0};if(!t)return e;for(const n of t.nodes){if(n.type!=="module")continue;const i=n.attributes.health_tier??"unknown";i==="green"||i==="amber"||i==="red"?(e[i]+=1,e.measured+=1):e.unknown+=1}return e}const vW=10080*60*1e3;function bW({graph:t}){const e=je(u=>u.activityByModule),n=C.useMemo(()=>{const u=Date.now()-vW,f=Object.values(e).filter(h=>{const p=Date.parse(h.lastChange);return!Number.isNaN(p)&&p>=u});return{total:f.length,unverified:f.filter(h=>!h.verified).length}},[e]),i=C.useMemo(()=>yW(t),[t]),r=i.red>0?"At risk":i.amber>0?"Needs attention":i.measured>0?"Healthy":"Not yet measured",s=i.amber+i.red,o=i.measured>0?`${s} ${s===1?"area needs":"areas need"} attention.`:"Run paqad-ai onboard to measure your areas.",l=n.total>0?` AI agents shipped to ${n.total} ${n.total===1?"module":"modules"} this week, ${n.unverified===0?"all verified":`${n.unverified} unverified`}.`:"";return y.jsxs("div",{className:"shrink-0 border-b px-6 py-4",style:{background:"var(--color-canvas)",borderColor:"color-mix(in srgb, var(--color-border) 60%, transparent)"},children:[y.jsxs("div",{className:"text-page font-semibold",children:[r,"."]}),y.jsxs("p",{className:"mt-0.5 text-secondary",style:{color:"var(--color-muted)"},children:[o,l]})]})}function xW(){const t=je(i=>i.overlay),e=je(i=>i.graph),n=C.useMemo(()=>{if(!e||t==="none")return null;const i=OM(e);return uW(t,i)},[t,e]);return n?y.jsxs("div",{className:"absolute bottom-3 left-3 rounded-lg border p-2 text-xs shadow-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:[y.jsx("div",{className:"font-medium",children:n.title}),y.jsx("ul",{className:"mt-1 space-y-0.5",children:n.stops.map(i=>y.jsxs("li",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"inline-block h-3 w-3 rounded-sm",style:{background:i.color,borderColor:"var(--color-border)"}}),y.jsx("span",{children:i.label})]},i.label))})]}):null}function wW(t){const e=t.lastIndexOf("/");return e>=0?t.slice(e+1):t}function SW(){const t=je(l=>l.graph),e=je(l=>l.search),n=je(l=>l.setSearchQuery),i=je(l=>l.setSearchMatches),r=je(l=>l.setSearchIndex),s=C.useRef(null),o=C.useMemo(()=>{if(!t||!e.query.trim())return[];const l=e.query.trim().toLowerCase(),u=[];for(const f of t.nodes){if(f.label.toLowerCase().includes(l)){u.push(f.id);continue}if(f.type==="file"&&wW(f.label).toLowerCase().includes(l)){u.push(f.id);continue}}return u},[t,e.query]);return C.useEffect(()=>{i(o)},[o,i]),C.useEffect(()=>{const l=u=>{if(u.target instanceof HTMLInputElement||u.target instanceof HTMLTextAreaElement){u.key==="Escape"&&u.target.blur();return}if(u.key==="/"&&!u.metaKey&&!u.ctrlKey){u.preventDefault(),s.current?.focus();return}o.length!==0&&(u.key==="n"&&(u.preventDefault(),r((e.index+1)%o.length)),u.key==="N"&&(u.preventDefault(),r((e.index-1+o.length)%o.length)))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[o,e.index,r]),y.jsxs("div",{className:"absolute left-1/2 top-3 -translate-x-1/2 rounded-lg border px-3 py-1.5 text-sm shadow-sm flex items-center gap-2",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:[y.jsx("input",{ref:s,value:e.query,onChange:l=>n(l.target.value),placeholder:"search modules, files, symbols…  (press /)",className:"w-72 bg-transparent text-sm outline-none"}),e.query&&y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"text-[11px]",style:{color:"var(--color-muted)"},children:o.length===0?"no matches":`${e.index+1} / ${o.length}`}),y.jsx("button",{type:"button",onClick:()=>n(""),className:"text-[11px] underline",style:{color:"var(--color-muted)"},children:"clear"})]})]})}function Jx({area:t,getScope:e,onApply:n}){const[i,r]=C.useState([]),[s,o]=C.useState(null),l=C.useCallback(()=>{MZ().then(h=>{r(h.filter(p=>p.area===t)),o(null)}).catch(h=>o(h instanceof Error?h.message:String(h)))},[t]);C.useEffect(()=>{l()},[l]);const u=()=>{const h=window.prompt("Name this view");h===null||h.trim().length===0||LZ({id:crypto.randomUUID(),name:h.trim(),area:t,scope:e()}).then(l).catch(p=>o(p instanceof Error?p.message:String(p)))},f=h=>{DZ(h).then(l).catch(p=>o(p instanceof Error?p.message:String(p)))};return y.jsxs("div",{className:"text-xs",children:[y.jsx("button",{type:"button",className:"rounded border px-2 py-1 font-medium",style:{borderColor:"var(--color-accent)",color:"var(--color-accent)"},onClick:u,children:"Save this view"}),i.length>0&&y.jsxs("div",{className:"mt-2",children:[y.jsx("div",{style:{color:"var(--color-muted)"},children:"Saved views"}),y.jsx("ul",{className:"mt-1 space-y-1",children:i.map(h=>y.jsxs("li",{className:"flex items-center gap-2",children:[y.jsx("button",{type:"button",className:"min-w-0 flex-1 truncate text-left",style:{color:"var(--color-accent)"},onClick:()=>n(h.scope),title:`Apply ${h.name}`,children:h.name}),y.jsx("button",{type:"button",className:"shrink-0",style:{color:"var(--color-muted)"},onClick:()=>f(h.id),"aria-label":`Delete ${h.name}`,title:`Delete ${h.name}`,children:"✕"})]},h.id))})]}),s&&y.jsx("div",{className:"mt-1",style:{color:"var(--color-mod-red)"},children:s})]})}const kW=[{key:"modules",label:"Modules"},{key:"files",label:"Files"},{key:"chunks",label:"Chunks"},{key:"symbols",label:"Symbols"},{key:"contains",label:"Contains edges"},{key:"imports",label:"Imports edges"},{key:"similar",label:"Similarity edges"}];function EW(){const t=je(_=>_.graph),e=je(_=>_.layers),n=je(_=>_.toggleLayer),i=je(_=>_.setLayers),r=je(_=>_.similarity),s=je(_=>_.setSimilarityThreshold),o=je(_=>_.setSimilarityLoading),l=je(_=>_.setSimilarityResult),u=je(_=>_.setSimilarityError),[f,h]=C.useState(r.threshold),p=t?.meta.similarity_edges_available??!1,g=je(_=>_.overlay),O=je(_=>_.setOverlay),v=je(_=>_.aiActivity),x=je(_=>_.setAiActivity),S=je(_=>_.disclosure),k=je(_=>_.setDisclosure),$=t?.meta.overlays_available,E=[{key:"none",label:"none"},{key:"health",label:"health",availableKey:"health"},{key:"defects",label:"defect density",availableKey:"defects"},{key:"risk",label:"risk floor",availableKey:"risk_floor"},{key:"complexity",label:"complexity correction",availableKey:"complexity_correction"}];async function T(_){s(_),o(!0);try{const Q=await jZ({threshold:_,scope:{type:"all",id:null}});l(Q.edges,Q.capped)}catch(Q){u(Q instanceof Error?Q.message:String(Q))}}return y.jsxs("aside",{className:"absolute left-3 top-3 w-72 max-h-[calc(100vh-1.5rem)] overflow-auto rounded-lg border p-3 text-sm shadow-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:[y.jsx("header",{className:"flex items-center justify-between",children:y.jsx("h1",{className:"font-semibold tracking-tight",children:"Graph"})}),t&&y.jsxs(y.Fragment,{children:[y.jsxs("p",{className:"mt-2 text-xs",style:{color:"var(--color-muted)"},children:[t.meta.counts.modules," ",t.meta.counts.modules===1?"area":"areas",", coloured by health. Zoom in to see the files inside each one."]}),y.jsxs("section",{className:"mt-3 space-y-2 text-xs",children:[y.jsxs("label",{className:"flex items-center gap-2",children:[y.jsx("input",{type:"checkbox",checked:v,onChange:_=>x(_.target.checked)}),"What the AI changed"]}),y.jsx("div",{className:"flex gap-1",children:["working","shareable"].map(_=>y.jsx("button",{type:"button",className:"rounded border px-2 py-0.5",style:{borderColor:"var(--color-border)",background:S===_?"var(--color-canvas)":"transparent",color:S===_?"var(--color-canvas-fg)":"var(--color-muted)"},onClick:()=>k(_),children:_==="working"?"Working view":"Shareable view"},_))})]}),y.jsxs("details",{className:"mt-3 border-t pt-2",style:{borderColor:"var(--color-border)"},children:[y.jsx("summary",{className:"cursor-pointer text-xs font-medium uppercase tracking-wide",style:{color:"var(--color-muted)"},children:"Advanced / for engineers"}),y.jsxs("section",{className:"mt-2 grid grid-cols-2 gap-x-3 gap-y-1 text-xs",style:{color:"var(--color-muted)"},children:[y.jsx("div",{children:"modules"}),y.jsx("div",{className:"text-right",children:t.meta.counts.modules}),y.jsx("div",{children:"files"}),y.jsx("div",{className:"text-right",children:t.meta.counts.files}),y.jsx("div",{children:"chunks"}),y.jsx("div",{className:"text-right",children:t.meta.counts.chunks}),y.jsx("div",{children:"symbols"}),y.jsx("div",{className:"text-right",children:t.meta.counts.symbols}),y.jsx("div",{children:"imports"}),y.jsx("div",{className:"text-right",children:t.meta.counts.imports})]}),y.jsxs("section",{className:"mt-3 border-t pt-2",style:{borderColor:"var(--color-border)"},children:[y.jsx("h2",{className:"text-xs font-medium uppercase tracking-wide",style:{color:"var(--color-muted)"},children:"Layers"}),y.jsx("ul",{className:"mt-1 space-y-1",children:kW.map(_=>y.jsxs("li",{className:"flex items-center gap-2",children:[y.jsx("input",{id:"layer-"+_.key,type:"checkbox",checked:e[_.key],onChange:()=>n(_.key)}),y.jsx("label",{htmlFor:"layer-"+_.key,children:_.label})]},_.key))})]}),y.jsxs("section",{className:"mt-3 border-t pt-2",style:{borderColor:"var(--color-border)"},children:[y.jsx("h2",{className:"text-xs font-medium uppercase tracking-wide",style:{color:"var(--color-muted)"},children:"Overlay"}),y.jsx("select",{value:g,onChange:_=>O(_.target.value),className:"mt-1 w-full rounded border px-1.5 py-0.5 text-xs",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:E.map(_=>{const Q=_.availableKey!=null&&$!=null&&!$[_.availableKey];return y.jsxs("option",{value:_.key,disabled:Q,children:[_.label,Q?" (unavailable)":""]},_.key)})})]}),y.jsxs("section",{className:"mt-3 border-t pt-2",style:{borderColor:"var(--color-border)"},children:[y.jsx("h2",{className:"text-xs font-medium uppercase tracking-wide",style:{color:"var(--color-muted)"},children:"Similarity"}),y.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[y.jsx("input",{type:"range",min:.1,max:1,step:.01,disabled:!p,value:f,onChange:_=>h(parseFloat(_.target.value)),onMouseUp:_=>T(parseFloat(_.target.value)),onKeyUp:_=>{(_.key==="ArrowLeft"||_.key==="ArrowRight")&&T(parseFloat(_.target.value))},className:"flex-1"}),y.jsx("span",{className:"w-10 text-right text-xs tabular-nums",style:{color:"var(--color-muted)"},children:f.toFixed(2)})]}),y.jsx("div",{className:"mt-1 text-[11px]",style:{color:"var(--color-muted)"},children:p?r.loading?"resolving…":r.error?`error: ${r.error}`:`${r.edges.length} edges${r.capped?" (capped)":""}`:"vector store missing — similarity disabled"})]})]}),t.meta.degraded_reasons.length>0&&y.jsxs("section",{className:"mt-3 border-t pt-2",style:{borderColor:"var(--color-border)"},children:[y.jsx("h2",{className:"text-xs font-medium uppercase tracking-wide",style:{color:"var(--color-muted)"},children:"Notes"}),y.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4 text-xs",style:{color:"var(--color-muted)"},children:t.meta.degraded_reasons.map(_=>y.jsx("li",{children:_},_))})]}),y.jsx("section",{className:"mt-3 border-t pt-2",style:{borderColor:"var(--color-border)"},children:y.jsx(Jx,{area:"graph",getScope:()=>({layers:e,threshold:r.threshold,overlay:g}),onApply:_=>{const Q=_;Q.layers&&i(Q.layers),typeof Q.overlay=="string"&&O(Q.overlay),typeof Q.threshold=="number"&&(h(Q.threshold),T(Q.threshold))}})})]})]})}function TW(){const t=je(k=>k.graph),e=je(k=>k.loading),n=je(k=>k.error),i=je(k=>k.setGraph),r=je(k=>k.setLoading),s=je(k=>k.setError),[o,l]=C.useState(null),[u,f]=C.useState(null),[h,p]=C.useState(!1),[g,O]=C.useState([]),v=je(k=>k.setActivityByModule);C.useEffect(()=>{let k=!1;return r(!0),jC().then($=>{k||(i($),r(!1))}).catch($=>{k||(s($ instanceof Error?$.message:String($)),r(!1))}),_i().then($=>{k||(l($.projectName),f($.frameworkVersion))}).catch(()=>{}),()=>{k=!0}},[i,r,s]),C.useEffect(()=>{let k=!1;return Xg().then($=>{k||O($.receipts)}).catch(()=>{}),()=>{k=!0}},[]),C.useEffect(()=>{v(iW(t,g))},[t,g,v]);const[x,S]=C.useState(null);return C.useEffect(()=>{const k=new EventSource("/api/events"),$=()=>{jC().then(E=>{i(E),S(Date.now())}).catch(E=>s(E instanceof Error?E.message:String(E))),Xg().then(E=>O(E.receipts)).catch(()=>{})};return k.addEventListener("open",()=>p(!0)),k.addEventListener("error",()=>p(!1)),k.addEventListener("graph-updated",$),()=>{k.removeEventListener("graph-updated",$),k.close()}},[i,s]),C.useEffect(()=>{if(x==null)return;const k=setTimeout(()=>S(null),2500);return()=>clearTimeout(k)},[x]),y.jsx(Qi,{projectName:o,frameworkVersion:u,sseLive:h,children:y.jsxs("div",{className:"flex h-full w-full flex-col",children:[y.jsx(bW,{graph:t}),y.jsxs("div",{className:"relative min-h-0 flex-1",children:[t&&y.jsx(OW,{data:t}),y.jsx(EW,{}),t&&y.jsx(SW,{}),y.jsx(l8,{}),y.jsx(xW,{}),(e||n)&&y.jsx("div",{className:"absolute right-3 top-3 rounded border px-3 py-1.5 text-xs shadow-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:e?"Loading graph…":`Error: ${n}`}),x!=null&&y.jsx("div",{className:"absolute bottom-3 right-3 rounded border px-3 py-1.5 text-xs shadow-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-accent)",color:"var(--color-accent)"},children:".paqad/ changed · graph reloaded"}),t&&t.nodes.length===0&&!e&&y.jsx("div",{className:"absolute inset-0 grid place-items-center text-sm",style:{color:"var(--color-muted)"},children:y.jsxs("div",{className:"rounded-lg border p-6",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:[y.jsx("div",{className:"text-base font-medium",children:"No nodes to display"}),y.jsxs("div",{className:"mt-1",children:["Run ",y.jsx("code",{children:"paqad-ai onboard"})," to populate this project's graph."]})]})})]})]})})}function M1(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Pa=M1();function yM(t){Pa=t}var na={exec:()=>null};function _l(t){let e=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),r=e[i];return r||(r=t(i),e[i]=r),r}}function Fe(t,e=""){let n=typeof t=="string"?t:t.source,i={replace:(r,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(fn.caret,"$1"),n=n.replace(r,o),i},getRegex:()=>new RegExp(n,e)};return i}var CW=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),fn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[	 ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:_l(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`)),hrRegex:_l(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:_l(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:_l(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:_l(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:_l(t=>new RegExp(`^ {0,${t}}>`))},$W=/^(?:[ \t]*(?:\n|$))+/,_W=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,QW=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Md=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,AW=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,L1=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,vM=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,bM=Fe(vM).replace(/bull/g,L1).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),NW=Fe(vM).replace(/bull/g,L1).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),D1=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,PW=/^[^\n]+/,z1=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,RW=Fe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",z1).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),jW=Fe(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,L1).getRegex(),nO="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",X1=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,MW=Fe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$))","i").replace("comment",X1).replace("tag",nO).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),xM=Fe(D1).replace("hr",Md).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",nO).getRegex(),LW=Fe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",xM).getRegex(),Z1={blockquote:LW,code:_W,def:RW,fences:QW,heading:AW,hr:Md,html:MW,lheading:bM,list:jW,newline:$W,paragraph:xM,table:na,text:PW},j_=Fe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Md).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}	)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",nO).getRegex(),DW={...Z1,lheading:NW,table:j_,paragraph:Fe(D1).replace("hr",Md).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",j_).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",nO).getRegex()},zW={...Z1,html:Fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",X1).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:na,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Fe(D1).replace("hr",Md).replace("heading",` *#{1,6} *[^
]`).replace("lheading",bM).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},XW=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ZW=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,wM=/^( {2,}|\\)\n(?!\s*$)/,BW=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Wc=/[\p{P}\p{S}]/u,iO=/[\s\p{P}\p{S}]/u,B1=/[^\s\p{P}\p{S}]/u,IW=Fe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,iO).getRegex(),SM=/(?!~)[\p{P}\p{S}]/u,GW=/(?!~)[\s\p{P}\p{S}]/u,VW=/(?:[^\s\p{P}\p{S}]|~)/u,UW=Fe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",CW?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),kM=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,YW=Fe(kM,"u").replace(/punct/g,Wc).getRegex(),qW=Fe(kM,"u").replace(/punct/g,SM).getRegex(),EM="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",WW=Fe(EM,"gu").replace(/notPunctSpace/g,B1).replace(/punctSpace/g,iO).replace(/punct/g,Wc).getRegex(),FW=Fe(EM,"gu").replace(/notPunctSpace/g,VW).replace(/punctSpace/g,GW).replace(/punct/g,SM).getRegex(),HW=Fe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,B1).replace(/punctSpace/g,iO).replace(/punct/g,Wc).getRegex(),KW=Fe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Wc).getRegex(),JW="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",eF=Fe(JW,"gu").replace(/notPunctSpace/g,B1).replace(/punctSpace/g,iO).replace(/punct/g,Wc).getRegex(),tF=Fe(/\\(punct)/,"gu").replace(/punct/g,Wc).getRegex(),nF=Fe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),iF=Fe(X1).replace("(?:-->|$)","-->").getRegex(),rF=Fe("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",iF).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),gm=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,sF=Fe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",gm).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),TM=Fe(/^!?\[(label)\]\[(ref)\]/).replace("label",gm).replace("ref",z1).getRegex(),CM=Fe(/^!?\[(ref)\](?:\[\])?/).replace("ref",z1).getRegex(),oF=Fe("reflink|nolink(?!\\()","g").replace("reflink",TM).replace("nolink",CM).getRegex(),M_=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,I1={_backpedal:na,anyPunctuation:tF,autolink:nF,blockSkip:UW,br:wM,code:ZW,del:na,delLDelim:na,delRDelim:na,emStrongLDelim:YW,emStrongRDelimAst:WW,emStrongRDelimUnd:HW,escape:XW,link:sF,nolink:CM,punctuation:IW,reflink:TM,reflinkSearch:oF,tag:rF,text:BW,url:na},aF={...I1,link:Fe(/^!?\[(label)\]\((.*?)\)/).replace("label",gm).getRegex(),reflink:Fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",gm).getRegex()},ew={...I1,emStrongRDelimAst:FW,emStrongLDelim:qW,delLDelim:KW,delRDelim:eF,url:Fe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",M_).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Fe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",M_).getRegex()},lF={...ew,br:Fe(wM).replace("{2,}","*").getRegex(),text:Fe(ew.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Gp={normal:Z1,gfm:DW,pedantic:zW},bf={normal:I1,gfm:ew,breaks:lF,pedantic:aF},cF={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},L_=t=>cF[t];function vr(t,e){if(e){if(fn.escapeTest.test(t))return t.replace(fn.escapeReplace,L_)}else if(fn.escapeTestNoEncode.test(t))return t.replace(fn.escapeReplaceNoEncode,L_);return t}function D_(t){try{t=encodeURI(t).replace(fn.percentDecode,"%")}catch{return null}return t}function z_(t,e){let n=t.replace(fn.findPipe,(s,o,l)=>{let u=!1,f=o;for(;--f>=0&&l[f]==="\\";)u=!u;return u?"|":" |"}),i=n.split(fn.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(fn.slashPipe,"|");return i}function ao(t,e,n){let i=t.length;if(i===0)return"";let r=0;for(;r<i&&t.charAt(i-r-1)===e;)r++;return t.slice(0,i-r)}function X_(t){let e=t.split(`
`),n=e.length-1;for(;n>=0&&fn.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
`)}function uF(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===e[0])n++;else if(t[i]===e[1]&&(n--,n<0))return i;return n>0?-2:-1}function fF(t,e=0){let n=e,i="";for(let r of t)if(r==="	"){let s=4-n%4;i+=" ".repeat(s),n+=s}else i+=r,n++;return i}function Z_(t,e,n,i,r){let s=e.href,o=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let u={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:o,text:l,tokens:i.inlineTokens(l)};return i.state.inLink=!1,u}function dF(t,e,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return e;let r=i[1];return e.split(`
`).map(s=>{let o=s.match(n.other.beginningSpace);if(o===null)return s;let[l]=o;return l.length>=r.length?s.slice(r.length):s}).join(`
`)}var mm=class{options;rules;lexer;constructor(t){this.options=t||Pa}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:X_(e[0]),i=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:i}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],i=dF(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let i=ao(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:ao(e[0],`
`),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:ao(e[0],`
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=ao(e[0],`
`).split(`
`),i="",r="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))l.push(n[u]),o=!0;else if(!o)l.push(n[u]);else break;n=n.slice(u);let f=l.join(`
`),h=f.replace(this.rules.other.blockquoteSetextReplace,`
    $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
${f}`:f,r=r?`${r}
${h}`:h;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,s,!0),this.lexer.state.top=p,n.length===0)break;let g=s.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){let O=g,v=O.raw+`
`+n.join(`
`),x=this.blockquote(v);s[s.length-1]=x,i=i.substring(0,i.length-O.raw.length)+x.raw,r=r.substring(0,r.length-O.text.length)+x.text;break}else if(g?.type==="list"){let O=g,v=O.raw+`
`+n.join(`
`),x=this.list(v);s[s.length-1]=x,i=i.substring(0,i.length-g.raw.length)+x.raw,r=r.substring(0,r.length-O.raw.length)+x.raw,n=v.substring(s.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:i,tokens:s,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),i=n.length>1,r={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;t;){let u=!1,f="",h="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;f=e[0],t=t.substring(f.length);let p=fF(e[2].split(`
`,1)[0],e[1].length),g=t.split(`
`,1)[0],O=!p.trim(),v=0;if(this.options.pedantic?(v=2,h=p.trimStart()):O?v=e[1].length+1:(v=p.search(this.rules.other.nonSpaceChar),v=v>4?1:v,h=p.slice(v),v+=e[1].length),O&&this.rules.other.blankLine.test(g)&&(f+=g+`
`,t=t.substring(g.length+1),u=!0),!u){let x=this.rules.other.nextBulletRegex(v),S=this.rules.other.hrRegex(v),k=this.rules.other.fencesBeginRegex(v),$=this.rules.other.headingBeginRegex(v),E=this.rules.other.htmlBeginRegex(v),T=this.rules.other.blockquoteBeginRegex(v);for(;t;){let _=t.split(`
`,1)[0],Q;if(g=_,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting,"  "),Q=g):Q=g.replace(this.rules.other.tabCharGlobal,"    "),k.test(g)||$.test(g)||E.test(g)||T.test(g)||x.test(g)||S.test(g))break;if(Q.search(this.rules.other.nonSpaceChar)>=v||!g.trim())h+=`
`+Q.slice(v);else{if(O||p.replace(this.rules.other.tabCharGlobal,"    ").search(this.rules.other.nonSpaceChar)>=4||k.test(p)||$.test(p)||S.test(p))break;h+=`
`+g}O=!g.trim(),f+=_+`
`,t=t.substring(_.length+1),p=Q.slice(v)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(o=!0)),r.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),r.raw+=f}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let u of r.items){this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]);let f=u.tokens[0];if(u.task&&(f?.type==="text"||f?.type==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),f.raw=f.raw.replace(this.rules.other.listReplaceTask,""),f.text=f.text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(u.raw);if(h){let p={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};u.checked=p.checked,r.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=p.raw+u.tokens[0].raw,u.tokens[0].text=p.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(p)):u.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):u.tokens.unshift(p)}}else u.task&&(u.task=!1);if(!r.loose){let h=u.tokens.filter(g=>g.type==="space"),p=h.length>0&&h.some(g=>this.rules.other.anyLine.test(g.raw));r.loose=p}}if(r.loose)for(let u of r.items){u.loose=!0;for(let f of u.tokens)f.type==="text"&&(f.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=X_(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:ao(e[0],`
`),href:i,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=z_(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],s={type:"table",raw:ao(e[0],`
`),header:[],align:[],rows:[]};if(n.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<n.length;o++)s.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:s.align[o]});for(let o of r)s.rows.push(z_(o,s.header.length).map((l,u)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[u]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:ao(e[0],`
`),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=ao(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=uF(e[2],"()");if(s===-2)return;if(s>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),Z_(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[i.toLowerCase()];if(!r){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return Z_(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let r=[...i[0]].length-1,s,o,l=r,u=0,f=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,e=e.slice(-1*t.length+r);(i=f.exec(e))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&r%3&&!((r+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let h=[...i[0]][0].length,p=t.slice(0,r+i.index+h+o);if(Math.min(r,o)%2){let O=p.slice(1,-1);return{type:"em",raw:p,text:O,tokens:this.lexer.inlineTokens(O)}}let g=p.slice(2,-2);return{type:"strong",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...i[0]].length-1,s,o,l=r,u=this.rules.inline.delRDelim;for(u.lastIndex=0,e=e.slice(-1*t.length+r);(i=u.exec(e))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s||(o=[...s].length,o!==r))continue;if(i[3]||i[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let f=[...i[0]][0].length,h=t.slice(0,r+i.index+f+o),p=h.slice(r,-r);return{type:"del",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,i;return e[2]==="@"?(n=e[1],i="mailto:"+n):(n=e[1],i=n),{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,i;if(e[2]==="@")n=e[0],i="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Gi=class tw{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Pa,this.options.tokenizer=this.options.tokenizer||new mm,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:fn,block:Gp.normal,inline:bf.normal};this.options.pedantic?(n.block=Gp.pedantic,n.inline=bf.pedantic):this.options.gfm&&(n.block=Gp.gfm,this.options.breaks?n.inline=bf.breaks:n.inline=bf.gfm),this.tokenizer.rules=n}static get rules(){return{block:Gp,inline:bf}}static lex(e,n){return new tw(n).lex(e)}static lexInline(e,n){return new tw(n).inlineTokens(e)}lex(e){e=e.replace(fn.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],i=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(fn.tabCharGlobal,"    ").replace(fn.spaceLine,""));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let s;if(this.options.extensions?.block?.some(l=>(s=l.call({lexer:this},e,n))?(e=e.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let l=n.at(-1);s.raw.length===1&&l!==void 0?l.raw+=`
`:n.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
`)?"":`
`)+s.raw,l.text+=`
`+s.text,this.inlineQueue.at(-1).src=l.text):n.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
`)?"":`
`)+s.raw,l.text+=`
`+s.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),n.push(s);continue}let o=e;if(this.options.extensions?.startBlock){let l=1/0,u=e.slice(1),f;this.options.extensions.startBlock.forEach(h=>{f=h.call({lexer:this},u),typeof f=="number"&&f>=0&&(l=Math.min(l,f))}),l<1/0&&l>=0&&(o=e.substring(0,l+1))}if(this.state.top&&(s=this.tokenizer.paragraph(o))){let l=n.at(-1);i&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
`)?"":`
`)+s.raw,l.text+=`
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(s),i=o.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
`)?"":`
`)+s.raw,l.text+=`
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(s);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let i=e,r=null;if(this.tokens.links){let f=Object.keys(this.tokens.links);if(f.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)f.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)s=r[2]?r[2].length:0,i=i.slice(0,r.index+s)+"["+"a".repeat(r[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let o=!1,l="",u=1/0;for(;e;){if(e.length<u)u=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}o||(l=""),o=!1;let f;if(this.options.extensions?.inline?.some(p=>(f=p.call({lexer:this},e,n))?(e=e.substring(f.raw.length),n.push(f),!0):!1))continue;if(f=this.tokenizer.escape(e)){e=e.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.tag(e)){e=e.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.link(e)){e=e.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(f.raw.length);let p=n.at(-1);f.type==="text"&&p?.type==="text"?(p.raw+=f.raw,p.text+=f.text):n.push(f);continue}if(f=this.tokenizer.emStrong(e,i,l)){e=e.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.codespan(e)){e=e.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.br(e)){e=e.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.del(e,i,l)){e=e.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.autolink(e)){e=e.substring(f.raw.length),n.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(e))){e=e.substring(f.raw.length),n.push(f);continue}let h=e;if(this.options.extensions?.startInline){let p=1/0,g=e.slice(1),O;this.options.extensions.startInline.forEach(v=>{O=v.call({lexer:this},g),typeof O=="number"&&O>=0&&(p=Math.min(p,O))}),p<1/0&&p>=0&&(h=e.substring(0,p+1))}if(f=this.tokenizer.inlineText(h)){e=e.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(l=f.raw.slice(-1)),o=!0;let p=n.at(-1);p?.type==="text"?(p.raw+=f.raw,p.text+=f.text):n.push(f);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},Om=class{options;parser;constructor(t){this.options=t||Pa}space(t){return""}code({text:t,lang:e,escaped:n}){let i=(e||"").match(fn.notSpaceStart)?.[0],r=t.replace(fn.endingNewline,"")+`
`;return i?'<pre><code class="language-'+vr(i)+'">'+(n?r:vr(r,!0))+`</code></pre>
`:"<pre><code>"+(n?r:vr(r,!0))+`</code></pre>
`}blockquote({tokens:t}){return`<blockquote>
${this.parser.parse(t)}</blockquote>
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
`}hr(t){return`<hr>
`}list(t){let e=t.ordered,n=t.start,i="";for(let o=0;o<t.items.length;o++){let l=t.items[o];i+=this.listitem(l)}let r=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+r+s+`>
`+i+"</"+r+`>
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
`}table(t){let e="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);e+=this.tablerow({text:n});let i="";for(let r=0;r<t.rows.length;r++){let s=t.rows[r];n="";for(let o=0;o<s.length;o++)n+=this.tablecell(s[o]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+i+`</table>
`}tablerow({text:t}){return`<tr>
${t}</tr>
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${vr(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let i=this.parser.parseInline(n),r=D_(t);if(r===null)return i;t=r;let s='<a href="'+t+'"';return e&&(s+=' title="'+vr(e)+'"'),s+=">"+i+"</a>",s}image({href:t,title:e,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=D_(t);if(r===null)return vr(n);t=r;let s=`<img src="${t}" alt="${vr(n)}"`;return e&&(s+=` title="${vr(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:vr(t.text)}},G1=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Vi=class nw{options;renderer;textRenderer;constructor(e){this.options=e||Pa,this.options.renderer=this.options.renderer||new Om,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new G1}static parse(e,n){return new nw(n).parse(e)}static parseInline(e,n){return new nw(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let i=0;i<e.length;i++){let r=e[i];if(this.options.extensions?.renderers?.[r.type]){let o=r,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=l||"";continue}}let s=r;switch(s.type){case"space":{n+=this.renderer.space(s);break}case"hr":{n+=this.renderer.hr(s);break}case"heading":{n+=this.renderer.heading(s);break}case"code":{n+=this.renderer.code(s);break}case"table":{n+=this.renderer.table(s);break}case"blockquote":{n+=this.renderer.blockquote(s);break}case"list":{n+=this.renderer.list(s);break}case"checkbox":{n+=this.renderer.checkbox(s);break}case"html":{n+=this.renderer.html(s);break}case"def":{n+=this.renderer.def(s);break}case"paragraph":{n+=this.renderer.paragraph(s);break}case"text":{n+=this.renderer.text(s);break}default:{let o='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let i="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=l||"";continue}}let o=s;switch(o.type){case"escape":{i+=n.text(o);break}case"html":{i+=n.html(o);break}case"link":{i+=n.link(o);break}case"image":{i+=n.image(o);break}case"checkbox":{i+=n.checkbox(o);break}case"strong":{i+=n.strong(o);break}case"em":{i+=n.em(o);break}case"codespan":{i+=n.codespan(o);break}case"br":{i+=n.br(o);break}case"del":{i+=n.del(o);break}case"text":{i+=n.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},Qf=class{options;block;constructor(e){this.options=e||Pa}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Gi.lex:Gi.lexInline}provideParser(e=this.block){return e?Vi.parse:Vi.parseInline}},hF=class{defaults=M1();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Vi;Renderer=Om;TextRenderer=G1;Lexer=Gi;Tokenizer=mm;Hooks=Qf;constructor(...e){this.use(...e)}walkTokens(e,n){let i=[];for(let r of e)switch(i=i.concat(n.call(this,r)),r.type){case"table":{let s=r;for(let o of s.header)i=i.concat(this.walkTokens(o.tokens,n));for(let o of s.rows)for(let l of o)i=i.concat(this.walkTokens(l.tokens,n));break}case"list":{let s=r;i=i.concat(this.walkTokens(s.items,n));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{let l=s[o].flat(1/0);i=i.concat(this.walkTokens(l,n))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,n)))}}return i}use(...e){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{let r={...i};if(r.async=this.defaults.async||r.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=n.renderers[s.name];o?n.renderers[s.name]=function(...l){let u=s.renderer.apply(this,l);return u===!1&&(u=o.apply(this,l)),u}:n.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=n[s.level];o?o.unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),r.extensions=n),i.renderer){let s=this.defaults.renderer||new Om(this.defaults);for(let o in i.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let l=o,u=i.renderer[l],f=s[l];s[l]=(...h)=>{let p=u.apply(s,h);return p===!1&&(p=f.apply(s,h)),p||""}}r.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new mm(this.defaults);for(let o in i.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let l=o,u=i.tokenizer[l],f=s[l];s[l]=(...h)=>{let p=u.apply(s,h);return p===!1&&(p=f.apply(s,h)),p}}r.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new Qf;for(let o in i.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let l=o,u=i.hooks[l],f=s[l];Qf.passThroughHooks.has(o)?s[l]=h=>{if(this.defaults.async&&Qf.passThroughHooksRespectAsync.has(o))return(async()=>{let g=await u.call(s,h);return f.call(s,g)})();let p=u.call(s,h);return f.call(s,p)}:s[l]=(...h)=>{if(this.defaults.async)return(async()=>{let g=await u.apply(s,h);return g===!1&&(g=await f.apply(s,h)),g})();let p=u.apply(s,h);return p===!1&&(p=f.apply(s,h)),p}}r.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,o=i.walkTokens;r.walkTokens=function(l){let u=[];return u.push(o.call(this,l)),s&&(u=u.concat(s.call(this,l))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return Gi.lex(e,n??this.defaults)}parser(e,n){return Vi.parse(e,n??this.defaults)}parseMarkdown(e){return(n,i)=>{let r={...i},s={...this.defaults,...r},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let l=s.hooks?await s.hooks.preprocess(n):n,u=await(s.hooks?await s.hooks.provideLexer(e):e?Gi.lex:Gi.lexInline)(l,s),f=s.hooks?await s.hooks.processAllTokens(u):u;s.walkTokens&&await Promise.all(this.walkTokens(f,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser(e):e?Vi.parse:Vi.parseInline)(f,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(o);try{s.hooks&&(n=s.hooks.preprocess(n));let l=(s.hooks?s.hooks.provideLexer(e):e?Gi.lex:Gi.lexInline)(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let u=(s.hooks?s.hooks.provideParser(e):e?Vi.parse:Vi.parseInline)(l,s);return s.hooks&&(u=s.hooks.postprocess(u)),u}catch(l){return o(l)}}}onError(e,n){return i=>{if(i.message+=`
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+vr(i.message+"",!0)+"</pre>";return n?Promise.resolve(r):r}if(n)return Promise.reject(i);throw i}}},wa=new hF;function at(t,e){return wa.parse(t,e)}at.options=at.setOptions=function(t){return wa.setOptions(t),at.defaults=wa.defaults,yM(at.defaults),at};at.getDefaults=M1;at.defaults=Pa;at.use=function(...t){return wa.use(...t),at.defaults=wa.defaults,yM(at.defaults),at};at.walkTokens=function(t,e){return wa.walkTokens(t,e)};at.parseInline=wa.parseInline;at.Parser=Vi;at.parser=Vi.parse;at.Renderer=Om;at.TextRenderer=G1;at.Lexer=Gi;at.lexer=Gi.lex;at.Tokenizer=mm;at.Hooks=Qf;at.parse=at;at.options;at.setOptions;at.use;at.walkTokens;at.parseInline;Vi.parse;Gi.lex;const V1=Symbol.for("yaml.alias"),iw=Symbol.for("yaml.document"),yo=Symbol.for("yaml.map"),$M=Symbol.for("yaml.pair"),Mr=Symbol.for("yaml.scalar"),Fc=Symbol.for("yaml.seq"),$i=Symbol.for("yaml.node.type"),Ra=t=>!!t&&typeof t=="object"&&t[$i]===V1,ja=t=>!!t&&typeof t=="object"&&t[$i]===iw,Hc=t=>!!t&&typeof t=="object"&&t[$i]===yo,St=t=>!!t&&typeof t=="object"&&t[$i]===$M,gt=t=>!!t&&typeof t=="object"&&t[$i]===Mr,Kc=t=>!!t&&typeof t=="object"&&t[$i]===Fc;function kt(t){if(t&&typeof t=="object")switch(t[$i]){case yo:case Fc:return!0}return!1}function Tt(t){if(t&&typeof t=="object")switch(t[$i]){case V1:case yo:case Mr:case Fc:return!0}return!1}const _M=t=>(gt(t)||kt(t))&&!!t.anchor,zn=Symbol("break visit"),QM=Symbol("skip children"),Nr=Symbol("remove node");function Ma(t,e){const n=AM(e);ja(t)?Ul(null,t.contents,n,Object.freeze([t]))===Nr&&(t.contents=null):Ul(null,t,n,Object.freeze([]))}Ma.BREAK=zn;Ma.SKIP=QM;Ma.REMOVE=Nr;function Ul(t,e,n,i){const r=NM(t,e,n,i);if(Tt(r)||St(r))return PM(t,i,r),Ul(t,r,n,i);if(typeof r!="symbol"){if(kt(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){const o=Ul(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===zn)return zn;o===Nr&&(e.items.splice(s,1),s-=1)}}}else if(St(e)){i=Object.freeze(i.concat(e));const s=Ul("key",e.key,n,i);if(s===zn)return zn;s===Nr&&(e.key=null);const o=Ul("value",e.value,n,i);if(o===zn)return zn;o===Nr&&(e.value=null)}}return r}async function rO(t,e){const n=AM(e);ja(t)?await Yl(null,t.contents,n,Object.freeze([t]))===Nr&&(t.contents=null):await Yl(null,t,n,Object.freeze([]))}rO.BREAK=zn;rO.SKIP=QM;rO.REMOVE=Nr;async function Yl(t,e,n,i){const r=await NM(t,e,n,i);if(Tt(r)||St(r))return PM(t,i,r),Yl(t,r,n,i);if(typeof r!="symbol"){if(kt(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){const o=await Yl(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===zn)return zn;o===Nr&&(e.items.splice(s,1),s-=1)}}}else if(St(e)){i=Object.freeze(i.concat(e));const s=await Yl("key",e.key,n,i);if(s===zn)return zn;s===Nr&&(e.key=null);const o=await Yl("value",e.value,n,i);if(o===zn)return zn;o===Nr&&(e.value=null)}}return r}function AM(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function NM(t,e,n,i){if(typeof n=="function")return n(t,e,i);if(Hc(e))return n.Map?.(t,e,i);if(Kc(e))return n.Seq?.(t,e,i);if(St(e))return n.Pair?.(t,e,i);if(gt(e))return n.Scalar?.(t,e,i);if(Ra(e))return n.Alias?.(t,e,i)}function PM(t,e,n){const i=e[e.length-1];if(kt(i))i.items[t]=n;else if(St(i))t==="key"?i.key=n:i.value=n;else if(ja(i))i.contents=n;else{const r=Ra(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const pF={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},gF=t=>t.replace(/[!,[\]{}]/g,e=>pF[e]);class bn{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},bn.defaultYaml,e),this.tags=Object.assign({},bn.defaultTags,n)}clone(){const e=new bn(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new bn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:bn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},bn.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:bn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},bn.defaultTags),this.atNextDocument=!1);const i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[n,i]of Object.entries(this.tags))if(e.startsWith(i))return n+gF(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(e&&i.length>0&&Tt(e.contents)){const s={};Ma(e.contents,(o,l)=>{Tt(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
`)}}bn.defaultYaml={explicit:!1,version:"1.2"};bn.defaultTags={"!!":"tag:yaml.org,2002:"};function RM(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function jM(t){const e=new Set;return Ma(t,{Value(n,i){i.anchor&&e.add(i.anchor)}}),e}function MM(t,e){for(let n=1;;++n){const i=`${t}${n}`;if(!e.has(i))return i}}function mF(t,e){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=jM(t));const o=MM(e,r);return r.add(o),o},setAnchors:()=>{for(const s of n){const o=i.get(s);if(typeof o=="object"&&o.anchor&&(gt(o.node)||kt(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function ql(t,e,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){const o=i[r],l=ql(t,i,String(r),o);l===void 0?delete i[r]:l!==o&&(i[r]=l)}else if(i instanceof Map)for(const r of Array.from(i.keys())){const s=i.get(r),o=ql(t,i,r,s);o===void 0?i.delete(r):o!==s&&i.set(r,o)}else if(i instanceof Set)for(const r of Array.from(i)){const s=ql(t,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(const[r,s]of Object.entries(i)){const o=ql(t,i,r,s);o===void 0?delete i[r]:o!==s&&(i[r]=o)}return t.call(e,n,i)}function Ti(t,e,n){if(Array.isArray(t))return t.map((i,r)=>Ti(i,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!_M(t))return t.toJSON(e,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(t,i),n.onCreate=s=>{i.res=s,delete n.onCreate};const r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}class U1{constructor(e){Object.defineProperty(this,$i,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!ja(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Ti(this,"",o);if(typeof r=="function")for(const{count:u,res:f}of o.anchors.values())r(f,u);return typeof s=="function"?ql(s,{"":l},"",l):l}}class sO extends U1{constructor(e){super(V1),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],Ma(e,{Node:(s,o)=>{(Ra(o)||_M(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(const s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(e,n){if(!n)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){const u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let l=i.get(o);if(l||(Ti(o,null,n),l=i.get(o)),l?.res===void 0){const u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=$g(r,o,i)),l.count*l.aliasCount>s)){const u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return l.res}toString(e,n,i){const r=`*${this.source}`;if(e){if(RM(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}}function $g(t,e,n){if(Ra(e)){const i=e.resolve(t),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(kt(e)){let i=0;for(const r of e.items){const s=$g(t,r,n);s>i&&(i=s)}return i}else if(St(e)){const i=$g(t,e.key,n),r=$g(t,e.value,n);return Math.max(i,r)}return 1}const LM=t=>!t||typeof t!="function"&&typeof t!="object";class De extends U1{constructor(e){super(Mr),this.value=e}toJSON(e,n){return n?.keep?this.value:Ti(this.value,e,n)}toString(){return String(this.value)}}De.BLOCK_FOLDED="BLOCK_FOLDED";De.BLOCK_LITERAL="BLOCK_LITERAL";De.PLAIN="PLAIN";De.QUOTE_DOUBLE="QUOTE_DOUBLE";De.QUOTE_SINGLE="QUOTE_SINGLE";const OF="tag:yaml.org,2002:";function yF(t,e,n){if(e){const i=n.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(i=>i.identify?.(t)&&!i.format)}function cd(t,e,n){if(ja(t)&&(t=t.contents),Tt(t))return t;if(St(t)){const p=n.schema[yo].createNode?.(n.schema,null,n);return p.items.push(t),p}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:l}=n;let u;if(i&&t&&typeof t=="object"){if(u=l.get(t),u)return u.anchor??(u.anchor=r(t)),new sO(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=OF+e.slice(2));let f=yF(t,e,o.tags);if(!f){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const p=new De(t);return u&&(u.node=p),p}f=t instanceof Map?o[yo]:Symbol.iterator in Object(t)?o[Fc]:o[yo]}s&&(s(f),delete n.onTagObj);const h=f?.createNode?f.createNode(n.schema,t,n):typeof f?.nodeClass?.from=="function"?f.nodeClass.from(n.schema,t,n):new De(t);return e?h.tag=e:f.default||(h.tag=f.tag),u&&(u.node=h),h}function ym(t,e,n){let i=n;for(let r=e.length-1;r>=0;--r){const s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return cd(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const Af=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class DM extends U1{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(i=>Tt(i)||St(i)?i.clone(e):i),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Af(e))this.add(n);else{const[i,...r]=e,s=this.get(i,!0);if(kt(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,ym(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){const[n,...i]=e;if(i.length===0)return this.delete(n);const r=this.get(n,!0);if(kt(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(e,n){const[i,...r]=e,s=this.get(i,!0);return r.length===0?!n&&gt(s)?s.value:s:kt(s)?s.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!St(n))return!1;const i=n.value;return i==null||e&&gt(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){const[n,...i]=e;if(i.length===0)return this.has(n);const r=this.get(n,!0);return kt(r)?r.hasIn(i):!1}setIn(e,n){const[i,...r]=e;if(r.length===0)this.set(i,n);else{const s=this.get(i,!0);if(kt(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,ym(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const vF=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ps(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const aa=(t,e,n)=>t.endsWith(`
`)?ps(n,e):n.includes(`
`)?`
`+ps(n,e):(t.endsWith(" ")?"":" ")+n,zM="flow",rw="block",_g="quoted";function oO(t,e,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return t;r<s&&(s=0);const u=Math.max(1+s,1+r-e.length);if(t.length<=u)return t;const f=[],h={};let p=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?f.push(0):p=r-i);let g,O,v=!1,x=-1,S=-1,k=-1;n===rw&&(x=B_(t,x,e.length),x!==-1&&(p=x+u));for(let E;E=t[x+=1];){if(n===_g&&E==="\\"){switch(S=x,t[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}k=x}if(E===`
`)n===rw&&(x=B_(t,x,e.length)),p=x+e.length+u,g=void 0;else{if(E===" "&&O&&O!==" "&&O!==`
`&&O!=="	"){const T=t[x+1];T&&T!==" "&&T!==`
`&&T!=="	"&&(g=x)}if(x>=p)if(g)f.push(g),p=g+u,g=void 0;else if(n===_g){for(;O===" "||O==="	";)O=E,E=t[x+=1],v=!0;const T=x>k+1?x-2:S-1;if(h[T])return t;f.push(T),h[T]=!0,p=T+u,g=void 0}else v=!0}O=E}if(v&&l&&l(),f.length===0)return t;o&&o();let $=t.slice(0,f[0]);for(let E=0;E<f.length;++E){const T=f[E],_=f[E+1]||t.length;T===0?$=`
${e}${t.slice(0,_)}`:(n===_g&&h[T]&&($+=`${t[T]}\\`),$+=`
${e}${t.slice(T+1,_)}`)}return $}function B_(t,e,n){let i=e,r=e+1,s=t[r];for(;s===" "||s==="	";)if(e<r+n)s=t[++e];else{do s=t[++e];while(s&&s!==`
`);i=e,r=e+1,s=t[r]}return i}const aO=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),lO=t=>/^(%|---|\.\.\.)/m.test(t);function bF(t,e,n){if(!e||e<0)return!1;const i=e-n,r=t.length;if(r<=i)return!1;for(let s=0,o=0;s<r;++s)if(t[s]===`
`){if(s-o>i)return!0;if(o=s+1,r-o<=i)return!1}return!0}function Gf(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(lO(t)?"  ":"");let o="",l=0;for(let u=0,f=n[u];f;f=n[++u])if(f===" "&&n[u+1]==="\\"&&n[u+2]==="n"&&(o+=n.slice(l,u)+"\\ ",u+=1,l=u,f="\\"),f==="\\")switch(n[u+1]){case"u":{o+=n.slice(l,u);const h=n.substr(u+2,4);switch(h){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:h.substr(0,2)==="00"?o+="\\x"+h.substr(2):o+=n.substr(u,6)}u+=5,l=u+1}break;case"n":if(i||n[u+2]==='"'||n.length<r)u+=1;else{for(o+=n.slice(l,u)+`

`;n[u+2]==="\\"&&n[u+3]==="n"&&n[u+4]!=='"';)o+=`
`,u+=2;o+=s,n[u+2]===" "&&(o+="\\"),u+=1,l=u+1}break;default:u+=1}return o=l?o+n.slice(l):n,i?o:oO(o,s,_g,aO(e,!1))}function sw(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
`)||/[ \t]\n|\n[ \t]/.test(t))return Gf(t,e);const n=e.indent||(lO(t)?"  ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
${n}`)+"'";return e.implicitKey?i:oO(i,n,zM,aO(e,!1))}function Wl(t,e){const{singleQuote:n}=e.options;let i;if(n===!1)i=Gf;else{const r=t.includes('"'),s=t.includes("'");r&&!s?i=sw:s&&!r?i=Gf:i=n?sw:Gf}return i(t,e)}let ow;try{ow=new RegExp(`(^|(?<!
))
+(?!
|$)`,"g")}catch{ow=/\n+(?!\n|$)/g}function Qg({comment:t,type:e,value:n},i,r,s){const{blockQuote:o,commentString:l,lineWidth:u}=i.options;if(!o||/\n[\t ]+$/.test(n))return Wl(n,i);const f=i.indent||(i.forceBlockIndent||lO(n)?"  ":""),h=o==="literal"?!0:o==="folded"||e===De.BLOCK_FOLDED?!1:e===De.BLOCK_LITERAL?!0:!bF(n,u,f.length);if(!n)return h?`|
`:`>
`;let p,g;for(g=n.length;g>0;--g){const _=n[g-1];if(_!==`
`&&_!=="	"&&_!==" ")break}let O=n.substring(g);const v=O.indexOf(`
`);v===-1?p="-":n===O||v!==O.length-1?(p="+",s&&s()):p="",O&&(n=n.slice(0,-O.length),O[O.length-1]===`
`&&(O=O.slice(0,-1)),O=O.replace(ow,`$&${f}`));let x=!1,S,k=-1;for(S=0;S<n.length;++S){const _=n[S];if(_===" ")x=!0;else if(_===`
`)k=S;else break}let $=n.substring(0,k<S?k+1:S);$&&(n=n.substring($.length),$=$.replace(/\n+/g,`$&${f}`));let T=(x?f?"2":"1":"")+p;if(t&&(T+=" "+l(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!h){const _=n.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let Q=!1;const N=aO(i,!0);o!=="folded"&&e!==De.BLOCK_FOLDED&&(N.onOverflow=()=>{Q=!0});const R=oO(`${$}${_}${O}`,f,rw,N);if(!Q)return`>${T}
${f}${R}`}return n=n.replace(/\n+/g,`$&${f}`),`|${T}
${f}${$}${n}${O}`}function xF(t,e,n,i){const{type:r,value:s}=t,{actualString:o,implicitKey:l,indent:u,indentStep:f,inFlow:h}=e;if(l&&s.includes(`
`)||h&&/[[\]{},]/.test(s))return Wl(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||h||!s.includes(`
`)?Wl(s,e):Qg(t,e,n,i);if(!l&&!h&&r!==De.PLAIN&&s.includes(`
`))return Qg(t,e,n,i);if(lO(s)){if(u==="")return e.forceBlockIndent=!0,Qg(t,e,n,i);if(l&&u===f)return Wl(s,e)}const p=s.replace(/\n+/g,`$&
${u}`);if(o){const g=x=>x.default&&x.tag!=="tag:yaml.org,2002:str"&&x.test?.test(p),{compat:O,tags:v}=e.doc.schema;if(v.some(g)||O?.some(g))return Wl(s,e)}return l?p:oO(p,u,zM,aO(e,!1))}function Ld(t,e,n,i){const{implicitKey:r,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:l}=t;l!==De.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=De.QUOTE_DOUBLE);const u=h=>{switch(h){case De.BLOCK_FOLDED:case De.BLOCK_LITERAL:return r||s?Wl(o.value,e):Qg(o,e,n,i);case De.QUOTE_DOUBLE:return Gf(o.value,e);case De.QUOTE_SINGLE:return sw(o.value,e);case De.PLAIN:return xF(o,e,n,i);default:return null}};let f=u(l);if(f===null){const{defaultKeyType:h,defaultStringType:p}=e.options,g=r&&h||p;if(f=u(g),f===null)throw new Error(`Unsupported default string type ${g}`)}return f}function XM(t,e){const n=Object.assign({blockQuote:!0,commentString:vF,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},t.schema.toStringOptions,e);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):"  ",inFlow:i,options:n}}function wF(t,e){if(e.tag){const r=t.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let n,i;if(gt(e)){i=e.value;let r=t.filter(s=>s.identify?.(i));if(r.length>1){const s=r.filter(o=>o.test);s.length>0&&(r=s)}n=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,n=t.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){const r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function SF(t,e,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(gt(t)||kt(t))&&t.anchor;s&&RM(s)&&(n.add(s),r.push(`&${s}`));const o=t.tag??(e.default?null:e.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function Tc(t,e,n,i){if(St(t))return t.toString(e,n,i);if(Ra(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r;const s=Tt(t)?t:e.doc.createNode(t,{onTagObj:u=>r=u});r??(r=wF(e.doc.schema.tags,s));const o=SF(s,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const l=typeof r.stringify=="function"?r.stringify(s,e,n,i):gt(s)?Ld(s,e,n,i):s.toString(e,n,i);return o?gt(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
${e.indent}${l}`:l}function kF({key:t,value:e},n,i,r){const{allNullValues:s,doc:o,indent:l,indentStep:u,options:{commentString:f,indentSeq:h,simpleKeys:p}}=n;let g=Tt(t)&&t.comment||null;if(p){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(kt(t)||!Tt(t)&&typeof t=="object"){const N="With simple keys, collection cannot be used as a key value";throw new Error(N)}}let O=!p&&(!t||g&&e==null&&!n.inFlow||kt(t)||(gt(t)?t.type===De.BLOCK_FOLDED||t.type===De.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!O&&(p||!s),indent:l+u});let v=!1,x=!1,S=Tc(t,n,()=>v=!0,()=>x=!0);if(!O&&!n.inFlow&&S.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");O=!0}if(n.inFlow){if(s||e==null)return v&&i&&i(),S===""?"?":O?`? ${S}`:S}else if(s&&!p||e==null&&O)return S=`? ${S}`,g&&!v?S+=aa(S,n.indent,f(g)):x&&r&&r(),S;v&&(g=null),O?(g&&(S+=aa(S,n.indent,f(g))),S=`? ${S}
${l}:`):(S=`${S}:`,g&&(S+=aa(S,n.indent,f(g))));let k,$,E;Tt(e)?(k=!!e.spaceBefore,$=e.commentBefore,E=e.comment):(k=!1,$=null,E=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!O&&!g&&gt(e)&&(n.indentAtStart=S.length+1),x=!1,!h&&u.length>=2&&!n.inFlow&&!O&&Kc(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let T=!1;const _=Tc(e,n,()=>T=!0,()=>x=!0);let Q=" ";if(g||k||$){if(Q=k?`
`:"",$){const N=f($);Q+=`
${ps(N,n.indent)}`}_===""&&!n.inFlow?Q===`
`&&E&&(Q=`

`):Q+=`
${n.indent}`}else if(!O&&kt(e)){const N=_[0],R=_.indexOf(`
`),X=R!==-1,q=n.inFlow??e.flow??e.items.length===0;if(X||!q){let z=!1;if(X&&(N==="&"||N==="!")){let Z=_.indexOf(" ");N==="&"&&Z!==-1&&Z<R&&_[Z+1]==="!"&&(Z=_.indexOf(" ",Z+1)),(Z===-1||R<Z)&&(z=!0)}z||(Q=`
${n.indent}`)}}else(_===""||_[0]===`
`)&&(Q="");return S+=Q+_,n.inFlow?T&&i&&i():E&&!T?S+=aa(S,n.indent,f(E)):x&&r&&r(),S}function ZM(t,e){(t==="debug"||t==="warn")&&console.warn(e)}const Vp="<<",vs={identify:t=>t===Vp||typeof t=="symbol"&&t.description===Vp,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new De(Symbol(Vp)),{addToJSMap:BM}),stringify:()=>Vp},EF=(t,e)=>(vs.identify(e)||gt(e)&&(!e.type||e.type===De.PLAIN)&&vs.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===vs.tag&&n.default);function BM(t,e,n){const i=IM(t,n);if(Kc(i))for(const r of i.items)ib(t,e,r);else if(Array.isArray(i))for(const r of i)ib(t,e,r);else ib(t,e,i)}function ib(t,e,n){const i=IM(t,n);if(!Hc(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,t,Map);for(const[s,o]of r)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function IM(t,e){return t&&Ra(e)?e.resolve(t.doc,t):e}function GM(t,e,{key:n,value:i}){if(Tt(n)&&n.addToJSMap)n.addToJSMap(t,e,i);else if(EF(t,n))BM(t,e,i);else{const r=Ti(n,"",t);if(e instanceof Map)e.set(r,Ti(i,r,t));else if(e instanceof Set)e.add(r);else{const s=TF(n,r,t),o=Ti(i,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function TF(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Tt(t)&&n?.doc){const i=XM(n.doc,{});i.anchors=new Set;for(const s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;const r=t.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),ZM(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}function Y1(t,e,n){const i=cd(t,void 0,n),r=cd(e,void 0,n);return new hn(i,r)}class hn{constructor(e,n=null){Object.defineProperty(this,$i,{value:$M}),this.key=e,this.value=n}clone(e){let{key:n,value:i}=this;return Tt(n)&&(n=n.clone(e)),Tt(i)&&(i=i.clone(e)),new hn(n,i)}toJSON(e,n){const i=n?.mapAsMap?new Map:{};return GM(n,i,this)}toString(e,n,i){return e?.doc?kF(this,e,n,i):JSON.stringify(this)}}function VM(t,e,n){return(e.inFlow??t.flow?$F:CF)(t,e,n)}function CF({comment:t,items:e},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:l}){const{indent:u,options:{commentString:f}}=n,h=Object.assign({},n,{indent:s,type:null});let p=!1;const g=[];for(let v=0;v<e.length;++v){const x=e[v];let S=null;if(Tt(x))!p&&x.spaceBefore&&g.push(""),vm(n,g,x.commentBefore,p),x.comment&&(S=x.comment);else if(St(x)){const $=Tt(x.key)?x.key:null;$&&(!p&&$.spaceBefore&&g.push(""),vm(n,g,$.commentBefore,p))}p=!1;let k=Tc(x,h,()=>S=null,()=>p=!0);S&&(k+=aa(k,s,f(S))),p&&S&&(p=!1),g.push(i+k)}let O;if(g.length===0)O=r.start+r.end;else{O=g[0];for(let v=1;v<g.length;++v){const x=g[v];O+=x?`
${u}${x}`:`
`}}return t?(O+=`
`+ps(f(t),u),l&&l()):p&&o&&o(),O}function $F({items:t},e,{flowChars:n,itemIndent:i}){const{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=e;i+=s;const u=Object.assign({},e,{indent:i,inFlow:!0,type:null});let f=!1,h=0;const p=[];for(let v=0;v<t.length;++v){const x=t[v];let S=null;if(Tt(x))x.spaceBefore&&p.push(""),vm(e,p,x.commentBefore,!1),x.comment&&(S=x.comment);else if(St(x)){const $=Tt(x.key)?x.key:null;$&&($.spaceBefore&&p.push(""),vm(e,p,$.commentBefore,!1),$.comment&&(f=!0));const E=Tt(x.value)?x.value:null;E?(E.comment&&(S=E.comment),E.commentBefore&&(f=!0)):x.value==null&&$?.comment&&(S=$.comment)}S&&(f=!0);let k=Tc(x,u,()=>S=null);f||(f=p.length>h||k.includes(`
`)),v<t.length-1?k+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(f||(f=p.reduce(($,E)=>$+E.length+2,2)+(k.length+2)>e.options.lineWidth)),f&&(k+=",")),S&&(k+=aa(k,i,l(S))),p.push(k),h=p.length}const{start:g,end:O}=n;if(p.length===0)return g+O;if(!f){const v=p.reduce((x,S)=>x+S.length+2,2);f=e.options.lineWidth>0&&v>e.options.lineWidth}if(f){let v=g;for(const x of p)v+=x?`
${s}${r}${x}`:`
`;return`${v}
${r}${O}`}else return`${g}${o}${p.join(" ")}${o}${O}`}function vm({indent:t,options:{commentString:e}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=ps(e(i),t);n.push(s.trimStart())}}function la(t,e){const n=gt(e)?e.value:e;for(const i of t)if(St(i)&&(i.key===e||i.key===n||gt(i.key)&&i.key.value===n))return i}class ri extends DM{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(yo,e),this.items=[]}static from(e,n,i){const{keepUndefined:r,replacer:s}=i,o=new this(e),l=(u,f)=>{if(typeof s=="function")f=s.call(n,u,f);else if(Array.isArray(s)&&!s.includes(u))return;(f!==void 0||r)&&o.items.push(Y1(u,f,i))};if(n instanceof Map)for(const[u,f]of n)l(u,f);else if(n&&typeof n=="object")for(const u of Object.keys(n))l(u,n[u]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let i;St(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new hn(e,e?.value):i=new hn(e.key,e.value);const r=la(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);gt(r.value)&&LM(i.value)?r.value.value=i.value:r.value=i.value}else if(s){const o=this.items.findIndex(l=>s(i,l)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){const n=la(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){const r=la(this.items,e)?.value;return(!n&&gt(r)?r.value:r)??void 0}has(e){return!!la(this.items,e)}set(e,n){this.add(new hn(e,n),!0)}toJSON(e,n,i){const r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(const s of this.items)GM(n,r,s);return r}toString(e,n,i){if(!e)return JSON.stringify(this);for(const r of this.items)if(!St(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),VM(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:n})}}const Jc={collection:"map",default:!0,nodeClass:ri,tag:"tag:yaml.org,2002:map",resolve(t,e){return Hc(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>ri.from(t,e,n)};class Eo extends DM{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Fc,e),this.items=[]}add(e){this.items.push(e)}delete(e){const n=Up(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){const i=Up(e);if(typeof i!="number")return;const r=this.items[i];return!n&&gt(r)?r.value:r}has(e){const n=Up(e);return typeof n=="number"&&n<this.items.length}set(e,n){const i=Up(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);const r=this.items[i];gt(r)&&LM(n)?r.value=n:this.items[i]=n}toJSON(e,n){const i=[];n?.onCreate&&n.onCreate(i);let r=0;for(const s of this.items)i.push(Ti(s,String(r++),n));return i}toString(e,n,i){return e?VM(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+"  ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(e,n,i){const{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let l of n){if(typeof r=="function"){const u=n instanceof Set?l:String(o++);l=r.call(n,u,l)}s.items.push(cd(l,void 0,i))}}return s}}function Up(t){let e=gt(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const eu={collection:"seq",default:!0,nodeClass:Eo,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Kc(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Eo.from(t,e,n)},cO={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,i){return e=Object.assign({actualString:!0},e),Ld(t,e,n,i)}},uO={identify:t=>t==null,createNode:()=>new De(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new De(null),stringify:({source:t},e)=>typeof t=="string"&&uO.test.test(t)?t:e.options.nullStr},q1={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new De(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&q1.test.test(t)){const i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?n.options.trueStr:n.options.falseStr}};function ir({format:t,minFractionDigits:e,tag:n,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=e-(s.length-o-1);for(;l-- >0;)s+="0"}return s}const UM={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ir},YM={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ir(t)}},qM={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new De(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:ir},fO=t=>typeof t=="bigint"||Number.isInteger(t),W1=(t,e,n,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),n);function WM(t,e,n){const{value:i}=t;return fO(i)&&i>=0?n+i.toString(e):ir(t)}const FM={identify:t=>fO(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>W1(t,2,8,n),stringify:t=>WM(t,8,"0o")},HM={identify:fO,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>W1(t,0,10,n),stringify:ir},KM={identify:t=>fO(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>W1(t,2,16,n),stringify:t=>WM(t,16,"0x")},_F=[Jc,eu,cO,uO,q1,FM,HM,KM,UM,YM,qM];function I_(t){return typeof t=="bigint"||Number.isInteger(t)}const Yp=({value:t})=>JSON.stringify(t),QF=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Yp},{identify:t=>t==null,createNode:()=>new De(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Yp},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Yp},{identify:I_,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>I_(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Yp}],AF={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},NF=[Jc,eu].concat(QF,AF),F1={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){const n=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},i,r,s){if(!n)return"";const o=n;let l;if(typeof btoa=="function"){let u="";for(let f=0;f<o.length;++f)u+=String.fromCharCode(o[f]);l=btoa(u)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=De.BLOCK_LITERAL),e!==De.QUOTE_DOUBLE){const u=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),f=Math.ceil(l.length/u),h=new Array(f);for(let p=0,g=0;p<f;++p,g+=u)h[p]=l.substr(g,u);l=h.join(e===De.BLOCK_LITERAL?`
`:" ")}return Ld({comment:t,type:e,value:l},i,r,s)}};function JM(t,e){if(Kc(t))for(let n=0;n<t.items.length;++n){let i=t.items[n];if(!St(i)){if(Hc(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");const r=i.items[0]||new hn(new De(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
${r.key.commentBefore}`:i.commentBefore),i.comment){const s=r.value??r.key;s.comment=s.comment?`${i.comment}
${s.comment}`:i.comment}i=r}t.items[n]=St(i)?i:new hn(i)}}else e("Expected a sequence for this tag");return t}function eL(t,e,n){const{replacer:i}=n,r=new Eo(t);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(s++),o));let l,u;if(Array.isArray(o))if(o.length===2)l=o[0],u=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const f=Object.keys(o);if(f.length===1)l=f[0],u=o[l];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else l=o;r.items.push(Y1(l,u,n))}return r}const H1={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:JM,createNode:eL};class sc extends Eo{constructor(){super(),this.add=ri.prototype.add.bind(this),this.delete=ri.prototype.delete.bind(this),this.get=ri.prototype.get.bind(this),this.has=ri.prototype.has.bind(this),this.set=ri.prototype.set.bind(this),this.tag=sc.tag}toJSON(e,n){if(!n)return super.toJSON(e);const i=new Map;n?.onCreate&&n.onCreate(i);for(const r of this.items){let s,o;if(St(r)?(s=Ti(r.key,"",n),o=Ti(r.value,s,n)):s=Ti(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(e,n,i){const r=eL(e,n,i),s=new this;return s.items=r.items,s}}sc.tag="tag:yaml.org,2002:omap";const K1={collection:"seq",identify:t=>t instanceof Map,nodeClass:sc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=JM(t,e),i=[];for(const{key:r}of n.items)gt(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new sc,n)},createNode:(t,e,n)=>sc.from(t,e,n)};function tL({value:t,source:e},n){return e&&(t?nL:iL).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const nL={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new De(!0),stringify:tL},iL={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new De(!1),stringify:tL},PF={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ir},RF={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ir(t)}},jF={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new De(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){const i=t.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:ir},Dd=t=>typeof t=="bigint"||Number.isInteger(t);function dO(t,e,n,{intAsBigInt:i}){const r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const o=BigInt(t);return r==="-"?BigInt(-1)*o:o}const s=parseInt(t,n);return r==="-"?-1*s:s}function J1(t,e,n){const{value:i}=t;if(Dd(i)){const r=i.toString(e);return i<0?"-"+n+r.substr(1):n+r}return ir(t)}const MF={identify:Dd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>dO(t,2,2,n),stringify:t=>J1(t,2,"0b")},LF={identify:Dd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>dO(t,1,8,n),stringify:t=>J1(t,8,"0")},DF={identify:Dd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>dO(t,0,10,n),stringify:ir},zF={identify:Dd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>dO(t,2,16,n),stringify:t=>J1(t,16,"0x")};class oc extends ri{constructor(e){super(e),this.tag=oc.tag}add(e){let n;St(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new hn(e.key,null):n=new hn(e,null),la(this.items,n.key)||this.items.push(n)}get(e,n){const i=la(this.items,e);return!n&&St(i)?gt(i.key)?i.key.value:i.key:i}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=la(this.items,e);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new hn(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(e,n,i){const{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(Y1(o,null,i));return s}}oc.tag="tag:yaml.org,2002:set";const eS={collection:"map",identify:t=>t instanceof Set,nodeClass:oc,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>oc.from(t,e,n),resolve(t,e){if(Hc(t)){if(t.hasAllNullValues(!0))return Object.assign(new oc,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function tS(t,e){const n=t[0],i=n==="-"||n==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function rL(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return ir(t);let i="";e<0&&(i="-",e*=n(-1));const r=n(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const sL={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>tS(t,n),stringify:rL},oL={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>tS(t,!1),stringify:rL},hO={identify:t=>t 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(t){const e=t.match(hO.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,o,l]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0;let f=Date.UTC(n,i-1,r,s||0,o||0,l||0,u);const h=e[8];if(h&&h!=="Z"){let p=tS(h,!1);Math.abs(p)<30&&(p*=60),f-=6e4*p}return new Date(f)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},G_=[Jc,eu,cO,uO,nL,iL,MF,LF,DF,zF,PF,RF,jF,F1,vs,K1,H1,eS,sL,oL,hO],V_=new Map([["core",_F],["failsafe",[Jc,eu,cO]],["json",NF],["yaml11",G_],["yaml-1.1",G_]]),U_={binary:F1,bool:q1,float:qM,floatExp:YM,floatNaN:UM,floatTime:oL,int:HM,intHex:KM,intOct:FM,intTime:sL,map:Jc,merge:vs,null:uO,omap:K1,pairs:H1,seq:eu,set:eS,timestamp:hO},XF={"tag:yaml.org,2002:binary":F1,"tag:yaml.org,2002:merge":vs,"tag:yaml.org,2002:omap":K1,"tag:yaml.org,2002:pairs":H1,"tag:yaml.org,2002:set":eS,"tag:yaml.org,2002:timestamp":hO};function rb(t,e,n){const i=V_.get(e);if(i&&!t)return n&&!i.includes(vs)?i.concat(vs):i.slice();let r=i;if(!r)if(Array.isArray(t))r=[];else{const s=Array.from(V_.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(const s of t)r=r.concat(s);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(vs)),r.reduce((s,o)=>{const l=typeof o=="string"?U_[o]:o;if(!l){const u=JSON.stringify(o),f=Object.keys(U_).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${f}`)}return s.includes(l)||s.push(l),s},[])}const ZF=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0;class pO{constructor({compat:e,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?rb(e,"compat"):e?rb(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?XF:{},this.tags=rb(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,yo,{value:Jc}),Object.defineProperty(this,Mr,{value:cO}),Object.defineProperty(this,Fc,{value:eu}),this.sortMapEntries=typeof o=="function"?o:o===!0?ZF:null}clone(){const e=Object.create(pO.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function BF(t,e){const n=[];let i=e.directives===!0;if(e.directives!==!1&&t.directives){const u=t.directives.toString(t);u?(n.push(u),i=!0):t.directives.docStart&&(i=!0)}i&&n.push("---");const r=XM(t,e),{commentString:s}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");const u=s(t.commentBefore);n.unshift(ps(u,""))}let o=!1,l=null;if(t.contents){if(Tt(t.contents)){if(t.contents.spaceBefore&&i&&n.push(""),t.contents.commentBefore){const h=s(t.contents.commentBefore);n.push(ps(h,""))}r.forceBlockIndent=!!t.comment,l=t.contents.comment}const u=l?void 0:()=>o=!0;let f=Tc(t.contents,r,()=>l=null,u);l&&(f+=aa(f,"",s(l))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(Tc(t.contents,r));if(t.directives?.docEnd)if(t.comment){const u=s(t.comment);u.includes(`
`)?(n.push("..."),n.push(ps(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=t.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(ps(s(u),"")))}return n.join(`
`)+`
`}class tu{constructor(e,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,$i,{value:iw});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new bn({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){const e=Object.create(tu.prototype,{[$i]:{value:iw}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Tt(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ql(this.contents)&&this.contents.add(e)}addIn(e,n){Ql(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){const i=jM(this);e.anchor=!n||i.has(n)?MM(n||"a",i):n}return new sO(e.anchor)}createNode(e,n,i){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){const S=$=>typeof $=="number"||$ instanceof String||$ instanceof Number,k=n.filter(S).map(String);k.length>0&&(n=n.concat(k)),r=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:u,onTagObj:f,tag:h}=i??{},{onAnchor:p,setAnchors:g,sourceObjects:O}=mF(this,o||"a"),v={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:p,onTagObj:f,replacer:r,schema:this.schema,sourceObjects:O},x=cd(e,h,v);return l&&kt(x)&&(x.flow=!0),g(),x}createPair(e,n,i={}){const r=this.createNode(e,null,i),s=this.createNode(n,null,i);return new hn(r,s)}delete(e){return Ql(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Af(e)?this.contents==null?!1:(this.contents=null,!0):Ql(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return kt(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Af(e)?!n&&gt(this.contents)?this.contents.value:this.contents:kt(this.contents)?this.contents.getIn(e,n):void 0}has(e){return kt(this.contents)?this.contents.has(e):!1}hasIn(e){return Af(e)?this.contents!==void 0:kt(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=ym(this.schema,[e],n):Ql(this.contents)&&this.contents.set(e,n)}setIn(e,n){Af(e)?this.contents=n:this.contents==null?this.contents=ym(this.schema,Array.from(e),n):Ql(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new bn({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new bn({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new pO(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},u=Ti(this.contents,n??"",l);if(typeof s=="function")for(const{count:f,res:h}of l.anchors.values())s(h,f);return typeof o=="function"?ql(o,{"":u},"",u):u}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return BF(this,e)}}function Ql(t){if(kt(t))return!0;throw new Error("Expected a YAML collection as document contents")}class nS extends Error{constructor(e,n,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=n}}class ca extends nS{constructor(e,n,i){super("YAMLParseError",e,n,i)}}class aL extends nS{constructor(e,n,i){super("YAMLWarning",e,n,i)}}const bm=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>e.linePos(l));const{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){const l=Math.min(s-39,o.length-79);o="…"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,s))){let l=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`…
`),o=l+o}if(/[^ ]/.test(o)){let l=1;const u=n.linePos[1];u?.line===i&&u.col>r&&(l=Math.max(1,Math.min(u.col-r,80-s)));const f=" ".repeat(s)+"^".repeat(l);n.message+=`:

${o}
${f}
`}};function Cc(t,{flow:e,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:l}){let u=!1,f=l,h=l,p="",g="",O=!1,v=!1,x=null,S=null,k=null,$=null,E=null,T=null,_=null;for(const R of t)switch(v&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&s(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v=!1),x&&(f&&R.type!=="comment"&&R.type!=="newline"&&s(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),R.type){case"space":!e&&(n!=="doc-start"||i?.type!=="flow-collection")&&R.source.includes("	")&&(x=R),h=!0;break;case"comment":{h||s(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const X=R.source.substring(1)||" ";p?p+=g+X:p=X,g="",f=!1;break}case"newline":f?p?p+=R.source:(!T||n!=="seq-item-ind")&&(u=!0):g+=R.source,f=!0,O=!0,(S||k)&&($=R),h=!0;break;case"anchor":S&&s(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&s(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),S=R,_??(_=R.offset),f=!1,h=!1,v=!0;break;case"tag":{k&&s(R,"MULTIPLE_TAGS","A node can have at most one tag"),k=R,_??(_=R.offset),f=!1,h=!1,v=!0;break}case n:(S||k)&&s(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),T&&s(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${e??"collection"}`),T=R,f=n==="seq-item-ind"||n==="explicit-key-ind",h=!1;break;case"comma":if(e){E&&s(R,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),E=R,f=!1,h=!1;break}default:s(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),f=!1,h=!1}const Q=t[t.length-1],N=Q?Q.offset+Q.source.length:r;return v&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x&&(f&&x.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&s(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:E,found:T,spaceBefore:u,comment:p,hasNewline:O,anchor:S,tag:k,newlineAfterProp:$,end:N,start:_??N}}function ud(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
`))return!0;if(t.end){for(const e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of t.items){for(const n of e.start)if(n.type==="newline")return!0;if(e.sep){for(const n of e.sep)if(n.type==="newline")return!0}if(ud(e.key)||ud(e.value))return!0}return!1;default:return!0}}function aw(t,e,n){if(e?.type==="flow-collection"){const i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&ud(e)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function lL(t,e,n){const{uniqueKeys:i}=t.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,o)=>s===o||gt(s)&&gt(o)&&s.value===o.value;return e.some(s=>r(s.key,n))}const Y_="All mapping items must start at the same column";function IF({composeNode:t,composeEmptyNode:e},n,i,r,s){const o=s?.nodeClass??ri,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let u=i.offset,f=null;for(const h of i.items){const{start:p,key:g,sep:O,value:v}=h,x=Cc(p,{indicator:"explicit-key-ind",next:g??O?.[0],offset:u,onError:r,parentIndent:i.indent,startOnNewline:!0}),S=!x.found;if(S){if(g&&(g.type==="block-seq"?r(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==i.indent&&r(u,"BAD_INDENT",Y_)),!x.anchor&&!x.tag&&!O){f=x.end,x.comment&&(l.comment?l.comment+=`
`+x.comment:l.comment=x.comment);continue}(x.newlineAfterProp||ud(g))&&r(g??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else x.found?.indent!==i.indent&&r(u,"BAD_INDENT",Y_);n.atKey=!0;const k=x.end,$=g?t(n,g,x,r):e(n,k,p,null,x,r);n.schema.compat&&aw(i.indent,g,r),n.atKey=!1,lL(n,l.items,$)&&r(k,"DUPLICATE_KEY","Map keys must be unique");const E=Cc(O??[],{indicator:"map-value-ind",next:v,offset:$.range[2],onError:r,parentIndent:i.indent,startOnNewline:!g||g.type==="block-scalar"});if(u=E.end,E.found){S&&(v?.type==="block-map"&&!E.hasNewline&&r(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&x.start<E.found.offset-1024&&r($.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const T=v?t(n,v,E,r):e(n,u,O,null,E,r);n.schema.compat&&aw(i.indent,v,r),u=T.range[2];const _=new hn($,T);n.options.keepSourceTokens&&(_.srcToken=h),l.items.push(_)}else{S&&r($.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),E.comment&&($.comment?$.comment+=`
`+E.comment:$.comment=E.comment);const T=new hn($);n.options.keepSourceTokens&&(T.srcToken=h),l.items.push(T)}}return f&&f<u&&r(f,"IMPOSSIBLE","Map comment with trailing content"),l.range=[i.offset,u,f??u],l}function GF({composeNode:t,composeEmptyNode:e},n,i,r,s){const o=s?.nodeClass??Eo,l=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=i.offset,f=null;for(const{start:h,value:p}of i.items){const g=Cc(h,{indicator:"seq-item-ind",next:p,offset:u,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||p)p?.type==="block-seq"?r(g.end,"BAD_INDENT","All sequence items must start at the same column"):r(u,"MISSING_CHAR","Sequence item without - indicator");else{f=g.end,g.comment&&(l.comment=g.comment);continue}const O=p?t(n,p,g,r):e(n,g.end,h,null,g,r);n.schema.compat&&aw(i.indent,p,r),u=O.range[2],l.items.push(O)}return l.range=[i.offset,u,f??u],l}function zd(t,e,n,i){let r="";if(t){let s=!1,o="";for(const l of t){const{source:u,type:f}=l;switch(f){case"space":s=!0;break;case"comment":{n&&!s&&i(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const h=u.substring(1)||" ";r?r+=o+h:r=h,o="";break}case"newline":r&&(o+=u),s=!0;break;default:i(l,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}e+=u.length}}return{comment:r,offset:e}}const sb="Block collections are not allowed within flow collections",ob=t=>t&&(t.type==="block-map"||t.type==="block-seq");function VF({composeNode:t,composeEmptyNode:e},n,i,r,s){const o=i.start.source==="{",l=o?"flow map":"flow sequence",u=s?.nodeClass??(o?ri:Eo),f=new u(n.schema);f.flow=!0;const h=n.atRoot;h&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let p=i.offset+i.start.source.length;for(let S=0;S<i.items.length;++S){const k=i.items[S],{start:$,key:E,sep:T,value:_}=k,Q=Cc($,{flow:l,indicator:"explicit-key-ind",next:E??T?.[0],offset:p,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!Q.found){if(!Q.anchor&&!Q.tag&&!T&&!_){S===0&&Q.comma?r(Q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):S<i.items.length-1&&r(Q.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),Q.comment&&(f.comment?f.comment+=`
`+Q.comment:f.comment=Q.comment),p=Q.end;continue}!o&&n.options.strict&&ud(E)&&r(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)Q.comma&&r(Q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(Q.comma||r(Q.start,"MISSING_CHAR",`Missing , between ${l} items`),Q.comment){let N="";e:for(const R of $)switch(R.type){case"comma":case"space":break;case"comment":N=R.source.substring(1);break e;default:break e}if(N){let R=f.items[f.items.length-1];St(R)&&(R=R.value??R.key),R.comment?R.comment+=`
`+N:R.comment=N,Q.comment=Q.comment.substring(N.length+1)}}if(!o&&!T&&!Q.found){const N=_?t(n,_,Q,r):e(n,Q.end,T,null,Q,r);f.items.push(N),p=N.range[2],ob(_)&&r(N.range,"BLOCK_IN_FLOW",sb)}else{n.atKey=!0;const N=Q.end,R=E?t(n,E,Q,r):e(n,N,$,null,Q,r);ob(E)&&r(R.range,"BLOCK_IN_FLOW",sb),n.atKey=!1;const X=Cc(T??[],{flow:l,indicator:"map-value-ind",next:_,offset:R.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(X.found){if(!o&&!Q.found&&n.options.strict){if(T)for(const Z of T){if(Z===X.found)break;if(Z.type==="newline"){r(Z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}Q.start<X.found.offset-1024&&r(X.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else _&&("source"in _&&_.source?.[0]===":"?r(_,"MISSING_CHAR",`Missing space after : in ${l}`):r(X.start,"MISSING_CHAR",`Missing , or : between ${l} items`));const q=_?t(n,_,X,r):X.found?e(n,X.end,T,null,X,r):null;q?ob(_)&&r(q.range,"BLOCK_IN_FLOW",sb):X.comment&&(R.comment?R.comment+=`
`+X.comment:R.comment=X.comment);const z=new hn(R,q);if(n.options.keepSourceTokens&&(z.srcToken=k),o){const Z=f;lL(n,Z.items,R)&&r(N,"DUPLICATE_KEY","Map keys must be unique"),Z.items.push(z)}else{const Z=new ri(n.schema);Z.flow=!0,Z.items.push(z);const F=(q??R).range;Z.range=[R.range[0],F[1],F[2]],f.items.push(Z)}p=q?q.range[2]:X.end}}const g=o?"}":"]",[O,...v]=i.end;let x=p;if(O?.source===g)x=O.offset+O.source.length;else{const S=l[0].toUpperCase()+l.substring(1),k=h?`${S} must end with a ${g}`:`${S} in block collection must be sufficiently indented and end with a ${g}`;r(p,h?"MISSING_CHAR":"BAD_INDENT",k),O&&O.source.length!==1&&v.unshift(O)}if(v.length>0){const S=zd(v,x,n.options.strict,r);S.comment&&(f.comment?f.comment+=`
`+S.comment:f.comment=S.comment),f.range=[i.offset,x,S.offset]}else f.range=[i.offset,x,x];return f}function ab(t,e,n,i,r,s){const o=n.type==="block-map"?IF(t,e,n,i,s):n.type==="block-seq"?GF(t,e,n,i,s):VF(t,e,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function UF(t,e,n,i,r){const s=i.tag,o=s?e.directives.tagName(s.source,g=>r(s,"TAG_RESOLVE_FAILED",g)):null;if(n.type==="block-seq"){const{anchor:g,newlineAfterProp:O}=i,v=g&&s?g.offset>s.offset?g:s:g??s;v&&(!O||O.offset<v.offset)&&r(v,"MISSING_CHAR","Missing newline after block sequence props")}const l=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===ri.tagName&&l==="map"||o===Eo.tagName&&l==="seq")return ab(t,e,n,r,o);let u=e.schema.tags.find(g=>g.tag===o&&g.collection===l);if(!u){const g=e.schema.knownTags[o];if(g?.collection===l)e.schema.tags.push(Object.assign({},g,{default:!1})),u=g;else return g?r(s,"BAD_COLLECTION_TYPE",`${g.tag} used for ${l} collection, but expects ${g.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),ab(t,e,n,r,o)}const f=ab(t,e,n,r,o,u),h=u.resolve?.(f,g=>r(s,"TAG_RESOLVE_FAILED",g),e.options)??f,p=Tt(h)?h:new De(h);return p.range=f.range,p.tag=o,u?.format&&(p.format=u.format),p}function cL(t,e,n){const i=e.offset,r=YF(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?De.BLOCK_FOLDED:De.BLOCK_LITERAL,o=e.source?qF(e.source):[];let l=o.length;for(let x=o.length-1;x>=0;--x){const S=o[x][1];if(S===""||S==="\r")l=x;else break}if(l===0){const x=r.chomp==="+"&&o.length>0?`
`.repeat(Math.max(1,o.length-1)):"";let S=i+r.length;return e.source&&(S+=e.source.length),{value:x,type:s,comment:r.comment,range:[i,S,S]}}let u=e.indent+r.indent,f=e.offset+r.length,h=0;for(let x=0;x<l;++x){const[S,k]=o[x];if(k===""||k==="\r")r.indent===0&&S.length>u&&(u=S.length);else{S.length<u&&n(f+S.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(u=S.length),h=x,u===0&&!t.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=S.length+k.length+1}for(let x=o.length-1;x>=l;--x)o[x][0].length>u&&(l=x+1);let p="",g="",O=!1;for(let x=0;x<h;++x)p+=o[x][0].slice(u)+`
`;for(let x=h;x<l;++x){let[S,k]=o[x];f+=S.length+k.length+1;const $=k[k.length-1]==="\r";if($&&(k=k.slice(0,-1)),k&&S.length<u){const T=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(f-k.length-($?2:1),"BAD_INDENT",T),S=""}s===De.BLOCK_LITERAL?(p+=g+S.slice(u)+k,g=`
`):S.length>u||k[0]==="	"?(g===" "?g=`
`:!O&&g===`
`&&(g=`

`),p+=g+S.slice(u)+k,g=`
`,O=!0):k===""?g===`
`?p+=`
`:g=`
`:(p+=g+k,g=" ",O=!1)}switch(r.chomp){case"-":break;case"+":for(let x=l;x<o.length;++x)p+=`
`+o[x][0].slice(u);p[p.length-1]!==`
`&&(p+=`
`);break;default:p+=`
`}const v=i+r.length+e.source.length;return{value:p,type:s,comment:r.comment,range:[i,v,v]}}function YF({offset:t,props:e},n,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=e[0],s=r[0];let o=0,l="",u=-1;for(let g=1;g<r.length;++g){const O=r[g];if(!l&&(O==="-"||O==="+"))l=O;else{const v=Number(O);!o&&v?o=v:u===-1&&(u=t+g)}}u!==-1&&i(u,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let f=!1,h="",p=r.length;for(let g=1;g<e.length;++g){const O=e[g];switch(O.type){case"space":f=!0;case"newline":p+=O.source.length;break;case"comment":n&&!f&&i(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=O.source.length,h=O.source.substring(1);break;case"error":i(O,"UNEXPECTED_TOKEN",O.message),p+=O.source.length;break;default:{const v=`Unexpected token in block scalar header: ${O.type}`;i(O,"UNEXPECTED_TOKEN",v);const x=O.source;x&&typeof x=="string"&&(p+=x.length)}}}return{mode:s,indent:o,chomp:l,comment:h,length:p}}function qF(t){const e=t.split(/\n( *)/),n=e[0],i=n.match(/^( *)/),s=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}function uL(t,e,n){const{offset:i,type:r,source:s,end:o}=t;let l,u;const f=(g,O,v)=>n(i+g,O,v);switch(r){case"scalar":l=De.PLAIN,u=WF(s,f);break;case"single-quoted-scalar":l=De.QUOTE_SINGLE,u=FF(s,f);break;case"double-quoted-scalar":l=De.QUOTE_DOUBLE,u=HF(s,f);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}const h=i+s.length,p=zd(o,h,e,n);return{value:u,type:l,comment:p.comment,range:[i,h,p.offset]}}function WF(t,e){let n="";switch(t[0]){case"	":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),fL(t)}function FF(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),fL(t.slice(1,-1)).replace(/''/g,"'")}function fL(t){let e,n;try{e=new RegExp(`(.*?)(?<![ 	])[ 	]*\r?
`,"sy"),n=new RegExp(`[ 	]*(.*?)(?:(?<![ 	])[ 	]*)?\r?
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let r=i[1],s=" ",o=e.lastIndex;for(n.lastIndex=o;i=n.exec(t);)i[1]===""?s===`
`?r+=s:s=`
`:(r+=s+i[1],s=" "),o=n.lastIndex;const l=/[ \t]*(.*)/sy;return l.lastIndex=o,i=l.exec(t),r+s+(i?.[1]??"")}function HF(t,e){let n="";for(let i=1;i<t.length-1;++i){const r=t[i];if(!(r==="\r"&&t[i+1]===`
`))if(r===`
`){const{fold:s,offset:o}=KF(t,i);n+=s,i=o}else if(r==="\\"){let s=t[++i];const o=JF[s];if(o)n+=o;else if(s===`
`)for(s=t[i+1];s===" "||s==="	";)s=t[++i+1];else if(s==="\r"&&t[i+1]===`
`)for(s=t[++i+1];s===" "||s==="	";)s=t[++i+1];else if(s==="x"||s==="u"||s==="U"){const l=s==="x"?2:s==="u"?4:8;n+=eH(t,i+1,l,e),i+=l}else{const l=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),n+=l}}else if(r===" "||r==="	"){const s=i;let o=t[i+1];for(;o===" "||o==="	";)o=t[++i+1];o!==`
`&&!(o==="\r"&&t[i+2]===`
`)&&(n+=i>s?t.slice(s,i+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function KF(t,e){let n="",i=t[e+1];for(;(i===" "||i==="	"||i===`
`||i==="\r")&&!(i==="\r"&&t[e+2]!==`
`);)i===`
`&&(n+=`
`),e+=1,i=t[e+1];return n||(n=" "),{fold:n,offset:e}}const JF={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
`,r:"\r",t:"	",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","	":"	"};function eH(t,e,n,i){const r=t.substr(e,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{const l=t.substr(e-2,n+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function dL(t,e,n,i){const{value:r,type:s,comment:o,range:l}=e.type==="block-scalar"?cL(t,e,i):uL(e,t.options.strict,i),u=n?t.directives.tagName(n.source,p=>i(n,"TAG_RESOLVE_FAILED",p)):null;let f;t.options.stringKeys&&t.atKey?f=t.schema[Mr]:u?f=tH(t.schema,r,u,n,i):e.type==="scalar"?f=nH(t,r,e,i):f=t.schema[Mr];let h;try{const p=f.resolve(r,g=>i(n??e,"TAG_RESOLVE_FAILED",g),t.options);h=gt(p)?p:new De(p)}catch(p){const g=p instanceof Error?p.message:String(p);i(n??e,"TAG_RESOLVE_FAILED",g),h=new De(r)}return h.range=l,h.source=r,s&&(h.type=s),u&&(h.tag=u),f.format&&(h.format=f.format),o&&(h.comment=o),h}function tH(t,e,n,i,r){if(n==="!")return t[Mr];const s=[];for(const l of t.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)s.push(l);else return l;for(const l of s)if(l.test?.test(e))return l;const o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Mr])}function nH({atKey:t,directives:e,schema:n},i,r,s){const o=n.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(i))||n[Mr];if(n.compat){const l=n.compat.find(u=>u.default&&u.test?.test(i))??n[Mr];if(o.tag!==l.tag){const u=e.tagString(o.tag),f=e.tagString(l.tag),h=`Value may be parsed as either ${u} or ${f}`;s(r,"TAG_RESOLVE_FAILED",h,!0)}}return o}function iH(t,e,n){if(e){n??(n=e.length);for(let i=n-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++i];r?.type==="space";)t+=r.source.length,r=e[++i];break}}return t}const rH={composeNode:hL,composeEmptyNode:iS};function hL(t,e,n,i){const r=t.atKey,{spaceBefore:s,comment:o,anchor:l,tag:u}=n;let f,h=!0;switch(e.type){case"alias":f=sH(t,e,i),(l||u)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=dL(t,e,u,i),l&&(f.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{f=UF(rH,t,e,n,i),l&&(f.anchor=l.source.substring(1))}catch(p){const g=p instanceof Error?p.message:String(p);i(e,"RESOURCE_EXHAUSTION",g)}break;default:{const p=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",p),h=!1}}return f??(f=iS(t,e.offset,void 0,null,n,i)),l&&f.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!gt(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&i(u??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(f.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?f.comment=o:f.commentBefore=o),t.options.keepSourceTokens&&h&&(f.srcToken=e),f}function iS(t,e,n,i,{spaceBefore:r,comment:s,anchor:o,tag:l,end:u},f){const h={type:"scalar",offset:iH(e,n,i),indent:-1,source:""},p=dL(t,h,l,f);return o&&(p.anchor=o.source.substring(1),p.anchor===""&&f(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(p.spaceBefore=!0),s&&(p.comment=s,p.range[2]=u),p}function sH({options:t},{offset:e,source:n,end:i},r){const s=new sO(n.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+n.length,l=zd(i,o,t.strict,r);return s.range=[e,o,l.offset],l.comment&&(s.comment=l.comment),s}function oH(t,e,{offset:n,start:i,value:r,end:s},o){const l=Object.assign({_directives:e},t),u=new tu(void 0,l),f={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},h=Cc(i,{indicator:"doc-start",next:r??s?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});h.found&&(u.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!h.hasNewline&&o(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=r?hL(f,r,h,o):iS(f,h.end,i,null,h,o);const p=u.contents.range[2],g=zd(s,p,!1,o);return g.comment&&(u.comment=g.comment),u.range=[n,p,g.offset],u}function xf(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function q_(t){let e="",n=!1,i=!1;for(let r=0;r<t.length;++r){const s=t[r];switch(s[0]){case"#":e+=(e===""?"":i?`

`:`
`)+(s.substring(1)||" "),n=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:e,afterEmptyLine:i}}class rS{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{const o=xf(n);s?this.warnings.push(new aL(o,i,r)):this.errors.push(new ca(o,i,r))},this.directives=new bn({version:e.version||"1.2"}),this.options=e}decorate(e,n){const{comment:i,afterEmptyLine:r}=q_(this.prelude);if(i){const s=e.contents;if(n)e.comment=e.comment?`${e.comment}
${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if(kt(s)&&!s.flow&&s.items.length>0){let o=s.items[0];St(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${i}
${l}`:i}else{const o=s.commentBefore;s.commentBefore=o?`${i}
${o}`:i}}if(n){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:q_(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,i=-1){for(const r of e)yield*this.next(r);yield*this.end(n,i)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,i,r)=>{const s=xf(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const n=oH(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new ca(xf(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new ca(xf(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=zd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i}
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ca(xf(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const i=Object.assign({_directives:this.directives},this.options),r=new tu(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}}function aH(t,e=!0,n){if(t){const i=(r,s,o)=>{const l=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(l,s,o);else throw new ca([l,l+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return uL(t,e,i);case"block-scalar":return cL({options:{strict:e}},t,i)}}return null}function lH(t,e){const{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:s=-1,type:o="PLAIN"}=e,l=Ld({type:o,value:t},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),u=e.end??[{type:"newline",offset:-1,indent:i,source:`
`}];switch(l[0]){case"|":case">":{const f=l.indexOf(`
`),h=l.substring(0,f),p=l.substring(f+1)+`
`,g=[{type:"block-scalar-header",offset:s,indent:i,source:h}];return pL(g,u)||g.push({type:"newline",offset:-1,indent:i,source:`
`}),{type:"block-scalar",offset:s,indent:i,props:g,source:p}}case'"':return{type:"double-quoted-scalar",offset:s,indent:i,source:l,end:u};case"'":return{type:"single-quoted-scalar",offset:s,indent:i,source:l,end:u};default:return{type:"scalar",offset:s,indent:i,source:l,end:u}}}function cH(t,e,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:s=!1,type:o}=n,l="indent"in t?t.indent:null;if(i&&typeof l=="number"&&(l+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const f=t.props[0];if(f.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=f.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const u=Ld({type:o,value:e},{implicitKey:r||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(u[0]){case"|":case">":uH(t,u);break;case'"':lb(t,u,"double-quoted-scalar");break;case"'":lb(t,u,"single-quoted-scalar");break;default:lb(t,u,"scalar")}}function uH(t,e){const n=e.indexOf(`
`),i=e.substring(0,n),r=e.substring(n+1)+`
`;if(t.type==="block-scalar"){const s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=i,t.source=r}else{const{offset:s}=t,o="indent"in t?t.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:o,source:i}];pL(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:o,source:`
`});for(const u of Object.keys(t))u!=="type"&&u!=="offset"&&delete t[u];Object.assign(t,{type:"block-scalar",indent:o,props:l,source:r})}}function pL(t,e){if(e)for(const n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function lb(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{const i=t.props.slice(1);let r=e.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(const s of i)s.offset+=r;delete t.props,Object.assign(t,{type:n,source:e,end:i});break}case"block-map":case"block-seq":{const r={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
`};delete t.items,Object.assign(t,{type:n,source:e,end:[r]});break}default:{const i="indent"in t?t.indent:-1,r="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(const s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:n,indent:i,source:e,end:r})}}}const fH=t=>"type"in t?xm(t):Ag(t);function xm(t){switch(t.type){case"block-scalar":{let e="";for(const n of t.props)e+=xm(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(const n of t.items)e+=Ag(n);return e}case"flow-collection":{let e=t.start.source;for(const n of t.items)e+=Ag(n);for(const n of t.end)e+=n.source;return e}case"document":{let e=Ag(t);if(t.end)for(const n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(const n of t.end)e+=n.source;return e}}}function Ag({start:t,key:e,sep:n,value:i}){let r="";for(const s of t)r+=s.source;if(e&&(r+=xm(e)),n)for(const s of n)r+=s.source;return i&&(r+=xm(i)),r}const lw=Symbol("break visit"),dH=Symbol("skip children"),gL=Symbol("remove item");function Sa(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),mL(Object.freeze([]),t,e)}Sa.BREAK=lw;Sa.SKIP=dH;Sa.REMOVE=gL;Sa.itemAtPath=(t,e)=>{let n=t;for(const[i,r]of e){const s=n?.[i];if(s&&"items"in s)n=s.items[r];else return}return n};Sa.parentCollection=(t,e)=>{const n=Sa.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function mL(t,e,n){let i=n(e,t);if(typeof i=="symbol")return i;for(const r of["key","value"]){const s=e[r];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){const l=mL(Object.freeze(t.concat([[r,o]])),s.items[o],n);if(typeof l=="number")o=l-1;else{if(l===lw)return lw;l===gL&&(s.items.splice(o,1),o-=1)}}typeof i=="function"&&r==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}const gO="\uFEFF",mO="",OO="",fd="",hH=t=>!!t&&"items"in t,pH=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function gH(t){switch(t){case gO:return"<BOM>";case mO:return"<DOC>";case OO:return"<FLOW_END>";case fd:return"<SCALAR>";default:return JSON.stringify(t)}}function OL(t){switch(t){case gO:return"byte-order-mark";case mO:return"doc-mode";case OO:return"flow-error-end";case fd: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(t[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 mH=Object.freeze(Object.defineProperty({__proto__:null,BOM:gO,DOCUMENT:mO,FLOW_END:OO,SCALAR:fd,createScalarToken:lH,isCollection:hH,isScalar:pH,prettyToken:gH,resolveAsScalar:aH,setScalarValue:cH,stringify:fH,tokenType:OL,visit:Sa},Symbol.toStringTag,{value:"Module"}));function Zi(t){switch(t){case void 0:case" ":case`
`:case"\r":case"	":return!0;default:return!1}}const W_=new Set("0123456789ABCDEFabcdef"),OH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),qp=new Set(",[]{}"),yH=new Set(` ,[]{}
\r	`),cb=t=>!t||yH.has(t);class yL{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(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n==="	";)n=this.buffer[++e];return!n||n==="#"||n===`
`?!0:n==="\r"?this.buffer[e+1]===`
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+e];if(n==="\r"){const r=this.buffer[i+e+1];if(r===`
`||!r&&!this.atEnd)return e+i+1}return n===`
`||i>=this.indentNext||!n&&!this.atEnd?e+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&Zi(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===gO&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,i=e.indexOf("#");for(;i!==-1;){const s=e[i-1];if(s===" "||s==="	"){n=i-1;break}else i=e.indexOf("#",i+1)}for(;;){const s=e[n-1];if(s===" "||s==="	")n-=1;else break}const r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield mO,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&Zi(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Zi(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Zi(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);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(cb),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,i=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&Zi(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield OO,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(cb),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||Zi(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}const i=this.buffer.substring(0,n);let r=i.indexOf(`
`,this.pos);if(r!==-1){for(;r!==-1;){const s=this.continueScalar(r+1);if(s===-1)break;r=i.indexOf(`
`,s)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Zi(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case`
`:e=s,n=0;break;case"\r":{const o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i==="	"){for(;i==="	"||i===" "||i==="\r"||i===`
`;)i=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);const l=s;for(;o===" ";)o=this.buffer[--s];if(o===`
`&&s>=this.pos&&s+1+n>l)e=s;else break}while(!0);return yield fd,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){const s=this.buffer[i+1];if(Zi(s)||e&&qp.has(s))break;n=i}else if(Zi(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
`?(i+=1,r=`
`,s=this.buffer[i+1]):n=i),s==="#"||e&&qp.has(s))break;if(r===`
`){const o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&qp.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield fd,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){const i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(cb),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(Zi(i)||n&&qp.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!Zi(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(OH.has(n))n=this.buffer[++e];else if(n==="%"&&W_.has(this.buffer[e+1])&&W_.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||e&&i==="	");const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,i=this.buffer[n];for(;!e(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class vL{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,i=this.lineStarts.length;for(;n<i;){const s=n+i>>1;this.lineStarts[s]<e?n=s+1:i=s}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};const r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}}function ho(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function F_(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function bL(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Wp(t){switch(t.type){case"document":return t.start;case"block-map":{const e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Al(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function wm(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function H_(t){if(t.start.type==="flow-seq-start")for(const e of t.items)e.sep&&!e.value&&!ho(e.start,"explicit-key-ind")&&!ho(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,bL(e.value)?e.value.end?wm(e.value.end,e.sep):e.value.end=e.sep:wm(e.start,e.sep),delete e.sep)}class sS{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new yL,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const i of this.lexer.lex(e,n))yield*this.next(i);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const n=OL(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.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 e=this.peek(1);if(this.type==="doc-end"&&e?.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(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&H_(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&F_(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{F_(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const n=Wp(this.peek(2)),i=Al(n);let r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];const s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){const r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){wm(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let s=[];if(r&&n.sep&&!n.value){const o=[];for(let l=0;l<n.sep.length;++l){const u=n.sep[l];switch(u.type){case"newline":o.push(l);break;case"space":break;case"comment":u.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(s.push(this.sourceToken),e.items.push({start:s,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(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ho(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(bL(n.key)&&!ho(n.sep,"newline")){const o=Al(n.start),l=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:u}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(ho(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=Al(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):ho(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);r||n.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ho(n.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 i&&e.items.push({start:s});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){wm(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||ho(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=Wp(i),s=Al(r);H_(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Wp(e),i=Al(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Wp(e),i=Al(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function xL(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new vL||null,prettyErrors:e}}function vH(t,e={}){const{lineCounter:n,prettyErrors:i}=xL(e),r=new sS(n?.addNewLine),s=new rS(e),o=Array.from(s.compose(r.parse(t)));if(i&&n)for(const l of o)l.errors.forEach(bm(t,n)),l.warnings.forEach(bm(t,n));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function wL(t,e={}){const{lineCounter:n,prettyErrors:i}=xL(e),r=new sS(n?.addNewLine),s=new rS(e);let o=null;for(const l of s.compose(r.parse(t),!0,t.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new ca(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(bm(t,n)),o.warnings.forEach(bm(t,n))),o}function bH(t,e,n){let i;typeof e=="function"?i=e:n===void 0&&e&&typeof e=="object"&&(n=e);const r=wL(t,n);if(!r)return null;if(r.warnings.forEach(s=>ZM(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function xH(t,e,n){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){const r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){const{keepUndefined:r}=n??e??{};if(!r)return}return ja(t)&&!i?t.toString(n):new tu(t,i,n).toString(n)}const cw=Object.freeze(Object.defineProperty({__proto__:null,Alias:sO,CST:mH,Composer:rS,Document:tu,Lexer:yL,LineCounter:vL,Pair:hn,Parser:sS,Scalar:De,Schema:pO,YAMLError:nS,YAMLMap:ri,YAMLParseError:ca,YAMLSeq:Eo,YAMLWarning:aL,isAlias:Ra,isCollection:kt,isDocument:ja,isMap:Hc,isNode:Tt,isPair:St,isScalar:gt,isSeq:Kc,parse:bH,parseAllDocuments:vH,parseDocument:wL,stringify:xH,visit:Ma,visitAsync:rO},Symbol.toStringTag,{value:"Module"})),wH="Saved. Agents reload this automatically on their next session.";function SH(t){return typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):t==null?"":cw.stringify(t).trim()}function kH(t){return Object.entries(t).map(([e,n])=>({key:e,text:SH(n)}))}function EH(t){return t.endsWith(".md")?"markdown":t.endsWith(".yml")||t.endsWith(".yaml")?"yaml":"plain"}function SL({node:t,depth:e,selected:n,onSelect:i}){const[r,s]=C.useState(!0);return y.jsxs("div",{children:[e>0&&y.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 rounded-[6px] px-2 py-1 text-secondary font-medium",style:{color:"var(--color-muted)",paddingLeft:e*12+8},"aria-expanded":r,onClick:()=>s(o=>!o),children:[y.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",style:{transform:r?"rotate(90deg)":"none",transition:"transform 150ms ease-out"},children:y.jsx("path",{d:"M3.5 2l3 3-3 3"})}),y.jsx("span",{className:"truncate",children:t.name})]}),r&&(t.children??[]).map(o=>o.type==="directory"?y.jsx(SL,{node:o,depth:e+1,selected:n,onSelect:i},o.path):y.jsx("button",{type:"button",className:"block w-full truncate rounded-[6px] px-2 py-1 text-left text-secondary",style:{paddingLeft:(e+1)*12+8,color:n===o.path?"var(--color-accent)":"var(--color-canvas-fg)",background:n===o.path?"var(--color-surface)":"transparent"},"aria-current":n===o.path?"true":void 0,onClick:()=>i(o.path),children:o.name},o.path))]})}function TH(){const[t,e]=C.useState(null),[n,i]=C.useState(null),[r,s]=C.useState(!1),[o,l]=C.useState(null),[u,f]=C.useState(!0),[h,p]=C.useState(null),[g,O]=C.useState(null),[v,x]=C.useState(null),[S,k]=C.useState(""),[$,E]=C.useState([]),[T,_]=C.useState(!1),[Q,N]=C.useState(!1),[R,X]=C.useState(0),[q,z]=C.useState(!1),[Z,F]=C.useState(!1),[M,B]=C.useState(null),[L,I]=C.useState(null),[U,V]=C.useState(null),[te,P]=C.useState(!1),[j,Y]=C.useState(null);C.useEffect(()=>{xZ().then(he=>{l(he.tree),f(he.exists)}).catch(he=>p(he instanceof Error?he.message:String(he))),_i().then(he=>{e(he.projectName),i(he.frameworkVersion)}).catch(()=>{})},[]),C.useEffect(()=>{const he=new EventSource("/api/events");return he.addEventListener("open",()=>s(!0)),he.addEventListener("error",()=>s(!1)),()=>{he.close()}},[]);const G=C.useCallback(he=>{O(he),x(null),k(""),E([]),_(!1),N(!1),z(!1),B(null),I(null),V(null),P(!1),wZ(he).then(ve=>{x(ve),k(ve.body??""),E(kH(ve.frontmatter)),X(Ee=>Ee+1)}).catch(ve=>I(ve instanceof Error?ve.message:String(ve)))},[]),J=he=>{if(he!==g){if(Q){Y(he);return}G(he)}},ne=C.useCallback(()=>{if(!v||v.content===null||$.length===0)return S;if(!T){const ve=v.body??"";return v.content.slice(0,v.content.length-ve.length)+S}const he={};for(const ve of $){let Ee=ve.text;try{Ee=cw.parse(ve.text)}catch{}he[ve.key]=Ee}return`---
`+cw.stringify(he)+`---
`+S},[v,S,$,T]),le=C.useCallback(he=>{if(Z||!v||g===null)return;F(!0),B(null),I(null);const ve=ne();SZ(g,{content:ve,baseHash:he!==void 0?he:v.hash}).then(Ee=>{if(Ee.status==="ok"){x(Xe=>Xe&&{...Xe,exists:!0,content:ve,hash:Ee.result.hash,body:S}),V(null),N(!1),_(!1),P(!0);return}if(Ee.status==="invalid"){B(Ee.issues);return}V({content:Ee.conflict.content??"",hash:Ee.conflict.hash})}).catch(Ee=>{I(Ee instanceof Error?Ee.message:String(Ee))}).finally(()=>F(!1))},[Z,v,g,ne,S]),H=C.useRef(le);H.current=le,C.useEffect(()=>{const he=ve=>{(ve.metaKey||ve.ctrlKey)&&ve.key.toLowerCase()==="s"&&(ve.preventDefault(),H.current())};return window.addEventListener("keydown",he),()=>window.removeEventListener("keydown",he)},[]);const ce=()=>{N(!0),P(!1)},be=g!==null&&g.endsWith(".md"),Se=be&&q?at.parse(S):null;return y.jsx(Qi,{projectName:t,frameworkVersion:n,sseLive:r,children:y.jsxs("div",{className:"mx-auto w-full max-w-5xl p-6",children:[y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx("h1",{className:"text-page font-semibold",children:"Instructions"}),y.jsx(Zc,{managedBy:"you"})]}),y.jsx(Tn,{children:"Your standards, applied to every change without repeating yourself."}),h&&y.jsxs("div",{className:"mt-4 rounded-[10px] border p-4 text-secondary",style:{background:"var(--color-surface)",borderColor:"var(--color-mod-red)"},children:["Could not load the instructions tree: ",h]}),!u&&!h&&y.jsx("div",{className:"mt-6",children:y.jsx(Rd,{what:"No docs/instructions directory yet.",why:"Onboarding creates it, and every agent reads it before touching your code.",actionLabel:"Copy the onboarding command",onAction:()=>{navigator.clipboard?.writeText("paqad-ai onboard")}})}),o&&y.jsxs("div",{className:"mt-6 flex gap-6",children:[y.jsx("nav",{"aria-label":"Instruction files",className:"w-60 shrink-0 self-start overflow-auto rounded-[10px] py-2",style:{background:"var(--color-surface)",maxHeight:"70vh"},children:y.jsx(SL,{node:o,depth:0,selected:g,onSelect:J})}),y.jsxs("div",{className:"min-w-0 flex-1",children:[g===null&&y.jsx("div",{className:"mt-2 text-secondary",style:{color:"var(--color-muted)"},children:"Pick a file on the left to edit it."}),j!==null&&y.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2.5 rounded-[10px] p-4",style:{background:"var(--color-surface)"},children:[y.jsx("span",{className:"text-secondary",children:"This file has unsaved changes. Switching now loses them."}),y.jsx("button",{type:"button",className:"rounded-[6px] border px-3 py-1.5 text-secondary font-medium",style:{borderColor:"var(--color-mod-red)",color:"var(--color-mod-red)"},onClick:()=>{const he=j;Y(null),G(he)},children:"Discard"}),y.jsx("button",{type:"button",className:"rounded-[6px] px-3 py-1.5 text-secondary font-medium",style:{color:"var(--color-muted)"},onClick:()=>Y(null),children:"Stay"})]}),g!==null&&v&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("div",{className:"min-w-0 truncate text-secondary",style:{color:"var(--color-muted)"},children:v.path}),y.jsxs("div",{className:"flex items-center gap-2.5",children:[be&&y.jsx("button",{type:"button","aria-pressed":q,className:"rounded-[6px] px-2.5 py-1.5 text-secondary font-medium",style:{color:q?"var(--color-accent)":"var(--color-muted)",background:q?"var(--color-surface)":"transparent"},onClick:()=>z(he=>!he),children:"Preview"}),te&&y.jsx(nr,{onDone:()=>P(!1),children:wH}),Q&&!te&&y.jsx("span",{title:"Unsaved changes","aria-label":"Unsaved changes",className:"inline-block h-1.5 w-1.5 rounded-full",style:{background:"var(--color-accent)"}}),y.jsx("button",{type:"button",disabled:Z,className:"rounded-[6px] px-3.5 py-1.5 text-secondary font-medium disabled:opacity-50",style:{background:"var(--color-accent)",color:"#ffffff"},onClick:()=>le(),children:Z?"Saving…":"Save"})]})]}),$.length>0&&y.jsx("div",{className:"mt-4 grid gap-x-4 gap-y-2 rounded-[10px] p-4 sm:grid-cols-2",style:{background:"var(--color-surface)"},children:$.map((he,ve)=>y.jsxs("div",{className:"min-w-0",children:[y.jsx("label",{htmlFor:"fm-"+he.key,className:"block text-caption",style:{color:"var(--color-muted)"},children:he.key}),y.jsx("input",{id:"fm-"+he.key,type:"text",className:"mt-1 w-full rounded-[6px] border px-2 py-1 text-secondary",style:{background:"var(--color-canvas)",borderColor:"var(--color-border)",color:"var(--color-canvas-fg)"},value:he.text,onChange:Ee=>{E(Xe=>Xe.map((Je,Nt)=>Nt===ve?{...Je,text:Ee.target.value}:Je)),_(!0),ce()}})]},he.key))}),y.jsx("div",{className:"mt-4",children:Se!==null?y.jsx("div",{className:"rounded-[10px] p-5 text-body leading-relaxed [&_a]:underline [&_code]:font-mono [&_code]:text-secondary [&_h1]:text-page [&_h1]:font-semibold [&_h2]:text-section [&_h2]:font-medium [&_h3]:text-body [&_h3]:font-medium [&_li]:ml-5 [&_p]:my-2 [&_ol]:list-decimal [&_pre]:overflow-auto [&_pre]:rounded-[6px] [&_pre]:p-3 [&_table]:text-secondary [&_ul]:list-disc",style:{background:"var(--color-surface)"},dangerouslySetInnerHTML:{__html:Se}}):y.jsx(Km,{value:S,onChange:he=>{k(he),ce()},lang:EH(g),ariaLabel:"Contents of "+v.path,minHeight:420},g+":"+R)}),M&&M.length>0&&y.jsx("div",{className:"mt-4 flex flex-col gap-1.5",children:M.map(he=>y.jsxs("div",{className:"flex items-baseline gap-2 text-secondary",children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 shrink-0 translate-y-[-1px] rounded-full",style:{background:"var(--color-mod-red)"}}),y.jsx("span",{style:{color:"var(--color-muted)"},children:he.path}),y.jsx("span",{children:he.message})]},he.path+he.message))}),L&&y.jsx("div",{className:"mt-4 text-secondary",style:{color:"var(--color-mod-red)"},children:L}),U&&y.jsx(Jm,{mine:ne(),theirs:U.content,saving:Z,onLoadLatest:()=>{V(null),G(g)},onKeepMine:()=>le(U.hash)})]}),g!==null&&!v&&!L&&y.jsx("div",{className:"mt-2 text-secondary",style:{color:"var(--color-muted)"},children:"Loading…"})]})]})]})})}function ha({action:t,label:e,confirm:n,done:i,onDone:r}){const[s,o]=C.useState({kind:"idle"}),l=C.useRef(r);l.current=r;const u=s.kind==="running"?s.jobId:null,f=p=>{p.status==="done"?(o({kind:"done"}),l.current?.(p)):p.status==="failed"&&o({kind:"failed",error:p.error??"The operation failed."})};C.useEffect(()=>{if(u===null)return;const p=new EventSource("/api/events");p.addEventListener("ops-progress",O=>{let v;try{v=JSON.parse(O.data)}catch{return}v.jobId===u&&(v.status==="running"?o({kind:"running",jobId:u,message:v.message}):RC(u).then(f).catch(()=>{}))});const g=setInterval(()=>{RC(u).then(O=>{if(O.status==="running"){const v=O.progress[O.progress.length-1];v!==void 0&&o({kind:"running",jobId:u,message:v})}else f(O)}).catch(()=>{})},3e3);return()=>{p.close(),clearInterval(g)}},[u]);const h=()=>{o({kind:"running",jobId:"",message:"Starting…"}),CZ(t).then(p=>o({kind:"running",jobId:p.id,message:"Started."})).catch(p=>{o({kind:"failed",error:p instanceof Error?p.message:String(p)})})};return s.kind==="confirm"?y.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[y.jsx("span",{className:"text-secondary",style:{color:"var(--color-canvas-fg)"},children:n}),y.jsx("button",{type:"button",className:"rounded-[6px] border px-3 py-1.5 text-secondary font-medium",style:{borderColor:"var(--color-accent)",color:"var(--color-accent)"},onClick:h,children:"Go ahead"}),y.jsx("button",{type:"button",className:"rounded-[6px] px-3 py-1.5 text-secondary",style:{color:"var(--color-muted)"},onClick:()=>o({kind:"idle"}),children:"Cancel"})]}):s.kind==="running"?y.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[y.jsx("button",{type:"button",disabled:!0,className:"rounded-[6px] border px-3 py-1.5 text-secondary font-medium opacity-50",style:{borderColor:"var(--color-border)",color:"var(--color-muted)"},children:e}),y.jsx("span",{className:"text-caption",style:{color:"var(--color-muted)"},children:s.message})]}):s.kind==="done"?y.jsx(nr,{onDone:()=>o({kind:"idle"}),children:i??"Done."}):s.kind==="failed"?y.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[y.jsxs("span",{className:"flex items-baseline gap-2 text-secondary",children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 shrink-0 translate-y-[-1px] rounded-full",style:{background:"var(--color-mod-red)"}}),y.jsx("span",{style:{color:"var(--color-canvas-fg)"},children:s.error})]}),y.jsx("button",{type:"button",className:"rounded-[6px] border px-3 py-1.5 text-secondary font-medium",style:{borderColor:"var(--color-accent)",color:"var(--color-accent)"},onClick:n!==void 0?()=>o({kind:"confirm"}):h,children:"Try again"})]}):y.jsx("button",{type:"button",className:"rounded-[6px] border px-3 py-1.5 text-secondary font-medium",style:{borderColor:"var(--color-accent)",color:"var(--color-accent)"},onClick:n!==void 0?()=>o({kind:"confirm"}):h,children:e})}const CH="Saved. Every agent picks this up automatically on its next session.",$H="Clearing deletes the semantic index. The AI falls back to filename search until you rebuild.",Fp={background:"var(--color-canvas)",borderColor:"var(--color-border)",color:"var(--color-canvas-fg)"};function _H(t){const e=t.intelligence??{},n=i=>e[i];return{rag_enabled:n("rag_enabled")===!0,embedding_provider:typeof n("embedding_provider")=="string"?String(n("embedding_provider")):"",embedding_model:typeof n("embedding_model")=="string"?String(n("embedding_model")):"",rag_similarity_threshold:typeof n("rag_similarity_threshold")=="number"?String(n("rag_similarity_threshold")):"",rag_top_n:typeof n("rag_top_n")=="number"?String(n("rag_top_n")):""}}function QH(){const[t,e]=C.useState(null),[n,i]=C.useState(null),[r,s]=C.useState(null),[o,l]=C.useState(!1),[u,f]=C.useState(!1),[h,p]=C.useState(null),[g,O]=C.useState(null),[v,x]=C.useState(!1),S=C.useCallback(()=>{OZ().then(T=>{e(T),i(_=>_??_H(T))}).catch(T=>s(T instanceof Error?T.message:String(T)))},[]);C.useEffect(()=>{S()},[S]);const k=T=>{i(_=>_&&{..._,...T}),l(!0),x(!1)},$=()=>{if(u||n===null)return;f(!0),p(null),O(null);const T={rag_enabled:n.rag_enabled};n.embedding_provider!==""&&(T.embedding_provider=n.embedding_provider),n.embedding_model!==""&&(T.embedding_model=n.embedding_model),n.rag_similarity_threshold!==""&&(T.rag_similarity_threshold=Number(n.rag_similarity_threshold)),n.rag_top_n!==""&&(T.rag_top_n=Number(n.rag_top_n)),yZ(T).then(_=>{if(_.status==="ok"){l(!1),x(!0),e(null),i(null),S();return}if(_.status==="invalid"){p(_.issues);return}O(_.error)}).catch(_=>{O(_ instanceof Error?_.message:String(_))}).finally(()=>f(!1))},E=t?.status??null;return y.jsxs("section",{className:"mt-8",children:[y.jsx("h2",{className:"text-section font-medium",children:"Retrieval"}),y.jsx(Tn,{children:"Your code and docs, indexed so agents cite the real thing."}),r&&y.jsxs("div",{className:"mt-3 text-secondary",style:{color:"var(--color-mod-red)"},children:["Could not load the retrieval settings: ",r]}),y.jsxs("div",{className:"mt-3 grid gap-4 md:grid-cols-2",children:[y.jsxs("div",{className:"rounded-[10px] p-4",style:{background:"var(--color-surface)"},children:[y.jsx("div",{className:"text-body font-medium",children:"Index status"}),E===null?y.jsx("div",{className:"mt-2 text-secondary",style:{color:"var(--color-muted)"},children:"Loading…"}):y.jsxs("div",{className:"mt-2 flex flex-col gap-1 text-secondary",children:[y.jsxs("div",{children:[y.jsx("span",{style:{color:"var(--color-muted)"},children:"Retrieval "}),E.enabled?"on":"off"]}),y.jsxs("div",{children:[y.jsx("span",{style:{color:"var(--color-muted)"},children:"Provider "}),E.provider??"not set"]}),y.jsxs("div",{children:[y.jsx("span",{style:{color:"var(--color-muted)"},children:"Model "}),E.model??"not set"]}),y.jsxs("div",{children:[y.jsx("span",{style:{color:"var(--color-muted)"},children:"Index "}),E.indexPresent?E.indexAgeDays===null?"present":E.indexAgeDays===0?"present, refreshed today":"present, "+E.indexAgeDays+(E.indexAgeDays===1?" day old":" days old"):"not built yet"]})]}),y.jsxs("div",{className:"mt-4 flex flex-col items-start gap-2.5",children:[y.jsx(ha,{action:"rag-rebuild",label:"Rebuild the index",done:"Rebuilt. Answers cite the fresh index now.",onDone:()=>{e(null),S()}}),y.jsx(ha,{action:"rag-clear",label:"Clear the index",confirm:$H,done:"Cleared. Rebuild whenever you want retrieval back.",onDone:()=>{e(null),i(null),S()}}),y.jsx(ha,{action:"refresh-context",label:"Refresh the context index",done:"Refreshed. The context index matches the code again."})]})]}),y.jsxs("div",{className:"rounded-[10px] p-4",style:{background:"var(--color-surface)"},children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("div",{className:"text-body font-medium",children:"Settings"}),y.jsxs("div",{className:"flex items-center gap-2.5",children:[v&&y.jsx(nr,{onDone:()=>x(!1),children:CH}),o&&!v&&y.jsx("span",{title:"Unsaved changes","aria-label":"Unsaved changes",className:"inline-block h-1.5 w-1.5 rounded-full",style:{background:"var(--color-accent)"}}),y.jsx("button",{type:"button",disabled:u||n===null,className:"rounded-[6px] px-3 py-1.5 text-secondary font-medium disabled:opacity-50",style:{background:"var(--color-accent)",color:"#ffffff"},onClick:$,children:u?"Saving…":"Save"})]})]}),n===null?y.jsx("div",{className:"mt-2 text-secondary",style:{color:"var(--color-muted)"},children:"Loading…"}):y.jsxs("div",{className:"mt-3 flex flex-col gap-3",children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsx("label",{htmlFor:"rag-enabled",className:"text-caption",style:{color:"var(--color-muted)"},children:"Retrieval on"}),y.jsx("button",{id:"rag-enabled",type:"button",role:"switch","aria-checked":n.rag_enabled,className:"relative inline-flex h-4.5 w-8 shrink-0 items-center rounded-full",style:{background:n.rag_enabled?"var(--color-accent)":"var(--color-border)",transition:"background 200ms ease-out"},onClick:()=>k({rag_enabled:!n.rag_enabled}),children:y.jsx("span",{"aria-hidden":"true",className:"inline-block h-3.5 w-3.5 rounded-full",style:{background:"var(--color-surface)",transform:n.rag_enabled?"translateX(15px)":"translateX(2px)",transition:"transform 200ms ease-out"}})})]}),y.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("label",{htmlFor:"rag-provider",className:"block text-caption",style:{color:"var(--color-muted)"},children:"Embedding provider"}),y.jsx("input",{id:"rag-provider",type:"text",className:"mt-1 w-full rounded-[6px] border px-2 py-1 text-secondary",style:Fp,value:n.embedding_provider,onChange:T=>k({embedding_provider:T.target.value})})]}),y.jsxs("div",{className:"min-w-0",children:[y.jsx("label",{htmlFor:"rag-model",className:"block text-caption",style:{color:"var(--color-muted)"},children:"Embedding model"}),y.jsx("input",{id:"rag-model",type:"text",className:"mt-1 w-full rounded-[6px] border px-2 py-1 text-secondary",style:Fp,value:n.embedding_model,onChange:T=>k({embedding_model:T.target.value})})]}),y.jsxs("div",{className:"min-w-0",children:[y.jsx("label",{htmlFor:"rag-threshold",className:"block text-caption",style:{color:"var(--color-muted)"},children:"Similarity threshold (0 to 1)"}),y.jsx("input",{id:"rag-threshold",type:"number",min:0,max:1,step:.05,className:"mt-1 w-full rounded-[6px] border px-2 py-1 text-secondary",style:Fp,value:n.rag_similarity_threshold,onChange:T=>k({rag_similarity_threshold:T.target.value})})]}),y.jsxs("div",{className:"min-w-0",children:[y.jsx("label",{htmlFor:"rag-top-n",className:"block text-caption",style:{color:"var(--color-muted)"},children:"Results per lookup"}),y.jsx("input",{id:"rag-top-n",type:"number",min:1,step:1,className:"mt-1 w-full rounded-[6px] border px-2 py-1 text-secondary",style:Fp,value:n.rag_top_n,onChange:T=>k({rag_top_n:T.target.value})})]})]})]}),h&&h.length>0&&y.jsx("div",{className:"mt-3 flex flex-col gap-1.5",children:h.map(T=>y.jsxs("div",{className:"flex items-baseline gap-2 text-secondary",children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 shrink-0 translate-y-[-1px] rounded-full",style:{background:"var(--color-mod-red)"}}),y.jsx("span",{style:{color:"var(--color-muted)"},children:T.path}),y.jsx("span",{children:T.message})]},T.path+T.message))}),g&&y.jsx("div",{className:"mt-3 text-secondary",style:{color:"var(--color-mod-red)"},children:g})]})]})]})}const AH="Saved. The reconciler keeps this truthful from here.",NH=`modules: []
`;function PH({modules:t}){return t.length===0?null:y.jsx("div",{className:"mt-4 rounded-[10px] p-4",style:{background:"var(--color-surface)"},children:y.jsxs("div",{className:"grid grid-cols-[1fr_1.4fr_auto_auto] gap-x-4 gap-y-1.5",children:[y.jsx("div",{className:"text-caption font-medium",style:{color:"var(--color-muted)"},children:"Slug"}),y.jsx("div",{className:"text-caption font-medium",style:{color:"var(--color-muted)"},children:"Name"}),y.jsx("div",{className:"text-caption font-medium text-right",style:{color:"var(--color-muted)"},children:"Sources"}),y.jsx("div",{className:"text-caption font-medium text-right",style:{color:"var(--color-muted)"},children:"Features"}),t.map(e=>y.jsxs("div",{className:"contents",children:[y.jsx("div",{className:"truncate font-mono text-secondary",children:e.slug||"(no slug)"}),y.jsx("div",{className:"truncate text-secondary",children:e.name}),y.jsx("div",{className:"text-right text-secondary",style:{color:"var(--color-muted)"},children:e.sources.length}),y.jsx("div",{className:"text-right text-secondary",style:{color:"var(--color-muted)"},children:e.features.length})]},e.slug+e.name))]})})}function RH(){const[t,e]=C.useState(null),[n,i]=C.useState(null),[r,s]=C.useState(null),[o,l]=C.useState(null),[u,f]=C.useState(!1),[h,p]=C.useState(!1),[g,O]=C.useState(""),[v,x]=C.useState(null),[S,k]=C.useState(0),[$,E]=C.useState(!1),[T,_]=C.useState(!1),[Q,N]=C.useState(null),[R,X]=C.useState(null),[q,z]=C.useState(null),[Z,F]=C.useState(!1),M=C.useCallback(()=>{gZ().then(V=>{e(V),x(V.file.hash),V.file.exists&&V.file.content!==null&&(p(!0),O(V.file.content),k(te=>te+1))}).catch(V=>i(V instanceof Error?V.message:String(V)))},[]);C.useEffect(()=>{M(),_i().then(V=>{s(V.projectName),l(V.frameworkVersion)}).catch(()=>{})},[M]),C.useEffect(()=>{const V=new EventSource("/api/events");return V.addEventListener("open",()=>f(!0)),V.addEventListener("error",()=>f(!1)),()=>{V.close()}},[]);const B=C.useCallback(V=>{T||!h||(_(!0),N(null),X(null),mZ({content:g,baseHash:V!==void 0?V:v}).then(te=>{if(te.status==="ok"){x(te.result.hash),e(P=>P&&{...P,modules:te.result.modules,file:{...P.file,exists:!0,content:g,hash:te.result.hash}}),z(null),E(!1),F(!0);return}if(te.status==="invalid"){N(te.issues);return}z({content:te.conflict.content??"",hash:te.conflict.hash})}).catch(te=>{X(te instanceof Error?te.message:String(te))}).finally(()=>_(!1)))},[T,h,g,v]),L=C.useRef(B);L.current=B,C.useEffect(()=>{const V=te=>{(te.metaKey||te.ctrlKey)&&te.key.toLowerCase()==="s"&&(te.preventDefault(),L.current())};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[]);const U=(t?.drift??null)?.findings??[];return y.jsx(Qi,{projectName:r,frameworkVersion:o,sseLive:u,children:y.jsxs("div",{className:"mx-auto w-full max-w-4xl p-6",children:[y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx("h1",{className:"text-page font-semibold",children:"Module map"}),y.jsx(Zc,{managedBy:"shared"})]}),y.jsx(Tn,{children:"What exists in your codebase, kept truthful automatically."}),n&&y.jsxs("div",{className:"mt-4 rounded-[10px] border p-4 text-secondary",style:{background:"var(--color-surface)",borderColor:"var(--color-mod-red)"},children:["Could not load the module map: ",n]}),!t&&!n&&y.jsx("div",{className:"mt-6 text-secondary",style:{color:"var(--color-muted)"},children:"Loading…"}),t&&!h&&y.jsx("div",{className:"mt-6",children:y.jsx(Rd,{what:"No module map yet.",why:"Declare what exists once and the reconciler keeps it honest against the code.",actionLabel:"Start an empty map",onAction:()=>{p(!0),O(NH),k(V=>V+1),E(!0)}})}),t&&h&&y.jsxs(y.Fragment,{children:[U.length>0&&y.jsxs("div",{className:"mt-4 rounded-[10px] p-4",style:{background:"var(--color-surface)"},children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{className:"text-body font-medium",children:["The map and the code disagree in ",U.length," ",U.length===1?"place":"places"]}),y.jsx(ha,{action:"reconcile",label:"Reconcile now",done:"Reconciled. Reload to see the fresh findings.",onDone:M})]}),y.jsx("div",{className:"mt-3 flex flex-col gap-1.5",children:U.map((V,te)=>y.jsxs("div",{className:"flex items-baseline gap-2 text-secondary",children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 shrink-0 translate-y-[-1px] rounded-full",style:{background:"var(--color-mod-amber)"}}),y.jsx("span",{className:"shrink-0 font-mono text-caption",style:{color:"var(--color-muted)"},children:V.code}),y.jsx("span",{className:"min-w-0",children:V.detail})]},V.code+te))})]}),y.jsx(PH,{modules:t.modules}),y.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2.5",children:[Z&&y.jsx(nr,{onDone:()=>F(!1),children:AH}),$&&!Z&&y.jsx("span",{title:"Unsaved changes","aria-label":"Unsaved changes",className:"inline-block h-1.5 w-1.5 rounded-full",style:{background:"var(--color-accent)"}}),y.jsx("button",{type:"button",disabled:T,className:"rounded-[6px] px-3.5 py-1.5 text-secondary font-medium disabled:opacity-50",style:{background:"var(--color-accent)",color:"#ffffff"},onClick:()=>B(),children:T?"Saving…":"Save"})]}),y.jsx("div",{className:"mt-3",children:y.jsx(Km,{value:g,onChange:V=>{O(V),E(!0),F(!1)},lang:"yaml",ariaLabel:"Raw module map YAML",minHeight:420},S)}),Q&&Q.length>0&&y.jsx("div",{className:"mt-4 flex flex-col gap-1.5",children:Q.map(V=>y.jsxs("div",{className:"flex items-baseline gap-2 text-secondary",children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 shrink-0 translate-y-[-1px] rounded-full",style:{background:"var(--color-mod-red)"}}),y.jsx("span",{style:{color:"var(--color-muted)"},children:V.path}),y.jsx("span",{children:V.message})]},V.path+V.message))}),R&&y.jsx("div",{className:"mt-4 text-secondary",style:{color:"var(--color-mod-red)"},children:R}),q&&y.jsx(Jm,{mine:g,theirs:q.content,saving:T,onLoadLatest:()=>{O(q.content),x(q.hash),k(V=>V+1),z(null),E(!1)},onKeepMine:()=>B(q.hash)})]})]})})}const Vf={background:"var(--color-canvas)",borderColor:"var(--color-border)",color:"var(--color-canvas-fg)"};function Sm(t){const e=t.type;return typeof e=="string"?e:Array.isArray(e)&&typeof e[0]=="string"?e[0]:null}function jH(t){if(Sm(t)!=="array")return!1;const e=t.items;return e===null||typeof e!="object"||Array.isArray(e)?!1:Sm(e)==="string"}function MH(t){if(Sm(t)!=="object")return!1;const e=t.properties;return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Fl({children:t,htmlFor:e}){return y.jsx("label",{htmlFor:e,className:"block text-caption",style:{color:"var(--color-muted)"},children:t})}function LH({id:t,label:e,initial:n,onCommit:i}){const[r,s]=C.useState(()=>n.join(", "));return y.jsxs("div",{className:"min-w-0",children:[y.jsx(Fl,{htmlFor:t,children:e}),y.jsx("input",{id:t,type:"text",className:"mt-1 w-full rounded-[6px] border px-2 py-1 text-secondary",style:Vf,value:r,placeholder:"comma separated",onChange:o=>{s(o.target.value),i(o.target.value.split(",").map(l=>l.trim()).filter(l=>l!==""))}})]})}function DH({id:t,label:e,initial:n,onCommit:i}){const[r,s]=C.useState(()=>JSON.stringify(n??null,null,2)),[o,l]=C.useState(!1);return y.jsxs("div",{className:"min-w-0 sm:col-span-2",children:[y.jsx(Fl,{htmlFor:t,children:e}),y.jsx("textarea",{id:t,className:"mt-1 w-full rounded-[6px] border p-2 font-mono text-caption",style:{...Vf,minHeight:96,resize:"vertical"},spellCheck:!1,value:r,onChange:u=>{s(u.target.value);try{i(JSON.parse(u.target.value)),l(!1)}catch{l(!0)}}}),o&&y.jsx("div",{className:"mt-1 text-caption",style:{color:"var(--color-mod-red)"},children:"Not valid JSON yet. The last valid value is kept until this parses."})]})}function zH({id:t,label:e,schema:n,value:i,onCommit:r}){const s=Sm(n);if(s==="string"&&Array.isArray(n.enum)){const o=n.enum.map(l=>String(l));return y.jsxs("div",{className:"min-w-0",children:[y.jsx(Fl,{htmlFor:t,children:e}),y.jsxs("select",{id:t,className:"mt-1 w-full rounded-[6px] border px-2 py-1 text-secondary",style:Vf,value:typeof i=="string"?i:"",onChange:l=>r(l.target.value),children:[typeof i!="string"&&y.jsx("option",{value:"",children:"(unset)"}),o.map(l=>y.jsx("option",{value:l,children:l},l))]})]})}if(s==="string")return y.jsxs("div",{className:"min-w-0",children:[y.jsx(Fl,{htmlFor:t,children:e}),y.jsx("input",{id:t,type:"text",className:"mt-1 w-full rounded-[6px] border px-2 py-1 text-secondary",style:Vf,value:typeof i=="string"?i:"",onChange:o=>r(o.target.value)})]});if(s==="boolean"){const o=i===!0;return y.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[y.jsx(Fl,{htmlFor:t,children:e}),y.jsx("button",{id:t,type:"button",role:"switch","aria-checked":o,className:"relative inline-flex h-4.5 w-8 shrink-0 items-center rounded-full",style:{background:o?"var(--color-accent)":"var(--color-border)",transition:"background 200ms ease-out"},onClick:()=>r(!o),children:y.jsx("span",{"aria-hidden":"true",className:"inline-block h-3.5 w-3.5 rounded-full",style:{background:"var(--color-surface)",transform:o?"translateX(15px)":"translateX(2px)",transition:"transform 200ms ease-out"}})})]})}if(s==="number"||s==="integer")return y.jsxs("div",{className:"min-w-0",children:[y.jsx(Fl,{htmlFor:t,children:e}),y.jsx("input",{id:t,type:"number",className:"mt-1 w-full rounded-[6px] border px-2 py-1 text-secondary",style:Vf,value:typeof i=="number"?i:"",onChange:o=>{const l=s==="integer"?Number.parseInt(o.target.value,10):Number.parseFloat(o.target.value);Number.isFinite(l)&&r(l)}})]});if(jH(n))return y.jsx(LH,{id:t,label:e,initial:Array.isArray(i)?i.map(o=>String(o)):[],onCommit:r});if(MH(n)){const o=i!==null&&typeof i=="object"&&!Array.isArray(i)?i:{};return y.jsxs("fieldset",{className:"min-w-0 sm:col-span-2 rounded-[10px] p-4",style:{background:"var(--color-canvas)"},children:[y.jsx("legend",{className:"text-section font-medium px-1",children:e}),y.jsx(kL,{schema:n,value:o,onChange:l=>r(l),idPrefix:t})]})}return y.jsx(DH,{id:t,label:e,initial:i,onCommit:r})}function kL({schema:t,value:e,onChange:n,idPrefix:i="sf"}){const r=t.properties!==null&&typeof t.properties=="object"&&!Array.isArray(t.properties)?t.properties:{},s=Object.entries(r).filter(o=>o[1]!==null&&typeof o[1]=="object"&&!Array.isArray(o[1]));return y.jsx("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:s.map(([o,l])=>y.jsx(zH,{id:i+"-"+o,label:o.replace(/_/g," "),schema:l,value:e[o],onCommit:u=>n({...e,[o]:u})},o))})}const EL="Saved. Every agent picks this up automatically on its next session.",XH={content:"Writing and documentation workflows for every project.",coding:"Code workflows, verification gates, and the module map.",planning:"Plans that survive interruptions and sessions.",security:"Pentest workflows and security rules on every change."},ZH="Removing this pack removes its rules from every future change. Existing code is untouched.",K_={background:"var(--color-canvas)",borderColor:"var(--color-border)",color:"var(--color-canvas-fg)"};function BH({issues:t}){return y.jsx("div",{className:"mt-3 flex flex-col gap-1.5",children:t.map(e=>y.jsxs("div",{className:"flex items-baseline gap-2 text-secondary",children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 shrink-0 translate-y-[-1px] rounded-full",style:{background:"var(--color-mod-red)"}}),y.jsx("span",{style:{color:"var(--color-muted)"},children:e.path}),y.jsx("span",{children:e.message})]},e.path+e.message))})}function IH(){const[t,e]=C.useState(null),[n,i]=C.useState(null),[r,s]=C.useState(null),[o,l]=C.useState(!1),[u,f]=C.useState(!1),[h,p]=C.useState(null),[g,O]=C.useState(null),[v,x]=C.useState(!1);C.useEffect(()=>{iN().then(k=>{e(k),i(k.profile)}).catch(k=>s(k instanceof Error?k.message:String(k)))},[]);const S=()=>{u||n===null||(f(!0),p(null),O(null),hZ(n).then(k=>{if(k.status==="ok"){i(k.result.profile),l(!1),x(!0);return}if(k.status==="invalid"){p(k.issues);return}O(k.error)}).catch(k=>O(k instanceof Error?k.message:String(k))).finally(()=>f(!1)))};return y.jsxs("section",{className:"mt-8",children:[y.jsx("h2",{className:"text-section font-medium",children:"Profile"}),y.jsx(Tn,{children:"Paqad tunes its checks to the shape of your project."}),r&&y.jsxs("div",{className:"mt-3 text-secondary",style:{color:"var(--color-mod-red)"},children:["Could not load the profile: ",r]}),t&&t.profile===null&&y.jsx("div",{className:"mt-3",children:y.jsx(Rd,{what:"No project profile yet.",why:"Onboarding interviews the project once and writes the profile every agent reads.",actionLabel:"Copy the onboarding command",onAction:()=>{navigator.clipboard?.writeText("paqad-ai onboard")}})}),t&&n!==null&&y.jsxs("div",{className:"mt-3 rounded-[10px] p-4",style:{background:"var(--color-surface)"},children:[y.jsxs("div",{className:"flex items-center justify-end gap-2.5",children:[v&&y.jsx(nr,{onDone:()=>x(!1),children:EL}),o&&!v&&y.jsx("span",{title:"Unsaved changes","aria-label":"Unsaved changes",className:"inline-block h-1.5 w-1.5 rounded-full",style:{background:"var(--color-accent)"}}),y.jsx("button",{type:"button",disabled:u,className:"rounded-[6px] px-3.5 py-1.5 text-secondary font-medium disabled:opacity-50",style:{background:"var(--color-accent)",color:"#ffffff"},onClick:S,children:u?"Saving…":"Save"})]}),y.jsx("div",{className:"mt-3",children:y.jsx(kL,{schema:t.schema,value:n,onChange:k=>{i(k),l(!0),x(!1)},idPrefix:"profile"})}),h&&h.length>0&&y.jsx(BH,{issues:h}),g&&y.jsx("div",{className:"mt-3 text-secondary",style:{color:"var(--color-mod-red)"},children:g})]}),!t&&!r&&y.jsx("div",{className:"mt-3 text-secondary",style:{color:"var(--color-muted)"},children:"Loading…"})]})}function GH(){const[t,e]=C.useState(null),[n,i]=C.useState([]),[r,s]=C.useState(null),[o,l]=C.useState(null),[u,f]=C.useState(!1);C.useEffect(()=>{iN().then(p=>{e([...p.capabilities.available]),i(p.capabilities.active)}).catch(p=>l(p instanceof Error?p.message:String(p)))},[]);const h=(p,g)=>{r===null&&(s(p),l(null),f(!1),pZ(p,g).then(O=>{if(O.status==="ok"){i(O.result.active),f(!0);return}if(O.status==="invalid"){l(O.issues[0]?.message??O.error);return}l(O.error)}).catch(O=>l(O instanceof Error?O.message:String(O))).finally(()=>s(null)))};return y.jsxs("section",{className:"mt-8",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("h2",{className:"text-section font-medium",children:"Capabilities"}),u&&y.jsx(nr,{onDone:()=>f(!1),children:EL})]}),y.jsx(Tn,{children:"A clear record of what is switched on and what stays off."}),o&&y.jsx("div",{className:"mt-3 text-secondary",style:{color:"var(--color-mod-red)"},children:o}),t===null&&!o&&y.jsx("div",{className:"mt-3 text-secondary",style:{color:"var(--color-muted)"},children:"Loading…"}),t!==null&&y.jsx("div",{className:"mt-3 flex flex-col gap-2",children:t.map(p=>{const g=n.includes(p);return y.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-[10px] p-4",style:{background:"var(--color-surface)"},children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"text-body font-medium",children:p}),y.jsx("div",{className:"mt-0.5 text-secondary",style:{color:"var(--color-muted)"},children:XH[p]??"Workflows and rules for "+p+"."})]}),y.jsx("button",{type:"button",role:"switch","aria-checked":g,"aria-label":"Capability "+p,disabled:r!==null,className:"relative inline-flex h-4.5 w-8 shrink-0 items-center rounded-full disabled:opacity-50",style:{background:g?"var(--color-accent)":"var(--color-border)",transition:"background 200ms ease-out"},onClick:()=>h(p,!g),children:y.jsx("span",{"aria-hidden":"true",className:"inline-block h-3.5 w-3.5 rounded-full",style:{background:"var(--color-surface)",transform:g?"translateX(15px)":"translateX(2px)",transition:"transform 200ms ease-out"}})})]},p)})})]})}function VH({pack:t,onRemoved:e,onError:n}){const[i,r]=C.useState(!1),[s,o]=C.useState(!1),l=()=>{o(!0),TZ({name:t.name,scope:t.source==="global"?"global":"project"}).then(u=>{if(u.status==="ok"){e();return}n(u.error)}).catch(u=>n(u instanceof Error?u.message:String(u))).finally(()=>{o(!1),r(!1)})};return y.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-[10px] px-4 py-3",style:{background:"var(--color-surface)"},children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{background:t.valid?"var(--color-mod-green)":"var(--color-mod-red)"}}),y.jsx("span",{className:"min-w-0 truncate text-body font-medium",children:t.name}),y.jsxs("span",{className:"text-caption",style:{color:"var(--color-muted)"},children:[t.source," · v",t.version," · ",t.valid?"valid":"invalid"]}),y.jsx("div",{className:"ml-auto",children:t.source!=="built-in"&&(i?y.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[y.jsx("span",{className:"text-secondary",children:ZH}),y.jsx("button",{type:"button",disabled:s,className:"rounded-[6px] border px-3 py-1.5 text-secondary font-medium disabled:opacity-50",style:{borderColor:"var(--color-mod-red)",color:"var(--color-mod-red)"},onClick:l,children:"Go ahead"}),y.jsx("button",{type:"button",className:"rounded-[6px] px-3 py-1.5 text-secondary",style:{color:"var(--color-muted)"},onClick:()=>r(!1),children:"Cancel"})]}):y.jsx("button",{type:"button",className:"rounded-[6px] px-3 py-1.5 text-secondary font-medium",style:{color:"var(--color-muted)"},onClick:()=>r(!0),children:"Remove"}))})]})}function UH(){const[t,e]=C.useState(null),[n,i]=C.useState(null),[r,s]=C.useState(""),[o,l]=C.useState("project"),[u,f]=C.useState(!1),[h,p]=C.useState(null),g=C.useCallback(()=>{kZ().then(e).catch(v=>i(v instanceof Error?v.message:String(v)))},[]);C.useEffect(()=>{g()},[g]);const O=()=>{u||r.trim()===""||(f(!0),i(null),p(null),EZ({source:r.trim(),scope:o}).then(v=>{if(v.status==="ok"){s(""),p("Installed "+v.result.name+" v"+v.result.version+"."),g();return}if(v.status==="invalid"){i(v.issues[0]?.message??v.error);return}i(v.error)}).catch(v=>i(v instanceof Error?v.message:String(v))).finally(()=>f(!1)))};return y.jsxs("section",{className:"mt-8",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("h2",{className:"text-section font-medium",children:"Packs"}),h!==null&&y.jsx(nr,{onDone:()=>p(null),children:h})]}),y.jsx(Tn,{children:"Drop-in rule packs for your stack, ready to enforce."}),n&&y.jsx("div",{className:"mt-3 text-secondary",style:{color:"var(--color-mod-red)"},children:n}),t===null&&!n&&y.jsx("div",{className:"mt-3 text-secondary",style:{color:"var(--color-muted)"},children:"Loading…"}),t!==null&&y.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[t.map(v=>y.jsx(VH,{pack:v,onRemoved:g,onError:i},v.name+v.source)),t.length===0&&y.jsx("div",{className:"text-secondary",style:{color:"var(--color-muted)"},children:"No packs discovered yet."})]}),y.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2.5 rounded-[10px] px-4 py-3",style:{background:"var(--color-surface)"},children:[y.jsx("input",{type:"text","aria-label":"Pack source",placeholder:"Registry name, git URL, or path",className:"w-0 min-w-48 flex-1 rounded-[6px] border px-2 py-1 text-secondary",style:K_,value:r,onChange:v=>s(v.target.value)}),y.jsxs("select",{"aria-label":"Install scope",className:"rounded-[6px] border px-2 py-1 text-secondary",style:K_,value:o,onChange:v=>l(v.target.value==="global"?"global":"project"),children:[y.jsx("option",{value:"project",children:"This project"}),y.jsx("option",{value:"global",children:"Every project"})]}),y.jsx("button",{type:"button",disabled:u||r.trim()==="",className:"rounded-[6px] px-3 py-1.5 text-secondary font-medium disabled:opacity-50",style:{background:"var(--color-accent)",color:"#ffffff"},onClick:O,children:u?"Installing…":"Install"})]})]})}function YH(){const[t,e]=C.useState(null),[n,i]=C.useState(null),[r,s]=C.useState(!1),[o,l]=C.useState(null),[u,f]=C.useState(null);C.useEffect(()=>{_i().then(g=>{e(g.projectName),i(g.frameworkVersion)}).catch(()=>{});const p=new Set(["profile","capabilities","packs"]);nN().then(g=>{l(g.items.filter(O=>O.area==="setup"&&!p.has(O.key)))}).catch(()=>l([]))},[]),C.useEffect(()=>{const p=new EventSource("/api/events");return p.addEventListener("open",()=>s(!0)),p.addEventListener("error",()=>s(!1)),()=>{p.close()}},[]);const h=p=>{const g=sN[p.key]??{problem:p.why,benefit:p.why,without:""};f({title:p.name,copy:g})};return y.jsxs(Qi,{projectName:t,frameworkVersion:n,sseLive:r,children:[y.jsxs("div",{className:"mx-auto w-full max-w-4xl p-6",children:[y.jsx("h1",{className:"text-page font-semibold",children:"Setup"}),y.jsx(Tn,{children:Xc.setup}),y.jsx(IH,{}),y.jsx(GH,{}),y.jsx(UH,{}),y.jsxs("section",{className:"mt-8",children:[y.jsx("h2",{className:"text-section font-medium",children:"Operations"}),y.jsx(Tn,{children:"Run the framework checks without leaving the dashboard."}),y.jsxs("div",{className:"mt-3 flex flex-col items-start gap-2.5",children:[y.jsx(ha,{action:"doctor",label:"Run a health check",done:"Healthy or not, the verdict is in the audit log."}),y.jsx(ha,{action:"compliance-check",label:"Check spec compliance",done:"Checked. The findings are in the audit log."})]})]}),o!==null&&o.length>0&&y.jsxs("section",{className:"mt-8",children:[y.jsx("h2",{className:"text-section font-medium",children:"Also in this area"}),y.jsx("div",{className:"mt-3 grid gap-4 md:grid-cols-2",children:o.map(p=>y.jsx(cN,{item:p,onWhy:h},p.key))})]})]}),u&&y.jsx(lN,{title:u.title,problem:u.copy.problem,benefit:u.copy.benefit,without:u.copy.without,docsHref:u.copy.docsHref,onClose:()=>f(null)})]})}const J_="paqad-checklist-dismissed",qH="paqad-receipt-viewed";function eQ(t){try{return localStorage.getItem(t)==="1"}catch{return!1}}function WH({data:t}){const[e,n]=C.useState(()=>eQ(J_)),[i]=C.useState(()=>eQ(qH));if(e)return null;const r=()=>{try{localStorage.setItem(J_,"1")}catch{}n(!0)},s=(l,u)=>u||l==="first-receipt"&&t.receiptAvailable&&i;return t.steps.length>0&&t.steps.every(l=>s(l.key,l.done))?y.jsx("div",{className:"mt-6",children:y.jsx(nr,{onDone:r,children:"You have completed the first loop. This dashboard is yours now."})}):y.jsxs("div",{className:"mt-6 rounded-[10px] p-4",style:{background:"var(--color-surface)"},children:[y.jsxs("div",{className:"flex items-baseline justify-between gap-3 px-2.5",children:[y.jsx("h2",{className:"text-secondary font-medium",children:"Getting started"}),y.jsx("button",{type:"button",className:"shrink-0 text-caption",style:{color:"var(--color-muted)"},onClick:r,children:"Dismiss"})]}),y.jsx("div",{className:"mt-2 flex flex-col gap-0.5",children:t.steps.map((l,u)=>{const f=s(l.key,l.done);return y.jsxs("a",{href:l.route,className:"flex items-start gap-2.5 rounded-[6px] px-2.5 py-2 no-underline",style:{color:"var(--color-canvas-fg)"},children:[y.jsx("span",{"aria-hidden":"true",className:"mt-[5px] inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{background:f?"var(--color-accent)":"var(--color-muted)"}}),y.jsxs("span",{className:"min-w-0 flex-1",children:[y.jsx("span",{className:"block text-secondary font-medium",children:l.label}),y.jsx("span",{className:"block text-caption",style:{color:"var(--color-muted)"},children:l.detail}),u===0&&y.jsx("span",{className:"block text-caption",style:{color:"var(--color-muted)"},children:"Tip: press Cmd+K to jump anywhere."})]}),y.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:"mt-0.5 shrink-0",style:{color:"var(--color-muted)"},children:y.jsx("path",{d:"M3 7h8M8 4l3 3-3 3"})})]},l.key)})})]})}function Hp({value:t,delta:e,label:n,onClick:i}){return y.jsxs("button",{type:"button",className:"rounded-[10px] p-4 text-left",style:{background:"var(--color-surface)",color:"var(--color-canvas-fg)"},onClick:i,children:[y.jsx("div",{className:"text-stat font-semibold leading-tight",children:t}),e&&y.jsx("div",{className:"mt-0.5 text-caption",style:{color:"var(--color-muted)"},children:e}),y.jsx("div",{className:"mt-1 text-secondary",style:{color:"var(--color-muted)"},children:n})]})}const FH={green:"var(--color-mod-green)",amber:"var(--color-mod-amber)",red:"var(--color-mod-red)",unknown:"var(--color-mod-unknown)"},HH={info:"var(--color-mod-unknown)",warn:"var(--color-mod-amber)",critical:"var(--color-mod-red)"},KH={architecture:"build","module-docs":"build","module-events":"build","module-health":"build","module-map-drift":"build","stack-drift":"build","tech-debt":"build",pentest:"build","site-map":"site-map","rule-compliance":"build",decisions:"approvals","module-decisions":"approvals",attestation:"trust",delivery:"automation",workflows:"automation",session:"automation",rules:"knowledge","design-system":"knowledge","rag-status":"knowledge","framework-version":"setup","project-profile":"setup",registries:"setup",stack:"setup",tools:"setup"},JH={pass:"var(--color-mod-green)",fail:"var(--color-mod-red)",inconclusive:"var(--color-mod-amber)",blocked:"var(--color-mod-amber)"};function eK(t){const e=Date.now()-new Date(t).getTime();if(!Number.isFinite(e))return"";const n=Math.floor(e/6e4);if(n<1)return"just now";if(n<60)return n+"m ago";const i=Math.floor(n/60);return i<24?i+"h ago":Math.floor(i/24)+"d ago"}function tK(t){const e=t.action??"";if(/^dashboard\.config\..+\.write$/.test(e))return"You saved "+(e.split(".")[2]??"settings").replace(/-/g," ")+" on the web.";if(e==="dashboard.instructions.write")return"You edited an instruction file.";if(e.startsWith("dashboard.ops.")){const n=e.split(".")[2]??e,i=/(?:^|\s)status="([^"]+)"/.exec(t.raw)?.[1]??"finished";return"Operation "+n+" "+i+"."}return e.includes("resolve")||e.includes("accept")?"A decision was resolved.":e}function nK(t,e){const n=t.map(i=>({key:"evidence:"+i.content_hash+i.ts,ts:i.ts,text:"Gate "+i.code+" "+i.verdict+".",dot:JH[i.verdict]}));for(const i of e)i.actor!=="dashboard"||i.action===null||n.push({key:"audit:"+(i.ts??"")+i.raw,ts:i.ts,text:tK(i),dot:"var(--color-mod-unknown)"});return n.sort((i,r)=>i.ts===null&&r.ts===null?0:i.ts===null?1:r.ts===null?-1:r.ts.localeCompare(i.ts)),n.slice(0,10)}function iK(){const[t,e]=C.useState(null),[n,i]=C.useState(null),[r,s]=C.useState(null),[o,l]=C.useState(null),[u,f]=C.useState([]),[h,p]=C.useState(null),[g,O]=C.useState(!1),{navigate:v}=zc(),x=C.useCallback(()=>{_i().then(T=>{e(T),p(null)}).catch(T=>{p(T instanceof Error?T.message:String(T))}),Dw().then(T=>i(T.pendingCount)).catch(()=>i(null)),Xg().then(T=>s(T.receipts.length)).catch(()=>s(null)),_Z().then(l).catch(()=>l(null)),Promise.all([rN({}),QZ(50)]).then(([T,_])=>f(nK(T.rows,_.entries))).catch(()=>f([]))},[]);C.useEffect(()=>{x()},[x]),C.useEffect(()=>{const T=new EventSource("/api/events");return T.addEventListener("open",()=>O(!0)),T.addEventListener("error",()=>O(!1)),T.addEventListener("dashboard-updated",()=>x()),()=>{T.close()}},[x]);const S=t?.sections.filter(T=>T.score!==null)??[],k=S.filter(T=>T.band==="green").length,$=t?.attention[0]??null,E=$?$.message:"Healthy.";return y.jsx(Qi,{projectName:t?.projectName??null,frameworkVersion:t?.frameworkVersion??null,sseLive:g,children:y.jsxs("div",{className:"mx-auto w-full max-w-3xl p-6",children:[y.jsx("h1",{className:"text-page font-semibold",children:"Pulse"}),y.jsx(Tn,{children:Xc.pulse}),h&&y.jsxs("div",{className:"mt-4 rounded-[10px] border p-4 text-secondary",style:{background:"var(--color-surface)",borderColor:"var(--color-mod-red)"},children:["Could not load the pulse: ",h]}),t?.notOnboarded&&y.jsx("div",{className:"mt-6",children:y.jsx(Rd,{what:"This is where your project's pulse will live. Run your first workflow and watch the first gate pass.",why:"Once onboarded, every change is scored, checked and summarized here, so you never have to read logs to know where you stand.",actionLabel:"Start onboarding",onAction:()=>v("setup")})}),t&&!t.notOnboarded&&y.jsxs(y.Fragment,{children:[o&&y.jsx(WH,{data:o}),y.jsxs("div",{className:"mt-6 rounded-[10px] p-5",style:{background:"var(--color-surface)"},children:[y.jsxs("div",{className:"flex items-baseline gap-3",children:[y.jsx("span",{className:"text-stat font-semibold",children:t.overallScore!==null?String(t.overallScore):"…"}),y.jsxs("span",{className:"flex items-center gap-1.5 text-secondary",children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 rounded-full",style:{background:FH[t.overallBand]}}),y.jsx("span",{style:{color:"var(--color-muted)"},children:t.overallBand})]})]}),y.jsx("div",{className:"mt-1 text-secondary",style:{color:"var(--color-muted)"},children:E})]}),y.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-4 md:grid-cols-4",children:[y.jsx(Hp,{value:n!==null?String(n):"…",label:"Pending approvals",onClick:()=>v("approvals")}),y.jsx(Hp,{value:k+" / "+S.length,label:"Sections healthy",onClick:()=>v("build")}),y.jsx(Hp,{value:r!==null?String(r):"…",label:"Receipts sealed",onClick:()=>v("trust")}),y.jsx(Hp,{value:t.frameworkVersion?"v"+t.frameworkVersion:"…",label:"Framework version",onClick:()=>v("setup")})]}),t.attention.length>0&&y.jsxs("div",{className:"mt-6",children:[y.jsx("h2",{className:"text-section font-medium",children:"Worth your attention"}),y.jsx("div",{className:"mt-2 flex flex-col gap-1",children:t.attention.slice(0,5).map(T=>y.jsxs("button",{type:"button",className:"flex items-center gap-2.5 rounded-[6px] px-2.5 py-2 text-left text-secondary",style:{color:"var(--color-canvas-fg)"},title:T.severity+" · opens the area that explains it",onClick:()=>v(KH[T.sectionId]??"dashboard"),children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{background:HH[T.severity]}}),y.jsx("span",{className:"min-w-0 flex-1 truncate",children:T.message}),y.jsx("span",{className:"shrink-0 text-caption",style:{color:"var(--color-muted)"},children:T.severity})]},T.sectionId+T.message))})]}),u.length>0&&y.jsxs("div",{className:"mt-6",children:[y.jsx("h2",{className:"text-section font-medium",children:"Recent activity"}),y.jsx("div",{className:"mt-2 flex flex-col gap-1",children:u.map(T=>y.jsxs("div",{className:"flex items-center gap-2.5 rounded-[6px] px-2.5 py-1.5 text-secondary",style:{color:"var(--color-canvas-fg)"},children:[y.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{background:T.dot}}),y.jsx("span",{className:"min-w-0 flex-1 truncate",children:T.text}),T.ts!==null&&y.jsx("span",{className:"shrink-0 text-caption",style:{color:"var(--color-muted)"},children:eK(T.ts)})]},T.key))})]})]}),!t&&!h&&y.jsx("div",{className:"mt-6 text-secondary",style:{color:"var(--color-muted)"},children:"Loading…"})]})})}function It(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,i;n<t.length;n++)(i=It(t[n]))!==""&&(e+=(e&&" ")+i);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}var rK={value:()=>{}};function yO(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Ng(n)}function Ng(t){this._=t}function sK(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Ng.prototype=yO.prototype={constructor:Ng,on:function(t,e){var n=this._,i=sK(t+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s<o;)if((r=(t=i[s]).type)&&(r=oK(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<o;)if(r=(t=i[s]).type)n[r]=tQ(n[r],t.name,e);else if(e==null)for(r in n)n[r]=tQ(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ng(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],i=0,r=s.length;i<r;++i)s[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,s=i.length;r<s;++r)i[r].value.apply(e,n)}};function oK(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function tQ(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=rK,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var uw="http://www.w3.org/1999/xhtml";const nQ={svg:"http://www.w3.org/2000/svg",xhtml:uw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function vO(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),nQ.hasOwnProperty(e)?{space:nQ[e],local:t}:t}function aK(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===uw&&e.documentElement.namespaceURI===uw?e.createElement(t):e.createElementNS(n,t)}}function lK(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function TL(t){var e=vO(t);return(e.local?lK:aK)(e)}function cK(){}function oS(t){return t==null?cK:function(){return this.querySelector(t)}}function uK(t){typeof t!="function"&&(t=oS(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],o=s.length,l=i[r]=new Array(o),u,f,h=0;h<o;++h)(u=s[h])&&(f=t.call(u,u.__data__,h,s))&&("__data__"in u&&(f.__data__=u.__data__),l[h]=f);return new oi(i,this._parents)}function fK(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function dK(){return[]}function CL(t){return t==null?dK:function(){return this.querySelectorAll(t)}}function hK(t){return function(){return fK(t.apply(this,arguments))}}function pK(t){typeof t=="function"?t=hK(t):t=CL(t);for(var e=this._groups,n=e.length,i=[],r=[],s=0;s<n;++s)for(var o=e[s],l=o.length,u,f=0;f<l;++f)(u=o[f])&&(i.push(t.call(u,u.__data__,f,o)),r.push(u));return new oi(i,r)}function $L(t){return function(){return this.matches(t)}}function _L(t){return function(e){return e.matches(t)}}var gK=Array.prototype.find;function mK(t){return function(){return gK.call(this.children,t)}}function OK(){return this.firstElementChild}function yK(t){return this.select(t==null?OK:mK(typeof t=="function"?t:_L(t)))}var vK=Array.prototype.filter;function bK(){return Array.from(this.children)}function xK(t){return function(){return vK.call(this.children,t)}}function wK(t){return this.selectAll(t==null?bK:xK(typeof t=="function"?t:_L(t)))}function SK(t){typeof t!="function"&&(t=$L(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],o=s.length,l=i[r]=[],u,f=0;f<o;++f)(u=s[f])&&t.call(u,u.__data__,f,s)&&l.push(u);return new oi(i,this._parents)}function QL(t){return new Array(t.length)}function kK(){return new oi(this._enter||this._groups.map(QL),this._parents)}function km(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}km.prototype={constructor:km,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function EK(t){return function(){return t}}function TK(t,e,n,i,r,s){for(var o=0,l,u=e.length,f=s.length;o<f;++o)(l=e[o])?(l.__data__=s[o],i[o]=l):n[o]=new km(t,s[o]);for(;o<u;++o)(l=e[o])&&(r[o]=l)}function CK(t,e,n,i,r,s,o){var l,u,f=new Map,h=e.length,p=s.length,g=new Array(h),O;for(l=0;l<h;++l)(u=e[l])&&(g[l]=O=o.call(u,u.__data__,l,e)+"",f.has(O)?r[l]=u:f.set(O,u));for(l=0;l<p;++l)O=o.call(t,s[l],l,s)+"",(u=f.get(O))?(i[l]=u,u.__data__=s[l],f.delete(O)):n[l]=new km(t,s[l]);for(l=0;l<h;++l)(u=e[l])&&f.get(g[l])===u&&(r[l]=u)}function $K(t){return t.__data__}function _K(t,e){if(!arguments.length)return Array.from(this,$K);var n=e?CK:TK,i=this._parents,r=this._groups;typeof t!="function"&&(t=EK(t));for(var s=r.length,o=new Array(s),l=new Array(s),u=new Array(s),f=0;f<s;++f){var h=i[f],p=r[f],g=p.length,O=QK(t.call(h,h&&h.__data__,f,i)),v=O.length,x=l[f]=new Array(v),S=o[f]=new Array(v),k=u[f]=new Array(g);n(h,p,x,S,k,O,e);for(var $=0,E=0,T,_;$<v;++$)if(T=x[$]){for($>=E&&(E=$+1);!(_=S[E])&&++E<v;);T._next=_||null}}return o=new oi(o,i),o._enter=l,o._exit=u,o}function QK(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function AK(){return new oi(this._exit||this._groups.map(QL),this._parents)}function NK(t,e,n){var i=this.enter(),r=this,s=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?s.remove():n(s),i&&r?i.merge(r).order():r}function PK(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,s=i.length,o=Math.min(r,s),l=new Array(r),u=0;u<o;++u)for(var f=n[u],h=i[u],p=f.length,g=l[u]=new Array(p),O,v=0;v<p;++v)(O=f[v]||h[v])&&(g[v]=O);for(;u<r;++u)l[u]=n[u];return new oi(l,this._parents)}function RK(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i=t[e],r=i.length-1,s=i[r],o;--r>=0;)(o=i[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function jK(t){t||(t=MK);function e(p,g){return p&&g?t(p.__data__,g.__data__):!p-!g}for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var o=n[s],l=o.length,u=r[s]=new Array(l),f,h=0;h<l;++h)(f=o[h])&&(u[h]=f);u.sort(e)}return new oi(r,this._parents).order()}function MK(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function LK(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function DK(){return Array.from(this)}function zK(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length;r<s;++r){var o=i[r];if(o)return o}return null}function XK(){let t=0;for(const e of this)++t;return t}function ZK(){return!this.node()}function BK(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r=e[n],s=0,o=r.length,l;s<o;++s)(l=r[s])&&t.call(l,l.__data__,s,r);return this}function IK(t){return function(){this.removeAttribute(t)}}function GK(t){return function(){this.removeAttributeNS(t.space,t.local)}}function VK(t,e){return function(){this.setAttribute(t,e)}}function UK(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function YK(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function qK(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function WK(t,e){var n=vO(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((e==null?n.local?GK:IK:typeof e=="function"?n.local?qK:YK:n.local?UK:VK)(n,e))}function AL(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function FK(t){return function(){this.style.removeProperty(t)}}function HK(t,e,n){return function(){this.style.setProperty(t,e,n)}}function KK(t,e,n){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function JK(t,e,n){return arguments.length>1?this.each((e==null?FK:typeof e=="function"?KK:HK)(t,e,n??"")):$c(this.node(),t)}function $c(t,e){return t.style.getPropertyValue(e)||AL(t).getComputedStyle(t,null).getPropertyValue(e)}function eJ(t){return function(){delete this[t]}}function tJ(t,e){return function(){this[t]=e}}function nJ(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function iJ(t,e){return arguments.length>1?this.each((e==null?eJ:typeof e=="function"?nJ:tJ)(t,e)):this.node()[t]}function NL(t){return t.trim().split(/^|\s+/)}function aS(t){return t.classList||new PL(t)}function PL(t){this._node=t,this._names=NL(t.getAttribute("class")||"")}PL.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function RL(t,e){for(var n=aS(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function jL(t,e){for(var n=aS(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function rJ(t){return function(){RL(this,t)}}function sJ(t){return function(){jL(this,t)}}function oJ(t,e){return function(){(e.apply(this,arguments)?RL:jL)(this,t)}}function aJ(t,e){var n=NL(t+"");if(arguments.length<2){for(var i=aS(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?oJ:e?rJ:sJ)(n,e))}function lJ(){this.textContent=""}function cJ(t){return function(){this.textContent=t}}function uJ(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function fJ(t){return arguments.length?this.each(t==null?lJ:(typeof t=="function"?uJ:cJ)(t)):this.node().textContent}function dJ(){this.innerHTML=""}function hJ(t){return function(){this.innerHTML=t}}function pJ(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function gJ(t){return arguments.length?this.each(t==null?dJ:(typeof t=="function"?pJ:hJ)(t)):this.node().innerHTML}function mJ(){this.nextSibling&&this.parentNode.appendChild(this)}function OJ(){return this.each(mJ)}function yJ(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vJ(){return this.each(yJ)}function bJ(t){var e=typeof t=="function"?t:TL(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function xJ(){return null}function wJ(t,e){var n=typeof t=="function"?t:TL(t),i=e==null?xJ:typeof e=="function"?e:oS(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function SJ(){var t=this.parentNode;t&&t.removeChild(this)}function kJ(){return this.each(SJ)}function EJ(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function TJ(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function CJ(t){return this.select(t?TJ:EJ)}function $J(t){return arguments.length?this.property("__data__",t):this.node().__data__}function _J(t){return function(e){t.call(this,e,this.__data__)}}function QJ(t){return t.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function AJ(t){return function(){var e=this.__on;if(e){for(var n=0,i=-1,r=e.length,s;n<r;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++i]=s;++i?e.length=i:delete this.__on}}}function NJ(t,e,n){return function(){var i=this.__on,r,s=_J(e);if(i){for(var o=0,l=i.length;o<l;++o)if((r=i[o]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),r.value=e;return}}this.addEventListener(t.type,s,n),r={type:t.type,name:t.name,value:e,listener:s,options:n},i?i.push(r):this.__on=[r]}}function PJ(t,e,n){var i=QJ(t+""),r,s=i.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,f=l.length,h;u<f;++u)for(r=0,h=l[u];r<s;++r)if((o=i[r]).type===h.type&&o.name===h.name)return h.value}return}for(l=e?NJ:AJ,r=0;r<s;++r)this.each(l(i[r],e,n));return this}function ML(t,e,n){var i=AL(t),r=i.CustomEvent;typeof r=="function"?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function RJ(t,e){return function(){return ML(this,t,e)}}function jJ(t,e){return function(){return ML(this,t,e.apply(this,arguments))}}function MJ(t,e){return this.each((typeof e=="function"?jJ:RJ)(t,e))}function*LJ(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length,o;r<s;++r)(o=i[r])&&(yield o)}var LL=[null];function oi(t,e){this._groups=t,this._parents=e}function Xd(){return new oi([[document.documentElement]],LL)}function DJ(){return this}oi.prototype=Xd.prototype={constructor:oi,select:uK,selectAll:pK,selectChild:yK,selectChildren:wK,filter:SK,data:_K,enter:kK,exit:AK,join:NK,merge:PK,selection:DJ,order:RK,sort:jK,call:LK,nodes:DK,node:zK,size:XK,empty:ZK,each:BK,attr:WK,style:JK,property:iJ,classed:aJ,text:fJ,html:gJ,raise:OJ,lower:vJ,append:bJ,insert:wJ,remove:kJ,clone:CJ,datum:$J,on:PJ,dispatch:MJ,[Symbol.iterator]:LJ};function si(t){return typeof t=="string"?new oi([[document.querySelector(t)]],[document.documentElement]):new oi([[t]],LL)}function zJ(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Ii(t,e){if(t=zJ(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,i=i.matrixTransform(e.getScreenCTM().inverse()),[i.x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const XJ={passive:!1},dd={capture:!0,passive:!1};function ub(t){t.stopImmediatePropagation()}function ac(t){t.preventDefault(),t.stopImmediatePropagation()}function DL(t){var e=t.document.documentElement,n=si(t).on("dragstart.drag",ac,dd);"onselectstart"in e?n.on("selectstart.drag",ac,dd):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function zL(t,e){var n=t.document.documentElement,i=si(t).on("dragstart.drag",null);e&&(i.on("click.drag",ac,dd),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Kp=t=>()=>t;function fw(t,{sourceEvent:e,subject:n,target:i,identifier:r,active:s,x:o,y:l,dx:u,dy:f,dispatch:h}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:h}})}fw.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function ZJ(t){return!t.ctrlKey&&!t.button}function BJ(){return this.parentNode}function IJ(t,e){return e??{x:t.x,y:t.y}}function GJ(){return navigator.maxTouchPoints||"ontouchstart"in this}function XL(){var t=ZJ,e=BJ,n=IJ,i=GJ,r={},s=yO("start","drag","end"),o=0,l,u,f,h,p=0;function g(T){T.on("mousedown.drag",O).filter(i).on("touchstart.drag",S).on("touchmove.drag",k,XJ).on("touchend.drag touchcancel.drag",$).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function O(T,_){if(!(h||!t.call(this,T,_))){var Q=E(this,e.call(this,T,_),T,_,"mouse");Q&&(si(T.view).on("mousemove.drag",v,dd).on("mouseup.drag",x,dd),DL(T.view),ub(T),f=!1,l=T.clientX,u=T.clientY,Q("start",T))}}function v(T){if(ac(T),!f){var _=T.clientX-l,Q=T.clientY-u;f=_*_+Q*Q>p}r.mouse("drag",T)}function x(T){si(T.view).on("mousemove.drag mouseup.drag",null),zL(T.view,f),ac(T),r.mouse("end",T)}function S(T,_){if(t.call(this,T,_)){var Q=T.changedTouches,N=e.call(this,T,_),R=Q.length,X,q;for(X=0;X<R;++X)(q=E(this,N,T,_,Q[X].identifier,Q[X]))&&(ub(T),q("start",T,Q[X]))}}function k(T){var _=T.changedTouches,Q=_.length,N,R;for(N=0;N<Q;++N)(R=r[_[N].identifier])&&(ac(T),R("drag",T,_[N]))}function $(T){var _=T.changedTouches,Q=_.length,N,R;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),N=0;N<Q;++N)(R=r[_[N].identifier])&&(ub(T),R("end",T,_[N]))}function E(T,_,Q,N,R,X){var q=s.copy(),z=Ii(X||Q,_),Z,F,M;if((M=n.call(T,new fw("beforestart",{sourceEvent:Q,target:g,identifier:R,active:o,x:z[0],y:z[1],dx:0,dy:0,dispatch:q}),N))!=null)return Z=M.x-z[0]||0,F=M.y-z[1]||0,function B(L,I,U){var V=z,te;switch(L){case"start":r[R]=B,te=o++;break;case"end":delete r[R],--o;case"drag":z=Ii(U||I,_),te=o;break}q.call(L,T,new fw(L,{sourceEvent:I,subject:M,target:g,identifier:R,active:te,x:z[0]+Z,y:z[1]+F,dx:z[0]-V[0],dy:z[1]-V[1],dispatch:q}),N)}}return g.filter=function(T){return arguments.length?(t=typeof T=="function"?T:Kp(!!T),g):t},g.container=function(T){return arguments.length?(e=typeof T=="function"?T:Kp(T),g):e},g.subject=function(T){return arguments.length?(n=typeof T=="function"?T:Kp(T),g):n},g.touchable=function(T){return arguments.length?(i=typeof T=="function"?T:Kp(!!T),g):i},g.on=function(){var T=s.on.apply(s,arguments);return T===s?g:T},g.clickDistance=function(T){return arguments.length?(p=(T=+T)*T,g):Math.sqrt(p)},g}function lS(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ZL(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Zd(){}var hd=.7,Em=1/hd,lc="\\s*([+-]?\\d+)\\s*",pd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Pr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",VJ=/^#([0-9a-f]{3,8})$/,UJ=new RegExp(`^rgb\\(${lc},${lc},${lc}\\)$`),YJ=new RegExp(`^rgb\\(${Pr},${Pr},${Pr}\\)$`),qJ=new RegExp(`^rgba\\(${lc},${lc},${lc},${pd}\\)$`),WJ=new RegExp(`^rgba\\(${Pr},${Pr},${Pr},${pd}\\)$`),FJ=new RegExp(`^hsl\\(${pd},${Pr},${Pr}\\)$`),HJ=new RegExp(`^hsla\\(${pd},${Pr},${Pr},${pd}\\)$`),iQ={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};lS(Zd,ka,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:rQ,formatHex:rQ,formatHex8:KJ,formatHsl:JJ,formatRgb:sQ,toString:sQ});function rQ(){return this.rgb().formatHex()}function KJ(){return this.rgb().formatHex8()}function JJ(){return BL(this).formatHsl()}function sQ(){return this.rgb().formatRgb()}function ka(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=VJ.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?oQ(e):n===3?new Bn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Jp(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Jp(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=UJ.exec(t))?new Bn(e[1],e[2],e[3],1):(e=YJ.exec(t))?new Bn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=qJ.exec(t))?Jp(e[1],e[2],e[3],e[4]):(e=WJ.exec(t))?Jp(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=FJ.exec(t))?cQ(e[1],e[2]/100,e[3]/100,1):(e=HJ.exec(t))?cQ(e[1],e[2]/100,e[3]/100,e[4]):iQ.hasOwnProperty(t)?oQ(iQ[t]):t==="transparent"?new Bn(NaN,NaN,NaN,0):null}function oQ(t){return new Bn(t>>16&255,t>>8&255,t&255,1)}function Jp(t,e,n,i){return i<=0&&(t=e=n=NaN),new Bn(t,e,n,i)}function eee(t){return t instanceof Zd||(t=ka(t)),t?(t=t.rgb(),new Bn(t.r,t.g,t.b,t.opacity)):new Bn}function dw(t,e,n,i){return arguments.length===1?eee(t):new Bn(t,e,n,i??1)}function Bn(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}lS(Bn,dw,ZL(Zd,{brighter(t){return t=t==null?Em:Math.pow(Em,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?hd:Math.pow(hd,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Bn(pa(this.r),pa(this.g),pa(this.b),Tm(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:aQ,formatHex:aQ,formatHex8:tee,formatRgb:lQ,toString:lQ}));function aQ(){return`#${ua(this.r)}${ua(this.g)}${ua(this.b)}`}function tee(){return`#${ua(this.r)}${ua(this.g)}${ua(this.b)}${ua((isNaN(this.opacity)?1:this.opacity)*255)}`}function lQ(){const t=Tm(this.opacity);return`${t===1?"rgb(":"rgba("}${pa(this.r)}, ${pa(this.g)}, ${pa(this.b)}${t===1?")":`, ${t})`}`}function Tm(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function pa(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ua(t){return t=pa(t),(t<16?"0":"")+t.toString(16)}function cQ(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new qi(t,e,n,i)}function BL(t){if(t instanceof qi)return new qi(t.h,t.s,t.l,t.opacity);if(t instanceof Zd||(t=ka(t)),!t)return new qi;if(t instanceof qi)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),o=NaN,l=s-r,u=(s+r)/2;return l?(e===s?o=(n-i)/l+(n<i)*6:n===s?o=(i-e)/l+2:o=(e-n)/l+4,l/=u<.5?s+r:2-s-r,o*=60):l=u>0&&u<1?0:o,new qi(o,l,u,t.opacity)}function nee(t,e,n,i){return arguments.length===1?BL(t):new qi(t,e,n,i??1)}function qi(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}lS(qi,nee,ZL(Zd,{brighter(t){return t=t==null?Em:Math.pow(Em,t),new qi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?hd:Math.pow(hd,t),new qi(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Bn(fb(t>=240?t-240:t+120,r,i),fb(t,r,i),fb(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new qi(uQ(this.h),eg(this.s),eg(this.l),Tm(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Tm(this.opacity);return`${t===1?"hsl(":"hsla("}${uQ(this.h)}, ${eg(this.s)*100}%, ${eg(this.l)*100}%${t===1?")":`, ${t})`}`}}));function uQ(t){return t=(t||0)%360,t<0?t+360:t}function eg(t){return Math.max(0,Math.min(1,t||0))}function fb(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const cS=t=>()=>t;function iee(t,e){return function(n){return t+n*e}}function ree(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function see(t){return(t=+t)==1?IL:function(e,n){return n-e?ree(e,n,t):cS(isNaN(e)?n:e)}}function IL(t,e){var n=e-t;return n?iee(t,n):cS(isNaN(t)?e:t)}const Cm=(function t(e){var n=see(e);function i(r,s){var o=n((r=dw(r)).r,(s=dw(s)).r),l=n(r.g,s.g),u=n(r.b,s.b),f=IL(r.opacity,s.opacity);return function(h){return r.r=o(h),r.g=l(h),r.b=u(h),r.opacity=f(h),r+""}}return i.gamma=t,i})(1);function oee(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),r;return function(s){for(r=0;r<n;++r)i[r]=t[r]*(1-s)+e[r]*s;return i}}function aee(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function lee(t,e){var n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),s=new Array(n),o;for(o=0;o<i;++o)r[o]=Uf(t[o],e[o]);for(;o<n;++o)s[o]=e[o];return function(l){for(o=0;o<i;++o)s[o]=r[o](l);return s}}function cee(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function xr(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function uee(t,e){var n={},i={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?n[r]=Uf(t[r],e[r]):i[r]=e[r];return function(s){for(r in n)i[r]=n[r](s);return i}}var hw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,db=new RegExp(hw.source,"g");function fee(t){return function(){return t}}function dee(t){return function(e){return t(e)+""}}function GL(t,e){var n=hw.lastIndex=db.lastIndex=0,i,r,s,o=-1,l=[],u=[];for(t=t+"",e=e+"";(i=hw.exec(t))&&(r=db.exec(e));)(s=r.index)>n&&(s=e.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(i=i[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,u.push({i:o,x:xr(i,r)})),n=db.lastIndex;return n<e.length&&(s=e.slice(n),l[o]?l[o]+=s:l[++o]=s),l.length<2?u[0]?dee(u[0].x):fee(e):(e=u.length,function(f){for(var h=0,p;h<e;++h)l[(p=u[h]).i]=p.x(f);return l.join("")})}function Uf(t,e){var n=typeof e,i;return e==null||n==="boolean"?cS(e):(n==="number"?xr:n==="string"?(i=ka(e))?(e=i,Cm):GL:e instanceof ka?Cm:e instanceof Date?cee:aee(e)?oee:Array.isArray(e)?lee:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?uee:xr)(t,e)}var fQ=180/Math.PI,pw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function VL(t,e,n,i,r,s){var o,l,u;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(u=t*n+e*i)&&(n-=t*u,i-=e*u),(l=Math.sqrt(n*n+i*i))&&(n/=l,i/=l,u/=l),t*i<e*n&&(t=-t,e=-e,u=-u,o=-o),{translateX:r,translateY:s,rotate:Math.atan2(e,t)*fQ,skewX:Math.atan(u)*fQ,scaleX:o,scaleY:l}}var tg;function hee(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?pw:VL(e.a,e.b,e.c,e.d,e.e,e.f)}function pee(t){return t==null||(tg||(tg=document.createElementNS("http://www.w3.org/2000/svg","g")),tg.setAttribute("transform",t),!(t=tg.transform.baseVal.consolidate()))?pw:(t=t.matrix,VL(t.a,t.b,t.c,t.d,t.e,t.f))}function UL(t,e,n,i){function r(f){return f.length?f.pop()+" ":""}function s(f,h,p,g,O,v){if(f!==p||h!==g){var x=O.push("translate(",null,e,null,n);v.push({i:x-4,x:xr(f,p)},{i:x-2,x:xr(h,g)})}else(p||g)&&O.push("translate("+p+e+g+n)}function o(f,h,p,g){f!==h?(f-h>180?h+=360:h-f>180&&(f+=360),g.push({i:p.push(r(p)+"rotate(",null,i)-2,x:xr(f,h)})):h&&p.push(r(p)+"rotate("+h+i)}function l(f,h,p,g){f!==h?g.push({i:p.push(r(p)+"skewX(",null,i)-2,x:xr(f,h)}):h&&p.push(r(p)+"skewX("+h+i)}function u(f,h,p,g,O,v){if(f!==p||h!==g){var x=O.push(r(O)+"scale(",null,",",null,")");v.push({i:x-4,x:xr(f,p)},{i:x-2,x:xr(h,g)})}else(p!==1||g!==1)&&O.push(r(O)+"scale("+p+","+g+")")}return function(f,h){var p=[],g=[];return f=t(f),h=t(h),s(f.translateX,f.translateY,h.translateX,h.translateY,p,g),o(f.rotate,h.rotate,p,g),l(f.skewX,h.skewX,p,g),u(f.scaleX,f.scaleY,h.scaleX,h.scaleY,p,g),f=h=null,function(O){for(var v=-1,x=g.length,S;++v<x;)p[(S=g[v]).i]=S.x(O);return p.join("")}}}var gee=UL(hee,"px, ","px)","deg)"),mee=UL(pee,", ",")",")"),Oee=1e-12;function dQ(t){return((t=Math.exp(t))+1/t)/2}function yee(t){return((t=Math.exp(t))-1/t)/2}function vee(t){return((t=Math.exp(2*t))-1)/(t+1)}const Pg=(function t(e,n,i){function r(s,o){var l=s[0],u=s[1],f=s[2],h=o[0],p=o[1],g=o[2],O=h-l,v=p-u,x=O*O+v*v,S,k;if(x<Oee)k=Math.log(g/f)/e,S=function(N){return[l+N*O,u+N*v,f*Math.exp(e*N*k)]};else{var $=Math.sqrt(x),E=(g*g-f*f+i*x)/(2*f*n*$),T=(g*g-f*f-i*x)/(2*g*n*$),_=Math.log(Math.sqrt(E*E+1)-E),Q=Math.log(Math.sqrt(T*T+1)-T);k=(Q-_)/e,S=function(N){var R=N*k,X=dQ(_),q=f/(n*$)*(X*vee(e*R+_)-yee(_));return[l+q*O,u+q*v,f*X/dQ(e*R+_)]}}return S.duration=k*1e3*e/Math.SQRT2,S}return r.rho=function(s){var o=Math.max(.001,+s),l=o*o,u=l*l;return t(o,l,u)},r})(Math.SQRT2,2,4);var _c=0,Nf=0,wf=0,YL=1e3,$m,Pf,_m=0,Ea=0,bO=0,gd=typeof performance=="object"&&performance.now?performance:Date,qL=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function uS(){return Ea||(qL(bee),Ea=gd.now()+bO)}function bee(){Ea=0}function Qm(){this._call=this._time=this._next=null}Qm.prototype=WL.prototype={constructor:Qm,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?uS():+n)+(e==null?0:+e),!this._next&&Pf!==this&&(Pf?Pf._next=this:$m=this,Pf=this),this._call=t,this._time=n,gw()},stop:function(){this._call&&(this._call=null,this._time=1/0,gw())}};function WL(t,e,n){var i=new Qm;return i.restart(t,e,n),i}function xee(){uS(),++_c;for(var t=$m,e;t;)(e=Ea-t._time)>=0&&t._call.call(void 0,e),t=t._next;--_c}function hQ(){Ea=(_m=gd.now())+bO,_c=Nf=0;try{xee()}finally{_c=0,See(),Ea=0}}function wee(){var t=gd.now(),e=t-_m;e>YL&&(bO-=e,_m=t)}function See(){for(var t,e=$m,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:$m=n);Pf=t,gw(i)}function gw(t){if(!_c){Nf&&(Nf=clearTimeout(Nf));var e=t-Ea;e>24?(t<1/0&&(Nf=setTimeout(hQ,t-gd.now()-bO)),wf&&(wf=clearInterval(wf))):(wf||(_m=gd.now(),wf=setInterval(wee,YL)),_c=1,qL(hQ))}}function pQ(t,e,n){var i=new Qm;return e=e==null?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,n),i}var kee=yO("start","end","cancel","interrupt"),Eee=[],FL=0,gQ=1,mw=2,Rg=3,mQ=4,Ow=5,jg=6;function xO(t,e,n,i,r,s){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Tee(t,n,{name:e,index:i,group:r,on:kee,tween:Eee,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:FL})}function fS(t,e){var n=rr(t,e);if(n.state>FL)throw new Error("too late; already scheduled");return n}function Lr(t,e){var n=rr(t,e);if(n.state>Rg)throw new Error("too late; already running");return n}function rr(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Tee(t,e,n){var i=t.__transition,r;i[e]=n,n.timer=WL(s,0,n.time);function s(f){n.state=gQ,n.timer.restart(o,n.delay,n.time),n.delay<=f&&o(f-n.delay)}function o(f){var h,p,g,O;if(n.state!==gQ)return u();for(h in i)if(O=i[h],O.name===n.name){if(O.state===Rg)return pQ(o);O.state===mQ?(O.state=jg,O.timer.stop(),O.on.call("interrupt",t,t.__data__,O.index,O.group),delete i[h]):+h<e&&(O.state=jg,O.timer.stop(),O.on.call("cancel",t,t.__data__,O.index,O.group),delete i[h])}if(pQ(function(){n.state===Rg&&(n.state=mQ,n.timer.restart(l,n.delay,n.time),l(f))}),n.state=mw,n.on.call("start",t,t.__data__,n.index,n.group),n.state===mw){for(n.state=Rg,r=new Array(g=n.tween.length),h=0,p=-1;h<g;++h)(O=n.tween[h].value.call(t,t.__data__,n.index,n.group))&&(r[++p]=O);r.length=p+1}}function l(f){for(var h=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(u),n.state=Ow,1),p=-1,g=r.length;++p<g;)r[p].call(t,h);n.state===Ow&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=jg,n.timer.stop(),delete i[e];for(var f in i)return;delete t.__transition}}function Mg(t,e){var n=t.__transition,i,r,s=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((i=n[o]).name!==e){s=!1;continue}r=i.state>mw&&i.state<Ow,i.state=jg,i.timer.stop(),i.on.call(r?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete n[o]}s&&delete t.__transition}}function Cee(t){return this.each(function(){Mg(this,t)})}function $ee(t,e){var n,i;return function(){var r=Lr(this,t),s=r.tween;if(s!==n){i=n=s;for(var o=0,l=i.length;o<l;++o)if(i[o].name===e){i=i.slice(),i.splice(o,1);break}}r.tween=i}}function _ee(t,e,n){var i,r;if(typeof n!="function")throw new Error;return function(){var s=Lr(this,t),o=s.tween;if(o!==i){r=(i=o).slice();for(var l={name:e,value:n},u=0,f=r.length;u<f;++u)if(r[u].name===e){r[u]=l;break}u===f&&r.push(l)}s.tween=r}}function Qee(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i=rr(this.node(),n).tween,r=0,s=i.length,o;r<s;++r)if((o=i[r]).name===t)return o.value;return null}return this.each((e==null?$ee:_ee)(n,t,e))}function dS(t,e,n){var i=t._id;return t.each(function(){var r=Lr(this,i);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return rr(r,i).value[e]}}function HL(t,e){var n;return(typeof e=="number"?xr:e instanceof ka?Cm:(n=ka(e))?(e=n,Cm):GL)(t,e)}function Aee(t){return function(){this.removeAttribute(t)}}function Nee(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Pee(t,e,n){var i,r=n+"",s;return function(){var o=this.getAttribute(t);return o===r?null:o===i?s:s=e(i=o,n)}}function Ree(t,e,n){var i,r=n+"",s;return function(){var o=this.getAttributeNS(t.space,t.local);return o===r?null:o===i?s:s=e(i=o,n)}}function jee(t,e,n){var i,r,s;return function(){var o,l=n(this),u;return l==null?void this.removeAttribute(t):(o=this.getAttribute(t),u=l+"",o===u?null:o===i&&u===r?s:(r=u,s=e(i=o,l)))}}function Mee(t,e,n){var i,r,s;return function(){var o,l=n(this),u;return l==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),u=l+"",o===u?null:o===i&&u===r?s:(r=u,s=e(i=o,l)))}}function Lee(t,e){var n=vO(t),i=n==="transform"?mee:HL;return this.attrTween(t,typeof e=="function"?(n.local?Mee:jee)(n,i,dS(this,"attr."+t,e)):e==null?(n.local?Nee:Aee)(n):(n.local?Ree:Pee)(n,i,e))}function Dee(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function zee(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Xee(t,e){var n,i;function r(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&zee(t,s)),n}return r._value=e,r}function Zee(t,e){var n,i;function r(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&Dee(t,s)),n}return r._value=e,r}function Bee(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var i=vO(t);return this.tween(n,(i.local?Xee:Zee)(i,e))}function Iee(t,e){return function(){fS(this,t).delay=+e.apply(this,arguments)}}function Gee(t,e){return e=+e,function(){fS(this,t).delay=e}}function Vee(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Iee:Gee)(e,t)):rr(this.node(),e).delay}function Uee(t,e){return function(){Lr(this,t).duration=+e.apply(this,arguments)}}function Yee(t,e){return e=+e,function(){Lr(this,t).duration=e}}function qee(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Uee:Yee)(e,t)):rr(this.node(),e).duration}function Wee(t,e){if(typeof e!="function")throw new Error;return function(){Lr(this,t).ease=e}}function Fee(t){var e=this._id;return arguments.length?this.each(Wee(e,t)):rr(this.node(),e).ease}function Hee(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Lr(this,t).ease=n}}function Kee(t){if(typeof t!="function")throw new Error;return this.each(Hee(this._id,t))}function Jee(t){typeof t!="function"&&(t=$L(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],o=s.length,l=i[r]=[],u,f=0;f<o;++f)(u=s[f])&&t.call(u,u.__data__,f,s)&&l.push(u);return new Ss(i,this._parents,this._name,this._id)}function ete(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,s=Math.min(i,r),o=new Array(i),l=0;l<s;++l)for(var u=e[l],f=n[l],h=u.length,p=o[l]=new Array(h),g,O=0;O<h;++O)(g=u[O]||f[O])&&(p[O]=g);for(;l<i;++l)o[l]=e[l];return new Ss(o,this._parents,this._name,this._id)}function tte(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function nte(t,e,n){var i,r,s=tte(e)?fS:Lr;return function(){var o=s(this,t),l=o.on;l!==i&&(r=(i=l).copy()).on(e,n),o.on=r}}function ite(t,e){var n=this._id;return arguments.length<2?rr(this.node(),n).on.on(t):this.each(nte(n,t,e))}function rte(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function ste(){return this.on("end.remove",rte(this._id))}function ote(t){var e=this._name,n=this._id;typeof t!="function"&&(t=oS(t));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o<r;++o)for(var l=i[o],u=l.length,f=s[o]=new Array(u),h,p,g=0;g<u;++g)(h=l[g])&&(p=t.call(h,h.__data__,g,l))&&("__data__"in h&&(p.__data__=h.__data__),f[g]=p,xO(f[g],e,n,g,f,rr(h,n)));return new Ss(s,this._parents,e,n)}function ate(t){var e=this._name,n=this._id;typeof t!="function"&&(t=CL(t));for(var i=this._groups,r=i.length,s=[],o=[],l=0;l<r;++l)for(var u=i[l],f=u.length,h,p=0;p<f;++p)if(h=u[p]){for(var g=t.call(h,h.__data__,p,u),O,v=rr(h,n),x=0,S=g.length;x<S;++x)(O=g[x])&&xO(O,e,n,x,g,v);s.push(g),o.push(h)}return new Ss(s,o,e,n)}var lte=Xd.prototype.constructor;function cte(){return new lte(this._groups,this._parents)}function ute(t,e){var n,i,r;return function(){var s=$c(this,t),o=(this.style.removeProperty(t),$c(this,t));return s===o?null:s===n&&o===i?r:r=e(n=s,i=o)}}function KL(t){return function(){this.style.removeProperty(t)}}function fte(t,e,n){var i,r=n+"",s;return function(){var o=$c(this,t);return o===r?null:o===i?s:s=e(i=o,n)}}function dte(t,e,n){var i,r,s;return function(){var o=$c(this,t),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(t),$c(this,t))),o===u?null:o===i&&u===r?s:(r=u,s=e(i=o,l))}}function hte(t,e){var n,i,r,s="style."+e,o="end."+s,l;return function(){var u=Lr(this,t),f=u.on,h=u.value[s]==null?l||(l=KL(e)):void 0;(f!==n||r!==h)&&(i=(n=f).copy()).on(o,r=h),u.on=i}}function pte(t,e,n){var i=(t+="")=="transform"?gee:HL;return e==null?this.styleTween(t,ute(t,i)).on("end.style."+t,KL(t)):typeof e=="function"?this.styleTween(t,dte(t,i,dS(this,"style."+t,e))).each(hte(this._id,t)):this.styleTween(t,fte(t,i,e),n).on("end.style."+t,null)}function gte(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function mte(t,e,n){var i,r;function s(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&gte(t,o,n)),i}return s._value=e,s}function Ote(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;return this.tween(i,mte(t,e,n??""))}function yte(t){return function(){this.textContent=t}}function vte(t){return function(){var e=t(this);this.textContent=e??""}}function bte(t){return this.tween("text",typeof t=="function"?vte(dS(this,"text",t)):yte(t==null?"":t+""))}function xte(t){return function(e){this.textContent=t.call(this,e)}}function wte(t){var e,n;function i(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&xte(r)),e}return i._value=t,i}function Ste(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,wte(t))}function kte(){for(var t=this._name,e=this._id,n=JL(),i=this._groups,r=i.length,s=0;s<r;++s)for(var o=i[s],l=o.length,u,f=0;f<l;++f)if(u=o[f]){var h=rr(u,e);xO(u,t,n,f,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Ss(i,this._parents,t,n)}function Ete(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(s,o){var l={value:o},u={value:function(){--r===0&&s()}};n.each(function(){var f=Lr(this,i),h=f.on;h!==t&&(e=(t=h).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(u)),f.on=e}),r===0&&s()})}var Tte=0;function Ss(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function JL(){return++Tte}var os=Xd.prototype;Ss.prototype={constructor:Ss,select:ote,selectAll:ate,selectChild:os.selectChild,selectChildren:os.selectChildren,filter:Jee,merge:ete,selection:cte,transition:kte,call:os.call,nodes:os.nodes,node:os.node,size:os.size,empty:os.empty,each:os.each,on:ite,attr:Lee,attrTween:Bee,style:pte,styleTween:Ote,text:bte,textTween:Ste,remove:ste,tween:Qee,delay:Vee,duration:qee,ease:Fee,easeVarying:Kee,end:Ete,[Symbol.iterator]:os[Symbol.iterator]};function Cte(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var $te={time:null,delay:0,duration:250,ease:Cte};function _te(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Qte(t){var e,n;t instanceof Ss?(e=t._id,t=t._name):(e=JL(),(n=$te).time=uS(),t=t==null?null:t+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var o=i[s],l=o.length,u,f=0;f<l;++f)(u=o[f])&&xO(u,t,e,f,o,n||_te(u,e));return new Ss(i,this._parents,t,e)}Xd.prototype.interrupt=Cee;Xd.prototype.transition=Qte;const ng=t=>()=>t;function Ate(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function gs(t,e,n){this.k=t,this.x=e,this.y=n}gs.prototype={constructor:gs,scale:function(t){return t===1?this:new gs(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new gs(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var wO=new gs(1,0,0);eD.prototype=gs.prototype;function eD(t){for(;!t.__zoom;)if(!(t=t.parentNode))return wO;return t.__zoom}function hb(t){t.stopImmediatePropagation()}function Sf(t){t.preventDefault(),t.stopImmediatePropagation()}function Nte(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Pte(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function OQ(){return this.__zoom||wO}function Rte(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function jte(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mte(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function tD(){var t=Nte,e=Pte,n=Mte,i=Rte,r=jte,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,u=Pg,f=yO("start","zoom","end"),h,p,g,O=500,v=150,x=0,S=10;function k(M){M.property("__zoom",OQ).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",X).on("dblclick.zoom",q).filter(r).on("touchstart.zoom",z).on("touchmove.zoom",Z).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(M,B,L,I){var U=M.selection?M.selection():M;U.property("__zoom",OQ),M!==U?_(M,B,L,I):U.interrupt().each(function(){Q(this,arguments).event(I).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},k.scaleBy=function(M,B,L,I){k.scaleTo(M,function(){var U=this.__zoom.k,V=typeof B=="function"?B.apply(this,arguments):B;return U*V},L,I)},k.scaleTo=function(M,B,L,I){k.transform(M,function(){var U=e.apply(this,arguments),V=this.__zoom,te=L==null?T(U):typeof L=="function"?L.apply(this,arguments):L,P=V.invert(te),j=typeof B=="function"?B.apply(this,arguments):B;return n(E($(V,j),te,P),U,o)},L,I)},k.translateBy=function(M,B,L,I){k.transform(M,function(){return n(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof L=="function"?L.apply(this,arguments):L),e.apply(this,arguments),o)},null,I)},k.translateTo=function(M,B,L,I,U){k.transform(M,function(){var V=e.apply(this,arguments),te=this.__zoom,P=I==null?T(V):typeof I=="function"?I.apply(this,arguments):I;return n(wO.translate(P[0],P[1]).scale(te.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof L=="function"?-L.apply(this,arguments):-L),V,o)},I,U)};function $(M,B){return B=Math.max(s[0],Math.min(s[1],B)),B===M.k?M:new gs(B,M.x,M.y)}function E(M,B,L){var I=B[0]-L[0]*M.k,U=B[1]-L[1]*M.k;return I===M.x&&U===M.y?M:new gs(M.k,I,U)}function T(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function _(M,B,L,I){M.on("start.zoom",function(){Q(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){Q(this,arguments).event(I).end()}).tween("zoom",function(){var U=this,V=arguments,te=Q(U,V).event(I),P=e.apply(U,V),j=L==null?T(P):typeof L=="function"?L.apply(U,V):L,Y=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),G=U.__zoom,J=typeof B=="function"?B.apply(U,V):B,ne=u(G.invert(j).concat(Y/G.k),J.invert(j).concat(Y/J.k));return function(le){if(le===1)le=J;else{var H=ne(le),ce=Y/H[2];le=new gs(ce,j[0]-H[0]*ce,j[1]-H[1]*ce)}te.zoom(null,le)}})}function Q(M,B,L){return!L&&M.__zooming||new N(M,B)}function N(M,B){this.that=M,this.args=B,this.active=0,this.sourceEvent=null,this.extent=e.apply(M,B),this.taps=0}N.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,B){return this.mouse&&M!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var B=si(this.that).datum();f.call(M,this.that,new Ate(M,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:f}),B)}};function R(M,...B){if(!t.apply(this,arguments))return;var L=Q(this,B).event(M),I=this.__zoom,U=Math.max(s[0],Math.min(s[1],I.k*Math.pow(2,i.apply(this,arguments)))),V=Ii(M);if(L.wheel)(L.mouse[0][0]!==V[0]||L.mouse[0][1]!==V[1])&&(L.mouse[1]=I.invert(L.mouse[0]=V)),clearTimeout(L.wheel);else{if(I.k===U)return;L.mouse=[V,I.invert(V)],Mg(this),L.start()}Sf(M),L.wheel=setTimeout(te,v),L.zoom("mouse",n(E($(I,U),L.mouse[0],L.mouse[1]),L.extent,o));function te(){L.wheel=null,L.end()}}function X(M,...B){if(g||!t.apply(this,arguments))return;var L=M.currentTarget,I=Q(this,B,!0).event(M),U=si(M.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",Y,!0),V=Ii(M,L),te=M.clientX,P=M.clientY;DL(M.view),hb(M),I.mouse=[V,this.__zoom.invert(V)],Mg(this),I.start();function j(G){if(Sf(G),!I.moved){var J=G.clientX-te,ne=G.clientY-P;I.moved=J*J+ne*ne>x}I.event(G).zoom("mouse",n(E(I.that.__zoom,I.mouse[0]=Ii(G,L),I.mouse[1]),I.extent,o))}function Y(G){U.on("mousemove.zoom mouseup.zoom",null),zL(G.view,I.moved),Sf(G),I.event(G).end()}}function q(M,...B){if(t.apply(this,arguments)){var L=this.__zoom,I=Ii(M.changedTouches?M.changedTouches[0]:M,this),U=L.invert(I),V=L.k*(M.shiftKey?.5:2),te=n(E($(L,V),I,U),e.apply(this,B),o);Sf(M),l>0?si(this).transition().duration(l).call(_,te,I,M):si(this).call(k.transform,te,I,M)}}function z(M,...B){if(t.apply(this,arguments)){var L=M.touches,I=L.length,U=Q(this,B,M.changedTouches.length===I).event(M),V,te,P,j;for(hb(M),te=0;te<I;++te)P=L[te],j=Ii(P,this),j=[j,this.__zoom.invert(j),P.identifier],U.touch0?!U.touch1&&U.touch0[2]!==j[2]&&(U.touch1=j,U.taps=0):(U.touch0=j,V=!0,U.taps=1+!!h);h&&(h=clearTimeout(h)),V&&(U.taps<2&&(p=j[0],h=setTimeout(function(){h=null},O)),Mg(this),U.start())}}function Z(M,...B){if(this.__zooming){var L=Q(this,B).event(M),I=M.changedTouches,U=I.length,V,te,P,j;for(Sf(M),V=0;V<U;++V)te=I[V],P=Ii(te,this),L.touch0&&L.touch0[2]===te.identifier?L.touch0[0]=P:L.touch1&&L.touch1[2]===te.identifier&&(L.touch1[0]=P);if(te=L.that.__zoom,L.touch1){var Y=L.touch0[0],G=L.touch0[1],J=L.touch1[0],ne=L.touch1[1],le=(le=J[0]-Y[0])*le+(le=J[1]-Y[1])*le,H=(H=ne[0]-G[0])*H+(H=ne[1]-G[1])*H;te=$(te,Math.sqrt(le/H)),P=[(Y[0]+J[0])/2,(Y[1]+J[1])/2],j=[(G[0]+ne[0])/2,(G[1]+ne[1])/2]}else if(L.touch0)P=L.touch0[0],j=L.touch0[1];else return;L.zoom("touch",n(E(te,P,j),L.extent,o))}}function F(M,...B){if(this.__zooming){var L=Q(this,B).event(M),I=M.changedTouches,U=I.length,V,te;for(hb(M),g&&clearTimeout(g),g=setTimeout(function(){g=null},O),V=0;V<U;++V)te=I[V],L.touch0&&L.touch0[2]===te.identifier?delete L.touch0:L.touch1&&L.touch1[2]===te.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(te=Ii(te,this),Math.hypot(p[0]-te[0],p[1]-te[1])<S)){var P=si(this).on("dblclick.zoom");P&&P.apply(this,arguments)}}}return k.wheelDelta=function(M){return arguments.length?(i=typeof M=="function"?M:ng(+M),k):i},k.filter=function(M){return arguments.length?(t=typeof M=="function"?M:ng(!!M),k):t},k.touchable=function(M){return arguments.length?(r=typeof M=="function"?M:ng(!!M),k):r},k.extent=function(M){return arguments.length?(e=typeof M=="function"?M:ng([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),k):e},k.scaleExtent=function(M){return arguments.length?(s[0]=+M[0],s[1]=+M[1],k):[s[0],s[1]]},k.translateExtent=function(M){return arguments.length?(o[0][0]=+M[0][0],o[1][0]=+M[1][0],o[0][1]=+M[0][1],o[1][1]=+M[1][1],k):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},k.constrain=function(M){return arguments.length?(n=M,k):n},k.duration=function(M){return arguments.length?(l=+M,k):l},k.interpolate=function(M){return arguments.length?(u=M,k):u},k.on=function(){var M=f.on.apply(f,arguments);return M===f?k:M},k.clickDistance=function(M){return arguments.length?(x=(M=+M)*M,k):Math.sqrt(x)},k.tapDistance=function(M){return arguments.length?(S=+M,k):S},k}const Ji={error001:(t="react")=>`Seems like you have not used ${t==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${t}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:i}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:t=>`Edge with id "${t}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},md=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nD=["Enter"," ","Escape"],iD={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Qc;(function(t){t.Strict="strict",t.Loose="loose"})(Qc||(Qc={}));var ga;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(ga||(ga={}));var Od;(function(t){t.Partial="partial",t.Full="full"})(Od||(Od={}));const rD={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var mo;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(mo||(mo={}));var yd;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(yd||(yd={}));var _e;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(_e||(_e={}));const yQ={[_e.Left]:_e.Right,[_e.Right]:_e.Left,[_e.Top]:_e.Bottom,[_e.Bottom]:_e.Top};function sD(t){return t===null?null:t?"valid":"invalid"}const oD=t=>!!t&&typeof t=="object"&&"id"in t&&"source"in t&&"target"in t,Lte=t=>!!t&&typeof t=="object"&&"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),hS=t=>!!t&&typeof t=="object"&&"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Bd=(t,e=[0,0])=>{const{width:n,height:i}=sr(t),r=t.origin??e,s=n*r[0],o=i*r[1];return{x:t.position.x-s,y:t.position.y-o}},Dte=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const i=t.reduce((r,s)=>{const o=typeof s=="string";let l=!e.nodeLookup&&!o?s:void 0;return e.nodeLookup&&(l=o?e.nodeLookup.get(s):hS(s)?s:e.nodeLookup.get(s.id)),l?(n=!0,SO(r,Am(l,e.nodeOrigin))):r},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?kO(i):{x:0,y:0,width:0,height:0}},Id=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return t.forEach(r=>{(e.filter===void 0||e.filter(r))&&(n=SO(n,Am(r)),i=!0)}),i?kO(n):{x:0,y:0,width:0,height:0}},pS=(t,e,[n,i,r]=[0,0,1],s=!1,o=!1)=>{const l=(e.x-n)/r,u=(e.y-i)/r,f=e.width/r,h=e.height/r,p=[];for(const g of t.values()){const{measured:O,selectable:v=!0,hidden:x=!1}=g;if(o&&!v||x)continue;const S=O.width??g.width??g.initialWidth??0,k=O.height??g.height??g.initialHeight??0,{x:$,y:E}=g.internals.positionAbsolute,T=uD(l,u,f,h,$,E,S,k),_=S*k,Q=s&&T>0;(!g.internals.handleBounds||Q||T>=_||g.dragging)&&p.push(g)}return p},zte=(t,e)=>{const n=new Set;return t.forEach(i=>{n.add(i.id)}),e.filter(i=>n.has(i.source)||n.has(i.target))};function Xte(t,e){const n=new Map,i=e?.nodes?new Set(e.nodes.map(r=>r.id)):null;return t.forEach(r=>{let s;if(e?.includeHiddenNodes){const{width:o,height:l}=sr(r);s=o>0&&l>0}else s=!!(r.measured.width&&r.measured.height&&!r.hidden);s&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function Zte({nodes:t,width:e,height:n,panZoom:i,minZoom:r,maxZoom:s},o){if(t.size===0)return!0;const l=Xte(t,o),u=Id(l),f=mS(u,e,n,o?.minZoom??r,o?.maxZoom??s,o?.padding??.1);return await i.setViewport(f,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function aD({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const o=n.get(t),l=o.parentId?n.get(o.parentId):void 0,{x:u,y:f}=l?l.internals.positionAbsolute:{x:0,y:0},h=o.origin??i;let p=o.extent||r;if(o.extent==="parent"&&!o.expandParent)if(!l)s?.("005",Ji.error005());else{const{width:O,height:v}=sr(l);O&&v&&(p=[[u,f],[u+O,f+v]])}else l&&Ca(o.extent)&&(p=[[o.extent[0][0]+u,o.extent[0][1]+f],[o.extent[1][0]+u,o.extent[1][1]+f]]);const g=Ca(p)?Ta(e,p,o.measured):e;return(o.measured.width===void 0||o.measured.height===void 0)&&s?.("015",Ji.error015()),{position:{x:g.x-u+(o.measured.width??0)*h[0],y:g.y-f+(o.measured.height??0)*h[1]},positionAbsolute:g}}async function Bte({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(t.map(g=>g.id)),o=[];for(const g of n){if(g.deletable===!1)continue;const O=s.has(g.id),v=!O&&g.parentId&&o.find(x=>x.id===g.parentId);(O||v)&&o.push(g)}const l=new Set(e.map(g=>g.id)),u=i.filter(g=>g.deletable!==!1),h=zte(o,u);for(const g of u)l.has(g.id)&&!h.find(v=>v.id===g.id)&&h.push(g);if(!r)return{edges:h,nodes:o};const p=await r({nodes:o,edges:h});return typeof p=="boolean"?p?{edges:h,nodes:o}:{edges:[],nodes:[]}:p}const Ac=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Ta=(t={x:0,y:0},e,n)=>({x:Ac(t.x,e[0][0],e[1][0]-(n?.width??0)),y:Ac(t.y,e[0][1],e[1][1]-(n?.height??0))});function lD(t,e,n){const{width:i,height:r}=sr(n),{x:s,y:o}=n.internals.positionAbsolute;return Ta(t,[[s,o],[s+i,o+r]],e)}const vQ=(t,e,n)=>t<e?Ac(Math.abs(t-e),1,e)/e:t>n?-Ac(Math.abs(t-n),1,e)/e:0,gS=(t,e,n=15,i=40)=>{const r=vQ(t.x,i,e.width-i)*n,s=vQ(t.y,i,e.height-i)*n;return[r,s]},SO=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),yw=({x:t,y:e,width:n,height:i})=>({x:t,y:e,x2:t+n,y2:e+i}),kO=({x:t,y:e,x2:n,y2:i})=>({x:t,y:e,width:n-t,height:i-e}),vd=(t,e=[0,0])=>{const{x:n,y:i}=hS(t)?t.internals.positionAbsolute:Bd(t,e);return{x:n,y:i,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},Am=(t,e=[0,0])=>{const{x:n,y:i}=hS(t)?t.internals.positionAbsolute:Bd(t,e);return{x:n,y:i,x2:n+(t.measured?.width??t.width??t.initialWidth??0),y2:i+(t.measured?.height??t.height??t.initialHeight??0)}},cD=(t,e)=>kO(SO(yw(t),yw(e))),uD=(t,e,n,i,r,s,o,l)=>{const u=Math.max(0,Math.min(t+n,r+o)-Math.max(t,r)),f=Math.max(0,Math.min(e+i,s+l)-Math.max(e,s));return Math.ceil(u*f)},Nm=(t,e)=>uD(t.x,t.y,t.width,t.height,e.x,e.y,e.width,e.height),bQ=t=>Fi(t.width)&&Fi(t.height)&&Fi(t.x)&&Fi(t.y),Fi=t=>!isNaN(t)&&isFinite(t),fD=(t,e)=>(n,i)=>{},Gd=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),Vd=({x:t,y:e},[n,i,r],s=!1,o=[1,1])=>{const l={x:(t-n)/r,y:(e-i)/r};return s?Gd(l,o):l},Nc=({x:t,y:e},[n,i,r])=>({x:t*r+n,y:e*r+i});function Nl(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Ite(t,e,n){if(typeof t=="string"||typeof t=="number"){const i=Nl(t,n),r=Nl(t,e);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof t=="object"){const i=Nl(t.top??t.y??0,n),r=Nl(t.bottom??t.y??0,n),s=Nl(t.left??t.x??0,e),o=Nl(t.right??t.x??0,e);return{top:i,right:o,bottom:r,left:s,x:s+o,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Gte(t,e,n,i,r,s){const{x:o,y:l}=Nc(t,[e,n,i]),{x:u,y:f}=Nc({x:t.x+t.width,y:t.y+t.height},[e,n,i]),h=r-u,p=s-f;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(p)}}const mS=(t,e,n,i,r,s)=>{const o=Ite(s,e,n),l=(e-o.x)/t.width,u=(n-o.y)/t.height,f=Math.min(l,u),h=Ac(f,i,r),p=t.x+t.width/2,g=t.y+t.height/2,O=e/2-p*h,v=n/2-g*h,x=Gte(t,O,v,h,e,n),S={left:Math.min(x.left-o.left,0),top:Math.min(x.top-o.top,0),right:Math.min(x.right-o.right,0),bottom:Math.min(x.bottom-o.bottom,0)};return{x:O-S.left+S.right,y:v-S.top+S.bottom,zoom:h}},bd=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Ca(t){return t!=null&&t!=="parent"}function sr(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function dD(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function hD(t,e={width:0,height:0},n,i,r){const s={...t},o=i.get(n);if(o){const l=o.origin||r;s.x+=o.internals.positionAbsolute.x-(e.width??0)*l[0],s.y+=o.internals.positionAbsolute.y-(e.height??0)*l[1]}return s}function xQ(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function Vte(){let t,e;return{promise:new Promise((i,r)=>{t=i,e=r}),resolve:t,reject:e}}function Ute(t){return{...iD,...t||{}}}function Yf(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:o}=Hi(t),l=Vd({x:s-(r?.left??0),y:o-(r?.top??0)},i),{x:u,y:f}=n?Gd(l,e):l;return{xSnapped:u,ySnapped:f,...l}}const OS=t=>({width:t.offsetWidth,height:t.offsetHeight}),pD=t=>t?.getRootNode?.()||window?.document,Yte=["INPUT","SELECT","TEXTAREA"];function gD(t){const e=t.composedPath?.()?.[0]||t.target;return e?.nodeType!==1?!1:Yte.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const mD=t=>"clientX"in t,Hi=(t,e)=>{const n=mD(t),i=n?t.clientX:t.touches?.[0].clientX,r=n?t.clientY:t.touches?.[0].clientY;return{x:i-(e?.left??0),y:r-(e?.top??0)}},wQ=(t,e,n,i,r)=>{const s=e.querySelectorAll(`.${t}`);return!s||!s.length?null:Array.from(s).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:t,nodeId:r,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/i,y:(l.top-n.top)/i,...OS(o)}})};function OD({sourceX:t,sourceY:e,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:o,targetControlY:l}){const u=t*.125+r*.375+o*.375+n*.125,f=e*.125+s*.375+l*.375+i*.125,h=Math.abs(u-t),p=Math.abs(f-e);return[u,f,h,p]}function ig(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function SQ({pos:t,x1:e,y1:n,x2:i,y2:r,c:s}){switch(t){case _e.Left:return[e-ig(e-i,s),n];case _e.Right:return[e+ig(i-e,s),n];case _e.Top:return[e,n-ig(n-r,s)];case _e.Bottom:return[e,n+ig(r-n,s)]}}function yD({sourceX:t,sourceY:e,sourcePosition:n=_e.Bottom,targetX:i,targetY:r,targetPosition:s=_e.Top,curvature:o=.25}){const[l,u]=SQ({pos:n,x1:t,y1:e,x2:i,y2:r,c:o}),[f,h]=SQ({pos:s,x1:i,y1:r,x2:t,y2:e,c:o}),[p,g,O,v]=OD({sourceX:t,sourceY:e,targetX:i,targetY:r,sourceControlX:l,sourceControlY:u,targetControlX:f,targetControlY:h});return[`M${t},${e} C${l},${u} ${f},${h} ${i},${r}`,p,g,O,v]}function vD({sourceX:t,sourceY:e,targetX:n,targetY:i}){const r=Math.abs(n-t)/2,s=n<t?n+r:n-r,o=Math.abs(i-e)/2,l=i<e?i+o:i-o;return[s,l,r,o]}function qte({sourceNode:t,targetNode:e,selected:n=!1,zIndex:i=0,elevateOnSelect:r=!1,zIndexMode:s="basic"}){if(s==="manual")return i;const o=r&&n?i+1e3:i,l=Math.max(t.parentId||r&&t.selected?t.internals.z:0,e.parentId||r&&e.selected?e.internals.z:0);return o+l}function Wte({sourceNode:t,targetNode:e,width:n,height:i,transform:r}){const s=SO(Am(t),Am(e));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const o={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:i/r[2]};return Nm(o,kO(s))>0}const Fte=({source:t,sourceHandle:e,target:n,targetHandle:i})=>`xy-edge__${t}${e||""}-${n}${i||""}`,Hte=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),Kte=(t,e,n={})=>{if(!t.source||!t.target)return n.onError?.("006",Ji.error006()),e;const i=n.getEdgeId||Fte;let r;return oD(t)?r={...t}:r={...t,id:i(t)},Hte(r,e)?e:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,e.concat(r))};function bD({sourceX:t,sourceY:e,targetX:n,targetY:i}){const[r,s,o,l]=vD({sourceX:t,sourceY:e,targetX:n,targetY:i});return[`M ${t},${e}L ${n},${i}`,r,s,o,l]}const kQ={[_e.Left]:{x:-1,y:0},[_e.Right]:{x:1,y:0},[_e.Top]:{x:0,y:-1},[_e.Bottom]:{x:0,y:1}},Jte=({source:t,sourcePosition:e=_e.Bottom,target:n})=>e===_e.Left||e===_e.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},EQ=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function ene({source:t,sourcePosition:e=_e.Bottom,target:n,targetPosition:i=_e.Top,center:r,offset:s,stepPosition:o}){const l=kQ[e],u=kQ[i],f={x:t.x+l.x*s,y:t.y+l.y*s},h={x:n.x+u.x*s,y:n.y+u.y*s},p=Jte({source:f,sourcePosition:e,target:h}),g=p.x!==0?"x":"y",O=p[g];let v=[],x,S;const k={x:0,y:0},$={x:0,y:0},[,,E,T]=vD({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(l[g]*u[g]===-1){g==="x"?(x=r.x??f.x+(h.x-f.x)*o,S=r.y??(f.y+h.y)/2):(x=r.x??(f.x+h.x)/2,S=r.y??f.y+(h.y-f.y)*o);const R=[{x,y:f.y},{x,y:h.y}],X=[{x:f.x,y:S},{x:h.x,y:S}];l[g]===O?v=g==="x"?R:X:v=g==="x"?X:R}else{const R=[{x:f.x,y:h.y}],X=[{x:h.x,y:f.y}];if(g==="x"?v=l.x===O?X:R:v=l.y===O?R:X,e===i){const M=Math.abs(t[g]-n[g]);if(M<=s){const B=Math.min(s-1,s-M);l[g]===O?k[g]=(f[g]>t[g]?-1:1)*B:$[g]=(h[g]>n[g]?-1:1)*B}}if(e!==i){const M=g==="x"?"y":"x",B=l[g]===u[M],L=f[M]>h[M],I=f[M]<h[M];(l[g]===1&&(!B&&L||B&&I)||l[g]!==1&&(!B&&I||B&&L))&&(v=g==="x"?R:X)}const q={x:f.x+k.x,y:f.y+k.y},z={x:h.x+$.x,y:h.y+$.y},Z=Math.max(Math.abs(q.x-v[0].x),Math.abs(z.x-v[0].x)),F=Math.max(Math.abs(q.y-v[0].y),Math.abs(z.y-v[0].y));Z>=F?(x=(q.x+z.x)/2,S=v[0].y):(x=v[0].x,S=(q.y+z.y)/2)}const _={x:f.x+k.x,y:f.y+k.y},Q={x:h.x+$.x,y:h.y+$.y};return[[t,..._.x!==v[0].x||_.y!==v[0].y?[_]:[],...v,...Q.x!==v[v.length-1].x||Q.y!==v[v.length-1].y?[Q]:[],n],x,S,E,T]}function tne(t,e,n,i){const r=Math.min(EQ(t,e)/2,EQ(e,n)/2,i),{x:s,y:o}=e;if(t.x===s&&s===n.x||t.y===o&&o===n.y)return`L${s} ${o}`;if(t.y===o){const f=t.x<n.x?-1:1,h=t.y<n.y?1:-1;return`L ${s+r*f},${o}Q ${s},${o} ${s},${o+r*h}`}const l=t.x<n.x?1:-1,u=t.y<n.y?-1:1;return`L ${s},${o+r*u}Q ${s},${o} ${s+r*l},${o}`}function vw({sourceX:t,sourceY:e,sourcePosition:n=_e.Bottom,targetX:i,targetY:r,targetPosition:s=_e.Top,borderRadius:o=5,centerX:l,centerY:u,offset:f=20,stepPosition:h=.5}){const[p,g,O,v,x]=ene({source:{x:t,y:e},sourcePosition:n,target:{x:i,y:r},targetPosition:s,center:{x:l,y:u},offset:f,stepPosition:h});let S=`M${p[0].x} ${p[0].y}`;for(let k=1;k<p.length-1;k++)S+=tne(p[k-1],p[k],p[k+1],o);return S+=`L${p[p.length-1].x} ${p[p.length-1].y}`,[S,g,O,v,x]}function TQ(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function nne(t){const{sourceNode:e,targetNode:n}=t;if(!TQ(e)||!TQ(n))return null;const i=e.internals.handleBounds||CQ(e.handles),r=n.internals.handleBounds||CQ(n.handles),s=$Q(i?.source??[],t.sourceHandle),o=$Q(t.connectionMode===Qc.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),t.targetHandle);if(!s||!o)return t.onError?.("008",Ji.error008(s?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const l=s?.position||_e.Bottom,u=o?.position||_e.Top,f=$a(e,s,l),h=$a(n,o,u);return{sourceX:f.x,sourceY:f.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:u}}function CQ(t){if(!t)return null;const e=[],n=[];for(const i of t)i.width=i.width??1,i.height=i.height??1,i.type==="source"?e.push(i):i.type==="target"&&n.push(i);return{source:e,target:n}}function $a(t,e,n=_e.Left,i=!1){const r=(e?.x??0)+t.internals.positionAbsolute.x,s=(e?.y??0)+t.internals.positionAbsolute.y,{width:o,height:l}=e??sr(t);if(i)return{x:r+o/2,y:s+l/2};switch(e?.position??n){case _e.Top:return{x:r+o/2,y:s};case _e.Right:return{x:r+o,y:s+l/2};case _e.Bottom:return{x:r+o/2,y:s+l};case _e.Left:return{x:r,y:s+l/2}}}function $Q(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function bw(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("&")}`:""}function ine(t,{id:e,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return t.reduce((o,l)=>([l.markerStart||i,l.markerEnd||r].forEach(u=>{if(u&&typeof u=="object"){const f=bw(u,e);s.has(f)||(o.push({id:f,color:u.color||n,...u}),s.add(f))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const xD=1e3,rne=10,yS={nodeOrigin:[0,0],nodeExtent:md,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},sne={...yS,checkEquality:!0};function vS(t,e){const n={...t};for(const i in e)e[i]!==void 0&&(n[i]=e[i]);return n}function one(t,e,n){const i=vS(yS,n);for(const r of t.values())if(r.parentId)xS(r,t,e,i);else{const s=Bd(r,i.nodeOrigin),o=Ca(r.extent)?r.extent:i.nodeExtent,l=Ta(s,o,sr(r));r.internals.positionAbsolute=l}}function ane(t,e){if(!t.handles)return t.measured?e?.internals.handleBounds:void 0;const n=[],i=[];for(const r of t.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:t.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(s):r.type==="target"&&i.push(s)}return{source:n,target:i}}function bS(t){return t==="manual"}function xw(t,e,n,i={}){const r=vS(sne,i),s={i:0},o=new Map(e),l=r?.elevateNodesOnSelect&&!bS(r.zIndexMode)?xD:0;let u=t.length>0,f=!1;e.clear(),n.clear();for(const h of t){let p=o.get(h.id);if(r.checkEquality&&h===p?.internals.userNode)e.set(h.id,p);else{const g=Bd(h,r.nodeOrigin),O=Ca(h.extent)?h.extent:r.nodeExtent,v=Ta(g,O,sr(h));p={...r.defaults,...h,measured:{width:h.measured?.width,height:h.measured?.height},internals:{positionAbsolute:v,handleBounds:ane(h,p),z:wD(h,l,r.zIndexMode),userNode:h}},e.set(h.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(u=!1),h.parentId&&xS(p,e,n,i,s),f||=h.selected??!1}return{nodesInitialized:u,hasSelectedNodes:f}}function lne(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function xS(t,e,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:l,zIndexMode:u}=vS(yS,i),f=t.parentId,h=e.get(f);if(!h){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}lne(t,n),r&&!h.parentId&&h.internals.rootParentIndex===void 0&&u==="auto"&&(h.internals.rootParentIndex=++r.i,h.internals.z=h.internals.z+r.i*rne),r&&h.internals.rootParentIndex!==void 0&&(r.i=h.internals.rootParentIndex);const p=s&&!bS(u)?xD:0,{x:g,y:O,z:v}=cne(t,h,o,l,p,u),{positionAbsolute:x}=t.internals,S=g!==x.x||O!==x.y;(S||v!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:S?{x:g,y:O}:x,z:v}})}function wD(t,e,n){const i=Fi(t.zIndex)?t.zIndex:0;return bS(n)?i:i+(t.selected?e:0)}function cne(t,e,n,i,r,s){const{x:o,y:l}=e.internals.positionAbsolute,u=sr(t),f=Bd(t,n),h=Ca(t.extent)?Ta(f,t.extent,u):f;let p=Ta({x:o+h.x,y:l+h.y},i,u);t.extent==="parent"&&(p=lD(p,u,e));const g=wD(t,r,s),O=e.internals.z??0;return{x:p.x,y:p.y,z:O>=g?O+1:g}}function wS(t,e,n,i=[0,0]){const r=[],s=new Map;for(const o of t){const l=e.get(o.parentId);if(!l)continue;const u=s.get(o.parentId)?.expandedRect??vd(l),f=cD(u,o.rect);s.set(o.parentId,{expandedRect:f,parent:l})}return s.size>0&&s.forEach(({expandedRect:o,parent:l},u)=>{const f=l.internals.positionAbsolute,h=sr(l),p=l.origin??i,g=o.x<f.x?Math.round(Math.abs(f.x-o.x)):0,O=o.y<f.y?Math.round(Math.abs(f.y-o.y)):0,v=Math.max(h.width,Math.round(o.width)),x=Math.max(h.height,Math.round(o.height)),S=(v-h.width)*p[0],k=(x-h.height)*p[1];(g>0||O>0||S||k)&&(r.push({id:u,type:"position",position:{x:l.position.x-g+S,y:l.position.y-O+k}}),n.get(u)?.forEach($=>{t.some(E=>E.id===$.id)||r.push({id:$.id,type:"position",position:{x:$.position.x+g,y:$.position.y+O}})})),(h.width<o.width||h.height<o.height||g||O)&&r.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:v+(g?p[0]*g-S:0),height:x+(O?p[1]*O-k:0)}})}),r}function une(t,e,n,i,r,s,o){const l=i?.querySelector(".xyflow__viewport");let u=!1;if(!l)return{changes:[],updatedInternals:u};const f=[],h=window.getComputedStyle(l),{m22:p}=new window.DOMMatrixReadOnly(h.transform),g=[];for(const O of t.values()){const v=e.get(O.id);if(!v)continue;if(v.hidden){e.set(v.id,{...v,internals:{...v.internals,handleBounds:void 0}}),u=!0;continue}const x=OS(O.nodeElement),S=v.measured.width!==x.width||v.measured.height!==x.height;if(!!(x.width&&x.height&&(S||!v.internals.handleBounds||O.force))){const $=O.nodeElement.getBoundingClientRect(),E=Ca(v.extent)?v.extent:s;let{positionAbsolute:T}=v.internals;if(v.parentId&&v.extent==="parent"){const Q=e.get(v.parentId);Q&&(T=lD(T,x,Q))}else E&&(T=Ta(T,E,x));const _={...v,measured:x,internals:{...v.internals,positionAbsolute:T,handleBounds:{source:wQ("source",O.nodeElement,$,p,v.id),target:wQ("target",O.nodeElement,$,p,v.id)}}};e.set(v.id,_),v.parentId&&xS(_,e,n,{nodeOrigin:r,zIndexMode:o}),u=!0,S&&(f.push({id:v.id,type:"dimensions",dimensions:x}),v.expandParent&&v.parentId&&g.push({id:v.id,parentId:v.parentId,rect:vd(_,r)}))}}if(g.length>0){const O=wS(g,e,n,r);f.push(...O)}return{changes:f,updatedInternals:u}}async function fne({delta:t,panZoom:e,transform:n,translateExtent:i,width:r,height:s}){if(!e||!t.x&&!t.y)return!1;const o=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[r,s]],i);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function _Q(t,e,n,i,r,s){let o=r;const l=i.get(o)||new Map;i.set(o,l.set(n,e)),o=`${r}-${t}`;const u=i.get(o)||new Map;if(i.set(o,u.set(n,e)),s){o=`${r}-${t}-${s}`;const f=i.get(o)||new Map;i.set(o,f.set(n,e))}}function SD(t,e,n){t.clear(),e.clear();for(const i of n){const{source:r,target:s,sourceHandle:o=null,targetHandle:l=null}=i,u={edgeId:i.id,source:r,target:s,sourceHandle:o,targetHandle:l},f=`${r}-${o}--${s}-${l}`,h=`${s}-${l}--${r}-${o}`;_Q("source",u,h,t,r,o),_Q("target",u,f,t,s,l),e.set(i.id,i)}}function kD(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:kD(n,e):!1}function QQ(t,e,n){let i=t;do{if(i?.matches?.(e))return!0;if(i===n)return!1;i=i?.parentElement}while(i);return!1}function dne(t,e,n,i){const r=new Map;for(const[s,o]of t)if((o.selected||o.id===i)&&(!o.parentId||!kD(o,t))&&(o.draggable||e&&typeof o.draggable>"u")){const l=t.get(s);l&&r.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function pb({nodeId:t,dragItems:e,nodeLookup:n,dragging:i=!0}){const r=[];for(const[o,l]of e){const u=n.get(o)?.internals.userNode;u&&r.push({...u,position:l.position,dragging:i})}if(!t)return[r[0],r];const s=n.get(t)?.internals.userNode;return[s?{...s,position:e.get(t)?.position||s.position,dragging:i}:r[0],r]}function hne({dragItems:t,snapGrid:e,x:n,y:i}){const r=t.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},o=Gd(s,e);return{x:o.x-s.x,y:o.y-s.y}}function pne({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},o=0,l=new Map,u=!1,f={x:0,y:0},h=null,p=!1,g=null,O=!1,v=!1,x=null;function S({noDragClassName:$,handleSelector:E,domNode:T,isSelectable:_,nodeId:Q,nodeClickDistance:N=0}){g=si(T);function R({x:Z,y:F}){const{nodeLookup:M,nodeExtent:B,snapGrid:L,snapToGrid:I,nodeOrigin:U,onNodeDrag:V,onSelectionDrag:te,onError:P,updateNodePositions:j}=e();s={x:Z,y:F};let Y=!1;const G=l.size>1,J=G&&B?yw(Id(l)):null,ne=G&&I?hne({dragItems:l,snapGrid:L,x:Z,y:F}):null;for(const[le,H]of l){if(!M.has(le))continue;let ce={x:Z-H.distance.x,y:F-H.distance.y};I&&(ce=ne?{x:Math.round(ce.x+ne.x),y:Math.round(ce.y+ne.y)}:Gd(ce,L));let be=null;if(G&&B&&!H.extent&&J){const{positionAbsolute:ve}=H.internals,Ee=ve.x-J.x+B[0][0],Xe=ve.x+H.measured.width-J.x2+B[1][0],Je=ve.y-J.y+B[0][1],Nt=ve.y+H.measured.height-J.y2+B[1][1];be=[[Ee,Je],[Xe,Nt]]}const{position:Se,positionAbsolute:he}=aD({nodeId:le,nextPosition:ce,nodeLookup:M,nodeExtent:be||B,nodeOrigin:U,onError:P});Y=Y||H.position.x!==Se.x||H.position.y!==Se.y,H.position=Se,H.internals.positionAbsolute=he}if(v=v||Y,!!Y&&(j(l,!0),x&&(i||V||!Q&&te))){const[le,H]=pb({nodeId:Q,dragItems:l,nodeLookup:M});i?.(x,l,le,H),V?.(x,le,H),Q||te?.(x,H)}}async function X(){if(!h)return;const{transform:Z,panBy:F,autoPanSpeed:M,autoPanOnNodeDrag:B}=e();if(!B){u=!1,cancelAnimationFrame(o);return}const[L,I]=gS(f,h,M);(L!==0||I!==0)&&(s.x=(s.x??0)-L/Z[2],s.y=(s.y??0)-I/Z[2],await F({x:L,y:I})&&R(s)),o=requestAnimationFrame(X)}function q(Z){const{nodeLookup:F,multiSelectionActive:M,nodesDraggable:B,transform:L,snapGrid:I,snapToGrid:U,selectNodesOnDrag:V,onNodeDragStart:te,onSelectionDragStart:P,unselectNodesAndEdges:j}=e();p=!0,(!V||!_)&&!M&&Q&&(F.get(Q)?.selected||j()),_&&V&&Q&&t?.(Q);const Y=Yf(Z.sourceEvent,{transform:L,snapGrid:I,snapToGrid:U,containerBounds:h});if(s=Y,l=dne(F,B,Y,Q),l.size>0&&(n||te||!Q&&P)){const[G,J]=pb({nodeId:Q,dragItems:l,nodeLookup:F});n?.(Z.sourceEvent,l,G,J),te?.(Z.sourceEvent,G,J),Q||P?.(Z.sourceEvent,J)}}const z=XL().clickDistance(N).on("start",Z=>{const{domNode:F,nodeDragThreshold:M,transform:B,snapGrid:L,snapToGrid:I}=e();h=F?.getBoundingClientRect()||null,O=!1,v=!1,x=Z.sourceEvent,M===0&&q(Z),s=Yf(Z.sourceEvent,{transform:B,snapGrid:L,snapToGrid:I,containerBounds:h}),f=Hi(Z.sourceEvent,h)}).on("drag",Z=>{const{autoPanOnNodeDrag:F,transform:M,snapGrid:B,snapToGrid:L,nodeDragThreshold:I,nodeLookup:U}=e(),V=Yf(Z.sourceEvent,{transform:M,snapGrid:B,snapToGrid:L,containerBounds:h});if(x=Z.sourceEvent,(Z.sourceEvent.type==="touchmove"&&Z.sourceEvent.touches.length>1||Q&&!U.has(Q))&&(O=!0),!O){if(!u&&F&&p&&(u=!0,X()),!p){const te=Hi(Z.sourceEvent,h),P=te.x-f.x,j=te.y-f.y;Math.sqrt(P*P+j*j)>I&&q(Z)}(s.x!==V.xSnapped||s.y!==V.ySnapped)&&l&&p&&(f=Hi(Z.sourceEvent,h),R(V))}}).on("end",Z=>{if(!p||O){O&&l.size>0&&e().updateNodePositions(l,!1);return}if(u=!1,p=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:F,updateNodePositions:M,onNodeDragStop:B,onSelectionDragStop:L}=e();if(v&&(M(l,!1),v=!1),r||B||!Q&&L){const[I,U]=pb({nodeId:Q,dragItems:l,nodeLookup:F,dragging:!1});r?.(Z.sourceEvent,l,I,U),B?.(Z.sourceEvent,I,U),Q||L?.(Z.sourceEvent,U)}}}).filter(Z=>{const F=Z.target;return!Z.button&&(!$||!QQ(F,`.${$}`,T))&&(!E||QQ(F,E,T))});g.call(z)}function k(){g?.on(".drag",null)}return{update:S,destroy:k}}function gne(t,e,n){const i=[],r={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const s of e.values())Nm(r,vd(s))>0&&i.push(s);return i}const mne=250;function One(t,e,n,i){let r=[],s=1/0;const o=gne(t,n,e+mne);for(const l of o){const u=[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]];for(const f of u){if(i.nodeId===f.nodeId&&i.type===f.type&&i.id===f.id)continue;const{x:h,y:p}=$a(l,f,f.position,!0),g=Math.sqrt(Math.pow(h-t.x,2)+Math.pow(p-t.y,2));g>e||(g<s?(r=[{...f,x:h,y:p}],s=g):g===s&&r.push({...f,x:h,y:p}))}}if(!r.length)return null;if(r.length>1){const l=i.type==="source"?"target":"source";return r.find(u=>u.type===l)??r[0]}return r[0]}function ED(t,e,n,i,r,s=!1){const o=i.get(t);if(!o)return null;const l=r==="strict"?o.internals.handleBounds?.[e]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],u=(n?l?.find(f=>f.id===n):l?.[0])??null;return u&&s?{...u,...$a(o,u,u.position,!0)}:u}function TD(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function yne(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const CD=()=>!0;function vne(t,{connectionMode:e,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:o,domNode:l,nodeLookup:u,lib:f,autoPanOnConnect:h,flowId:p,panBy:g,cancelConnection:O,onConnectStart:v,onConnect:x,onConnectEnd:S,isValidConnection:k=CD,onReconnectEnd:$,updateConnection:E,getTransform:T,getFromHandle:_,autoPanSpeed:Q,dragThreshold:N=1,handleDomNode:R}){const X=pD(t.target);let q=0,z;const{x:Z,y:F}=Hi(t),M=TD(s,R),B=l?.getBoundingClientRect();let L=!1;if(!B||!M)return;const I=ED(r,M,i,u,e);if(!I)return;let U=Hi(t,B),V=!1,te=null,P=!1,j=null;function Y(){if(!h||!B)return;const[Se,he]=gS(U,B,Q);g({x:Se,y:he}),q=requestAnimationFrame(Y)}const G={...I,nodeId:r,type:M,position:I.position},J=u.get(r);let le={inProgress:!0,isValid:null,from:$a(J,G,_e.Left,!0),fromHandle:G,fromPosition:G.position,fromNode:J,to:U,toHandle:null,toPosition:yQ[G.position],toNode:null,pointer:U};function H(){L=!0,E(le),v?.(t,{nodeId:r,handleId:i,handleType:M})}N===0&&H();function ce(Se){if(!L){const{x:Nt,y:ai}=Hi(Se),Cn=Nt-Z,$n=ai-F;if(!(Cn*Cn+$n*$n>N*N))return;H()}if(!_()||!G){be(Se);return}const he=T();U=Hi(Se,B),z=One(Vd(U,he,!1,[1,1]),n,u,G),V||(Y(),V=!0);const ve=$D(Se,{handle:z,connectionMode:e,fromNodeId:r,fromHandleId:i,fromType:o?"target":"source",isValidConnection:k,doc:X,lib:f,flowId:p,nodeLookup:u});j=ve.handleDomNode,te=ve.connection,P=yne(!!z,ve.isValid);const Ee=u.get(r),Xe=Ee?$a(Ee,G,_e.Left,!0):le.from,Je={...le,from:Xe,isValid:P,to:ve.toHandle&&P?Nc({x:ve.toHandle.x,y:ve.toHandle.y},he):U,toHandle:ve.toHandle,toPosition:P&&ve.toHandle?ve.toHandle.position:yQ[G.position],toNode:ve.toHandle?u.get(ve.toHandle.nodeId):null,pointer:U};E(Je),le=Je}function be(Se){if(!("touches"in Se&&Se.touches.length>0)){if(L){(z||j)&&te&&P&&x?.(te);const{inProgress:he,...ve}=le,Ee={...ve,toPosition:le.toHandle?le.toPosition:null};S?.(Se,Ee),s&&$?.(Se,Ee)}O(),cancelAnimationFrame(q),V=!1,P=!1,te=null,j=null,X.removeEventListener("mousemove",ce),X.removeEventListener("mouseup",be),X.removeEventListener("touchmove",ce),X.removeEventListener("touchend",be)}}X.addEventListener("mousemove",ce),X.addEventListener("mouseup",be),X.addEventListener("touchmove",ce),X.addEventListener("touchend",be)}function $D(t,{handle:e,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:o,lib:l,flowId:u,isValidConnection:f=CD,nodeLookup:h}){const p=s==="target",g=e?o.querySelector(`.${l}-flow__handle[data-id="${u}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x:O,y:v}=Hi(t),x=o.elementFromPoint(O,v),S=x?.classList.contains(`${l}-flow__handle`)?x:g,k={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const $=TD(void 0,S),E=S.getAttribute("data-nodeid"),T=S.getAttribute("data-handleid"),_=S.classList.contains("connectable"),Q=S.classList.contains("connectableend");if(!E||!$)return k;const N={source:p?E:i,sourceHandle:p?T:r,target:p?i:E,targetHandle:p?r:T};k.connection=N;const X=_&&Q&&(n===Qc.Strict?p&&$==="source"||!p&&$==="target":E!==i||T!==r);k.isValid=X&&f(N),k.toHandle=ED(E,$,T,h,n,!0)}return k}const ww={onPointerDown:vne,isValid:$D};function bne({domNode:t,panZoom:e,getTransform:n,getViewScale:i}){const r=si(t);function s({translateExtent:l,width:u,height:f,zoomStep:h=1,pannable:p=!0,zoomable:g=!0,inversePan:O=!1}){const v=E=>{if(E.sourceEvent.type!=="wheel"||!e)return;const T=n(),_=E.sourceEvent.ctrlKey&&bd()?10:1,Q=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*h,N=T[2]*Math.pow(2,Q*_);e.scaleTo(N)};let x=[0,0];const S=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(x=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},k=E=>{const T=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!e)return;const _=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],Q=[_[0]-x[0],_[1]-x[1]];x=_;const N=i()*Math.max(T[2],Math.log(T[2]))*(O?-1:1),R={x:T[0]-Q[0]*N,y:T[1]-Q[1]*N},X=[[0,0],[u,f]];e.setViewportConstrained({x:R.x,y:R.y,zoom:T[2]},X,l)},$=tD().on("start",S).on("zoom",p?k:null).on("zoom.wheel",g?v:null);r.call($,{})}function o(){r.on("zoom",null)}return{update:s,destroy:o,pointer:Ii}}const EO=t=>({x:t.x,y:t.y,zoom:t.k}),gb=({x:t,y:e,zoom:n})=>wO.translate(t,e).scale(n),po=(t,e)=>t.target.closest(`.${e}`),_D=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),xne=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,mb=(t,e=0,n=xne,i=()=>{})=>{const r=typeof e=="number"&&e>0;return r||i(),r?t.transition().duration(e).ease(n).on("end",i):t},QD=t=>{const e=t.ctrlKey&&bd()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function wne({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:f}){return h=>{if(po(h,e))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(h.ctrlKey&&o){const S=Ii(h),k=QD(h),$=p*Math.pow(2,k);i.scaleTo(n,$,S,h);return}const g=h.deltaMode===1?20:1;let O=r===ga.Vertical?0:h.deltaX*g,v=r===ga.Horizontal?0:h.deltaY*g;!bd()&&h.shiftKey&&r!==ga.Vertical&&(O=h.deltaY*g,v=0),i.translateBy(n,-(O/p)*s,-(v/p)*s,{internal:!0});const x=EO(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?u?.(h,x):(t.isPanScrolling=!0,l?.(h,x)),t.panScrollTimeout=setTimeout(()=>{f?.(h,x),t.isPanScrolling=!1},150)}}function Sne({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",o=!e&&s&&!i.ctrlKey,l=po(i,t);if(i.ctrlKey&&s&&l&&i.preventDefault(),o||l)return null;i.preventDefault(),n.call(this,i,r)}}function kne({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return i=>{if(i.sourceEvent?.internal)return;const r=EO(i.transform);t.mouseButton=i.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=r,i.sourceEvent?.type==="mousedown"&&e(!0),n&&n?.(i.sourceEvent,r)}}function Ene({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{t.usedRightMouseButton=!!(n&&_D(e,t.mouseButton??0)),s.sourceEvent?.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!s.sourceEvent?.internal&&r?.(s.sourceEvent,EO(s.transform))}}function Tne({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return o=>{if(!o.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,s&&_D(e,t.mouseButton??0)&&!t.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),t.usedRightMouseButton=!1,i(!1),r)){const l=EO(o.transform);t.prevViewport=l,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{r?.(o.sourceEvent,l)},n?150:0)}}}function Cne({panActivationKeyPressed:t,zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:i,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:l,noWheelClassName:u,noPanClassName:f,lib:h,connectionInProgress:p}){return g=>{const O=e||n,v=i&&g.ctrlKey,x=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(po(g,`${h}-flow__node`)||po(g,`${h}-flow__edge`)||po(g,`${h}-flow__selection`)||po(g,`${h}-flow__nodesselection`)))return!0;if(!r&&!O&&!s&&!o&&!i||l||p&&!x||po(g,u)&&x||po(g,f)&&(!x||s&&x&&!e)||!i&&g.ctrlKey&&x)return!1;if(!i&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!O&&!s&&!v&&x||!r&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(r)&&!r.includes(g.button)&&g.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||x||t)&&S}}function $ne({domNode:t,minZoom:e,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:u}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=t.getBoundingClientRect();let p=[[0,0],[h.width,h.height]];(typeof ResizeObserver<"u"?new ResizeObserver(F=>{const M=F[0];M&&(p=[[0,0],[M.contentRect.width,M.contentRect.height]])}):null)?.observe(t);const O=tD().extent(()=>p).scaleExtent([e,n]).translateExtent(i),v=si(t).call(O);T({x:r.x,y:r.y,zoom:Ac(r.zoom,e,n)},[[0,0],[h.width,h.height]],i);const x=v.on("wheel.zoom"),S=v.on("dblclick.zoom");O.wheelDelta(QD);async function k(F,M){return v?new Promise(B=>{O?.interpolate(M?.interpolate==="linear"?Uf:Pg).transform(mb(v,M?.duration,M?.ease,()=>B(!0)),F)}):!1}function $({noWheelClassName:F,noPanClassName:M,onPaneContextMenu:B,userSelectionActive:L,panOnScroll:I,panOnDrag:U,panOnScrollMode:V,panOnScrollSpeed:te,preventScrolling:P,zoomOnPinch:j,zoomOnScroll:Y,zoomOnDoubleClick:G,panActivationKeyPressed:J=!1,zoomActivationKeyPressed:ne,lib:le,onTransformChange:H,connectionInProgress:ce,paneClickDistance:be,selectionOnDrag:Se}){L&&!f.isZoomingOrPanning&&E();const he=I&&!ne&&!L;O.clickDistance(Se?1/0:!Fi(be)||be<0?0:be);const ve=he?wne({zoomPanValues:f,noWheelClassName:F,d3Selection:v,d3Zoom:O,panOnScrollMode:V,panOnScrollSpeed:te,zoomOnPinch:j,onPanZoomStart:o,onPanZoom:s,onPanZoomEnd:l}):Sne({noWheelClassName:F,preventScrolling:P,d3ZoomHandler:x});v.on("wheel.zoom",ve,{passive:!1});const Ee=kne({zoomPanValues:f,onDraggingChange:u,onPanZoomStart:o});O.on("start",Ee);const Xe=Ene({zoomPanValues:f,panOnDrag:U,onPaneContextMenu:!!B,onPanZoom:s,onTransformChange:H});O.on("zoom",Xe);const Je=Tne({zoomPanValues:f,panOnDrag:U,panOnScroll:I,onPaneContextMenu:B,onPanZoomEnd:l,onDraggingChange:u});O.on("end",Je);const Nt=Cne({panActivationKeyPressed:J,zoomActivationKeyPressed:ne,panOnDrag:U,zoomOnScroll:Y,panOnScroll:I,zoomOnDoubleClick:G,zoomOnPinch:j,userSelectionActive:L,noPanClassName:M,noWheelClassName:F,lib:le,connectionInProgress:ce});O.filter(Nt),G?v.on("dblclick.zoom",S):v.on("dblclick.zoom",null)}function E(){O.on("zoom",null)}async function T(F,M,B){const L=gb(F),I=O?.constrain()(L,M,B);return I&&await k(I),I}async function _(F,M){const B=gb(F);return await k(B,M),B}function Q(F){if(v){const M=gb(F),B=v.property("__zoom");(B.k!==F.zoom||B.x!==F.x||B.y!==F.y)&&O?.transform(v,M,null,{sync:!0})}}function N(){const F=v?eD(v.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}async function R(F,M){return v?new Promise(B=>{O?.interpolate(M?.interpolate==="linear"?Uf:Pg).scaleTo(mb(v,M?.duration,M?.ease,()=>B(!0)),F)}):!1}async function X(F,M){return v?new Promise(B=>{O?.interpolate(M?.interpolate==="linear"?Uf:Pg).scaleBy(mb(v,M?.duration,M?.ease,()=>B(!0)),F)}):!1}function q(F){O?.scaleExtent(F)}function z(F){O?.translateExtent(F)}function Z(F){const M=!Fi(F)||F<0?0:F;O?.clickDistance(M)}return{update:$,destroy:E,setViewport:_,setViewportConstrained:T,getViewport:N,scaleTo:R,scaleBy:X,setScaleExtent:q,setTranslateExtent:z,syncViewport:Q,setClickDistance:Z}}var Pc;(function(t){t.Line="line",t.Handle="handle"})(Pc||(Pc={}));function _ne({width:t,prevWidth:e,height:n,prevHeight:i,affectsX:r,affectsY:s}){const o=t-e,l=n-i,u=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&r&&(u[0]=u[0]*-1),l&&s&&(u[1]=u[1]*-1),u}function AQ(t){const e=t.includes("right")||t.includes("left"),n=t.includes("bottom")||t.includes("top"),i=t.includes("left"),r=t.includes("top");return{isHorizontal:e,isVertical:n,affectsX:i,affectsY:r}}function lo(t,e){return Math.max(0,e-t)}function co(t,e){return Math.max(0,t-e)}function rg(t,e,n){return Math.max(0,e-t,t-n)}function NQ(t,e){return t?!e:e}function Qne(t,e,n,i,r,s,o,l){let{affectsX:u,affectsY:f}=e;const{isHorizontal:h,isVertical:p}=e,g=h&&p,{xSnapped:O,ySnapped:v}=n,{minWidth:x,maxWidth:S,minHeight:k,maxHeight:$}=i,{x:E,y:T,width:_,height:Q,aspectRatio:N}=t;let R=Math.floor(h?O-t.pointerX:0),X=Math.floor(p?v-t.pointerY:0);const q=_+(u?-R:R),z=Q+(f?-X:X),Z=-s[0]*_,F=-s[1]*Q;let M=rg(q,x,S),B=rg(z,k,$);if(o){let U=0,V=0;u&&R<0?U=lo(E+R+Z,o[0][0]):!u&&R>0&&(U=co(E+q+Z,o[1][0])),f&&X<0?V=lo(T+X+F,o[0][1]):!f&&X>0&&(V=co(T+z+F,o[1][1])),M=Math.max(M,U),B=Math.max(B,V)}if(l){let U=0,V=0;u&&R>0?U=co(E+R,l[0][0]):!u&&R<0&&(U=lo(E+q,l[1][0])),f&&X>0?V=co(T+X,l[0][1]):!f&&X<0&&(V=lo(T+z,l[1][1])),M=Math.max(M,U),B=Math.max(B,V)}if(r){if(h){const U=rg(q/N,k,$)*N;if(M=Math.max(M,U),o){let V=0;!u&&!f||u&&!f&&g?V=co(T+F+q/N,o[1][1])*N:V=lo(T+F+(u?R:-R)/N,o[0][1])*N,M=Math.max(M,V)}if(l){let V=0;!u&&!f||u&&!f&&g?V=lo(T+q/N,l[1][1])*N:V=co(T+(u?R:-R)/N,l[0][1])*N,M=Math.max(M,V)}}if(p){const U=rg(z*N,x,S)/N;if(B=Math.max(B,U),o){let V=0;!u&&!f||f&&!u&&g?V=co(E+z*N+Z,o[1][0])/N:V=lo(E+(f?X:-X)*N+Z,o[0][0])/N,B=Math.max(B,V)}if(l){let V=0;!u&&!f||f&&!u&&g?V=lo(E+z*N,l[1][0])/N:V=co(E+(f?X:-X)*N,l[0][0])/N,B=Math.max(B,V)}}}X=X+(X<0?B:-B),R=R+(R<0?M:-M),r&&(g?q>z*N?X=(NQ(u,f)?-R:R)/N:R=(NQ(u,f)?-X:X)*N:h?(X=R/N,f=u):(R=X*N,u=f));const L=u?E+R:E,I=f?T+X:T;return{width:_+(u?-R:R),height:Q+(f?-X:X),x:s[0]*R*(u?-1:1)+L,y:s[1]*X*(f?-1:1)+I}}const AD={width:0,height:0,x:0,y:0},Ane={...AD,pointerX:0,pointerY:0,aspectRatio:1};function Nne(t,e,n){const i=e.position.x+t.position.x,r=e.position.y+t.position.y,s=t.measured.width??0,o=t.measured.height??0,l=n[0]*s,u=n[1]*o;return[[i-l,r-u],[i+s-l,r+o-u]]}function Pne({domNode:t,nodeId:e,getStoreItems:n,onChange:i,onEnd:r}){const s=si(t);let o={controlDirection:AQ("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:f,boundaries:h,keepAspectRatio:p,resizeDirection:g,onResizeStart:O,onResize:v,onResizeEnd:x,shouldResize:S}){let k={...AD},$={...Ane};o={boundaries:h,resizeDirection:g,keepAspectRatio:p,controlDirection:AQ(f)};let E,T=null,_=[],Q,N,R,X=!1;const q=XL().on("start",z=>{const{nodeLookup:Z,transform:F,snapGrid:M,snapToGrid:B,nodeOrigin:L,paneDomNode:I}=n();if(E=Z.get(e),!E)return;T=I?.getBoundingClientRect()??null;const{xSnapped:U,ySnapped:V}=Yf(z.sourceEvent,{transform:F,snapGrid:M,snapToGrid:B,containerBounds:T});k={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},$={...k,pointerX:U,pointerY:V,aspectRatio:k.width/k.height},Q=void 0,N=Ca(E.extent)?E.extent:void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(Q=Z.get(E.parentId)),Q&&E.extent==="parent"&&(N=[[0,0],[Q.measured.width,Q.measured.height]]),_=[],R=void 0;for(const[te,P]of Z)if(P.parentId===e&&(_.push({id:te,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const j=Nne(P,E,P.origin??L);R?R=[[Math.min(j[0][0],R[0][0]),Math.min(j[0][1],R[0][1])],[Math.max(j[1][0],R[1][0]),Math.max(j[1][1],R[1][1])]]:R=j}O?.(z,{...k})}).on("drag",z=>{const{transform:Z,snapGrid:F,snapToGrid:M,nodeOrigin:B}=n(),L=Yf(z.sourceEvent,{transform:Z,snapGrid:F,snapToGrid:M,containerBounds:T}),I=[];if(!E)return;const{x:U,y:V,width:te,height:P}=k,j={},Y=E.origin??B,{width:G,height:J,x:ne,y:le}=Qne($,o.controlDirection,L,o.boundaries,o.keepAspectRatio,Y,N,R),H=G!==te,ce=J!==P,be=ne!==U&&H,Se=le!==V&&ce;if(!be&&!Se&&!H&&!ce)return;if((be||Se||Y[0]===1||Y[1]===1)&&(j.x=be?ne:k.x,j.y=Se?le:k.y,k.x=j.x,k.y=j.y,_.length>0)){const Xe=ne-U,Je=le-V;for(const Nt of _)Nt.position={x:Nt.position.x-Xe+Y[0]*(G-te),y:Nt.position.y-Je+Y[1]*(J-P)},I.push(Nt)}if((H||ce)&&(j.width=H&&(!o.resizeDirection||o.resizeDirection==="horizontal")?G:k.width,j.height=ce&&(!o.resizeDirection||o.resizeDirection==="vertical")?J:k.height,k.width=j.width,k.height=j.height),Q&&E.expandParent){const Xe=Y[0]*(j.width??0);j.x&&j.x<Xe&&(k.x=Xe,$.x=$.x-(j.x-Xe));const Je=Y[1]*(j.height??0);j.y&&j.y<Je&&(k.y=Je,$.y=$.y-(j.y-Je))}const he=_ne({width:k.width,prevWidth:te,height:k.height,prevHeight:P,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),ve={...k,direction:he};S?.(z,ve)!==!1&&(X=!0,v?.(z,ve),i(j,I))}).on("end",z=>{X&&(x?.(z,{...k}),r?.({...k}),X=!1)});s.call(q)}function u(){s.on(".drag",null)}return{update:l,destroy:u}}var Ob={exports:{}},yb={},vb={exports:{}},bb={};/**
 * @license React
 * use-sync-external-store-shim.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 PQ;function Rne(){if(PQ)return bb;PQ=1;var t=kd();function e(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:e,i=t.useState,r=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue;function l(p,g){var O=g(),v=i({inst:{value:O,getSnapshot:g}}),x=v[0].inst,S=v[1];return s(function(){x.value=O,x.getSnapshot=g,u(x)&&S({inst:x})},[p,O,g]),r(function(){return u(x)&&S({inst:x}),p(function(){u(x)&&S({inst:x})})},[p]),o(O),O}function u(p){var g=p.getSnapshot;p=p.value;try{var O=g();return!n(p,O)}catch{return!0}}function f(p,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:l;return bb.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,bb}var RQ;function jne(){return RQ||(RQ=1,vb.exports=Rne()),vb.exports}/**
 * @license React
 * use-sync-external-store-shim/with-selector.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 jQ;function Mne(){if(jQ)return yb;jQ=1;var t=kd(),e=jne();function n(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var i=typeof Object.is=="function"?Object.is:n,r=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,l=t.useMemo,u=t.useDebugValue;return yb.useSyncExternalStoreWithSelector=function(f,h,p,g,O){var v=s(null);if(v.current===null){var x={hasValue:!1,value:null};v.current=x}else x=v.current;v=l(function(){function k(Q){if(!$){if($=!0,E=Q,Q=g(Q),O!==void 0&&x.hasValue){var N=x.value;if(O(N,Q))return T=N}return T=Q}if(N=T,i(E,Q))return N;var R=g(Q);return O!==void 0&&O(N,R)?(E=Q,N):(E=Q,T=R)}var $=!1,E,T,_=p===void 0?null:p;return[function(){return k(h())},_===null?void 0:function(){return k(_())}]},[h,p,g,O]);var S=r(f,v[0],v[1]);return o(function(){x.hasValue=!0,x.value=S},[S]),u(S),S},yb}var MQ;function Lne(){return MQ||(MQ=1,Ob.exports=Mne()),Ob.exports}var Dne=Lne();const zne=Dc(Dne),Xne={},LQ=t=>{let e;const n=new Set,i=(h,p)=>{const g=typeof h=="function"?h(e):h;if(!Object.is(g,e)){const O=e;e=p??(typeof g!="object"||g===null)?g:Object.assign({},e,g),n.forEach(v=>v(e,O))}},r=()=>e,u={setState:i,getState:r,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(Xne?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=e=t(i,r,u);return u},Zne=t=>t?LQ(t):LQ,{useDebugValue:Bne}=Bl,{useSyncExternalStoreWithSelector:Ine}=zne,Gne=t=>t;function ND(t,e=Gne,n){const i=Ine(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return Bne(i),i}const DQ=(t,e)=>{const n=Zne(t),i=(r,s=e)=>ND(n,r,s);return Object.assign(i,n),i},Vne=(t,e)=>t?DQ(t,e):DQ;function Ct(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[i,r]of t)if(!Object.is(r,e.get(i)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(e,i)||!Object.is(t[i],e[i]))return!1;return!0}var SS=tN();const TO=C.createContext(null),Une=TO.Provider,PD=Ji.error001("react");function Ue(t,e){const n=C.useContext(TO);if(n===null)throw new Error(PD);return ND(n,t,e)}function bt(){const t=C.useContext(TO);if(t===null)throw new Error(PD);return C.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const zQ={display:"none"},Yne={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},RD="react-flow__node-desc",jD="react-flow__edge-desc",qne="react-flow__aria-live",Wne=t=>t.ariaLiveMessage,Fne=t=>t.ariaLabelConfig;function Hne({rfId:t}){const e=Ue(Wne);return y.jsx("div",{id:`${qne}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:Yne,children:e})}function Kne({rfId:t,disableKeyboardA11y:e}){const n=Ue(Fne);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${RD}-${t}`,style:zQ,children:e?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${jD}-${t}`,style:zQ,children:n["edge.a11yDescription.default"]}),!e&&y.jsx(Hne,{rfId:t})]})}const CO=C.forwardRef(({position:t="top-left",children:e,className:n,style:i,...r},s)=>{const o=`${t}`.split("-");return y.jsx("div",{className:It(["react-flow__panel",n,...o]),style:i,ref:s,...r,children:e})});CO.displayName="Panel";const XQ="https://reactflow.dev?utm_source=attribution";function Jne({proOptions:t,position:e="bottom-right"}){return t?.hideAttribution?null:y.jsx(CO,{position:e,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${XQ}`,children:y.jsx("a",{href:XQ,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const eie=t=>{const e=[],n=[];for(const[,i]of t.nodeLookup)i.selected&&e.push(i.internals.userNode);for(const[,i]of t.edgeLookup)i.selected&&n.push(i);return{selectedNodes:e,selectedEdges:n}},sg=t=>t.id;function tie(t,e){return Ct(t.selectedNodes.map(sg),e.selectedNodes.map(sg))&&Ct(t.selectedEdges.map(sg),e.selectedEdges.map(sg))}function nie({onSelectionChange:t}){const e=bt(),{selectedNodes:n,selectedEdges:i}=Ue(eie,tie);return C.useEffect(()=>{const r={nodes:n,edges:i};t?.(r),e.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,i,t]),null}const iie=t=>!!t.onSelectionChangeHandlers;function rie({onSelectionChange:t}){const e=Ue(iie);return t||e?y.jsx(nie,{onSelectionChange:t}):null}const MD=[0,0],sie={x:0,y:0,zoom:1},oie=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],ZQ=[...oie,"rfId"],aie=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),BQ={translateExtent:md,nodeOrigin:MD,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function lie(t){const{setNodes:e,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:u}=Ue(aie,Ct),f=bt();C.useEffect(()=>(u(t.defaultNodes,t.defaultEdges),()=>{h.current=BQ,l()}),[]);const h=C.useRef(BQ);return C.useEffect(()=>{for(const p of ZQ){const g=t[p],O=h.current[p];g!==O&&(typeof t[p]>"u"||(p==="nodes"?e(g):p==="edges"?n(g):p==="minZoom"?i(g):p==="maxZoom"?r(g):p==="translateExtent"?s(g):p==="nodeExtent"?o(g):p==="ariaLabelConfig"?f.setState({ariaLabelConfig:Ute(g)}):p==="fitView"?f.setState({fitViewQueued:g}):p==="fitViewOptions"?f.setState({fitViewOptions:g}):f.setState({[p]:g})))}h.current=t},ZQ.map(p=>t[p])),null}function IQ(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function cie(t){const[e,n]=C.useState(t==="system"?null:t);return C.useEffect(()=>{if(t!=="system"){n(t);return}const i=IQ(),r=()=>n(i?.matches?"dark":"light");return r(),i?.addEventListener("change",r),()=>{i?.removeEventListener("change",r)}},[t]),e!==null?e:IQ()?.matches?"dark":"light"}const GQ=typeof document<"u"?document:null;function xd(t=null,e={target:GQ,actInsideInputWithModifier:!0}){const[n,i]=C.useState(!1),r=C.useRef(!1),s=C.useRef(new Set([])),[o,l]=C.useMemo(()=>{if(t!==null){const f=(Array.isArray(t)?t:[t]).filter(p=>typeof p=="string").map(p=>p.replace(/\+/g,`
`).replace(`

`,`
+`).split(`
`)),h=f.reduce((p,g)=>p.concat(...g),[]);return[f,h]}return[[],[]]},[t]);return C.useEffect(()=>{const u=e?.target??GQ,f=e?.actInsideInputWithModifier??!0;if(t!==null){const h=O=>{if(r.current=O.ctrlKey||O.metaKey||O.shiftKey||O.altKey,(!r.current||r.current&&!f)&&gD(O))return!1;const x=UQ(O.code,l);if(s.current.add(O[x]),VQ(o,s.current,!1)){const S=O.composedPath?.()?.[0]||O.target,k=S?.nodeName==="BUTTON"||S?.nodeName==="A";e.preventDefault!==!1&&(r.current||!k)&&O.preventDefault(),i(!0)}},p=O=>{const v=UQ(O.code,l);VQ(o,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(O[v]),O.key==="Meta"&&s.current.clear(),r.current=!1},g=()=>{s.current.clear(),i(!1)};return u?.addEventListener("keydown",h),u?.addEventListener("keyup",p),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u?.removeEventListener("keydown",h),u?.removeEventListener("keyup",p),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[t,i]),n}function VQ(t,e,n){return t.filter(i=>n||i.length===e.size).some(i=>i.every(r=>e.has(r)))}function UQ(t,e){return e.includes(t)?"code":"key"}const uie=()=>{const t=bt();return C.useMemo(()=>({zoomIn:async e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1.2,e):!1},zoomOut:async e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1/1.2,e):!1},zoomTo:async(e,n)=>{const{panZoom:i}=t.getState();return i?i.scaleTo(e,n):!1},getZoom:()=>t.getState().transform[2],setViewport:async(e,n)=>{const{transform:[i,r,s],panZoom:o}=t.getState();return o?(await o.setViewport({x:e.x??i,y:e.y??r,zoom:e.zoom??s},n),!0):!1},getViewport:()=>{const[e,n,i]=t.getState().transform;return{x:e,y:n,zoom:i}},setCenter:async(e,n,i)=>t.getState().setCenter(e,n,i),fitBounds:async(e,n)=>{const{width:i,height:r,minZoom:s,maxZoom:o,panZoom:l}=t.getState(),u=mS(e,i,r,s,o,n?.padding??.1);return l?(await l.setViewport(u,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(e,n={})=>{const{transform:i,snapGrid:r,snapToGrid:s,domNode:o}=t.getState();if(!o)return e;const{x:l,y:u}=o.getBoundingClientRect(),f={x:e.x-l,y:e.y-u},h=n.snapGrid??r,p=n.snapToGrid??s;return Vd(f,i,p,h)},flowToScreenPosition:e=>{const{transform:n,domNode:i}=t.getState();if(!i)return e;const{x:r,y:s}=i.getBoundingClientRect(),o=Nc(e,n);return{x:o.x+r,y:o.y+s}}}),[])};function LD(t,e){const n=[],i=new Map,r=[];for(const s of t)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const o=i.get(s.id);o?o.push(s):i.set(s.id,[s])}for(const s of e){const o=i.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...s};for(const u of o)fie(u,l);n.push(l)}return r.length&&r.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function fie(t,e){switch(t.type){case"select":{e.selected=t.selected;break}case"position":{typeof t.position<"u"&&(e.position=t.position),typeof t.dragging<"u"&&(e.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(e.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(e.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(e.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(e.resizing=t.resizing);break}}}function DD(t,e){return LD(t,e)}function die(t,e){return LD(t,e)}function Ko(t,e){return{id:t,type:"select",selected:e}}function Hl(t,e=new Set,n=!1){const i=[];for(const[r,s]of t){const o=e.has(r);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),i.push(Ko(s.id,o)))}return i}function YQ({items:t=[],lookup:e}){const n=[],i=new Map(t.map(r=>[r.id,r]));for(const[r,s]of t.entries()){const o=e.get(s.id),l=o?.internals?.userNode??o;l!==void 0&&l!==s&&n.push({id:s.id,item:s,type:"replace"}),l===void 0&&n.push({item:s,type:"add",index:r})}for(const[r]of e)i.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function qQ(t){return{id:t.id,type:"remove"}}const hie=fD();function pie(t,e,n={}){return Kte(t,e,{...n,onError:n.onError??hie})}const WQ=t=>Lte(t),gie=t=>oD(t);function zD(t){return C.forwardRef(t)}const XD=typeof window<"u"?C.useLayoutEffect:C.useEffect;function FQ(t){const[e,n]=C.useState(BigInt(0)),[i]=C.useState(()=>mie(()=>n(r=>r+BigInt(1))));return XD(()=>{const r=i.get();r.length&&(t(r),i.reset())},[e]),i}function mie(t){let e=[];return{get:()=>e,reset:()=>{e=[]},push:n=>{e.push(n),t()}}}const ZD=C.createContext(null);function Oie({children:t}){const e=bt(),n=C.useCallback(l=>{const{nodes:u=[],setNodes:f,hasDefaultNodes:h,onNodesChange:p,nodeLookup:g,fitViewQueued:O,onNodesChangeMiddlewareMap:v}=e.getState();let x=u;for(const k of l)x=typeof k=="function"?k(x):k;let S=YQ({items:x,lookup:g});for(const k of v.values())S=k(S);h&&f(x),S.length>0?p?.(S):O&&window.requestAnimationFrame(()=>{const{fitViewQueued:k,nodes:$,setNodes:E}=e.getState();k&&E($)})},[]),i=FQ(n),r=C.useCallback(l=>{const{edges:u=[],setEdges:f,hasDefaultEdges:h,onEdgesChange:p,edgeLookup:g}=e.getState();let O=u;for(const v of l)O=typeof v=="function"?v(O):v;h?f(O):p&&p(YQ({items:O,lookup:g}))},[]),s=FQ(r),o=C.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return y.jsx(ZD.Provider,{value:o,children:t})}function yie(){const t=C.useContext(ZD);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const vie=t=>!!t.panZoom;function $O(){const t=uie(),e=bt(),n=yie(),i=Ue(vie),r=C.useMemo(()=>{const s=p=>e.getState().nodeLookup.get(p),o=p=>{n.nodeQueue.push(p)},l=p=>{n.edgeQueue.push(p)},u=p=>{const{nodeLookup:g,nodeOrigin:O}=e.getState(),v=WQ(p)?p:g.get(p.id),x=v.parentId?hD(v.position,v.measured,v.parentId,g,O):v.position,S={...v,position:x,width:v.measured?.width??v.width,height:v.measured?.height??v.height};return vd(S)},f=(p,g,O={replace:!1})=>{o(v=>v.map(x=>{if(x.id===p){const S=typeof g=="function"?g(x):g;return O.replace&&WQ(S)?S:{...x,...S}}return x}))},h=(p,g,O={replace:!1})=>{l(v=>v.map(x=>{if(x.id===p){const S=typeof g=="function"?g(x):g;return O.replace&&gie(S)?S:{...x,...S}}return x}))};return{getNodes:()=>e.getState().nodes.map(p=>({...p})),getNode:p=>s(p)?.internals.userNode,getInternalNode:s,getEdges:()=>{const{edges:p=[]}=e.getState();return p.map(g=>({...g}))},getEdge:p=>e.getState().edgeLookup.get(p),setNodes:o,setEdges:l,addNodes:p=>{const g=Array.isArray(p)?p:[p];n.nodeQueue.push(O=>[...O,...g])},addEdges:p=>{const g=Array.isArray(p)?p:[p];n.edgeQueue.push(O=>[...O,...g])},toObject:()=>{const{nodes:p=[],edges:g=[],transform:O}=e.getState(),[v,x,S]=O;return{nodes:p.map(k=>({...k})),edges:g.map(k=>({...k})),viewport:{x:v,y:x,zoom:S}}},deleteElements:async({nodes:p=[],edges:g=[]})=>{const{nodes:O,edges:v,onNodesDelete:x,onEdgesDelete:S,triggerNodeChanges:k,triggerEdgeChanges:$,onDelete:E,onBeforeDelete:T}=e.getState(),{nodes:_,edges:Q}=await Bte({nodesToRemove:p,edgesToRemove:g,nodes:O,edges:v,onBeforeDelete:T}),N=Q.length>0,R=_.length>0;if(N){const X=Q.map(qQ);S?.(Q),$(X)}if(R){const X=_.map(qQ);x?.(_),k(X)}return(R||N)&&E?.({nodes:_,edges:Q}),{deletedNodes:_,deletedEdges:Q}},getIntersectingNodes:(p,g=!0,O)=>{const v=bQ(p),x=v?p:u(p),S=O!==void 0;return x?(O||e.getState().nodes).filter(k=>{const $=e.getState().nodeLookup.get(k.id);if($&&!v&&(k.id===p.id||!$.internals.positionAbsolute))return!1;const E=vd(S?k:$),T=Nm(E,x);return g&&T>0||T>=E.width*E.height||T>=x.width*x.height}):[]},isNodeIntersecting:(p,g,O=!0)=>{const x=bQ(p)?p:u(p);if(!x)return!1;const S=Nm(x,g);return O&&S>0||S>=g.width*g.height||S>=x.width*x.height},updateNode:f,updateNodeData:(p,g,O={replace:!1})=>{f(p,v=>{const x=typeof g=="function"?g(v):g;return O.replace?{...v,data:x}:{...v,data:{...v.data,...x}}},O)},updateEdge:h,updateEdgeData:(p,g,O={replace:!1})=>{h(p,v=>{const x=typeof g=="function"?g(v):g;return O.replace?{...v,data:x}:{...v,data:{...v.data,...x}}},O)},getNodesBounds:p=>{const{nodeLookup:g,nodeOrigin:O}=e.getState();return Dte(p,{nodeLookup:g,nodeOrigin:O})},getHandleConnections:({type:p,id:g,nodeId:O})=>Array.from(e.getState().connectionLookup.get(`${O}-${p}${g?`-${g}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:g,nodeId:O})=>Array.from(e.getState().connectionLookup.get(`${O}${p?g?`-${p}-${g}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const g=e.getState().fitViewResolver??Vte();return e.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:g}),n.nodeQueue.push(O=>[...O]),g.promise}}},[]);return C.useMemo(()=>({...r,...t,viewportInitialized:i}),[i])}const HQ=t=>t.selected,bie=typeof window<"u"?window:void 0;function xie({deleteKeyCode:t,multiSelectionKeyCode:e}){const n=bt(),{deleteElements:i}=$O(),r=xd(t,{actInsideInputWithModifier:!1}),s=xd(e,{target:bie});C.useEffect(()=>{if(r){const{edges:o,nodes:l}=n.getState();i({nodes:l.filter(HQ),edges:o.filter(HQ)}),n.setState({nodesSelectionActive:!1})}},[r]),C.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function wie(t){const e=bt();C.useEffect(()=>{const n=()=>{if(!t.current||!(t.current.checkVisibility?.()??!0))return!1;const i=OS(t.current);(i.height===0||i.width===0)&&e.getState().onError?.("004",Ji.error004()),e.setState({width:i.width||500,height:i.height||500})};if(t.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(t.current),()=>{window.removeEventListener("resize",n),i&&t.current&&i.unobserve(t.current)}}},[])}const _O={position:"absolute",width:"100%",height:"100%",top:0,left:0},Sie=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function kie({onPaneContextMenu:t,zoomOnScroll:e=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panActivationKeyPressed:r,panOnScrollSpeed:s=.5,panOnScrollMode:o=ga.Free,zoomOnDoubleClick:l=!0,panOnDrag:u=!0,defaultViewport:f,translateExtent:h,minZoom:p,maxZoom:g,zoomActivationKeyCode:O,preventScrolling:v=!0,children:x,noWheelClassName:S,noPanClassName:k,onViewportChange:$,isControlledViewport:E,paneClickDistance:T,selectionOnDrag:_}){const Q=bt(),N=C.useRef(null),{userSelectionActive:R,lib:X,connectionInProgress:q}=Ue(Sie,Ct),z=xd(O),Z=C.useRef();wie(N);const F=C.useCallback(M=>{$?.({x:M[0],y:M[1],zoom:M[2]}),E||Q.setState({transform:M})},[$,E]);return C.useEffect(()=>{if(N.current){Z.current=$ne({domNode:N.current,minZoom:p,maxZoom:g,translateExtent:h,viewport:f,onDraggingChange:I=>Q.setState(U=>U.paneDragging===I?U:{paneDragging:I}),onPanZoomStart:(I,U)=>{const{onViewportChangeStart:V,onMoveStart:te}=Q.getState();te?.(I,U),V?.(U)},onPanZoom:(I,U)=>{const{onViewportChange:V,onMove:te}=Q.getState();te?.(I,U),V?.(U)},onPanZoomEnd:(I,U)=>{const{onViewportChangeEnd:V,onMoveEnd:te}=Q.getState();te?.(I,U),V?.(U)}});const{x:M,y:B,zoom:L}=Z.current.getViewport();return Q.setState({panZoom:Z.current,transform:[M,B,L],domNode:N.current.closest(".react-flow")}),()=>{Z.current?.destroy()}}},[]),C.useEffect(()=>{Z.current?.update({onPaneContextMenu:t,zoomOnScroll:e,zoomOnPinch:n,panOnScroll:i,panActivationKeyPressed:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:l,panOnDrag:u,zoomActivationKeyPressed:z,preventScrolling:v,noPanClassName:k,userSelectionActive:R,noWheelClassName:S,lib:X,onTransformChange:F,connectionInProgress:q,selectionOnDrag:_,paneClickDistance:T})},[t,e,n,i,r,s,o,l,u,z,v,k,R,S,X,F,q,_,T]),y.jsx("div",{className:"react-flow__renderer",ref:N,style:_O,children:x})}const Eie=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function Tie(){const{userSelectionActive:t,userSelectionRect:e}=Ue(Eie,Ct);return t&&e?y.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const xb=(t,e)=>n=>{n.target===e.current&&t?.(n)},Cie=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging,panBy:t.panBy,autoPanSpeed:t.autoPanSpeed});function $ie({isSelecting:t,selectionKeyPressed:e,selectionMode:n=Od.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:u,onPaneClick:f,onPaneContextMenu:h,onPaneScroll:p,onPaneMouseEnter:g,onPaneMouseMove:O,onPaneMouseLeave:v,children:x}){const S=C.useRef(0),k=bt(),{userSelectionActive:$,elementsSelectable:E,dragging:T,panBy:_,autoPanSpeed:Q}=Ue(Cie,Ct),N=E&&(t||$),R=C.useRef(null),X=C.useRef(),q=C.useRef(new Set),z=C.useRef(new Set),Z=C.useRef(!1),F=C.useRef(!1),M=C.useRef({x:0,y:0}),B=C.useRef(!1),L=H=>{if(F.current||Z.current||k.getState().connection.inProgress){F.current=!1,Z.current=!1;return}f?.(H),k.getState().resetSelectedElements(),k.setState({nodesSelectionActive:!1})},I=H=>{if(Array.isArray(i)&&i?.includes(2)){H.preventDefault();return}h?.(H)},U=p?H=>p(H):void 0,V=H=>{F.current&&(H.stopPropagation(),F.current=!1)},te=H=>{if(H.pointerType==="touch"&&i!==!1&&!e)return;const{domNode:ce,transform:be}=k.getState();if(X.current=ce?.getBoundingClientRect(),!X.current)return;const Se=H.target===R.current;if(!Se&&!!H.target.closest(".nokey")||!t||!(o&&Se||e)||H.button!==0||!H.isPrimary)return;H.target?.setPointerCapture?.(H.pointerId),F.current=!1;const{x:Ee,y:Xe}=Hi(H.nativeEvent,X.current),Je=Vd({x:Ee,y:Xe},be);k.setState({userSelectionRect:{width:0,height:0,startX:Je.x,startY:Je.y,x:Ee,y:Xe}}),Se||(H.stopPropagation(),H.preventDefault())};function P(H,ce){const{userSelectionRect:be}=k.getState();if(!be)return;const{transform:Se,nodeLookup:he,edgeLookup:ve,connectionLookup:Ee,triggerNodeChanges:Xe,triggerEdgeChanges:Je,defaultEdgeOptions:Nt}=k.getState(),ai={x:be.startX,y:be.startY},{x:Cn,y:$n}=Nc(ai,Se),Gn={startX:ai.x,startY:ai.y,x:H<Cn?H:Cn,y:ce<$n?ce:$n,width:Math.abs(H-Cn),height:Math.abs(ce-$n)},$o=q.current,Dr=z.current;q.current=new Set(pS(he,Gn,Se,n===Od.Partial,!0).map(Vn=>Vn.id)),z.current=new Set;const Pt=Nt?.selectable??!0;for(const Vn of q.current){const li=Ee.get(Vn);if(li)for(const{edgeId:ci}of li.values()){const ui=ve.get(ci);ui&&(ui.selectable??Pt)&&z.current.add(ci)}}if(!xQ($o,q.current)){const Vn=Hl(he,q.current,!0);Xe(Vn)}if(!xQ(Dr,z.current)){const Vn=Hl(ve,z.current);Je(Vn)}k.setState({userSelectionRect:Gn,userSelectionActive:!0,nodesSelectionActive:!1})}function j(){if(!r||!X.current)return;const[H,ce]=gS(M.current,X.current,Q);_({x:H,y:ce}).then(be=>{if(!F.current||!be){S.current=requestAnimationFrame(j);return}const{x:Se,y:he}=M.current;P(Se,he),S.current=requestAnimationFrame(j)})}const Y=()=>{cancelAnimationFrame(S.current),S.current=0,B.current=!1};C.useEffect(()=>()=>Y(),[]);const G=H=>{const{userSelectionRect:ce,transform:be,resetSelectedElements:Se}=k.getState();if(!X.current||!ce)return;const{x:he,y:ve}=Hi(H.nativeEvent,X.current);M.current={x:he,y:ve};const Ee=Nc({x:ce.startX,y:ce.startY},be);if(!F.current){const Xe=e?0:s;if(Math.hypot(he-Ee.x,ve-Ee.y)<=Xe)return;Se(),l?.(H)}F.current=!0,B.current||(j(),B.current=!0),P(he,ve)},J=H=>{if(!N){H.target===R.current&&k.getState().connection.inProgress&&(Z.current=!0);return}H.button===0&&(H.target?.releasePointerCapture?.(H.pointerId),!$&&H.target===R.current&&k.getState().userSelectionRect&&L?.(H),k.setState({userSelectionActive:!1,userSelectionRect:null}),F.current&&(u?.(H),k.setState({nodesSelectionActive:q.current.size>0})),Y())},ne=H=>{H.target?.releasePointerCapture?.(H.pointerId),Y()},le=i===!0||Array.isArray(i)&&i.includes(0);return y.jsxs("div",{className:It(["react-flow__pane",{draggable:le,dragging:T,selection:t}]),onClick:N?void 0:xb(L,R),onContextMenu:xb(I,R),onWheel:xb(U,R),onPointerEnter:N?void 0:g,onPointerMove:N?G:O,onPointerUp:J,onPointerCancel:N?ne:void 0,onPointerDownCapture:N?te:void 0,onClickCapture:N?V:void 0,onPointerLeave:v,ref:R,style:_O,children:[x,y.jsx(Tie,{})]})}function Sw({id:t,store:e,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:l,onError:u}=e.getState(),f=l.get(t);if(!f){u?.("012",Ji.error012(t));return}e.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&o)&&(s({nodes:[f],edges:[]}),requestAnimationFrame(()=>i?.current?.blur())):r([t])}function BD({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:o}){const l=bt(),[u,f]=C.useState(!1),h=C.useRef();return C.useEffect(()=>{if(!e)return h.current=pne({getStoreItems:()=>l.getState(),onNodeMouseDown:p=>{Sw({id:p,store:l,nodeRef:t})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}}),()=>{h.current?.destroy(),h.current=void 0}},[e,l,t]),C.useEffect(()=>{e||!t.current||!h.current||h.current.update({noDragClassName:n,handleSelector:i,domNode:t.current,isSelectable:s,nodeId:r,nodeClickDistance:o})},[n,i,e,s,t,r,o]),u}const _ie=t=>e=>e.selected&&(e.draggable||t&&typeof e.draggable>"u");function ID(){const t=bt();return C.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:o,onError:l,updateNodePositions:u,nodeLookup:f,nodeOrigin:h}=t.getState(),p=new Map,g=_ie(o),O=r?s[0]:5,v=r?s[1]:5,x=n.direction.x*O*n.factor,S=n.direction.y*v*n.factor;for(const[,k]of f){if(!g(k))continue;let $={x:k.internals.positionAbsolute.x+x,y:k.internals.positionAbsolute.y+S};r&&($=Gd($,s));const{position:E,positionAbsolute:T}=aD({nodeId:k.id,nextPosition:$,nodeLookup:f,nodeExtent:i,nodeOrigin:h,onError:l});k.position=E,k.internals.positionAbsolute=T,p.set(k.id,k)}u(p)},[])}const kS=C.createContext(null),Qie=kS.Provider;kS.Consumer;const GD=()=>C.useContext(kS),Aie=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),VD=C.createContext(null);function Nie({children:t}){const e=Ue(Aie,Ct);return y.jsx(VD.Provider,{value:e,children:t})}function Pie(){const t=C.useContext(VD);if(!t)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return t}const Rie={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},jie=(t,e,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:o}=i,{fromHandle:l,toHandle:u,isValid:f}=o;if(!l&&!r)return Rie;const h=u?.nodeId===t&&u?.id===e&&u?.type===n;return{connectingFrom:l?.nodeId===t&&l?.id===e&&l?.type===n,connectingTo:h,clickConnecting:r?.nodeId===t&&r?.id===e&&r?.type===n,isPossibleEndHandle:s===Qc.Strict?l?.type!==n:t!==l?.nodeId||e!==l?.id,connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:h&&f}};function Mie({type:t="source",position:e=_e.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:o,onConnect:l,children:u,className:f,onMouseDown:h,onTouchStart:p,...g},O){const v=o||null,x=t==="target",S=bt(),k=GD(),{connectOnClick:$,noPanClassName:E,rfId:T}=Pie(),{connectingFrom:_,connectingTo:Q,clickConnecting:N,isPossibleEndHandle:R,connectionInProcess:X,clickConnectionInProcess:q,valid:z}=Ue(jie(k,v,t),Ct);k||S.getState().onError?.("010",Ji.error010());const Z=B=>{const{defaultEdgeOptions:L,onConnect:I,hasDefaultEdges:U}=S.getState(),V={...L,...B};if(U){const{edges:te,setEdges:P,onError:j}=S.getState();P(pie(V,te,{onError:j}))}I?.(V),l?.(V)},F=B=>{if(!k)return;const L=mD(B.nativeEvent);if(r&&(L&&B.button===0||!L)){const I=S.getState();ww.onPointerDown(B.nativeEvent,{handleDomNode:B.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:x,handleId:v,nodeId:k,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...U)=>S.getState().onConnectEnd?.(...U),updateConnection:I.updateConnection,onConnect:Z,isValidConnection:n||((...U)=>S.getState().isValidConnection?.(...U)??!0),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}L?h?.(B):p?.(B)},M=B=>{const{onClickConnectStart:L,onClickConnectEnd:I,connectionClickStartHandle:U,connectionMode:V,isValidConnection:te,lib:P,rfId:j,nodeLookup:Y,connection:G}=S.getState();if(!k||!U&&!r)return;if(!U){L?.(B.nativeEvent,{nodeId:k,handleId:v,handleType:t}),S.setState({connectionClickStartHandle:{nodeId:k,type:t,id:v}});return}const J=pD(B.target),ne=n||te,{connection:le,isValid:H}=ww.isValid(B.nativeEvent,{handle:{nodeId:k,id:v,type:t},connectionMode:V,fromNodeId:U.nodeId,fromHandleId:U.id||null,fromType:U.type,isValidConnection:ne,flowId:j,doc:J,lib:P,nodeLookup:Y});H&&le&&Z(le);const ce=structuredClone(G);delete ce.inProgress,ce.toPosition=ce.toHandle?ce.toHandle.position:null,I?.(B,ce),S.setState({connectionClickStartHandle:null})};return y.jsx("div",{"data-handleid":v,"data-nodeid":k,"data-handlepos":e,"data-id":`${T}-${k}-${v}-${t}`,className:It(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",E,f,{source:!x,target:x,connectable:i,connectablestart:r,connectableend:s,clickconnecting:N,connectingfrom:_,connectingto:Q,valid:z,connectionindicator:i&&(!X||R)&&(X||q?s:r)}]),onMouseDown:F,onTouchStart:F,onClick:$?M:void 0,ref:O,...g,children:u})}const Rc=C.memo(zD(Mie));function Lie({data:t,isConnectable:e,sourcePosition:n=_e.Bottom}){return y.jsxs(y.Fragment,{children:[t?.label,y.jsx(Rc,{type:"source",position:n,isConnectable:e})]})}function Die({data:t,isConnectable:e,targetPosition:n=_e.Top,sourcePosition:i=_e.Bottom}){return y.jsxs(y.Fragment,{children:[y.jsx(Rc,{type:"target",position:n,isConnectable:e}),t?.label,y.jsx(Rc,{type:"source",position:i,isConnectable:e})]})}function zie(){return null}function Xie({data:t,isConnectable:e,targetPosition:n=_e.Top}){return y.jsxs(y.Fragment,{children:[y.jsx(Rc,{type:"target",position:n,isConnectable:e}),t?.label]})}const Pm={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},KQ={input:Lie,default:Die,output:Xie,group:zie};function Zie(t){return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??t.style?.width,height:t.height??t.initialHeight??t.style?.height}:{width:t.width??t.style?.width,height:t.height??t.style?.height}}const Bie=t=>{const{width:e,height:n,x:i,y:r}=Id(t.nodeLookup,{filter:s=>!!s.selected});return{width:Fi(e)?e:null,height:Fi(n)?n:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${i}px,${r}px)`}};function Iie({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const i=bt(),{width:r,height:s,transformString:o,userSelectionActive:l}=Ue(Bie,Ct),u=ID(),f=C.useRef(null);C.useEffect(()=>{n||f.current?.focus({preventScroll:!0})},[n]);const h=!l&&r!==null&&s!==null;if(BD({nodeRef:f,disabled:!h}),!h)return null;const p=t?O=>{const v=i.getState().nodes.filter(x=>x.selected);t(O,v)}:void 0,g=O=>{Object.prototype.hasOwnProperty.call(Pm,O.key)&&(O.preventDefault(),u({direction:Pm[O.key],factor:O.shiftKey?4:1}))};return y.jsx("div",{className:It(["react-flow__nodesselection","react-flow__container",e]),style:{transform:o},children:y.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:r,height:s}})})}const JQ=typeof window<"u"?window:void 0,Gie=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function UD({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:f,selectionOnDrag:h,selectionMode:p,onSelectionStart:g,onSelectionEnd:O,multiSelectionKeyCode:v,panActivationKeyCode:x,zoomActivationKeyCode:S,elementsSelectable:k,zoomOnScroll:$,zoomOnPinch:E,panOnScroll:T,panOnScrollSpeed:_,panOnScrollMode:Q,zoomOnDoubleClick:N,panOnDrag:R,autoPanOnSelection:X,defaultViewport:q,translateExtent:z,minZoom:Z,maxZoom:F,preventScrolling:M,onSelectionContextMenu:B,noWheelClassName:L,noPanClassName:I,disableKeyboardA11y:U,onViewportChange:V,isControlledViewport:te}){const{nodesSelectionActive:P,userSelectionActive:j}=Ue(Gie,Ct),Y=xd(f,{target:JQ}),G=xd(x,{target:JQ}),J=G||R,ne=G||T,le=h&&J!==!0,H=Y||j||le;return xie({deleteKeyCode:u,multiSelectionKeyCode:v}),y.jsx(kie,{onPaneContextMenu:s,elementsSelectable:k,zoomOnScroll:$,zoomOnPinch:E,panOnScroll:ne,panActivationKeyPressed:G,panOnScrollSpeed:_,panOnScrollMode:Q,zoomOnDoubleClick:N,panOnDrag:!Y&&J,defaultViewport:q,translateExtent:z,minZoom:Z,maxZoom:F,zoomActivationKeyCode:S,preventScrolling:M,noWheelClassName:L,noPanClassName:I,onViewportChange:V,isControlledViewport:te,paneClickDistance:l,selectionOnDrag:le,children:y.jsxs($ie,{onSelectionStart:g,onSelectionEnd:O,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:J,autoPanOnSelection:X,isSelecting:!!H,selectionMode:p,selectionKeyPressed:Y,paneClickDistance:l,selectionOnDrag:le,children:[t,P&&y.jsx(Iie,{onSelectionContextMenu:B,noPanClassName:I,disableKeyboardA11y:U})]})})}UD.displayName="FlowRenderer";const Vie=C.memo(UD),Uie=t=>e=>t?pS(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(n=>n.id):Array.from(e.nodeLookup.keys());function Yie(t){return Ue(C.useCallback(Uie(t),[t]),Ct)}const qie=t=>t.updateNodeInternals;function Wie(){const t=Ue(qie),[e]=C.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const s=r.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:r.target,force:!0})}),t(i)}));return C.useEffect(()=>()=>{e?.disconnect()},[e]),e}function Fie({node:t,nodeType:e,hasDimensions:n,resizeObserver:i}){const r=bt(),s=C.useRef(null),o=C.useRef(null),l=C.useRef(t.sourcePosition),u=C.useRef(t.targetPosition),f=C.useRef(e),h=n&&!!t.internals.handleBounds;return C.useEffect(()=>{s.current&&!t.hidden&&(!h||o.current!==s.current)&&(o.current&&i?.unobserve(o.current),i?.observe(s.current),o.current=s.current)},[h,t.hidden]),C.useEffect(()=>()=>{o.current&&(i?.unobserve(o.current),o.current=null)},[]),C.useEffect(()=>{if(s.current){const p=f.current!==e,g=l.current!==t.sourcePosition,O=u.current!==t.targetPosition;(p||g||O)&&(f.current=e,l.current=t.sourcePosition,u.current=t.targetPosition,r.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:s.current,force:!0}]])))}},[t.id,e,t.sourcePosition,t.targetPosition]),s}function Hie({id:t,onClick:e,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:o,nodesDraggable:l,elementsSelectable:u,nodesConnectable:f,nodesFocusable:h,resizeObserver:p,noDragClassName:g,noPanClassName:O,disableKeyboardA11y:v,rfId:x,nodeTypes:S,nodeClickDistance:k,onError:$}){const{node:E,internals:T,isParent:_}=Ue(H=>{const ce=H.nodeLookup.get(t),be=H.parentLookup.has(t);return{node:ce,internals:ce.internals,isParent:be}},Ct);let Q=E.type||"default",N=S?.[Q]||KQ[Q];N===void 0&&($?.("003",Ji.error003(Q)),Q="default",N=S?.default||KQ.default);const R=!!(E.draggable||l&&typeof E.draggable>"u"),X=!!(E.selectable||u&&typeof E.selectable>"u"),q=!!(E.connectable||f&&typeof E.connectable>"u"),z=!!(E.focusable||h&&typeof E.focusable>"u"),Z=bt(),F=dD(E),M=Fie({node:E,nodeType:Q,hasDimensions:F,resizeObserver:p}),B=BD({nodeRef:M,disabled:E.hidden||!R,noDragClassName:g,handleSelector:E.dragHandle,nodeId:t,isSelectable:X,nodeClickDistance:k}),L=ID();if(E.hidden)return null;const I=sr(E),U=Zie(E),V=X||R||e||n||i||r,te=n?H=>n(H,{...T.userNode}):void 0,P=i?H=>i(H,{...T.userNode}):void 0,j=r?H=>r(H,{...T.userNode}):void 0,Y=s?H=>s(H,{...T.userNode}):void 0,G=o?H=>o(H,{...T.userNode}):void 0,J=H=>{const{selectNodesOnDrag:ce,nodeDragThreshold:be}=Z.getState();X&&(!ce||!R||be>0)&&Sw({id:t,store:Z,nodeRef:M}),e&&e(H,{...T.userNode})},ne=H=>{if(!(gD(H.nativeEvent)||v)){if(nD.includes(H.key)&&X){const ce=H.key==="Escape";Sw({id:t,store:Z,unselect:ce,nodeRef:M})}else if(R&&E.selected&&Object.prototype.hasOwnProperty.call(Pm,H.key)){H.preventDefault();const{ariaLabelConfig:ce}=Z.getState();Z.setState({ariaLiveMessage:ce["node.a11yDescription.ariaLiveMessage"]({direction:H.key.replace("Arrow","").toLowerCase(),x:~~T.positionAbsolute.x,y:~~T.positionAbsolute.y})}),L({direction:Pm[H.key],factor:H.shiftKey?4:1})}}},le=()=>{if(v||!M.current?.matches(":focus-visible"))return;const{transform:H,width:ce,height:be,autoPanOnNodeFocus:Se,setCenter:he}=Z.getState();if(!Se)return;pS(new Map([[t,E]]),{x:0,y:0,width:ce,height:be},H,!0).length>0||he(E.position.x+I.width/2,E.position.y+I.height/2,{zoom:H[2]})};return y.jsx("div",{className:It(["react-flow__node",`react-flow__node-${Q}`,{[O]:R},E.className,{selected:E.selected,selectable:X,parent:_,draggable:R,dragging:B}]),ref:M,style:{zIndex:T.z,transform:`translate(${T.positionAbsolute.x}px,${T.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:F?"visible":"hidden",...E.style,...U},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:te,onMouseMove:P,onMouseLeave:j,onContextMenu:Y,onClick:J,onDoubleClick:G,onKeyDown:z?ne:void 0,tabIndex:z?0:void 0,onFocus:z?le:void 0,role:E.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":v?void 0:`${RD}-${x}`,"aria-label":E.ariaLabel,...E.domAttributes,children:y.jsx(Qie,{value:t,children:y.jsx(N,{id:t,data:E.data,type:Q,positionAbsoluteX:T.positionAbsolute.x,positionAbsoluteY:T.positionAbsolute.y,selected:E.selected??!1,selectable:X,draggable:R,deletable:E.deletable??!0,isConnectable:q,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:B,dragHandle:E.dragHandle,zIndex:T.z,parentId:E.parentId,...I})})})}var Kie=C.memo(Hie);const Jie=t=>({nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function YD(t){const{nodesConnectable:e,nodesFocusable:n,elementsSelectable:i,onError:r}=Ue(Jie,Ct),s=Yie(t.onlyRenderVisibleElements),o=Wie();return y.jsx("div",{className:"react-flow__nodes",style:_O,children:s.map(l=>y.jsx(Kie,{id:l,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:o,nodesDraggable:t.nodesDraggable??!0,nodesConnectable:e,nodesFocusable:n,elementsSelectable:i,nodeClickDistance:t.nodeClickDistance,onError:r},l))})}YD.displayName="NodeRenderer";const ere=C.memo(YD);function tre(t){return Ue(C.useCallback(n=>{if(!t)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),o=n.nodeLookup.get(r.target);s&&o&&Wte({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[t]),Ct)}const nre=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t}};return y.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},ire=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t,fill:t}};return y.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},eA={[yd.Arrow]:nre,[yd.ArrowClosed]:ire};function rre(t){const e=bt();return C.useMemo(()=>Object.prototype.hasOwnProperty.call(eA,t)?eA[t]:(e.getState().onError?.("009",Ji.error009(t)),null),[t])}const sre=({id:t,type:e,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const u=rre(e);return u?y.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:y.jsx(u,{color:n,strokeWidth:o})}):null},qD=({defaultColor:t,rfId:e})=>{const n=Ue(s=>s.edges),i=Ue(s=>s.defaultEdgeOptions),r=C.useMemo(()=>ine(n,{id:e,defaultColor:t,defaultMarkerStart:i?.markerStart,defaultMarkerEnd:i?.markerEnd}),[n,i,e,t]);return r.length?y.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:y.jsx("defs",{children:r.map(s=>y.jsx(sre,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};qD.displayName="MarkerDefinitions";var ore=C.memo(qD);function WD({x:t,y:e,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:u,className:f,...h}){const[p,g]=C.useState({x:1,y:0,width:0,height:0}),O=It(["react-flow__edge-textwrapper",f]),v=C.useRef(null);return C.useEffect(()=>{if(v.current){const x=v.current.getBBox();g({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n?y.jsxs("g",{transform:`translate(${t-p.width/2} ${e-p.height/2})`,className:O,visibility:p.width?"visible":"hidden",...h,children:[r&&y.jsx("rect",{width:p.width+2*o[0],x:-o[0],y:-o[1],height:p.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),y.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:v,style:i,children:n}),u]}):null}WD.displayName="EdgeText";const are=C.memo(WD);function QO({path:t,labelX:e,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:f=20,...h}){return y.jsxs(y.Fragment,{children:[y.jsx("path",{...h,d:t,fill:"none",className:It(["react-flow__edge-path",h.className])}),f?y.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,i&&Fi(e)&&Fi(n)?y.jsx(are,{x:e,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function tA({pos:t,x1:e,y1:n,x2:i,y2:r}){return t===_e.Left||t===_e.Right?[.5*(e+i),n]:[e,.5*(n+r)]}function FD({sourceX:t,sourceY:e,sourcePosition:n=_e.Bottom,targetX:i,targetY:r,targetPosition:s=_e.Top}){const[o,l]=tA({pos:n,x1:t,y1:e,x2:i,y2:r}),[u,f]=tA({pos:s,x1:i,y1:r,x2:t,y2:e}),[h,p,g,O]=OD({sourceX:t,sourceY:e,targetX:i,targetY:r,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:f});return[`M${t},${e} C${o},${l} ${u},${f} ${i},${r}`,h,p,g,O]}function HD(t){return C.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o,targetPosition:l,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:O,style:v,markerEnd:x,markerStart:S,interactionWidth:k})=>{const[$,E,T]=FD({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l}),_=t.isInternal?void 0:e;return y.jsx(QO,{id:_,path:$,labelX:E,labelY:T,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:O,style:v,markerEnd:x,markerStart:S,interactionWidth:k})})}const lre=HD({isInternal:!1}),KD=HD({isInternal:!0});lre.displayName="SimpleBezierEdge";KD.displayName="SimpleBezierEdgeInternal";function JD(t){return C.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,sourcePosition:O=_e.Bottom,targetPosition:v=_e.Top,markerEnd:x,markerStart:S,pathOptions:k,interactionWidth:$})=>{const[E,T,_]=vw({sourceX:n,sourceY:i,sourcePosition:O,targetX:r,targetY:s,targetPosition:v,borderRadius:k?.borderRadius,offset:k?.offset,stepPosition:k?.stepPosition}),Q=t.isInternal?void 0:e;return y.jsx(QO,{id:Q,path:E,labelX:T,labelY:_,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:x,markerStart:S,interactionWidth:$})})}const e5=JD({isInternal:!1}),t5=JD({isInternal:!0});e5.displayName="SmoothStepEdge";t5.displayName="SmoothStepEdgeInternal";function n5(t){return C.memo(({id:e,...n})=>{const i=t.isInternal?void 0:e;return y.jsx(e5,{...n,id:i,pathOptions:C.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const cre=n5({isInternal:!1}),i5=n5({isInternal:!0});cre.displayName="StepEdge";i5.displayName="StepEdgeInternal";function r5(t){return C.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:O,markerStart:v,interactionWidth:x})=>{const[S,k,$]=bD({sourceX:n,sourceY:i,targetX:r,targetY:s}),E=t.isInternal?void 0:e;return y.jsx(QO,{id:E,path:S,labelX:k,labelY:$,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:O,markerStart:v,interactionWidth:x})})}const ure=r5({isInternal:!1}),s5=r5({isInternal:!0});ure.displayName="StraightEdge";s5.displayName="StraightEdgeInternal";function o5(t){return C.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o=_e.Bottom,targetPosition:l=_e.Top,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:O,style:v,markerEnd:x,markerStart:S,pathOptions:k,interactionWidth:$})=>{const[E,T,_]=yD({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l,curvature:k?.curvature}),Q=t.isInternal?void 0:e;return y.jsx(QO,{id:Q,path:E,labelX:T,labelY:_,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:O,style:v,markerEnd:x,markerStart:S,interactionWidth:$})})}const fre=o5({isInternal:!1}),a5=o5({isInternal:!0});fre.displayName="BezierEdge";a5.displayName="BezierEdgeInternal";const nA={default:a5,straight:s5,step:i5,smoothstep:t5,simplebezier:KD},iA={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},dre=(t,e,n)=>n===_e.Left?t-e:n===_e.Right?t+e:t,hre=(t,e,n)=>n===_e.Top?t-e:n===_e.Bottom?t+e:t,rA="react-flow__edgeupdater";function sA({position:t,centerX:e,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:o,type:l}){return y.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:o,className:It([rA,`${rA}-${l}`]),cx:dre(e,i,t),cy:hre(n,i,t),r:i,stroke:"transparent",fill:"transparent"})}function pre({isReconnectable:t,reconnectRadius:e,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:o,sourcePosition:l,targetPosition:u,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,setReconnecting:g,setUpdateHover:O}){const v=bt(),x=(T,_)=>{if(T.button!==0)return;const{autoPanOnConnect:Q,domNode:N,connectionMode:R,connectionRadius:X,lib:q,onConnectStart:z,cancelConnection:Z,nodeLookup:F,rfId:M,panBy:B,updateConnection:L}=v.getState(),I=_.type==="target",U=(P,j)=>{g(!1),p?.(P,n,_.type,j)},V=P=>f?.(n,P),te=(P,j)=>{g(!0),h?.(T,n,_.type),z?.(P,j)};ww.onPointerDown(T.nativeEvent,{autoPanOnConnect:Q,connectionMode:R,connectionRadius:X,domNode:N,handleId:_.id,nodeId:_.nodeId,nodeLookup:F,isTarget:I,edgeUpdaterType:_.type,lib:q,flowId:M,cancelConnection:Z,panBy:B,isValidConnection:(...P)=>v.getState().isValidConnection?.(...P)??!0,onConnect:V,onConnectStart:te,onConnectEnd:(...P)=>v.getState().onConnectEnd?.(...P),onReconnectEnd:U,updateConnection:L,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,dragThreshold:v.getState().connectionDragThreshold,handleDomNode:T.currentTarget})},S=T=>x(T,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),k=T=>x(T,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),$=()=>O(!0),E=()=>O(!1);return y.jsxs(y.Fragment,{children:[(t===!0||t==="source")&&y.jsx(sA,{position:l,centerX:i,centerY:r,radius:e,onMouseDown:S,onMouseEnter:$,onMouseOut:E,type:"source"}),(t===!0||t==="target")&&y.jsx(sA,{position:u,centerX:s,centerY:o,radius:e,onMouseDown:k,onMouseEnter:$,onMouseOut:E,type:"target"})]})}function gre({id:t,edgesFocusable:e,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:o,onMouseEnter:l,onMouseMove:u,onMouseLeave:f,reconnectRadius:h,onReconnect:p,onReconnectStart:g,onReconnectEnd:O,rfId:v,edgeTypes:x,noPanClassName:S,onError:k,disableKeyboardA11y:$}){let E=Ue(he=>he.edgeLookup.get(t));const T=Ue(he=>he.defaultEdgeOptions);E=T?{...T,...E}:E;let _=E.type||"default",Q=x?.[_]||nA[_];Q===void 0&&(k?.("011",Ji.error011(_)),_="default",Q=x?.default||nA.default);const N=!!(E.focusable||e&&typeof E.focusable>"u"),R=typeof p<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),X=!!(E.selectable||i&&typeof E.selectable>"u"),q=C.useRef(null),[z,Z]=C.useState(!1),[F,M]=C.useState(!1),B=bt(),{zIndex:L=E.zIndex,sourceX:I,sourceY:U,targetX:V,targetY:te,sourcePosition:P,targetPosition:j}=Ue(C.useCallback(he=>{const ve=he.nodeLookup.get(E.source),Ee=he.nodeLookup.get(E.target);if(!ve||!Ee)return iA;const Xe=nne({id:t,sourceNode:ve,targetNode:Ee,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:he.connectionMode,onError:k}),Je=qte({selected:E.selected,zIndex:E.zIndex,sourceNode:ve,targetNode:Ee,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode});return{...Xe||iA,zIndex:Je}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex,k]),Ct),Y=C.useMemo(()=>E.markerStart?`url('#${bw(E.markerStart,v)}')`:void 0,[E.markerStart,v]),G=C.useMemo(()=>E.markerEnd?`url('#${bw(E.markerEnd,v)}')`:void 0,[E.markerEnd,v]);if(E.hidden||I===null||U===null||V===null||te===null)return null;const J=he=>{const{addSelectedEdges:ve,unselectNodesAndEdges:Ee,multiSelectionActive:Xe}=B.getState();X&&(B.setState({nodesSelectionActive:!1}),E.selected&&Xe?(Ee({nodes:[],edges:[E]}),q.current?.blur()):ve([t])),r&&r(he,E)},ne=s?he=>{s(he,{...E})}:void 0,le=o?he=>{o(he,{...E})}:void 0,H=l?he=>{l(he,{...E})}:void 0,ce=u?he=>{u(he,{...E})}:void 0,be=f?he=>{f(he,{...E})}:void 0,Se=he=>{if(!$&&nD.includes(he.key)&&X){const{unselectNodesAndEdges:ve,addSelectedEdges:Ee}=B.getState();he.key==="Escape"?(q.current?.blur(),ve({edges:[E]})):Ee([t])}};return y.jsx("svg",{style:{zIndex:L},children:y.jsxs("g",{className:It(["react-flow__edge",`react-flow__edge-${_}`,E.className,S,{selected:E.selected,animated:E.animated,inactive:!X&&!r,updating:z,selectable:X}]),onClick:J,onDoubleClick:ne,onContextMenu:le,onMouseEnter:H,onMouseMove:ce,onMouseLeave:be,onKeyDown:N?Se:void 0,tabIndex:N?0:void 0,role:E.ariaRole??(N?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":N?`${jD}-${v}`:void 0,ref:q,...E.domAttributes,children:[!F&&y.jsx(Q,{id:t,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:X,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:I,sourceY:U,targetX:V,targetY:te,sourcePosition:P,targetPosition:j,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:Y,markerEnd:G,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),R&&y.jsx(pre,{edge:E,isReconnectable:R,reconnectRadius:h,onReconnect:p,onReconnectStart:g,onReconnectEnd:O,sourceX:I,sourceY:U,targetX:V,targetY:te,sourcePosition:P,targetPosition:j,setUpdateHover:Z,setReconnecting:M})]})})}var mre=C.memo(gre);const Ore=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function l5({defaultMarkerColor:t,onlyRenderVisibleElements:e,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:f,onEdgeClick:h,reconnectRadius:p,onEdgeDoubleClick:g,onReconnectStart:O,onReconnectEnd:v,disableKeyboardA11y:x}){const{edgesFocusable:S,edgesReconnectable:k,elementsSelectable:$,onError:E}=Ue(Ore,Ct),T=tre(e);return y.jsxs("div",{className:"react-flow__edges",children:[y.jsx(ore,{defaultColor:t,rfId:n}),T.map(_=>y.jsx(mre,{id:_,edgesFocusable:S,edgesReconnectable:k,elementsSelectable:$,noPanClassName:r,onReconnect:s,onContextMenu:o,onMouseEnter:l,onMouseMove:u,onMouseLeave:f,onClick:h,reconnectRadius:p,onDoubleClick:g,onReconnectStart:O,onReconnectEnd:v,rfId:n,onError:E,edgeTypes:i,disableKeyboardA11y:x},_))]})}l5.displayName="EdgeRenderer";const yre=C.memo(l5),oA=t=>`translate(${t[0]}px,${t[1]}px) scale(${t[2]})`;function vre({children:t}){const e=bt(),n=C.useRef(null),[i]=C.useState(()=>e.getState().transform);return XD(()=>{let r=null;const s=()=>{const o=e.getState().transform;r&&o[0]===r[0]&&o[1]===r[1]&&o[2]===r[2]||(r=o,n.current&&(n.current.style.transform=oA(o)))};return s(),e.subscribe(s)},[e]),y.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:oA(i)},children:t})}function bre(t){const e=$O(),n=C.useRef(!1);C.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const xre=t=>t.panZoom?.syncViewport;function wre(t){const e=Ue(xre),n=bt();return C.useEffect(()=>{t&&(e?.(t),n.setState({transform:[t.x,t.y,t.zoom]}))},[t,e]),null}function Sre(t){return t.connection.inProgress?{...t.connection,to:Vd(t.connection.to,t.transform)}:{...t.connection}}function kre(t){return Sre}function Ere(t){const e=kre();return Ue(e,Ct)}const Tre=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function Cre({containerStyle:t,style:e,type:n,component:i}){const{nodesConnectable:r,width:s,height:o,isValid:l,inProgress:u}=Ue(Tre,Ct);return!(s&&r&&u)?null:y.jsx("svg",{style:t,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:y.jsx("g",{className:It(["react-flow__connection",sD(l)]),children:y.jsx(c5,{style:e,type:n,CustomComponent:i,isValid:l})})})}const c5=({style:t,type:e=mo.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:o,fromHandle:l,fromPosition:u,to:f,toNode:h,toHandle:p,toPosition:g,pointer:O}=Ere();if(!r)return;if(n)return y.jsx(n,{connectionLineType:e,connectionLineStyle:t,fromNode:o,fromHandle:l,fromX:s.x,fromY:s.y,toX:f.x,toY:f.y,fromPosition:u,toPosition:g,connectionStatus:sD(i),toNode:h,toHandle:p,pointer:O});let v="";const x={sourceX:s.x,sourceY:s.y,sourcePosition:u,targetX:f.x,targetY:f.y,targetPosition:g};switch(e){case mo.Bezier:[v]=yD(x);break;case mo.SimpleBezier:[v]=FD(x);break;case mo.Step:[v]=vw({...x,borderRadius:0});break;case mo.SmoothStep:[v]=vw(x);break;default:[v]=bD(x)}return y.jsx("path",{d:v,fill:"none",className:"react-flow__connection-path",style:t})};c5.displayName="ConnectionLine";const $re={};function aA(t=$re){C.useRef(t),bt(),C.useEffect(()=>{},[t])}function _re(){bt(),C.useRef(!1),C.useEffect(()=>{},[])}function u5({nodeTypes:t,edgeTypes:e,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:g,onSelectionEnd:O,connectionLineType:v,connectionLineStyle:x,connectionLineComponent:S,connectionLineContainerStyle:k,selectionKeyCode:$,selectionOnDrag:E,selectionMode:T,multiSelectionKeyCode:_,panActivationKeyCode:Q,zoomActivationKeyCode:N,deleteKeyCode:R,onlyRenderVisibleElements:X,elementsSelectable:q,defaultViewport:z,translateExtent:Z,minZoom:F,maxZoom:M,preventScrolling:B,defaultMarkerColor:L,zoomOnScroll:I,zoomOnPinch:U,panOnScroll:V,panOnScrollSpeed:te,panOnScrollMode:P,zoomOnDoubleClick:j,panOnDrag:Y,autoPanOnSelection:G,onPaneClick:J,onPaneMouseEnter:ne,onPaneMouseMove:le,onPaneMouseLeave:H,onPaneScroll:ce,onPaneContextMenu:be,paneClickDistance:Se,nodeClickDistance:he,onEdgeContextMenu:ve,onEdgeMouseEnter:Ee,onEdgeMouseMove:Xe,onEdgeMouseLeave:Je,reconnectRadius:Nt,onReconnect:ai,onReconnectStart:Cn,onReconnectEnd:$n,noDragClassName:Gn,noWheelClassName:$o,noPanClassName:Dr,disableKeyboardA11y:Pt,nodeExtent:Vn,rfId:li,viewport:ci,onViewportChange:ui,nodesDraggable:su}){return aA(t),aA(e),_re(),bre(n),wre(ci),y.jsx(Vie,{onPaneClick:J,onPaneMouseEnter:ne,onPaneMouseMove:le,onPaneMouseLeave:H,onPaneContextMenu:be,onPaneScroll:ce,paneClickDistance:Se,deleteKeyCode:R,selectionKeyCode:$,selectionOnDrag:E,selectionMode:T,onSelectionStart:g,onSelectionEnd:O,multiSelectionKeyCode:_,panActivationKeyCode:Q,zoomActivationKeyCode:N,elementsSelectable:q,zoomOnScroll:I,zoomOnPinch:U,zoomOnDoubleClick:j,panOnScroll:V,panOnScrollSpeed:te,panOnScrollMode:P,panOnDrag:Y,autoPanOnSelection:G,defaultViewport:z,translateExtent:Z,minZoom:F,maxZoom:M,onSelectionContextMenu:p,preventScrolling:B,noDragClassName:Gn,noWheelClassName:$o,noPanClassName:Dr,disableKeyboardA11y:Pt,onViewportChange:ui,isControlledViewport:!!ci,children:y.jsxs(vre,{children:[y.jsx(yre,{edgeTypes:e,onEdgeClick:r,onEdgeDoubleClick:o,onReconnect:ai,onReconnectStart:Cn,onReconnectEnd:$n,onlyRenderVisibleElements:X,onEdgeContextMenu:ve,onEdgeMouseEnter:Ee,onEdgeMouseMove:Xe,onEdgeMouseLeave:Je,reconnectRadius:Nt,defaultMarkerColor:L,noPanClassName:Dr,disableKeyboardA11y:Pt,rfId:li}),y.jsx(Cre,{style:x,type:v,component:S,containerStyle:k}),y.jsx("div",{className:"react-flow__edgelabel-renderer"}),y.jsx(ere,{nodeTypes:t,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:h,nodeClickDistance:he,onlyRenderVisibleElements:X,noPanClassName:Dr,noDragClassName:Gn,disableKeyboardA11y:Pt,nodeExtent:Vn,rfId:li,nodesDraggable:su}),y.jsx("div",{className:"react-flow__viewport-portal"})]})})}u5.displayName="GraphView";const Qre=C.memo(u5),Are=fD(),lA=({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:u=.5,maxZoom:f=2,nodeOrigin:h,nodeExtent:p,zIndexMode:g="basic"}={})=>{const O=new Map,v=new Map,x=new Map,S=new Map,k=i??e??[],$=n??t??[],E=h??[0,0],T=p??md;SD(x,S,k);const{nodesInitialized:_}=xw($,O,v,{nodeOrigin:E,nodeExtent:T,zIndexMode:g});let Q=[0,0,1];if(o&&r&&s){const N=Id(O,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:R,y:X,zoom:q}=mS(N,r,s,u,f,l?.padding??.1);Q=[R,X,q]}return{rfId:"1",width:r??0,height:s??0,transform:Q,nodes:$,nodesInitialized:_,nodeLookup:O,parentLookup:v,edges:k,edgeLookup:S,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:u,maxZoom:f,translateExtent:md,nodeExtent:T,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Qc.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...rD},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Are,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:iD,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Nre=({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:f,nodeOrigin:h,nodeExtent:p,zIndexMode:g})=>Vne((O,v)=>{async function x(){const{nodeLookup:S,panZoom:k,fitViewOptions:$,fitViewResolver:E,width:T,height:_,minZoom:Q,maxZoom:N}=v();k&&(await Zte({nodes:S,width:T,height:_,panZoom:k,minZoom:Q,maxZoom:N},$),E?.resolve(!0),O({fitViewResolver:null}))}return{...lA({nodes:t,edges:e,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:f,nodeOrigin:h,nodeExtent:p,defaultNodes:n,defaultEdges:i,zIndexMode:g}),setNodes:S=>{const{nodeLookup:k,parentLookup:$,nodeOrigin:E,nodeExtent:T,elevateNodesOnSelect:_,fitViewQueued:Q,zIndexMode:N,nodesSelectionActive:R}=v(),{nodesInitialized:X,hasSelectedNodes:q}=xw(S,k,$,{nodeOrigin:E,nodeExtent:T,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:N}),z=R&&q;Q&&X?(x(),O({nodes:S,nodesInitialized:X,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:z})):O({nodes:S,nodesInitialized:X,nodesSelectionActive:z})},setEdges:S=>{const{connectionLookup:k,edgeLookup:$}=v();SD(k,$,S),O({edges:S})},setDefaultNodesAndEdges:(S,k)=>{if(S){const{setNodes:$}=v();$(S),O({hasDefaultNodes:!0})}if(k){const{setEdges:$}=v();$(k),O({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:k,nodeLookup:$,parentLookup:E,domNode:T,nodeOrigin:_,nodeExtent:Q,debug:N,fitViewQueued:R,zIndexMode:X}=v(),{changes:q,updatedInternals:z}=une(S,$,E,T,_,Q,X);z&&(one($,E,{nodeOrigin:_,nodeExtent:Q,zIndexMode:X}),R?(x(),O({fitViewQueued:!1,fitViewOptions:void 0})):O({}),q?.length>0&&(N&&console.log("React Flow: trigger node changes",q),k?.(q)))},updateNodePositions:(S,k=!1)=>{const $=[];let E=[];const{nodeLookup:T,triggerNodeChanges:_,connection:Q,updateConnection:N,onNodesChangeMiddlewareMap:R}=v();for(const[X,q]of S){const z=T.get(X),Z=!!(z?.expandParent&&z?.parentId&&q?.position),F={id:X,type:"position",position:Z?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:k};if(z&&Q.inProgress&&Q.fromNode.id===z.id){const M=$a(z,Q.fromHandle,_e.Left,!0);N({...Q,from:M})}Z&&z.parentId&&$.push({id:X,parentId:z.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),E.push(F)}if($.length>0){const{parentLookup:X,nodeOrigin:q}=v(),z=wS($,T,X,q);E.push(...z)}for(const X of R.values())E=X(E);_(E)},triggerNodeChanges:S=>{const{onNodesChange:k,setNodes:$,nodes:E,hasDefaultNodes:T,debug:_}=v();if(S?.length){if(T){const Q=DD(S,E);$(Q)}_&&console.log("React Flow: trigger node changes",S),k?.(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:k,setEdges:$,edges:E,hasDefaultEdges:T,debug:_}=v();if(S?.length){if(T){const Q=die(S,E);$(Q)}_&&console.log("React Flow: trigger edge changes",S),k?.(S)}},addSelectedNodes:S=>{const{multiSelectionActive:k,edgeLookup:$,nodeLookup:E,triggerNodeChanges:T,triggerEdgeChanges:_}=v();if(k){const Q=S.map(N=>Ko(N,!0));T(Q);return}T(Hl(E,new Set([...S]),!0)),_(Hl($))},addSelectedEdges:S=>{const{multiSelectionActive:k,edgeLookup:$,nodeLookup:E,triggerNodeChanges:T,triggerEdgeChanges:_}=v();if(k){const Q=S.map(N=>Ko(N,!0));_(Q);return}_(Hl($,new Set([...S]))),T(Hl(E,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:k}={})=>{const{edges:$,nodes:E,nodeLookup:T,triggerNodeChanges:_,triggerEdgeChanges:Q}=v(),N=S||E,R=k||$,X=[];for(const z of N){if(!z.selected)continue;const Z=T.get(z.id);Z&&(Z.selected=!1),X.push(Ko(z.id,!1))}const q=[];for(const z of R)z.selected&&q.push(Ko(z.id,!1));_(X),Q(q)},setMinZoom:S=>{const{panZoom:k,maxZoom:$}=v();k?.setScaleExtent([S,$]),O({minZoom:S})},setMaxZoom:S=>{const{panZoom:k,minZoom:$}=v();k?.setScaleExtent([$,S]),O({maxZoom:S})},setTranslateExtent:S=>{v().panZoom?.setTranslateExtent(S),O({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:k,triggerNodeChanges:$,triggerEdgeChanges:E,elementsSelectable:T}=v();if(!T)return;const _=k.reduce((N,R)=>R.selected?[...N,Ko(R.id,!1)]:N,[]),Q=S.reduce((N,R)=>R.selected?[...N,Ko(R.id,!1)]:N,[]);$(_),E(Q)},setNodeExtent:S=>{const{nodes:k,nodeLookup:$,parentLookup:E,nodeOrigin:T,elevateNodesOnSelect:_,nodeExtent:Q,zIndexMode:N}=v();S[0][0]===Q[0][0]&&S[0][1]===Q[0][1]&&S[1][0]===Q[1][0]&&S[1][1]===Q[1][1]||(xw(k,$,E,{nodeOrigin:T,nodeExtent:S,elevateNodesOnSelect:_,checkEquality:!1,zIndexMode:N}),O({nodeExtent:S}))},panBy:S=>{const{transform:k,width:$,height:E,panZoom:T,translateExtent:_}=v();return fne({delta:S,panZoom:T,transform:k,translateExtent:_,width:$,height:E})},setCenter:async(S,k,$)=>{const{width:E,height:T,maxZoom:_,panZoom:Q}=v();if(!Q)return!1;const N=typeof $?.zoom<"u"?$.zoom:_;return await Q.setViewport({x:E/2-S*N,y:T/2-k*N,zoom:N},{duration:$?.duration,ease:$?.ease,interpolate:$?.interpolate}),!0},cancelConnection:()=>{O({connection:{...rD}})},updateConnection:S=>{O({connection:S})},reset:()=>O({...lA()})}},Object.is);function f5({initialNodes:t,initialEdges:e,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:u,fitView:f,nodeOrigin:h,nodeExtent:p,zIndexMode:g,children:O}){const[v]=C.useState(()=>Nre({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:f,minZoom:o,maxZoom:l,fitViewOptions:u,nodeOrigin:h,nodeExtent:p,zIndexMode:g}));return y.jsx(Une,{value:v,children:y.jsx(Oie,{children:y.jsx(Nie,{children:O})})})}function Pre({children:t,nodes:e,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:o,fitView:l,fitViewOptions:u,minZoom:f,maxZoom:h,nodeOrigin:p,nodeExtent:g,zIndexMode:O}){return C.useContext(TO)?y.jsx(y.Fragment,{children:t}):y.jsx(f5,{initialNodes:e,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:l,initialFitViewOptions:u,initialMinZoom:f,initialMaxZoom:h,nodeOrigin:p,nodeExtent:g,zIndexMode:O,children:t})}const Rre={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function jre({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:o,onNodeClick:l,onEdgeClick:u,onInit:f,onMove:h,onMoveStart:p,onMoveEnd:g,onConnect:O,onConnectStart:v,onConnectEnd:x,onClickConnectStart:S,onClickConnectEnd:k,onNodeMouseEnter:$,onNodeMouseMove:E,onNodeMouseLeave:T,onNodeContextMenu:_,onNodeDoubleClick:Q,onNodeDragStart:N,onNodeDrag:R,onNodeDragStop:X,onNodesDelete:q,onEdgesDelete:z,onDelete:Z,onSelectionChange:F,onSelectionDragStart:M,onSelectionDrag:B,onSelectionDragStop:L,onSelectionContextMenu:I,onSelectionStart:U,onSelectionEnd:V,onBeforeDelete:te,connectionMode:P,connectionLineType:j=mo.Bezier,connectionLineStyle:Y,connectionLineComponent:G,connectionLineContainerStyle:J,deleteKeyCode:ne="Backspace",selectionKeyCode:le="Shift",selectionOnDrag:H=!1,selectionMode:ce=Od.Full,panActivationKeyCode:be="Space",multiSelectionKeyCode:Se=bd()?"Meta":"Control",zoomActivationKeyCode:he=bd()?"Meta":"Control",snapToGrid:ve,snapGrid:Ee,onlyRenderVisibleElements:Xe=!1,selectNodesOnDrag:Je,nodesDraggable:Nt,autoPanOnNodeFocus:ai,nodesConnectable:Cn,nodesFocusable:$n,nodeOrigin:Gn=MD,edgesFocusable:$o,edgesReconnectable:Dr,elementsSelectable:Pt=!0,defaultViewport:Vn=sie,minZoom:li=.5,maxZoom:ci=2,translateExtent:ui=md,preventScrolling:su=!0,nodeExtent:za,defaultMarkerColor:LO="#b1b1b7",zoomOnScroll:DO=!0,zoomOnPinch:_o=!0,panOnScroll:On=!1,panOnScrollSpeed:lr=.5,panOnScrollMode:yn=ga.Free,zoomOnDoubleClick:zO=!0,panOnDrag:XO=!0,onPaneClick:ZO,onPaneMouseEnter:Xa,onPaneMouseMove:Za,onPaneMouseLeave:Ba,onPaneScroll:zr,onPaneContextMenu:Ia,paneClickDistance:Qo=1,nodeClickDistance:BO=0,children:Wd,onReconnect:ou,onReconnectStart:Ao,onReconnectEnd:IO,onEdgeContextMenu:Fd,onEdgeDoubleClick:Hd,onEdgeMouseEnter:Kd,onEdgeMouseMove:au,onEdgeMouseLeave:lu,reconnectRadius:Jd=10,onNodesChange:eh,onEdgesChange:cr,noDragClassName:Gt="nodrag",noWheelClassName:an="nowheel",noPanClassName:Xr="nopan",fitView:Ga,fitViewOptions:th,connectOnClick:GO,attributionPosition:nh,proOptions:No,defaultEdgeOptions:cu,elevateNodesOnSelect:Qs=!0,elevateEdgesOnSelect:As=!1,disableKeyboardA11y:Ns=!1,autoPanOnConnect:Ps,autoPanOnNodeDrag:Lt,autoPanOnSelection:ih=!0,autoPanSpeed:rh,connectionRadius:Zr,isValidConnection:Rs,onError:VO,style:sh,id:uu,nodeDragThreshold:UO,connectionDragThreshold:Va,viewport:Ua,onViewportChange:Mi,width:_n,height:oh,colorMode:YO="light",debug:fu,onScroll:du,ariaLabelConfig:Ya,zIndexMode:ah="basic",...Qn},hu){const qa=uu||"1",pu=cie(YO),js=C.useCallback(gu=>{gu.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),du?.(gu)},[du]);return y.jsx("div",{"data-testid":"rf__wrapper",...Qn,onScroll:js,style:{...sh,...Rre},ref:hu,className:It(["react-flow",r,pu]),id:uu,role:"application",children:y.jsxs(Pre,{nodes:t,edges:e,width:_n,height:oh,fitView:Ga,fitViewOptions:th,minZoom:li,maxZoom:ci,nodeOrigin:Gn,nodeExtent:za,zIndexMode:ah,children:[y.jsx(lie,{nodes:t,edges:e,defaultNodes:n,defaultEdges:i,onConnect:O,onConnectStart:v,onConnectEnd:x,onClickConnectStart:S,onClickConnectEnd:k,nodesDraggable:Nt,autoPanOnNodeFocus:ai,nodesConnectable:Cn,nodesFocusable:$n,edgesFocusable:$o,edgesReconnectable:Dr,elementsSelectable:Pt,elevateNodesOnSelect:Qs,elevateEdgesOnSelect:As,minZoom:li,maxZoom:ci,nodeExtent:za,onNodesChange:eh,onEdgesChange:cr,snapToGrid:ve,snapGrid:Ee,connectionMode:P,translateExtent:ui,connectOnClick:GO,defaultEdgeOptions:cu,fitView:Ga,fitViewOptions:th,onNodesDelete:q,onEdgesDelete:z,onDelete:Z,onNodeDragStart:N,onNodeDrag:R,onNodeDragStop:X,onSelectionDrag:B,onSelectionDragStart:M,onSelectionDragStop:L,onMove:h,onMoveStart:p,onMoveEnd:g,noPanClassName:Xr,nodeOrigin:Gn,rfId:qa,autoPanOnConnect:Ps,autoPanOnNodeDrag:Lt,autoPanSpeed:rh,onError:VO,connectionRadius:Zr,isValidConnection:Rs,selectNodesOnDrag:Je,nodeDragThreshold:UO,connectionDragThreshold:Va,onBeforeDelete:te,debug:fu,ariaLabelConfig:Ya,zIndexMode:ah}),y.jsx(Qre,{onInit:f,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:$,onNodeMouseMove:E,onNodeMouseLeave:T,onNodeContextMenu:_,onNodeDoubleClick:Q,nodeTypes:s,edgeTypes:o,connectionLineType:j,connectionLineStyle:Y,connectionLineComponent:G,connectionLineContainerStyle:J,selectionKeyCode:le,selectionOnDrag:H,selectionMode:ce,deleteKeyCode:ne,multiSelectionKeyCode:Se,panActivationKeyCode:be,zoomActivationKeyCode:he,onlyRenderVisibleElements:Xe,defaultViewport:Vn,translateExtent:ui,minZoom:li,maxZoom:ci,preventScrolling:su,zoomOnScroll:DO,zoomOnPinch:_o,zoomOnDoubleClick:zO,panOnScroll:On,panOnScrollSpeed:lr,panOnScrollMode:yn,panOnDrag:XO,autoPanOnSelection:ih,onPaneClick:ZO,onPaneMouseEnter:Xa,onPaneMouseMove:Za,onPaneMouseLeave:Ba,onPaneScroll:zr,onPaneContextMenu:Ia,paneClickDistance:Qo,nodeClickDistance:BO,onSelectionContextMenu:I,onSelectionStart:U,onSelectionEnd:V,onReconnect:ou,onReconnectStart:Ao,onReconnectEnd:IO,onEdgeContextMenu:Fd,onEdgeDoubleClick:Hd,onEdgeMouseEnter:Kd,onEdgeMouseMove:au,onEdgeMouseLeave:lu,reconnectRadius:Jd,defaultMarkerColor:LO,noDragClassName:Gt,noWheelClassName:an,noPanClassName:Xr,rfId:qa,disableKeyboardA11y:Ns,nodeExtent:za,viewport:Ua,onViewportChange:Mi,nodesDraggable:Nt}),y.jsx(rie,{onSelectionChange:F}),Wd,y.jsx(Jne,{proOptions:No,position:nh}),y.jsx(Kne,{rfId:qa,disableKeyboardA11y:Ns})]})})}var Mre=zD(jre);const Lre=t=>t.domNode?.querySelector(".react-flow__viewport-portal");function Dre({children:t}){const e=Ue(Lre);return e?SS.createPortal(t,e):null}function zre(t){const[e,n]=C.useState(t),i=C.useCallback(r=>n(s=>DD(r,s)),[]);return[e,n,i]}function Xre({dimensions:t,lineWidth:e,variant:n,className:i}){return y.jsx("path",{strokeWidth:e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:It(["react-flow__background-pattern",n,i])})}function Zre({radius:t,className:e}){return y.jsx("circle",{cx:t,cy:t,r:t,className:It(["react-flow__background-pattern","dots",e])})}var vo;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(vo||(vo={}));const Bre={[vo.Dots]:1,[vo.Lines]:1,[vo.Cross]:6},Ire=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function d5({id:t,variant:e=vo.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:o,bgColor:l,style:u,className:f,patternClassName:h}){const p=C.useRef(null),{transform:g,patternId:O}=Ue(Ire,Ct),v=i||Bre[e],x=e===vo.Dots,S=e===vo.Cross,k=Array.isArray(n)?n:[n,n],$=[k[0]*g[2]||1,k[1]*g[2]||1],E=v*g[2],T=Array.isArray(s)?s:[s,s],_=S?[E,E]:$,Q=[T[0]*g[2]+_[0]/2,T[1]*g[2]+_[1]/2],N=`${O}${t||""}`;return y.jsxs("svg",{className:It(["react-flow__background",f]),style:{...u,..._O,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:p,"data-testid":"rf__background",children:[y.jsx("pattern",{id:N,x:g[0]%$[0],y:g[1]%$[1],width:$[0],height:$[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${Q[0]},-${Q[1]})`,children:x?y.jsx(Zre,{radius:E/2,className:h}):y.jsx(Xre,{dimensions:_,lineWidth:r,variant:e,className:h})}),y.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}d5.displayName="Background";const Gre=C.memo(d5);function Vre(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Ure(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Yre(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function qre(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Wre(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function og({children:t,className:e,...n}){return y.jsx("button",{type:"button",className:It(["react-flow__controls-button",e]),...n,children:t})}const Fre=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function h5({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:o,onFitView:l,onInteractiveChange:u,className:f,children:h,position:p="bottom-left",orientation:g="vertical","aria-label":O}){const v=bt(),{isInteractive:x,minZoomReached:S,maxZoomReached:k,ariaLabelConfig:$}=Ue(Fre,Ct),{zoomIn:E,zoomOut:T,fitView:_}=$O(),Q=()=>{E(),s?.()},N=()=>{T(),o?.()},R=()=>{_(r),l?.()},X=()=>{v.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),u?.(!x)},q=g==="horizontal"?"horizontal":"vertical";return y.jsxs(CO,{className:It(["react-flow__controls",q,f]),position:p,style:t,"data-testid":"rf__controls","aria-label":O??$["controls.ariaLabel"],children:[e&&y.jsxs(y.Fragment,{children:[y.jsx(og,{onClick:Q,className:"react-flow__controls-zoomin",title:$["controls.zoomIn.ariaLabel"],"aria-label":$["controls.zoomIn.ariaLabel"],disabled:k,children:y.jsx(Vre,{})}),y.jsx(og,{onClick:N,className:"react-flow__controls-zoomout",title:$["controls.zoomOut.ariaLabel"],"aria-label":$["controls.zoomOut.ariaLabel"],disabled:S,children:y.jsx(Ure,{})})]}),n&&y.jsx(og,{className:"react-flow__controls-fitview",onClick:R,title:$["controls.fitView.ariaLabel"],"aria-label":$["controls.fitView.ariaLabel"],children:y.jsx(Yre,{})}),i&&y.jsx(og,{className:"react-flow__controls-interactive",onClick:X,title:$["controls.interactive.ariaLabel"],"aria-label":$["controls.interactive.ariaLabel"],children:x?y.jsx(Wre,{}):y.jsx(qre,{})}),h]})}h5.displayName="Controls";const Hre=C.memo(h5);function Kre({id:t,x:e,y:n,width:i,height:r,style:s,color:o,strokeColor:l,strokeWidth:u,className:f,borderRadius:h,shapeRendering:p,selected:g,onClick:O}){const{background:v,backgroundColor:x}=s||{},S=o||v||x;return y.jsx("rect",{className:It(["react-flow__minimap-node",{selected:g},f]),x:e,y:n,rx:h,ry:h,width:i,height:r,style:{fill:S,stroke:l,strokeWidth:u},shapeRendering:p,onClick:O?k=>O(k,t):void 0})}const Jre=C.memo(Kre),ese=t=>t.nodes.map(e=>e.id),wb=t=>t instanceof Function?t:()=>t;function tse({nodeStrokeColor:t,nodeColor:e,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Jre,onClick:o}){const l=Ue(ese,Ct),u=wb(e),f=wb(t),h=wb(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return y.jsx(y.Fragment,{children:l.map(g=>y.jsx(ise,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:f,nodeClassNameFunc:h,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:o,shapeRendering:p},g))})}function nse({id:t,nodeColorFunc:e,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:l,onClick:u}){const{node:f,x:h,y:p,width:g,height:O}=Ue(v=>{const x=v.nodeLookup.get(t);if(!x)return{node:void 0,x:0,y:0,width:0,height:0};const S=x.internals.userNode,{x:k,y:$}=x.internals.positionAbsolute,{width:E,height:T}=sr(S);return{node:S,x:k,y:$,width:E,height:T}},Ct);return!f||f.hidden||!dD(f)?null:y.jsx(l,{x:h,y:p,width:g,height:O,style:f.style,selected:!!f.selected,className:i(f),color:e(f),borderRadius:r,strokeColor:n(f),strokeWidth:s,shapeRendering:o,onClick:u,id:f.id})}const ise=C.memo(nse);var rse=C.memo(tse);const sse=200,ose=150,ase=t=>!t.hidden,lse=t=>{const e={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:e,boundingRect:t.nodeLookup.size>0?cD(Id(t.nodeLookup,{filter:ase}),e):e,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},cA=(t,e)=>t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,cse=(t,e)=>cA(t.viewBB,e.viewBB)&&cA(t.boundingRect,e.boundingRect)&&t.rfId===e.rfId&&t.panZoom===e.panZoom&&t.translateExtent===e.translateExtent&&t.flowWidth===e.flowWidth&&t.flowHeight===e.flowHeight&&t.ariaLabelConfig===e.ariaLabelConfig,use="react-flow__minimap-desc";function p5({style:t,className:e,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:u,maskColor:f,maskStrokeColor:h,maskStrokeWidth:p,position:g="bottom-right",onClick:O,onNodeClick:v,pannable:x=!1,zoomable:S=!1,ariaLabel:k,inversePan:$,zoomStep:E=1,offsetScale:T=5}){const _=bt(),Q=C.useRef(null),{boundingRect:N,viewBB:R,rfId:X,panZoom:q,translateExtent:z,flowWidth:Z,flowHeight:F,ariaLabelConfig:M}=Ue(lse,cse),B=t?.width??sse,L=t?.height??ose,I=N.width/B,U=N.height/L,V=Math.max(I,U),te=V*B,P=V*L,j=T*V,Y=N.x-(te-N.width)/2-j,G=N.y-(P-N.height)/2-j,J=te+j*2,ne=P+j*2,le=`${use}-${X}`,H=C.useRef(0),ce=C.useRef();H.current=V,C.useEffect(()=>{if(Q.current&&q)return ce.current=bne({domNode:Q.current,panZoom:q,getTransform:()=>_.getState().transform,getViewScale:()=>H.current}),()=>{ce.current?.destroy()}},[q]),C.useEffect(()=>{ce.current?.update({translateExtent:z,width:Z,height:F,inversePan:$,pannable:x,zoomStep:E,zoomable:S})},[x,S,$,E,z,Z,F]);const be=O?ve=>{const[Ee,Xe]=ce.current?.pointer(ve)||[0,0];O(ve,{x:Ee,y:Xe})}:void 0,Se=v?C.useCallback((ve,Ee)=>{const Xe=_.getState().nodeLookup.get(Ee).internals.userNode;v(ve,Xe)},[]):void 0,he=k??M["minimap.ariaLabel"];return y.jsx(CO,{position:g,style:{...t,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*V:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:It(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:y.jsxs("svg",{width:B,height:L,viewBox:`${Y} ${G} ${J} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":le,ref:Q,onClick:be,children:[he&&y.jsx("title",{id:le,children:he}),y.jsx(rse,{onClick:Se,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:o,nodeComponent:l}),y.jsx("path",{className:"react-flow__minimap-mask",d:`M${Y-j},${G-j}h${J+j*2}v${ne+j*2}h${-J-j*2}z
        M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}p5.displayName="MiniMap";const fse=C.memo(p5),dse=t=>e=>t?`${Math.max(1/e.transform[2],1)}`:void 0,hse={[Pc.Line]:"right",[Pc.Handle]:"bottom-right"};function pse({nodeId:t,position:e,variant:n=Pc.Handle,className:i,style:r=void 0,children:s,color:o,minWidth:l=10,minHeight:u=10,maxWidth:f=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:g,autoScale:O=!0,shouldResize:v,onResizeStart:x,onResize:S,onResizeEnd:k}){const $=GD(),E=typeof t=="string"?t:$,T=bt(),_=C.useRef(null),Q=n===Pc.Handle,N=Ue(C.useCallback(dse(Q&&O),[Q,O]),Ct),R=C.useRef(null),X=e??hse[n];C.useEffect(()=>{if(!(!_.current||!E))return R.current||(R.current=Pne({domNode:_.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:z,transform:Z,snapGrid:F,snapToGrid:M,nodeOrigin:B,domNode:L}=T.getState();return{nodeLookup:z,transform:Z,snapGrid:F,snapToGrid:M,nodeOrigin:B,paneDomNode:L}},onChange:(z,Z)=>{const{triggerNodeChanges:F,nodeLookup:M,parentLookup:B,nodeOrigin:L}=T.getState(),I=[],U={x:z.x,y:z.y},V=M.get(E);if(V&&V.expandParent&&V.parentId){const te=V.origin??L,P=z.width??V.measured.width??0,j=z.height??V.measured.height??0,Y={id:V.id,parentId:V.parentId,rect:{width:P,height:j,...hD({x:z.x??V.position.x,y:z.y??V.position.y},{width:P,height:j},V.parentId,M,te)}},G=wS([Y],M,B,L);I.push(...G),U.x=z.x?Math.max(te[0]*P,z.x):void 0,U.y=z.y?Math.max(te[1]*j,z.y):void 0}if(U.x!==void 0&&U.y!==void 0){const te={id:E,type:"position",position:{...U}};I.push(te)}if(z.width!==void 0&&z.height!==void 0){const P={id:E,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};I.push(P)}for(const te of Z){const P={...te,type:"position"};I.push(P)}F(I)},onEnd:({width:z,height:Z})=>{const F={id:E,type:"dimensions",resizing:!1,dimensions:{width:z,height:Z}};T.getState().triggerNodeChanges([F])}})),R.current.update({controlPosition:X,boundaries:{minWidth:l,minHeight:u,maxWidth:f,maxHeight:h},keepAspectRatio:p,resizeDirection:g,onResizeStart:x,onResize:S,onResizeEnd:k,shouldResize:v}),()=>{R.current?.destroy()}},[X,l,u,f,h,p,x,S,k,v]);const q=X.split("-");return y.jsx("div",{className:It(["react-flow__resize-control","nodrag",...q,n,i]),ref:_,style:{...r,scale:N,...o&&{[Q?"backgroundColor":"borderColor"]:o}},children:s})}C.memo(pse);var g5=Object.defineProperty,gse=(t,e,n)=>e in t?g5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,mse=(t,e)=>{for(var n in e)g5(t,n,{get:e[n],enumerable:!0})},Ose=(t,e,n)=>gse(t,e+"",n),m5={};mse(m5,{Graph:()=>or,alg:()=>TS});var yse=Object.defineProperty,O5=(t,e)=>{for(var n in e)yse(t,n,{get:e[n],enumerable:!0})},ES=class{constructor(t){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},t&&(this._isDirected="directed"in t?t.directed:!0,this._isMultigraph="multigraph"in t?t.multigraph:!1,this._isCompound="compound"in t?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return typeof t!="function"?this._defaultNodeLabelFn=()=>t:this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(t=>Object.keys(this._in[t]).length===0)}sinks(){return this.nodes().filter(t=>Object.keys(this._out[t]).length===0)}setNodes(t,e){return t.forEach(n=>{e!==void 0?this.setNode(n,e):this.setNode(n)}),this}setNode(t,e){return t in this._nodes?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return t in this._nodes}removeNode(t){if(t in this._nodes){let e=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(n=>{this.setParent(n)}),delete this._children[t]),Object.keys(this._in[t]).forEach(e),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e===void 0)e="\0";else{e+="";for(let n=e;n!==void 0;n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}parent(t){if(this._isCompound){let e=this._parent[t];if(e!=="\0")return e}}children(t="\0"){if(this._isCompound){let e=this._children[t];if(e)return Object.keys(e)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}return[]}predecessors(t){let e=this._preds[t];if(e)return Object.keys(e)}successors(t){let e=this._sucs[t];if(e)return Object.keys(e)}neighbors(t){let e=this.predecessors(t);if(e){let n=new Set(e),i=this.successors(t);if(i)for(let r of i)n.add(r);return Array.from(n.values())}}isLeaf(t){var e;let n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),((e=n?.length)!=null?e:0)===0}filterNodes(t){let e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,s])=>{t(r)&&e.setNode(r,s)}),Object.values(this._edgeObjs).forEach(r=>{e.hasNode(r.v)&&e.hasNode(r.w)&&e.setEdge(r,this.edge(r))});let n={},i=r=>{let s=this.parent(r);return!s||e.hasNode(s)?(n[r]=s,s):s in n?n[s]:i(s)};return this._isCompound&&e.nodes().forEach(r=>e.setParent(r,i(r))),e}setDefaultEdgeLabel(t){return typeof t!="function"?this._defaultEdgeLabelFn=()=>t:this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,e){return t.reduce((n,i)=>(e!==void 0?this.setEdge(n,i,e):this.setEdge(n,i),i)),this}setEdge(t,e,n,i){let r,s,o,l,u=!1;typeof t=="object"&&t!==null&&"v"in t?(r=t.v,s=t.w,o=t.name,arguments.length===2&&(l=e,u=!0)):(r=t,s=e,o=i,arguments.length>2&&(l=n,u=!0)),r=""+r,s=""+s,o!==void 0&&(o=""+o);let f=Rf(this._isDirected,r,s,o);if(f in this._edgeLabels)return u&&(this._edgeLabels[f]=l),this;if(o!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(s),this._edgeLabels[f]=u?l:this._defaultEdgeLabelFn(r,s,o);let h=vse(this._isDirected,r,s,o);return r=h.v,s=h.w,Object.freeze(h),this._edgeObjs[f]=h,uA(this._preds[s],r),uA(this._sucs[r],s),this._in[s][f]=h,this._out[r][f]=h,this._edgeCount++,this}edge(t,e,n){let i=arguments.length===1?Sb(this._isDirected,t):Rf(this._isDirected,t,e,n);return this._edgeLabels[i]}edgeAsObj(t,e,n){let i=arguments.length===1?this.edge(t):this.edge(t,e,n);return typeof i!="object"||i===null?{label:i}:i}hasEdge(t,e,n){return(arguments.length===1?Sb(this._isDirected,t):Rf(this._isDirected,t,e,n))in this._edgeLabels}removeEdge(t,e,n){let i=arguments.length===1?Sb(this._isDirected,t):Rf(this._isDirected,t,e,n),r=this._edgeObjs[i];if(r){let s=r.v,o=r.w;delete this._edgeLabels[i],delete this._edgeObjs[i],fA(this._preds[o],s),fA(this._sucs[s],o),delete this._in[o][i],delete this._out[s][i],this._edgeCount--}return this}inEdges(t,e){return this.isDirected()?this.filterEdges(this._in[t],t,e):this.nodeEdges(t,e)}outEdges(t,e){return this.isDirected()?this.filterEdges(this._out[t],t,e):this.nodeEdges(t,e)}nodeEdges(t,e){if(t in this._nodes)return this.filterEdges({...this._in[t],...this._out[t]},t,e)}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}filterEdges(t,e,n){if(!t)return;let i=Object.values(t);return n?i.filter(r=>r.v===e&&r.w===n||r.v===n&&r.w===e):i}};function uA(t,e){t[e]?t[e]++:t[e]=1}function fA(t,e){t[e]!==void 0&&!--t[e]&&delete t[e]}function Rf(t,e,n,i){let r=""+e,s=""+n;if(!t&&r>s){let o=r;r=s,s=o}return r+""+s+""+(i===void 0?"\0":i)}function vse(t,e,n,i){let r=""+e,s=""+n;if(!t&&r>s){let l=r;r=s,s=l}let o={v:r,w:s};return i&&(o.name=i),o}function Sb(t,e){return Rf(t,e.v,e.w,e.name)}var bse={};O5(bse,{read:()=>kse,write:()=>xse});function xse(t){let e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:wse(t),edges:Sse(t)},n=t.graph();return n!==void 0&&(e.value=structuredClone(n)),e}function wse(t){return t.nodes().map(e=>{let n=t.node(e),i=t.parent(e),r={v:e};return n!==void 0&&(r.value=n),i!==void 0&&(r.parent=i),r})}function Sse(t){return t.edges().map(e=>{let n=t.edge(e),i={v:e.v,w:e.w};return e.name!==void 0&&(i.name=e.name),n!==void 0&&(i.value=n),i})}function kse(t){let e=new ES(t.options);return t.value!==void 0&&e.setGraph(t.value),t.nodes.forEach(n=>{e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)}),t.edges.forEach(n=>{e.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),e}var TS={};O5(TS,{CycleException:()=>jm,bellmanFord:()=>y5,components:()=>Cse,dijkstra:()=>Rm,dijkstraAll:()=>Qse,findCycles:()=>Ase,floydWarshall:()=>Pse,isAcyclic:()=>jse,postorder:()=>Lse,preorder:()=>Dse,prim:()=>zse,shortestPaths:()=>Xse,tarjan:()=>b5,topsort:()=>x5});var Ese=()=>1;function y5(t,e,n,i){return Tse(t,String(e),n||Ese,i||function(r){var s;return(s=t.outEdges(r))!=null?s:[]})}function Tse(t,e,n,i){let r={},s,o=0,l=t.nodes(),u=function(p){let g=r[p.v],O=r[p.w];if(!g||!O)return;let v=n(p);g.distance+v<O.distance&&(r[p.w]={distance:g.distance+v,predecessor:p.v},s=!0)},f=function(){l.forEach(function(p){i(p).forEach(function(g){let O=g.v===p?g.v:g.w,v=O===g.v?g.w:g.v;u({v:O,w:v})})})};l.forEach(function(p){let g=p===e?0:Number.POSITIVE_INFINITY;r[p]={distance:g,predecessor:""}});let h=l.length;for(let p=1;p<h&&(s=!1,o++,f(),!!s);p++);if(o===h-1&&(s=!1,f(),s))throw new Error("The graph contains a negative weight cycle");return r}function Cse(t){let e={},n=[],i;function r(s){var o,l;s in e||(e[s]=!0,i.push(s),(o=t.successors(s))==null||o.forEach(r),(l=t.predecessors(s))==null||l.forEach(r))}return t.nodes().forEach(function(s){i=[],r(s),i.length&&n.push(i)}),n}var v5=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let n=this._keyIndices[e];if(n!==void 0)return this._arr[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,n){let i=this._keyIndices,r=String(e);if(!(r in i)){let s=this._arr,o=s.length;return i[r]=o,s.push({key:r,priority:n}),this._decrease(o),!0}return!1}removeMin(){if(this.size()===0)throw new Error("Queue underflow");this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,n){let i=this._keyIndices[e];if(i===void 0)throw new Error(`Key not found: ${e}`);let r=this._arr[i].priority;if(n>r)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${n}`);this._arr[i].priority=n,this._decrease(i)}_heapify(e){let n=this._arr,i=2*e,r=i+1,s=e;i<n.length&&(s=n[i].priority<n[s].priority?i:s,r<n.length&&(s=n[r].priority<n[s].priority?r:s),s!==e&&(this._swap(e,s),this._heapify(s)))}_decrease(e){let n=this._arr,i=n[e].priority,r;for(;e!==0&&(r=e>>1,!(n[r].priority<i));)this._swap(e,r),e=r}_swap(e,n){let i=this._arr,r=this._keyIndices,s=i[e],o=i[n];i[e]=o,i[n]=s,r[o.key]=e,r[s.key]=n}},$se=()=>1;function Rm(t,e,n,i){let r=function(s){var o;return(o=t.outEdges(s))!=null?o:[]};return _se(t,String(e),n||$se,i||r)}function _se(t,e,n,i){let r={},s=new v5,o,l,u=function(f){let h=f.v!==o?f.v:f.w,p=r[h];if(!p)return;let g=n(f),O=l.distance+g;if(g<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+f+" Weight: "+g);O<p.distance&&(p.distance=O,p.predecessor=o,s.decrease(h,O))};for(t.nodes().forEach(function(f){let h=f===e?0:Number.POSITIVE_INFINITY;r[f]={distance:h,predecessor:""},s.add(f,h)});s.size()>0;){o=s.removeMin();let f=r[o];if(!f||f.distance===Number.POSITIVE_INFINITY)break;l=f,i(o).forEach(u)}return r}function Qse(t,e,n){return t.nodes().reduce(function(i,r){return i[r]=Rm(t,r,e,n),i},{})}function b5(t){let e=0,n=[],i={},r=[];function s(o){var l;let u=i[o]={onStack:!0,lowlink:e,index:e++};if(n.push(o),(l=t.successors(o))==null||l.forEach(function(f){if(f in i){let h=i[f];h!=null&&h.onStack&&(u.lowlink=Math.min(u.lowlink,h.index))}else{s(f);let h=i[f];h&&(u.lowlink=Math.min(u.lowlink,h.lowlink))}}),u.lowlink===u.index){let f=[],h;do{h=n.pop();let p=i[h];p&&(p.onStack=!1),f.push(h)}while(o!==h);r.push(f)}}return t.nodes().forEach(function(o){o in i||s(o)}),r}function Ase(t){return b5(t).filter(function(e){var n;let i=e[0];return i?e.length>1||e.length===1&&((n=t.outEdges(i,i))!=null?n:[]).length>0:!1})}var Nse=()=>1;function Pse(t,e,n){return Rse(t,e||Nse,n||function(i){var r;return(r=t.outEdges(i))!=null?r:[]})}function Rse(t,e,n){let i={},r=t.nodes();return r.forEach(function(s){let o={};i[s]=o,o[s]={distance:0,predecessor:""},r.forEach(function(l){s!==l&&(o[l]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(s).forEach(function(l){let u=l.v===s?l.w:l.v,f=e(l);o[u]={distance:f,predecessor:s}})}),r.forEach(function(s){let o=i[s];o&&r.forEach(function(l){let u=i[l];u&&r.forEach(function(f){let h=u[s],p=o[f],g=u[f];if(h&&p&&g){let O=h.distance+p.distance;O<g.distance&&(g.distance=O,g.predecessor=p.predecessor)}})})}),i}var jm=class extends Error{constructor(e){super(e),this.name="CycleException"}};function x5(t){let e={},n={},i=[];function r(s){var o;if(s in n)throw new jm;s in e||(n[s]=!0,e[s]=!0,(o=t.predecessors(s))==null||o.forEach(r),delete n[s],i.push(s))}if(t.sinks().forEach(r),Object.keys(e).length!==t.nodeCount())throw new jm;return i}function jse(t){try{x5(t)}catch(e){if(e instanceof jm)return!1;throw e}return!0}function Mse(t,e,n,i,r){Array.isArray(e)||(e=[e]);let s=(l=>{var u;return(u=t.isDirected()?t.successors(l):t.neighbors(l))!=null?u:[]}),o={};return e.forEach(function(l){if(!t.hasNode(l))throw new Error("Graph does not have node: "+l);r=w5(t,l,n==="post",o,s,i,r)}),r}function w5(t,e,n,i,r,s,o){return e in i||(i[e]=!0,n||(o=s(o,e)),r(e).forEach(function(l){o=w5(t,l,n,i,r,s,o)}),n&&(o=s(o,e))),o}function S5(t,e,n){return Mse(t,e,n,function(i,r){return i.push(r),i},[])}function Lse(t,e){return S5(t,e,"post")}function Dse(t,e){return S5(t,e,"pre")}function zse(t,e){var n;let i=new ES,r={},s=new v5,o;function l(h){let p=h.v===o?h.w:h.v,g=s.priority(p);if(g!==void 0){let O=e(h);O<g&&(r[p]=o,s.decrease(p,O))}}if(t.nodeCount()===0)return i;t.nodes().forEach(function(h){s.add(h,Number.POSITIVE_INFINITY),i.setNode(h)});let u=t.nodes()[0];u!==void 0&&s.decrease(u,0);let f=!1;for(;s.size()>0;){if(o=s.removeMin(),o in r)i.setEdge(o,r[o]);else{if(f)throw new Error("Input graph is not connected: "+t);f=!0}(n=t.nodeEdges(o))==null||n.forEach(l)}return i}function Xse(t,e,n,i){return Zse(t,e,n,i??(r=>{var s;return(s=t.outEdges(r))!=null?s:[]}))}function Zse(t,e,n,i){if(n===void 0)return Rm(t,e,n,i);let r=!1,s=t.nodes();for(let o=0;o<s.length;o++){let l=s[o];if(l===void 0)continue;let u=i(l);for(let f=0;f<u.length;f++){let h=u[f];if(!h)continue;let p=h.v===l?h.v:h.w,g=p===h.v?h.w:h.v;n({v:p,w:g})<0&&(r=!0)}if(r)return y5(t,e,n,i)}return Rm(t,e,n,i)}var or=ES;function nu(t,e,n,i){let r=i;for(;t.hasNode(r);)r=CS(i);return n.dummy=e,t.setNode(r,n),r}function Bse(t){let e=new or().setGraph(t.graph());return t.nodes().forEach(n=>e.setNode(n,t.node(n))),t.edges().forEach(n=>{let i=e.edge(n.v,n.w)||{weight:0,minlen:1},r=t.edge(n);e.setEdge(n.v,n.w,{weight:i.weight+r.weight,minlen:Math.max(i.minlen,r.minlen)})}),e}function k5(t){let e=new or({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach(n=>{t.children(n).length||e.setNode(n,t.node(n))}),t.edges().forEach(n=>{e.setEdge(n,t.edge(n))}),e}function dA(t,e){let n=t.x,i=t.y,r=e.x-n,s=e.y-i,o=t.width/2,l=t.height/2;if(!r&&!s)throw new Error("Not possible to find intersection inside of the rectangle");let u,f;return Math.abs(s)*o>Math.abs(r)*l?(s<0&&(l=-l),u=l*r/s,f=l):(r<0&&(o=-o),u=o,f=o*s/r),{x:n+u,y:i+f}}function Ud(t){let e=wd(T5(t)+1).map(()=>[]);return t.nodes().forEach(n=>{let i=t.node(n),r=i.rank;r!==void 0&&(e[r]||(e[r]=[]),e[r][i.order]=n)}),e}function Ise(t){let e=t.nodes().map(i=>{let r=t.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=_r(Math.min,e);t.nodes().forEach(i=>{let r=t.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function Gse(t){let e=t.nodes().map(o=>t.node(o).rank).filter(o=>o!==void 0),n=_r(Math.min,e),i=[];t.nodes().forEach(o=>{let l=t.node(o).rank-n;i[l]||(i[l]=[]),i[l].push(o)});let r=0,s=t.graph().nodeRankFactor;Array.from(i).forEach((o,l)=>{o===void 0&&l%s!==0?--r:o!==void 0&&r&&o.forEach(u=>t.node(u).rank+=r)})}function hA(t,e,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),nu(t,"border",r,e)}function Vse(t,e=E5){let n=[];for(let i=0;i<t.length;i+=e){let r=t.slice(i,i+e);n.push(r)}return n}var E5=65535;function _r(t,e){if(e.length>E5){let n=Vse(e);return t(...n.map(i=>t(...i)))}else return t(...e)}function T5(t){let e=t.nodes().map(n=>{let i=t.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return _r(Math.max,e)}function Use(t,e){let n={lhs:[],rhs:[]};return t.forEach(i=>{e(i)?n.lhs.push(i):n.rhs.push(i)}),n}function Yse(t,e){let n=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-n)+"ms")}}function C5(t,e){return e()}var qse=0;function CS(t){let e=++qse;return t+(""+e)}function wd(t,e,n=1){e==null&&(e=t,t=0);let i=s=>s<e;n<0&&(i=s=>e<s);let r=[];for(let s=t;i(s);s+=n)r.push(s);return r}function Mm(t,e){let n={};for(let i of e)t[i]!==void 0&&(n[i]=t[i]);return n}function AO(t,e){let n;return typeof e=="string"?n=i=>i[e]:n=e,Object.entries(t).reduce((i,[r,s])=>(i[r]=n(s,r),i),{})}function Wse(t,e){return t.reduce((n,i,r)=>(n[i]=e[r],n),{})}var NO="\0";function $5(t,e,n){var i,r,s,o,l,u;if(!(t&&e&&n&&e.dummy==="edge"&&n.dummy==="edge"&&e.edgeObj&&n.edgeObj&&t[e.edgeObj.v]&&t[n.edgeObj.v]&&t[e.edgeObj.w]&&t[n.edgeObj.w]))return 0;let f=!0;e.edgeObj.w===n.edgeObj.w&&(f=!1);let h=f?(r=(i=t[e.edgeObj.v])==null?void 0:i.rank)!=null?r:NaN+1:(o=(s=t[e.edgeObj.w])==null?void 0:s.rank)!=null?o:NaN-1,p=Object.entries(t).find(x=>{var S,k;return((S=x[1].edgeObj)==null?void 0:S.v)===e.edgeObj.v&&((k=x[1].edgeObj)==null?void 0:k.w)===e.edgeObj.w&&x[1].rank===h}),g=Object.entries(t).find(x=>{var S,k;return((S=x[1].edgeObj)==null?void 0:S.v)===n.edgeObj.v&&((k=x[1].edgeObj)==null?void 0:k.w)===n.edgeObj.w&&x[1].rank===h});if(!p||!g)return 0;let O=(l=p[1].order)!=null?l:NaN,v=(u=g[1].order)!=null?u:NaN;return isNaN(O-v)?0:O-v}var Fse="3.1.1",Hse=class{constructor(){Ose(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,n=e._prev;if(n!==e)return pA(n),n}enqueue(e){let n=this._sentinel;e._prev&&e._next&&pA(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){let e=[],n=this._sentinel,i=n._prev;for(;i!==n;)e.push(JSON.stringify(i,Kse)),i=i._prev;return"["+e.join(", ")+"]"}};function pA(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Kse(t,e){if(t!=="_next"&&t!=="_prev")return e}var Jse=Hse,eoe=()=>1;function toe(t,e){if(t.nodeCount()<=1)return[];let n=ioe(t,e||eoe);return noe(n.graph,n.buckets,n.zeroIdx).flatMap(i=>t.outEdges(i.v,i.w)||[])}function noe(t,e,n){var i;let r=[],s=e[e.length-1],o=e[0],l;for(;t.nodeCount();){for(;l=o.dequeue();)kb(t,e,n,l);for(;l=s.dequeue();)kb(t,e,n,l);if(t.nodeCount()){for(let u=e.length-2;u>0;--u)if(l=(i=e[u])==null?void 0:i.dequeue(),l){r=r.concat(kb(t,e,n,l,!0)||[]);break}}}return r}function kb(t,e,n,i,r){let s=[],o=r?s:void 0;return(t.inEdges(i.v)||[]).forEach(l=>{let u=t.edge(l),f=t.node(l.v);r&&s.push({v:l.v,w:l.w}),f.out-=u,kw(e,n,f)}),(t.outEdges(i.v)||[]).forEach(l=>{let u=t.edge(l),f=l.w,h=t.node(f);h.in-=u,kw(e,n,h)}),t.removeNode(i.v),o}function ioe(t,e){let n=new or,i=0,r=0;t.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),t.edges().forEach(l=>{let u=n.edge(l.v,l.w)||0,f=e(l),h=u+f;n.setEdge(l.v,l.w,h);let p=n.node(l.v),g=n.node(l.w);r=Math.max(r,p.out+=f),i=Math.max(i,g.in+=f)});let s=roe(r+i+3).map(()=>new Jse),o=i+1;return n.nodes().forEach(l=>{kw(s,o,n.node(l))}),{graph:n,buckets:s,zeroIdx:o}}function kw(t,e,n){var i,r,s;n.out?n.in?(s=t[n.out-n.in+e])==null||s.enqueue(n):(r=t[t.length-1])==null||r.enqueue(n):(i=t[0])==null||i.enqueue(n)}function roe(t){let e=[];for(let n=0;n<t;n++)e.push(n);return e}function soe(t,e){(t.graph().acyclicer==="greedy"?toe(t,n(t)):ooe(t,e??null)).forEach(i=>{let r=t.edge(i);t.removeEdge(i),r.forwardName=i.name,r.reversed=!0,t.setEdge(i.w,i.v,r,CS("rev"))});function n(i){return r=>i.edge(r).weight}}function ooe(t,e){let n=[],i={},r={};function s(u){Object.hasOwn(r,u)||(r[u]=!0,i[u]=!0,t.outEdges(u).forEach(f=>{Object.hasOwn(i,f.w)?n.push(f):s(f.w)}),delete i[u])}function o(u){var f;Object.hasOwn(r,u)||(r[u]=!0,i[u]=!0,(f=t.outEdges(u))==null||f.forEach(h=>{var p,g;Object.hasOwn(i,h.w)||((p=e.node(u))==null?void 0:p.rank)>((g=e.node(h.w))==null?void 0:g.rank)&&loe(t,h.w,h)?n.push(h):o(h.w)}),delete i[u])}let l=s;return e&&typeof e.node=="function"&&(l=o),t.sources().forEach(l),t.nodes().forEach(l),n}function aoe(t){t.edges().forEach(e=>{let n=t.edge(e);if(n.reversed){t.removeEdge(e);let i=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,i)}})}function loe(t,e,n){let i=new Set;function r(s){var o;if(t.sources().includes(s))return!0;i.add(s);for(let l of(o=t.inEdges(s))!=null?o:[])if(!(l.v===n.v&&l.w===n.w)&&!i.has(l.v)&&r(l.v))return!0;return!1}return r(e)}function coe(t){t.graph().dummyChains=[],t.edges().forEach(e=>uoe(t,e))}function uoe(t,e){let n=e.v,i=t.node(n).rank,r=e.w,s=t.node(r).rank,o=e.name,l=t.edge(e),u=l.labelRank;if(s===i+1)return;t.removeEdge(e);let f,h,p;for(p=0,++i;i<s;++p,++i)l.points=[],h={width:0,height:0,edgeLabel:l,edgeObj:e,rank:i},f=nu(t,"edge",h,"_d"),i===u&&(h.width=l.width,h.height=l.height,h.dummy="edge-label",h.labelpos=l.labelpos),t.setEdge(n,f,{weight:l.weight},o),p===0&&t.graph().dummyChains.push(f),n=f;t.setEdge(n,r,{weight:l.weight},o)}function foe(t){t.graph().dummyChains.forEach(e=>{let n=t.node(e),i=n.edgeLabel,r;for(t.setEdge(n.edgeObj,i);n.dummy;)r=t.successors(e)[0],t.removeNode(e),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),e=r,n=t.node(e)})}function $S(t){let e={};function n(i){let r=t.node(i);if(Object.hasOwn(e,i))return r.rank;e[i]=!0;let s=t.outEdges(i),o=s?s.map(u=>u==null?Number.POSITIVE_INFINITY:n(u.w)-t.edge(u).minlen):[],l=_r(Math.min,o);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}t.sources().forEach(n)}function jc(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var _5=doe;function doe(t){let e=new or({directed:!1}),n=t.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let i=n[0],r=t.nodeCount();e.setNode(i,{});let s,o;for(;hoe(e,t)<r&&(s=poe(e,t),!!s);)o=e.hasNode(s.v)?jc(t,s):-jc(t,s),goe(e,t,o);return e}function hoe(t,e){function n(i){let r=e.nodeEdges(i);r&&r.forEach(s=>{let o=s.v,l=i===o?s.w:o;!t.hasNode(l)&&!jc(e,s)&&(t.setNode(l,{}),t.setEdge(i,l,{}),n(l))})}return t.nodes().forEach(n),t.nodeCount()}function poe(t,e){return e.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return t.hasNode(i.v)!==t.hasNode(i.w)&&(r=jc(e,i)),r<n[0]?[r,i]:n},[Number.POSITIVE_INFINITY,null])[1]}function goe(t,e,n){t.nodes().forEach(i=>e.node(i).rank+=n)}var{preorder:moe,postorder:Ooe}=TS,yoe=La;La.initLowLimValues=QS;La.initCutValues=_S;La.calcCutValue=Q5;La.leaveEdge=N5;La.enterEdge=P5;La.exchangeEdges=R5;function La(t){t=Bse(t),$S(t);let e=_5(t);QS(e),_S(e,t);let n,i;for(;n=N5(e);)i=P5(e,t,n),R5(e,t,n,i)}function _S(t,e){let n=Ooe(t,t.nodes());n=n.slice(0,n.length-1),n.forEach(i=>voe(t,e,i))}function voe(t,e,n){let i=t.node(n).parent,r=t.edge(n,i);r.cutvalue=Q5(t,e,n)}function Q5(t,e,n){let i=t.node(n).parent,r=!0,s=e.edge(n,i),o=0;s||(r=!1,s=e.edge(i,n)),o=s.weight;let l=e.nodeEdges(n);return l&&l.forEach(u=>{let f=u.v===n,h=f?u.w:u.v;if(h!==i){let p=f===r,g=e.edge(u).weight;if(o+=p?g:-g,xoe(t,n,h)){let O=t.edge(n,h).cutvalue;o+=p?-O:O}}}),o}function QS(t,e){arguments.length<2&&(e=t.nodes()[0]),A5(t,{},1,e)}function A5(t,e,n,i,r){let s=n,o=t.node(i);e[i]=!0;let l=t.neighbors(i);return l&&l.forEach(u=>{Object.hasOwn(e,u)||(n=A5(t,e,n,u,i))}),o.low=s,o.lim=n++,r?o.parent=r:delete o.parent,n}function N5(t){return t.edges().find(e=>t.edge(e).cutvalue<0)}function P5(t,e,n){let i=n.v,r=n.w;e.hasEdge(i,r)||(i=n.w,r=n.v);let s=t.node(i),o=t.node(r),l=s,u=!1;return s.lim>o.lim&&(l=o,u=!0),e.edges().filter(f=>u===gA(t,t.node(f.v),l)&&u!==gA(t,t.node(f.w),l)).reduce((f,h)=>jc(e,h)<jc(e,f)?h:f)}function R5(t,e,n,i){let r=n.v,s=n.w;t.removeEdge(r,s),t.setEdge(i.v,i.w,{}),QS(t),_S(t,e),boe(t,e)}function boe(t,e){let n=t.nodes().find(r=>!t.node(r).parent);if(!n)return;let i=moe(t,[n]);i=i.slice(1),i.forEach(r=>{let s=t.node(r).parent,o=e.edge(r,s),l=!1;o||(o=e.edge(s,r),l=!0),e.node(r).rank=e.node(s).rank+(l?o.minlen:-o.minlen)})}function xoe(t,e,n){return t.hasEdge(e,n)}function gA(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}var woe=Soe;function Soe(t){let e=t.graph().ranker;if(typeof e=="function")return e(t);switch(e){case"network-simplex":mA(t);break;case"tight-tree":Eoe(t);break;case"longest-path":koe(t);break;case"none":break;default:mA(t)}}var koe=$S;function Eoe(t){$S(t),_5(t)}function mA(t){yoe(t)}var Toe=Coe;function Coe(t){let e=_oe(t),n=t.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(i=>{let r=t.node(i),s=r.edgeObj,o=$oe(t,e,s.v,s.w),l=o.path,u=o.lca,f=0,h=l[f],p=!0;for(;i!==s.w;){if(r=t.node(i),p){for(;(h=l[f])!==u&&t.node(h).maxRank<r.rank;)f++;h===u&&(p=!1)}if(!p){for(;f<l.length-1&&t.node(l[f+1]).minRank<=r.rank;)f++;h=l[f]}h!==void 0&&t.setParent(i,h),i=t.successors(i)[0]}})}function $oe(t,e,n,i){let r=[],s=[],o=Math.min(e[n].low,e[i].low),l=Math.max(e[n].lim,e[i].lim),u;u=n;do u=t.parent(u),r.push(u);while(u&&(e[u].low>o||l>e[u].lim));let f=u,h=i;for(;(h=t.parent(h))!==f;)s.push(h);return{path:r.concat(s.reverse()),lca:f}}function _oe(t){let e={},n=0;function i(r){let s=n;t.children(r).forEach(i),e[r]={low:s,lim:n++}}return t.children(NO).forEach(i),e}function Qoe(t){let e=nu(t,"root",{},"_root"),n=Aoe(t),i=Object.values(n),r=_r(Math.max,i)-1,s=2*r+1;t.graph().nestingRoot=e,t.edges().forEach(l=>t.edge(l).minlen*=s);let o=Noe(t)+1;t.children(NO).forEach(l=>{j5(t,e,s,o,r,n,l)}),t.graph().nodeRankFactor=s}function j5(t,e,n,i,r,s,o){var l;let u=t.children(o);if(!u.length){o!==e&&t.setEdge(e,o,{weight:0,minlen:n});return}let f=hA(t,"_bt"),h=hA(t,"_bb"),p=t.node(o);t.setParent(f,o),p.borderTop=f,t.setParent(h,o),p.borderBottom=h,u.forEach(g=>{var O;j5(t,e,n,i,r,s,g);let v=t.node(g),x=v.borderTop?v.borderTop:g,S=v.borderBottom?v.borderBottom:g,k=v.borderTop?i:2*i,$=x!==S?1:r-((O=s[o])!=null?O:0)+1;t.setEdge(f,x,{weight:k,minlen:$,nestingEdge:!0}),t.setEdge(S,h,{weight:k,minlen:$,nestingEdge:!0})}),t.parent(o)||t.setEdge(e,f,{weight:0,minlen:r+((l=s[o])!=null?l:0)})}function Aoe(t){let e={};function n(i,r){let s=t.children(i);s&&s.length&&s.forEach(o=>n(o,r+1)),e[i]=r}return t.children(NO).forEach(i=>n(i,1)),e}function Noe(t){return t.edges().reduce((e,n)=>e+t.edge(n).weight,0)}function Poe(t){let e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach(n=>{t.edge(n).nestingEdge&&t.removeEdge(n)})}var Roe=joe;function joe(t){function e(n){let i=t.children(n),r=t.node(n);if(i.length&&i.forEach(e),r&&Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let s=r.minRank,o=r.maxRank+1;s<o;++s)OA(t,"borderLeft","_bl",n,r,s),OA(t,"borderRight","_br",n,r,s)}}t.children(NO).forEach(e)}function OA(t,e,n,i,r,s){let o={width:0,height:0,rank:s,borderType:e},l=r[e][s-1],u=nu(t,"border",o,n);r[e][s]=u,t.setParent(u,i),l&&t.setEdge(l,u,{weight:1})}function Moe(t){var e;let n=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(n==="lr"||n==="rl")&&M5(t)}function Loe(t){var e;let n=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(n==="bt"||n==="rl")&&Doe(t),(n==="lr"||n==="rl")&&(zoe(t),M5(t))}function M5(t){t.nodes().forEach(e=>yA(t.node(e))),t.edges().forEach(e=>yA(t.edge(e)))}function yA(t){let e=t.width;t.width=t.height,t.height=e}function Doe(t){t.nodes().forEach(e=>Eb(t.node(e))),t.edges().forEach(e=>{var n;let i=t.edge(e);(n=i.points)==null||n.forEach(Eb),Object.hasOwn(i,"y")&&Eb(i)})}function Eb(t){t.y=-t.y}function zoe(t){t.nodes().forEach(e=>Tb(t.node(e))),t.edges().forEach(e=>{var n;let i=t.edge(e);(n=i.points)==null||n.forEach(Tb),Object.hasOwn(i,"x")&&Tb(i)})}function Tb(t){let e=t.x;t.x=t.y,t.y=e}function Xoe(t,e=null){let n={},i=t.nodes().filter(f=>!t.children(f).length),r=i.map(f=>t.node(f).rank),s=_r(Math.max,r),o=wd(s+1).map(()=>[]);function l(f){if(n[f])return;n[f]=!0;let h=t.node(f);o[h.rank].push(f);let p=t.successors(f);p&&[...p].sort((g,O)=>u(g,O)).forEach(l)}i.sort((f,h)=>t.node(f).rank-t.node(h).rank).forEach(l);function u(f,h){let p=t.node(f),g=t.node(h);return $5(e,p,g)}return o}function Zoe(t,e){let n=0;for(let i=1;i<e.length;++i)n+=Boe(t,e[i-1],e[i]);return n}function Boe(t,e,n){let i=Wse(n,n.map((f,h)=>h)),r=e.flatMap(f=>{let h=t.outEdges(f);return h?h.map(p=>({pos:i[p.w],weight:t.edge(p).weight})).sort((p,g)=>p.pos-g.pos):[]}),s=1;for(;s<n.length;)s<<=1;let o=2*s-1;s-=1;let l=new Array(o).fill(0),u=0;return r.forEach(f=>{let h=f.pos+s;l[h]+=f.weight;let p=0;for(;h>0;)h%2&&(p+=l[h+1]),h=h-1>>1,l[h]+=f.weight;u+=f.weight*p}),u}function Ioe(t,e=[]){return e.map(n=>{let i=t.inEdges(n);if(!i||!i.length)return{v:n};{let r=i.reduce((s,o)=>{let l=t.edge(o),u=t.node(o.v);return{sum:s.sum+l.weight*u.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}})}function Goe(t,e){let n={};t.forEach((r,s)=>{let o={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(o.barycenter=r.barycenter,o.weight=r.weight),n[r.v]=o}),e.edges().forEach(r=>{let s=n[r.v],o=n[r.w];s!==void 0&&o!==void 0&&(o.indegree++,s.out.push(o))});let i=Object.values(n).filter(r=>!r.indegree);return Voe(i)}function Voe(t){let e=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&Uoe(r,s)}}function i(r){return s=>{s.in.push(r),--s.indegree===0&&t.push(s)}}for(;t.length;){let r=t.pop();e.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(i(r))}return e.filter(r=>!r.merged).map(r=>Mm(r,["vs","i","barycenter","weight"]))}function Uoe(t,e){let n=0,i=0;t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/i,t.weight=i,t.i=Math.min(e.i,t.i),e.merged=!0}function Yoe(t,e,n,i,r){let s={},o=null,l=null,u=r;typeof e=="boolean"?(u=e,s={}):e&&(s=e,o=n??null,l=i??null);let f=Use(t,k=>Object.hasOwn(k,"barycenter")),h=f.lhs,p=f.rhs.sort((k,$)=>$.i-k.i),g=[],O=0,v=0,x=0;h.sort(qoe(l,o,!!u));for(let[k,$]of Object.entries(s)){let E=h.findIndex(T=>T.vs[0]===k);h.splice(E+1,0,$)}x=vA(g,p,x),h.forEach(k=>{x+=k.vs.length,g.push(k.vs),O+=k.barycenter*k.weight,v+=k.weight,x=vA(g,p,x)});let S={vs:g.flat(1)};return v&&(S.barycenter=O/v,S.weight=v),S}function vA(t,e,n){let i;for(;e.length&&(i=e[e.length-1]).i<=n;)e.pop(),t.push(i.vs),n++;return n}function qoe(t,e,n){return(i,r)=>{if(i.barycenter<r.barycenter)return-1;if(i.barycenter>r.barycenter)return 1;if(t&&(typeof i.vs[0]=="string"||typeof r.vs[0]=="string")){let s=t.node(i.vs[0]),o=t.node(r.vs[0]),l=$5(e,s,o);if(l!==0)return l}return n?r.i-i.i:i.i-r.i}}function L5(t,e,n,i,r){var s,o,l,u,f,h,p,g,O,v,x;let S=null,k=r;typeof i=="boolean"?(k=i,S=null):i!==void 0&&(S=i);let $=t.children(e),E=t.node(e),T=E?E.borderLeft:void 0,_=E?E.borderRight:void 0,Q={};T&&($=$.filter(Z=>Z!==T&&Z!==_));let N=Ioe(t,$);N.forEach(Z=>{if(t.children(Z.v).length){let{result:F}=L5(t,Z.v,n,S,k);Q[Z.v]=F,Object.hasOwn(F,"barycenter")&&Foe(Z,F)}});let R=Goe(N,n);Woe(R,Q);let X={},q=!1;for(let Z=0;Z<R.length;Z++)for(let F=Z+1;F<R.length;F++)if(!(!R[Z]||!R[F]||!((s=R[Z])!=null&&s.barycenter)||!((o=R[F])!=null&&o.barycenter))&&((l=R[Z])==null?void 0:l.barycenter)===R[F].barycenter){let M=(f=(u=R[Z])==null?void 0:u.vs[0])!=null?f:"",B=(p=(h=R[F])==null?void 0:h.vs[0])!=null?p:"",L=t.node(M),I=t.node(B);if(L.dummy==="edge"&&I.dummy==="edge"&&((g=L.edgeObj)==null?void 0:g.v)===((O=I.edgeObj)==null?void 0:O.v)&&((v=L.edgeObj)==null?void 0:v.w)===((x=I.edgeObj)==null?void 0:x.w))if(L.edgeLabel.reversed){X[B]=R[Z],R.splice(Z,1),Z--;break}else X[M]=R[F],R.splice(F,1),F--;else q=!0}let z=Yoe(R,X,S,t,k);if(T&&_){z.vs=[T,z.vs,_].flat(1);let Z=t.predecessors(T);if(Z&&Z.length){let F=t.node(Z[0]),M=t.predecessors(_),B=t.node(M[0]);Object.hasOwn(z,"barycenter")||(z.barycenter=0,z.weight=0),z.barycenter=(z.barycenter*z.weight+F.order+B.order)/(z.weight+2),z.weight+=2}}return Object.defineProperty(z,"result",{value:z,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(z,"usedBias",{value:q,enumerable:!1,configurable:!0,writable:!0}),z}function Woe(t,e){t.forEach(n=>{n.vs=n.vs.flatMap(i=>e[i]?e[i].vs:i)})}function Foe(t,e){t.barycenter!==void 0?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)}function Hoe(t,e,n,i){i||(i=t.nodes());let r=Koe(t),s=new or({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(o=>t.node(o));return i.forEach(o=>{let l=t.node(o),u=t.parent(o);if(l.rank===e||l.minRank<=e&&e<=l.maxRank){s.setNode(o),s.setParent(o,u||r);let f=t[n](o);f&&f.forEach(h=>{let p=h.v===o?h.w:h.v,g=s.edge(p,o),O=g!==void 0?g.weight:0;s.setEdge(p,o,{weight:t.edge(h).weight+O})}),Object.hasOwn(l,"minRank")&&s.setNode(o,{borderLeft:l.borderLeft[e],borderRight:l.borderRight[e]})}}),s}function Koe(t){let e;for(;t.hasNode(e=CS("_root")););return e}function Joe(t,e,n){let i={},r;n.forEach(s=>{let o=t.parent(s),l,u;for(;o;){if(l=t.parent(o),l?(u=i[l],i[l]=o):(u=r,r=o),u&&u!==o){e.setEdge(u,o);return}o=l}})}function D5(t,e={},n=null){if(typeof e.customOrder=="function"){e.customOrder(t,D5);return}let i=T5(t),r=bA(t,wd(1,i+1),"inEdges"),s=bA(t,wd(i-1,-1,-1),"outEdges"),o=Xoe(t,n);if(xA(t,o),e.disableOptimalOrderHeuristic)return;let l=Number.POSITIVE_INFINITY,u,f=e.constraints||[];for(let h=0,p=0;p<4;++h,++p){eae(h%2?r:s,h%4>=2,f,n),o=Ud(t);let g=Zoe(t,o);g<l?(p=0,u=Object.assign({},o),l=g):g===l&&(u=structuredClone(o))}xA(t,u)}function bA(t,e,n){let i=new Map,r=(s,o)=>{i.has(s)||i.set(s,[]),i.get(s).push(o)};for(let s of t.nodes()){let o=t.node(s);if(typeof o.rank=="number"&&r(o.rank,s),typeof o.minRank=="number"&&typeof o.maxRank=="number")for(let l=o.minRank;l<=o.maxRank;l++)l!==o.rank&&r(l,s)}return e.map(function(s){return Hoe(t,s,n,i.get(s)||[])})}function eae(t,e,n,i){let r=!0,s=new or;t.forEach(function(o){n.forEach(h=>s.setEdge(h.left,h.right));let l=o.graph().root,{result:u,usedBias:f}=L5(o,l,s,i,r);e&&f&&(r=!r),u.vs.forEach((h,p)=>o.node(h).order=p),Joe(o,s,u.vs)})}function xA(t,e){Object.values(e).forEach(n=>n.forEach((i,r)=>t.node(i).order=r))}function tae(t,e){let n={};function i(r,s){let o=0,l=0,u=r.length,f=s[s.length-1];return s.forEach((h,p)=>{let g=iae(t,h),O=g?t.node(g).order:u;(g||h===f)&&(s.slice(l,p+1).forEach(v=>{let x=t.predecessors(v);x&&x.forEach(S=>{let k=t.node(S),$=k.order;($<o||O<$)&&!(k.dummy&&t.node(v).dummy)&&z5(n,S,v)})}),l=p+1,o=O)}),s}return e.length&&e.reduce(i),n}function nae(t,e){let n={};function i(s,o,l,u,f){wd(o,l).forEach(h=>{let p=s[h];if(p!==void 0&&t.node(p).dummy){let g=t.predecessors(p);g&&g.forEach(O=>{if(O===void 0)return;let v=t.node(O);v.dummy&&(v.order<u||v.order>f)&&z5(n,O,p)})}})}function r(s,o){let l=-1,u=-1,f=0;return o.forEach((h,p)=>{if(t.node(h).dummy==="border"){let g=t.predecessors(h);if(g&&g.length){let O=g[0];if(O===void 0)return;u=t.node(O).order,i(o,f,p,l,u),f=p,l=u}}i(o,f,o.length,u,s.length)}),o}return e.length&&e.reduce(r),n}function iae(t,e){if(t.node(e).dummy){let n=t.predecessors(e);if(n)return n.find(i=>t.node(i).dummy)}}function z5(t,e,n){if(e>n){let r=e;e=n,n=r}let i=t[e];i||(t[e]=i={}),i[n]=!0}function rae(t,e,n){if(e>n){let r=e;e=n,n=r}let i=t[e];return i!==void 0&&Object.hasOwn(i,n)}function sae(t,e,n,i,r){let s={},o={},l={};return e.forEach(u=>{u.forEach((f,h)=>{s[f]=f,o[f]=f,l[f]=h})}),e.forEach(u=>{let f=-1,h=-1,p=!1,g=u,O=u.findIndex(v=>r?.includes(v)||wA(v,t,r));O>0&&(g=[u[O],...u.slice(0,O),...u.slice(O+1)],p=!0),g.forEach(v=>{var x;let S=i(v);if(S&&S.length){r!=null&&r.includes(v)&&(S=S.filter(E=>wA(E,t,r)));let k=S.sort((E,T)=>{let _=l[E],Q=l[T];return(_!==void 0?_:0)-(Q!==void 0?Q:0)}),$=(k.length-1)/2;for(let E=Math.floor($),T=Math.ceil($);E<=T;++E){let _=k[E];if(_===void 0)continue;let Q=l[_];if(Q!==void 0&&o[v]===v&&f<Q&&l[_]!==h&&!rae(n,v,_)){let N=s[_];N!==void 0&&(o[_]=v,o[v]=s[v]=N,f=Q,p&&(f=-1,h=(x=l[_])!=null?x:-1,p=!1))}}}})}),{root:s,align:o}}function oae(t,e,n,i,r=!1){let s={},o=aae(t,e,n,r),l=r?"borderLeft":"borderRight";function u(O,v){let x=o.nodes().slice(),S={},k=x.pop();for(;k;){if(S[k])O(k);else{S[k]=!0,x.push(k);for(let $ of v(k))x.push($)}k=x.pop()}}function f(O){let v=o.inEdges(O);v?s[O]=v.reduce((x,S)=>{var k;let $=(k=s[S.v])!=null?k:0,E=o.edge(S);return Math.max(x,$+(E!==void 0?E:0))},0):s[O]=0}function h(O){let v=o.outEdges(O),x=Number.POSITIVE_INFINITY;v&&(x=v.reduce((k,$)=>{let E=s[$.w],T=o.edge($);return Math.min(k,(E!==void 0?E:0)-(T!==void 0?T:0))},Number.POSITIVE_INFINITY));let S=t.node(O);x!==Number.POSITIVE_INFINITY&&S.borderType!==l&&(s[O]=Math.max(s[O]!==void 0?s[O]:0,x))}function p(O){return o.predecessors(O)||[]}function g(O){return o.successors(O)||[]}return u(f,p),u(h,g),Object.keys(i).forEach(O=>{var v;let x=n[O];x!==void 0&&(s[O]=(v=s[x])!=null?v:0)}),s}function aae(t,e,n,i){let r=new or,s=t.graph(),o=dae(s.nodesep,s.edgesep,i);return e.forEach(l=>{let u;l.forEach(f=>{let h=n[f];if(h!==void 0){if(r.setNode(h),u!==void 0){let p=n[u];if(p!==void 0){let g=r.edge(p,h);r.setEdge(p,h,Math.max(o(t,f,u),g||0))}}u=f}})}),r}function lae(t,e){return Object.values(e).reduce((n,i)=>{let r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;Object.entries(i).forEach(([l,u])=>{let f=hae(t,l)/2;r=Math.max(u+f,r),s=Math.min(u-f,s)});let o=r-s;return o<n[0]&&(n=[o,i]),n},[Number.POSITIVE_INFINITY,null])[1]}function cae(t,e){let n=Object.values(e),i=_r(Math.min,n),r=_r(Math.max,n);["u","d"].forEach(s=>{["l","r"].forEach(o=>{let l=s+o,u=t[l];if(!u||u===e)return;let f=Object.values(u),h=i-_r(Math.min,f);o!=="l"&&(h=r-_r(Math.max,f)),h&&(t[l]=AO(u,p=>p+h))})})}function uae(t,e=void 0){let n=t.ul;return n?AO(n,(i,r)=>{var s,o;if(e){let u=e.toLowerCase(),f=t[u];if(f&&f[r]!==void 0)return f[r]}let l=Object.values(t).map(u=>{let f=u[r];return f!==void 0?f:0}).sort((u,f)=>u-f);return(((s=l[1])!=null?s:0)+((o=l[2])!=null?o:0))/2}):{}}function fae(t,e){let n=Ud(t),i=Object.assign(tae(t,n),nae(t,n)),r={},s;["u","d"].forEach(l=>{s=l==="u"?n:Object.values(n).reverse(),["l","r"].forEach(u=>{u==="r"&&(s=s.map(p=>Object.values(p).reverse()));let f=sae(t,s,i,p=>(l==="u"?t.predecessors(p):t.successors(p))||[],e),h=oae(t,s,f.root,f.align,u==="r");u==="r"&&(h=AO(h,p=>-p)),r[l+u]=h})});let o=lae(t,r);return cae(r,o),uae(r,t.graph().align)}function dae(t,e,n){return(i,r,s)=>{let o=i.node(r),l=i.node(s),u=0,f;if(u+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":f=-o.width/2;break;case"r":f=o.width/2;break}if(f&&(u+=n?f:-f),f=void 0,u+=(o.dummy?e:t)/2,u+=(l.dummy?e:t)/2,u+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":f=l.width/2;break;case"r":f=-l.width/2;break}return f&&(u+=n?f:-f),u}}function hae(t,e){return t.node(e).width}function wA(t,e,n){var i;if(!n)return!1;let r=(i=e.node(t))==null?void 0:i.edgeObj;if(!r||e.node(t).edgeLabel.reversed)return!1;let s=n.indexOf(r?.v),o=n.indexOf(r?.w);return s!==-1&&o!==-1&&s===(o+1)%n.length||s===(o-1)%n.length}function pae(t,e){t=k5(t),gae(t),Object.entries(fae(t,e)).forEach(([n,i])=>t.node(n).x=i)}function gae(t){let e=Ud(t),n=t.graph(),i=n.ranksep,r=n.rankalign,s=0;e.forEach(o=>{let l=o.reduce((u,f)=>{var h;let p=(h=t.node(f).height)!=null?h:0;return u>p?u:p},0);o.forEach(u=>{let f=t.node(u);r==="top"?f.y=s+f.height/2:r==="bottom"?f.y=s+l-f.height/2:f.y=s+l/2}),s+=l+i})}var SA=new WeakMap;function mae(t,e={}){return X5(t,C5,e),t}function kA(t,e,n){let i=e;for(;i!==void 0;){let r=t.parent(i);if(r===n)return i;i=r}}function X5(t,e,n){var i;let r=t.nodes().filter($=>t.children($).length),s={};r.forEach($=>{let E=t.node($);if(E&&E.rankdir){let T=new or({multigraph:!0,compound:!0});T.setGraph({rankdir:E.rankdir});let _=t.children($);_.forEach(M=>{let B={...t.node(M)};T.setNode(M,B);let L=t.parent(M);L&&L!==$&&_.includes(L)&&T.setParent(M,L)});let Q=new Set;t.edges().forEach(M=>{let B=kA(t,M.v,$),L=kA(t,M.w,$);if(B&&L&&B!==L){let I=`${B}\0${L}`;Q.has(I)||(Q.add(I),T.setEdge(B,L,{...t.edge(M)}))}}),X5(T,e,n);let N=$A(T);EA(N,e,n,null),TA(T,N);let R=1/0,X=1/0,q=-1/0,z=-1/0;T.nodes().forEach(M=>{if(M===$)return;let B=T.node(M);B&&typeof B.x=="number"&&typeof B.y=="number"&&typeof B.width=="number"&&typeof B.height=="number"&&(R=Math.min(R,B.x-B.width/2),q=Math.max(q,B.x+B.width/2),X=Math.min(X,B.y-B.height/2),z=Math.max(z,B.y+B.height/2))}),(!isFinite(R)||!isFinite(X)||!isFinite(q)||!isFinite(z))&&(R=X=0,q=z=0);let Z=q-R,F=z-X;s[$]={minX:R,minY:X,maxX:q,maxY:z,width:Z,height:F,offsetX:R,offsetY:X},E._dagreClusterSubgraph=T}});let o=[],l=$=>{let E=[],T=(t.children($)||[]).filter(_=>_!==$);for(;T.length>0;){let _=T.shift();E.push(_),(t.children(_)||[]).filter(Q=>Q!==_).forEach(Q=>T.push(Q))}return E},u=new Map;r.forEach($=>{let E=t.node($);E&&E.rankdir&&s[$]&&u.set($,(t.children($)||[]).filter(T=>T!==$))});let f=new Set([...u.values()].flat()),h=new Map;u.forEach(($,E)=>{f.has(E)||h.set(E,l(E))});let p=new Set([...h.values()].flat()),g=$=>{for(let[E,T]of h)if(T.includes($))return E;return $},O=[];t.edges().forEach($=>{(p.has($.v)||p.has($.w))&&O.push({edge:$,label:t.edge($)})});let v=new Map;p.forEach($=>{let E=t.parent($);v.set($,typeof E=="string"?E:void 0)}),h.forEach(($,E)=>{let T=t.node(E),_=[];$.forEach(R=>{let X=t.node(R);X&&(_.push({id:R,node:X,parent:v.get(R)}),t.removeNode(R))});let Q=O.filter(({edge:R})=>$.includes(R.v)||$.includes(R.w)),N=s[E];T&&(o.push({clusterId:E,subgraph:T._dagreClusterSubgraph,bounds:N,children:$,removedNodes:_,removedEdges:Q}),T.width=N.width,T.height=N.height)});let x=new Set;O.forEach(({edge:$,label:E})=>{let T=g($.v),_=g($.w);if(T!==_&&t.hasNode(T)&&t.hasNode(_)){let Q=`${T}\0${_}`;x.has(Q)||(x.add(Q),t.setEdge(T,_,{...E,width:0,height:0}))}});let S=$A(t),k=EA(S,e,n,(i=SA.get(t))!=null?i:null);SA.set(t,k),TA(t,S),x.forEach($=>{let E=$.indexOf("\0"),T=$.slice(0,E),_=$.slice(E+1);t.hasEdge(T,_)&&t.removeEdge(T,_)}),o.forEach(({clusterId:$,subgraph:E,bounds:T,removedNodes:_,removedEdges:Q})=>{var N,R;let X=t.node($),q=(N=X?.x)!=null?N:0,z=(R=X?.y)!=null?R:0,Z=(T.minX+T.maxX)/2,F=(T.minY+T.maxY)/2;_.forEach(({id:M,node:B,parent:L})=>{t.setNode(M,B),L!==void 0&&t.setParent(M,L)}),Q.forEach(({edge:M,label:B})=>{t.setEdge(M,B)}),E.nodes().forEach(M=>{if(M===$)return;let B=E.node(M),L=t.node(M);L&&B&&typeof B.x=="number"&&typeof B.y=="number"&&(L.x=q+(B.x-Z),L.y=z+(B.y-F))}),delete X._dagreClusterSubgraph}),r.forEach($=>{var E,T;let _=t.node($),Q=s[$];if(_&&_.rankdir&&_._dagreClusterSubgraph&&Q){let N=_._dagreClusterSubgraph,R=(E=_.x)!=null?E:0,X=(T=_.y)!=null?T:0,q=(Q.minX+Q.maxX)/2,z=(Q.minY+Q.maxY)/2;N.nodes().forEach(Z=>{if(Z===$)return;let F=N.node(Z),M=t.node(Z);if(M&&F&&typeof F.x=="number"&&typeof F.y=="number"){let B=F.x-q,L=F.y-z;M.x=R+B,M.y=X+L}}),delete _._dagreClusterSubgraph}})}function EA(t,e,n,i=null){var r,s;let o=n?.useDynamic!==!1,l=o&&(r=i?.graph)!=null?r:null,u=o&&(s=i?.rawNodes)!=null?s:null;e("    makeSpaceForEdgeLabels",()=>kae(t)),e("    removeSelfEdges",()=>Pae(t)),e("    acyclic",()=>soe(t,l)),e("    nestingGraph.run",()=>Qoe(t)),e("    rank",()=>woe(k5(t))),e("    injectEdgeLabelProxies",()=>Eae(t)),e("    removeEmptyRanks",()=>Gse(t)),e("    nestingGraph.cleanup",()=>Poe(t)),e("    normalizeRanks",()=>Ise(t)),e("    assignRankMinMax",()=>Tae(t)),e("    removeEdgeLabelProxies",()=>Cae(t)),e("    normalize.run",()=>coe(t)),e("    parentDummyChains",()=>Toe(t)),e("    addBorderSegments",()=>Roe(t)),e("    order",()=>D5(t,n,u)),e("    insertSelfEdges",()=>Rae(t)),e("    adjustCoordinateSystem",()=>Moe(t)),e("    position",()=>pae(t,n.corePath)),e("    positionSelfEdges",()=>jae(t));let f=JSON.parse(JSON.stringify(t._nodes));return e("    removeBorderNodes",()=>Nae(t)),e("    normalize.undo",()=>foe(t)),e("    fixupEdgeLabelCoords",()=>Qae(t)),e("    undoCoordinateSystem",()=>Loe(t)),e("    translateGraph",()=>$ae(t)),e("    assignNodeIntersects",()=>_ae(t)),e("    reversePoints",()=>Aae(t)),e("    acyclic.undo",()=>aoe(t)),{graph:t,rawNodes:f}}function TA(t,e){t.nodes().forEach(n=>{let i=t.node(n),r=e.node(n);i&&(i.x=r.x,i.y=r.y,i.order=r.order,i.rank=r.rank,e.children(n).length&&(i.width=r.width,i.height=r.height))}),t.edges().forEach(n=>{let i=t.edge(n),r=e.edge(n);i.points=r.points,Object.hasOwn(r,"x")&&(i.x=r.x,i.y=r.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var Oae=["nodesep","edgesep","ranksep","marginx","marginy"],yae={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},vae=["acyclicer","ranker","rankdir","align","rankalign"],bae=["width","height","rank"],CA={width:0,height:0},xae=["minlen","weight","width","height","labeloffset"],wae={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Sae=["labelpos"];function $A(t){let e=new or({multigraph:!0,compound:!0}),n=$b(t.graph());return e.setGraph(Object.assign({},yae,Cb(n,Oae),Mm(n,vae))),t.nodes().forEach(i=>{let r=$b(t.node(i)),s=Cb(r,bae);Object.keys(CA).forEach(l=>{s[l]===void 0&&(s[l]=CA[l])}),e.setNode(i,s);let o=t.parent(i);o!==void 0&&e.setParent(i,o)}),t.edges().forEach(i=>{let r=$b(t.edge(i));e.setEdge(i,Object.assign({},wae,Cb(r,xae),Mm(r,Sae)))}),e}function kae(t){let e=t.graph();e.ranksep/=2,t.edges().forEach(n=>{var i;let r=t.edge(n);r.minlen*=2,((i=r.labelpos)!=null?i:"r").toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Eae(t){t.edges().forEach(e=>{let n=t.edge(e);if(n.width&&n.height){let i=t.node(e.v),r={rank:(t.node(e.w).rank-i.rank)/2+i.rank,e};nu(t,"edge-proxy",r,"_ep")}})}function Tae(t){let e=0;t.nodes().forEach(n=>{let i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,e=Math.max(e,i.maxRank))}),t.graph().maxRank=e}function Cae(t){t.nodes().forEach(e=>{let n=t.node(e);if(n.dummy==="edge-proxy"){let i=n;t.edge(i.e).labelRank=n.rank,t.removeNode(e)}})}function $ae(t){let e=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=t.graph(),o=s.marginx||0,l=s.marginy||0;function u(f){let h=f.x,p=f.y,g=f.width,O=f.height;e=Math.min(e,h-g/2),n=Math.max(n,h+g/2),i=Math.min(i,p-O/2),r=Math.max(r,p+O/2)}t.nodes().forEach(f=>u(t.node(f))),t.edges().forEach(f=>{let h=t.edge(f);Object.hasOwn(h,"x")&&u(h)}),e-=o,i-=l,t.nodes().forEach(f=>{let h=t.node(f);h.x-=e,h.y-=i}),t.edges().forEach(f=>{let h=t.edge(f);h.points.forEach(p=>{p.x-=e,p.y-=i}),Object.hasOwn(h,"x")&&(h.x-=e),Object.hasOwn(h,"y")&&(h.y-=i)}),s.width=n-e+o,s.height=r-i+l}function _ae(t){t.edges().forEach(e=>{if(e.v===e.w)return;let n=t.edge(e),i=t.node(e.v),r=t.node(e.w),s,o;n.points?(s=n.points[0],o=n.points[n.points.length-1]):(n.points=[],s=r,o=i),n.points.unshift(dA(i,s)),n.points.push(dA(r,o))})}function Qae(t){t.edges().forEach(e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function Aae(t){t.edges().forEach(e=>{let n=t.edge(e);n.reversed&&n.points.reverse()})}function Nae(t){t.nodes().forEach(e=>{if(t.children(e).length){let n=t.node(e),i=t.node(n.borderTop),r=t.node(n.borderBottom),s=t.node(n.borderLeft[n.borderLeft.length-1]),o=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-s.x),n.height=Math.abs(r.y-i.y),n.x=s.x+n.width/2,n.y=i.y+n.height/2}}),t.nodes().forEach(e=>{t.node(e).dummy==="border"&&t.removeNode(e)})}function Pae(t){t.edges().forEach(e=>{if(e.v===e.w){let n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function Rae(t){Ud(t).forEach(e=>{let n=0;e.forEach((i,r)=>{let s=t.node(i);typeof s.rank!="number"&&(s.rank=0),s.order=r+n,(s.selfEdges||[]).forEach(o=>{nu(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:r+ ++n,e:o.e,edgeLabel:o.label},"_se"),(!Array.isArray(o.label.points)||o.label.points.length!==7)&&(o.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete s.selfEdges})})}function jae(t){t.nodes().forEach(e=>{let n=t.node(e),i=r=>typeof r=="number"&&isFinite(r);if(n.dummy==="selfedge"){let r=n,s=t.node(r.e.v),o=i(s?.x)?s.x:0,l=i(s?.y)?s.y:0,u=i(s?.width)?s.width:0,f=i(s?.height)?s.height:0,h=i(n.x)?n.x:o,p=i(n.y)?n.y:l,g=u/2,O=f/2;r.edgeLabel.points=[{x:h+g,y:p-O},{x:h+g,y:p-O},{x:h,y:p},{x:h-g,y:p+O},{x:h-g,y:p+O},{x:h,y:p},{x:h,y:p}],r.edgeLabel.x=h,r.edgeLabel.y=p,t.setEdge(r.e,r.edgeLabel),t.removeNode(e)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(r=>{if(!Array.isArray(r.label.points)||r.label.points.length!==7){let s=i(n.x)?n.x:0,o=i(n.y)?n.y:0,l=i(n.width)?n.width:0,u=i(n.height)?n.height:0,f=l/2,h=u/2;r.label.points=[{x:s+f,y:o-h},{x:s+f,y:o-h},{x:s,y:o},{x:s-f,y:o+h},{x:s-f,y:o+h},{x:s,y:o},{x:s,y:o}]}})})}function Cb(t,e){return AO(Mm(t,e),Number)}function $b(t){let e={};return t&&Object.entries(t).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),e[n]=i}),e}function Mae(t){let e=Ud(t),n=new or({compound:!0,multigraph:!0}).setGraph({});return t.nodes().forEach(i=>{n.setNode(i,{label:i}),n.setParent(i,"layer"+t.node(i).rank)}),t.edges().forEach(i=>n.setEdge(i.v,i.w,{},i.name)),e.forEach((i,r)=>{let s="layer"+r;n.setNode(s,{rank:"same"}),i.reduce((o,l)=>(n.setEdge(o,l,{style:"invis"}),l))}),n}var Lae={graphlib:m5,version:Fse,layout:mae,debug:Mae,util:{time:Yse,notime:C5}},_A=Lae;/*! For license information please see dagre.esm.js.LEGAL.txt */const QA="__ungrouped__",Dae="Ungrouped",zae=12,Lg=46,fa=16,_b=24,AA=30,ag=40,Z5=1.6;function B5(t){return Math.max(120,Math.min(260,t.length*7.2+36))}function Xae(t){let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t.charCodeAt(n),e=Math.imul(e,16777619)>>>0;return e%zae}function Zae(t){const e=new Set(t.map(u=>u.id)),n=new Map;for(const u of t)n.set(u.id,new Set);for(const u of t)for(const f of u.transitions??[])!e.has(f.to)||f.to===u.id||(n.get(u.id).add(f.to),n.get(f.to).add(u.id));const i=new Map(t.map((u,f)=>[u.id,f])),r=new Set,s=[],o=[],l=new Map(t.map(u=>[u.id,u]));for(const u of t){if(r.has(u.id))continue;const f=[u.id],h=[];for(r.add(u.id);f.length>0;){const g=f.pop();h.push(g);const O=[...n.get(g)].sort((v,x)=>i.get(v)-i.get(x));for(const v of O)r.has(v)||(r.add(v),f.push(v))}const p=h.sort((g,O)=>i.get(g)-i.get(O)).map(g=>l.get(g));p.length>=2?s.push(p):o.push(p[0])}return{chains:s,loose:o}}function Bae(t){const e=new _A.graphlib.Graph({multigraph:!0});e.setGraph({rankdir:"LR",nodesep:fa,ranksep:48,marginx:0,marginy:0});const n=new Set(t.map(r=>r.id));for(const r of t)e.setNode(r.id,{width:B5(r.label),height:Lg});for(const r of t)(r.transitions??[]).forEach((s,o)=>{!n.has(s.to)||s.to===r.id||e.setEdge(r.id,s.to,{},`${r.id}->${s.to}#${o}`)});_A.layout(e);const i=t.map(r=>{const s=e.node(r.id);return{id:r.id,surface:r,x:s.x-s.width/2,y:s.y-s.height/2,width:s.width,height:s.height}});return Gae(i)}function Iae(t){const e=t.map(f=>B5(f.label)),n=e.reduce((f,h)=>Math.max(f,h),0),r=Math.max(1,Math.round(Math.sqrt(t.length)*Z5))*(n+fa),s=[];let o=0,l=0,u=0;for(let f=0;f<t.length;f+=1){const h=e[f];o>0&&o+h>r&&(o=0,l+=Lg+fa),s.push({id:t[f].id,surface:t[f],x:o,y:l,width:h,height:Lg}),o+=h+fa,u=Math.max(u,o-fa)}return{cards:s,width:u,height:l+Lg}}function Gae(t){let e=1/0,n=1/0,i=0,r=0;for(const o of t)e=Math.min(e,o.x),n=Math.min(n,o.y),i=Math.max(i,o.x+o.width),r=Math.max(r,o.y+o.height);return{cards:t.map(o=>({...o,x:o.x-e,y:o.y-n})),width:i-e,height:r-n}}function Vae(t){const{chains:e,loose:n}=Zae(t),i=e.map(Bae);n.length>0&&i.push(Iae(n));const r=[];let s=AA,o=0;for(const f of i){for(const h of f.cards)r.push({...h,x:_b+h.x,y:s+h.y});s+=f.height+fa,o=Math.max(o,f.width)}const l=Math.max(s-fa,AA)+_b,u=o+_b*2;return{cards:r,width:u,height:l}}function Uae(t){const e=new Map((t.areas??[]).map(s=>[s.id,s.label])),n=new Map,i=[];for(const s of t.surfaces){const o=s.area!==void 0&&e.has(s.area)?s.area:QA;n.has(o)||(n.set(o,[]),i.push(o)),n.get(o).push(s)}const r=i.map(s=>({id:s,label:s===QA?Dae:e.get(s),surfaces:n.get(s)}));return r.sort((s,o)=>o.surfaces.length!==s.surfaces.length?o.surfaces.length-s.surfaces.length:s.id<o.id?-1:1),r}function Yae(t,e){const i=Uae(t).map(S=>{const k=Vae(S.surfaces);return{id:S.id,label:S.label,colorIndex:Xae(S.id),surfaceCount:S.surfaces.length,cards:k.cards,width:k.width,height:k.height}});if(i.length===0)return{districts:[],width:0,height:0};const r=e??{},s=[],o=[];for(const S of i){const k=r[S.id];k===void 0?o.push(S):s.push({...S,x:k.x,y:k.y})}let l=0,u=0;for(const S of s)l=Math.max(l,S.x+S.width),u=Math.max(u,S.y+S.height);const f=o.reduce((S,k)=>S+k.width*k.height,0),h=Math.max(Math.sqrt(f*Z5),o.reduce((S,k)=>Math.max(S,k.width),0)),p=[...s];let g=0,O=s.length>0?u+ag:0,v=0;for(const S of o)g>0&&g+S.width>h&&(g=0,O+=v+ag,v=0),p.push({...S,x:g,y:O}),g+=S.width+ag,v=Math.max(v,S.height),l=Math.max(l,g-ag);const x=o.length>0?O+v:u;return{districts:p,width:l,height:x}}function qae(t,e){return{x:t.x+e.x+e.width/2,y:t.y+e.y+e.height/2}}function I5(t){const e=new Set,n=new Set,i=new Set(t.surfaces.map(s=>s.id));for(const s of t.surfaces)for(const o of s.transitions??[])i.has(o.to)&&(n.add(s.id),e.add(o.to));const r=new Set;for(const s of t.surfaces)!(s.entry!==void 0)&&!e.has(s.id)&&!n.has(s.id)&&r.add(s.id);return r}function Wae(t){const e=new Set;if(t===null)return e;for(const n of t.steps)e.add(n.surface);return e}function Fae(t){const e=new Set(t.surfaces.map(i=>i.id)),n=[];for(const i of t.surfaces)for(const r of i.transitions??[])e.has(r.to)||n.push({from:i.id,to:r.to});return n}function Hae(t,e){const n=new Set(t.surfaces.map(r=>r.id)),i=[];for(const r of e)for(const s of r.steps)n.has(s.surface)||i.push({journey:r.id,surface:s.surface});return i}const NA=.25;function Kae(t,e){return e.editable?"none":t==="f"||t==="F"?"toggle":t==="Escape"&&e.active?"exit":"none"}function Qb(t,e){return t?e?"css":"api":"css"}function Jae(t){const e=!t;return{sidebar:e,titleBand:e,honestyStrip:e,journeyBand:e}}function ele(t,e,n=.001){return t<=e+n}function tle(t){return t?0:200}function nle(t){return t===void 0?[]:Array.isArray(t)?t:[t]}function Lm(t){return t===void 0?[]:Array.isArray(t)?t:[t]}const PA=["#2563eb","#dc2626","#16a34a","#d97706","#7c3aed","#0891b2","#db2777","#65a30d"];function RA(t){return PA[t%PA.length]}function ile(t){const e=new Map;return t.steps.forEach((n,i)=>{e.has(n.surface)||e.set(n.surface,i+1)}),e}function rle(t){const e=new Map;for(const i of t){const r=new Set(i.steps.map(s=>s.surface));for(const s of r)e.set(s,(e.get(s)??0)+1)}const n=new Set;for(const[i,r]of e)r>=2&&n.add(i);return n}function sle(t,e){return t.steps.map(n=>e.get(n.surface)).filter(n=>n!==void 0)}function ole(t){return t.map((e,n)=>`${n===0?"M":"L"} ${e.x} ${e.y}`).join(" ")}function ale({journeys:t,activeJourneyId:e,centers:n,walkStationId:i,reducedMotion:r}){const s=rle(t);return y.jsx(Dre,{children:y.jsxs("svg",{width:1,height:1,style:{position:"absolute",left:0,top:0,overflow:"visible",pointerEvents:"none"},children:[t.map((o,l)=>{const u=o.id===e,f=e!==null&&!u,h=sle(o,n);if(h.length<2)return null;const p=RA(l);return y.jsx("path",{d:ole(h),fill:"none",stroke:p,strokeWidth:u?6:4,strokeLinejoin:"round",strokeLinecap:"round",opacity:f?.18:u?1:.4,pathLength:1,style:u&&!r?{strokeDasharray:1,strokeDashoffset:1,animation:"sm-metro-reveal 600ms ease-out forwards"}:void 0},o.id)}),t.map((o,l)=>{if(o.id!==e)return null;const u=RA(l);return[...ile(o).entries()].map(([h,p])=>{const g=n.get(h);if(g===void 0)return null;const O=h===i;return y.jsxs("g",{transform:`translate(${g.x} ${g.y})`,children:[O&&y.jsx("circle",{r:18,fill:"none",stroke:u,strokeWidth:2,opacity:.5}),s.has(h)&&y.jsx("circle",{r:13,fill:"var(--color-surface)",stroke:u,strokeWidth:2}),y.jsx("circle",{r:10,fill:u,stroke:"var(--color-surface)",strokeWidth:2}),y.jsx("text",{textAnchor:"middle",y:3.5,fontSize:11,fontWeight:700,fill:"#ffffff",children:p})]},`${o.id}:${h}`)})})]})})}var jA=1,lle=.9,cle=.8,ule=.17,Ab=.1,Nb=.999,fle=.9999,dle=.99,hle=/[\\\/_+.#"@\[\(\{&]/,ple=/[\\\/_+.#"@\[\(\{&]/g,gle=/[\s-]/,G5=/[\s-]/g;function Ew(t,e,n,i,r,s,o){if(s===e.length)return r===t.length?jA:dle;var l=`${r},${s}`;if(o[l]!==void 0)return o[l];for(var u=i.charAt(s),f=n.indexOf(u,r),h=0,p,g,O,v;f>=0;)p=Ew(t,e,n,i,f+1,s+1,o),p>h&&(f===r?p*=jA:hle.test(t.charAt(f-1))?(p*=cle,O=t.slice(r,f-1).match(ple),O&&r>0&&(p*=Math.pow(Nb,O.length))):gle.test(t.charAt(f-1))?(p*=lle,v=t.slice(r,f-1).match(G5),v&&r>0&&(p*=Math.pow(Nb,v.length))):(p*=ule,r>0&&(p*=Math.pow(Nb,f-r))),t.charAt(f)!==e.charAt(s)&&(p*=fle)),(p<Ab&&n.charAt(f-1)===i.charAt(s+1)||i.charAt(s+1)===i.charAt(s)&&n.charAt(f-1)!==i.charAt(s))&&(g=Ew(t,e,n,i,f+1,s+2,o),g*Ab>p&&(p=g*Ab)),p>h&&(h=p),f=n.indexOf(u,f+1);return o[l]=h,h}function MA(t){return t.toLowerCase().replace(G5," ")}function mle(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,Ew(t,e,MA(t),MA(e),0,0,{})}var Ole=Object.defineProperty,iu=(t,e)=>Ole(t,"name",{value:e,configurable:!0}),V5=!!(typeof window<"u"&&window.document&&window.document.createElement);function ma(t,e,{checkForDefaultPrevented:n=!0}={}){return iu(function(r){if(t?.(r),n===!1||!r||!r.defaultPrevented)return e?.(r)},"handleEvent")}iu(ma,"composeEventHandlers");function yle(t){if(!V5)throw new Error("Cannot access window outside of the DOM");return t?.ownerDocument?.defaultView??window}iu(yle,"getOwnerWindow");function Tw(t){if(!V5)throw new Error("Cannot access document outside of the DOM");return t?.ownerDocument??document}iu(Tw,"getOwnerDocument");function U5(t,e=!1){const{activeElement:n}=Tw(t);if(!n?.nodeName)return null;if(Y5(n)&&n.contentDocument)return U5(n.contentDocument.body,e);if(e){const i=n.getAttribute("aria-activedescendant");if(i){const r=Tw(n).getElementById(i);if(r)return r}}return n}iu(U5,"getActiveElement");function Y5(t){return t.tagName==="IFRAME"}iu(Y5,"isFrame");var vle=Object.defineProperty,AS=(t,e)=>vle(t,"name",{value:e,configurable:!0});function Cw(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}AS(Cw,"setRef");function _a(...t){return e=>{let n=!1;const i=t.map(r=>{const s=Cw(r,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<i.length;r++){const s=i[r];typeof s=="function"?s():Cw(t[r],null)}}}}AS(_a,"composeRefs");function ru(...t){return C.useCallback(_a(...t),t)}AS(ru,"useComposedRefs");var ble=Object.defineProperty,bi=(t,e)=>ble(t,"name",{value:e,configurable:!0});function xle(t,e){const n=C.createContext(e);n.displayName=t+"Context";const i=bi(s=>{const{children:o,...l}=s,u=C.useMemo(()=>l,Object.values(l));return y.jsx(n.Provider,{value:u,children:o})},"Provider");i.displayName=t+"Provider";function r(s,o={}){const{optional:l=!1}=o,u=C.useContext(n);if(u)return u;if(e!==void 0)return e;if(!l)throw new Error(`\`${s}\` must be used within \`${t}\``)}return bi(r,"useContext"),[i,r]}bi(xle,"createContext");function q5(t,e=[]){let n=[];function i(s,o){const l=C.createContext(o);l.displayName=s+"Context";const u=n.length;n=[...n,o];const f=bi(p=>{const{scope:g,children:O,...v}=p,x=g?.[t]?.[u]||l,S=C.useMemo(()=>v,Object.values(v));return y.jsx(x.Provider,{value:S,children:O})},"Provider");f.displayName=s+"Provider";function h(p,g,O={}){const{optional:v=!1}=O,x=g?.[t]?.[u]||l,S=C.useContext(x);if(S)return S;if(o!==void 0)return o;if(!v)throw new Error(`\`${p}\` must be used within \`${s}\``)}return bi(h,"useContext"),[f,h]}bi(i,"createContext");const r=bi(()=>{const s=n.map(o=>C.createContext(o));return bi(function(l){const u=l?.[t]||s;return C.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])},"useScope")},"createScope");return r.scopeName=t,[i,W5(r,...e)]}bi(q5,"createContextScope");function W5(...t){const e=t[0];if(t.length===1)return e;const n=bi(()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return bi(function(s){const o=i.reduce((l,{useScope:u,scopeName:f})=>{const p=u(s)[`__scope${f}`];return{...l,...p}},{});return C.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}bi(W5,"composeContextScopes");var Mc=globalThis?.document?C.useLayoutEffect:()=>{},wle=Object.defineProperty,Sle=(t,e)=>wle(t,"name",{value:e,configurable:!0}),kle=Ed[" useId ".trim().toString()]||(()=>{}),Ele=0;function Rr(t){const[e,n]=C.useState(kle());return Mc(()=>{t||n(i=>i??String(Ele++))},[t]),t||(e?`radix-${e}`:"")}Sle(Rr,"useId");var Tle=Object.defineProperty,Cle=(t,e)=>Tle(t,"name",{value:e,configurable:!0}),LA=Ed[" useEffectEvent ".trim().toString()],DA=Ed[" useInsertionEffect ".trim().toString()];function F5(t){if(typeof LA=="function")return LA(t);const e=C.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof DA=="function"?DA(()=>{e.current=t}):Mc(()=>{e.current=t}),C.useMemo(()=>((...n)=>e.current?.(...n)),[])}Cle(F5,"useEffectEvent");var $le=Object.defineProperty,Yd=(t,e)=>$le(t,"name",{value:e,configurable:!0}),_le=Ed[" useInsertionEffect ".trim().toString()]||Mc;function H5({prop:t,defaultProp:e,onChange:n=Yd(()=>{},"onChange"),caller:i}){const[r,s,o]=K5({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:r,f=C.useCallback(h=>{if(l){const p=J5(h)?h(t):h;p!==t&&o.current?.(p)}else s(h)},[l,t,s,o]);return[u,f]}Yd(H5,"useControllableState");function K5({defaultProp:t,onChange:e}){const[n,i]=C.useState(t),r=C.useRef(n),s=C.useRef(e);return _le(()=>{s.current=e},[e]),C.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,i,s]}Yd(K5,"useUncontrolledState");function J5(t){return typeof t=="function"}Yd(J5,"isFunction");var zA=Symbol("RADIX:SYNC_STATE");function Qle(t,e,n,i){const{prop:r,defaultProp:s,onChange:o,caller:l}=e,u=r!==void 0,f=F5(o),h=[{...n,state:s}];i&&h.push(i);const[p,g]=C.useReducer((S,k)=>{if(k.type===zA)return{...S,state:k.state};const $=t(S,k);return u&&!Object.is($.state,S.state)&&f($.state),$},...h),O=p.state,v=C.useRef(O);C.useEffect(()=>{v.current!==O&&(v.current=O,u||f(O))},[O,v,u]);const x=C.useMemo(()=>r!==void 0?{...p,state:r}:p,[p,r]);return C.useEffect(()=>{u&&!Object.is(r,p.state)&&g({type:zA,state:r})},[r,p.state,u]),[x,g]}Yd(Qle,"useControllableStateReducer");var Ale=Object.defineProperty,ar=(t,e)=>Ale(t,"name",{value:e,configurable:!0});function NS(t){const e=C.forwardRef((n,i)=>{let{children:r,...s}=n,o=null,l=!1;const u=[];$w(r)&&typeof lg=="function"&&(r=lg(r._payload)),C.Children.forEach(r,g=>{if(iz(g)){l=!0;const O=g;let v="child"in O.props?O.props.child:O.props.children;$w(v)&&typeof lg=="function"&&(v=lg(v._payload)),o=Ple(O,v),u.push(o?.props?.children)}else u.push(g)}),o?o=C.cloneElement(o,void 0,u):!l&&C.Children.count(r)===1&&C.isValidElement(r)&&(o=r);const f=o?nz(o):void 0,h=ru(i,f);if(!o){if(r||r===0)throw new Error(l?Mle(t):jle(t));return r}const p=tz(s,o.props??{});return o.type!==C.Fragment&&(p.ref=i?h:f),C.cloneElement(o,p)});return e.displayName=`${t}.Slot`,e}ar(NS,"createSlot");var ez=Symbol.for("radix.slottable");function Nle(t){const e=ar(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=ez,e}ar(Nle,"createSlottable");var Ple=ar((t,e)=>{if("child"in t.props){const n=t.props.child;return C.isValidElement(n)?C.cloneElement(n,void 0,t.props.children(n.props.children)):null}return C.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function tz(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...l)=>{const u=s(...l);return r(...l),u}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}ar(tz,"mergeProps");function nz(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}ar(nz,"getElementRef");function iz(t){return C.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===ez}ar(iz,"isSlottable");var Rle=Symbol.for("react.lazy");function $w(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===Rle&&"_payload"in t&&rz(t._payload)}ar($w,"isLazyComponent");function rz(t){return typeof t=="object"&&t!==null&&"then"in t}ar(rz,"isPromiseLike");var jle=ar(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Mle=ar(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),lg=Ed[" use ".trim().toString()],Lle=Object.defineProperty,Dle=(t,e)=>Lle(t,"name",{value:e,configurable:!0}),zle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ji=zle.reduce((t,e)=>{const n=NS(`Primitive.${e}`),i=C.forwardRef((r,s)=>{const{asChild:o,...l}=r,u=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(u,{...l,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{});function sz(t,e){t&&SS.flushSync(()=>t.dispatchEvent(e))}Dle(sz,"dispatchDiscreteCustomEvent");var Xle=Object.defineProperty,Zle=(t,e)=>Xle(t,"name",{value:e,configurable:!0});function Lc(t){const e=C.useRef(t);return C.useEffect(()=>{e.current=t}),C.useMemo(()=>((...n)=>e.current?.(...n)),[])}Zle(Lc,"useCallbackRef");var Ble=Object.defineProperty,Ft=(t,e)=>Ble(t,"name",{value:e,configurable:!0}),_w="dismissableLayer.update",Ile="dismissableLayer.pointerDownOutside",Gle="dismissableLayer.focusOutside",XA,oz=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Vle=C.forwardRef(Ft(function(e,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:f,...h}=e,p=C.useContext(oz),[g,O]=C.useState(null),v=g?.ownerDocument??globalThis?.document,[,x]=C.useState({}),S=ru(n,O),k=Array.from(p.layers),[$]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),E=$?k.indexOf($):-1,T=g?k.indexOf(g):-1,_=p.layersWithOutsidePointerEventsDisabled.size>0,Q=T>=E,N=C.useRef(!1),R=lz(Z=>{o?.(Z),u?.(Z),Z.defaultPrevented||f?.()},{ownerDocument:v,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:N,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:C.useCallback(Z=>{if(!(Z instanceof Node))return!1;const F=[...p.branches].some(M=>M.contains(Z));return Q&&!F},[p.branches,Q])}),X=cz(Z=>{if(r&&N.current)return;const F=Z.target;[...p.branches].some(B=>B.contains(F))||(l?.(Z),u?.(Z),Z.defaultPrevented||f?.())},v),q=g?T===k.length-1:!1,z=Lc(Z=>{Z.key==="Escape"&&(s?.(Z),!Z.defaultPrevented&&f&&(Z.preventDefault(),f()))});return C.useEffect(()=>{if(q)return v.addEventListener("keydown",z,{capture:!0}),()=>v.removeEventListener("keydown",z,{capture:!0})},[v,q,z]),C.useEffect(()=>{if(g)return i&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(XA=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(g)),p.layers.add(g),Qw(),()=>{i&&(p.layersWithOutsidePointerEventsDisabled.delete(g),p.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=XA))}},[g,v,i,p]),C.useEffect(()=>()=>{g&&(p.layers.delete(g),p.layersWithOutsidePointerEventsDisabled.delete(g),Qw())},[g,p]),C.useEffect(()=>{const Z=Ft(()=>x({}),"handleUpdate");return document.addEventListener(_w,Z),()=>document.removeEventListener(_w,Z)},[]),y.jsx(ji.div,{...h,ref:S,style:{pointerEvents:_?Q?"auto":"none":void 0,...e.style},onFocusCapture:ma(e.onFocusCapture,X.onFocusCapture),onBlurCapture:ma(e.onBlurCapture,X.onBlurCapture),onPointerDownCapture:ma(e.onPointerDownCapture,R.onPointerDownCapture)})},"DismissableLayer"));function az(){const t=C.useContext(oz),[e,n]=C.useState(null);return C.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Ft(az,"useDismissableLayerSurface");var Ule=Ft(()=>!0,"IS_TRUE");function lz(t,e){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:o=Ule}=e,l=Lc(t),u=C.useRef(!1),f=C.useRef(!1),h=C.useRef(new Map),p=C.useRef(()=>{});return C.useEffect(()=>{function g(){f.current=!1,r.current=!1,h.current.clear()}Ft(g,"resetOutsideInteraction");function O(){return Array.from(h.current.values()).some(Boolean)}Ft(O,"isOutsideInteractionIntercepted");function v(E){if(!f.current)return;const T=E.target;T instanceof Node&&[...s].some(Q=>Q.contains(T))||h.current.set(E.type,!0),E.type==="click"&&window.setTimeout(()=>{f.current&&p.current()},0)}Ft(v,"handleInteractionCapture");function x(E){f.current&&h.current.set(E.type,!1)}Ft(x,"handleInteractionBubble");const S=Ft(E=>{if(E.target&&!u.current){let T=function(){n.removeEventListener("click",p.current);const Q=O();g(),Q||PS(Ile,l,_,{discrete:!0})};if(Ft(T,"handleAndDispatchPointerDownOutsideEvent"),!o(E.target)){n.removeEventListener("click",p.current),g(),u.current=!1;return}const _={originalEvent:E};f.current=!0,r.current=i&&E.button===0,h.current.clear(),!i||E.button!==0?T():(n.removeEventListener("click",p.current),p.current=T,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),g();u.current=!1},"handlePointerDown"),k=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const E of k)n.addEventListener(E,v,!0),n.addEventListener(E,x);const $=window.setTimeout(()=>{n.addEventListener("pointerdown",S)},0);return()=>{window.clearTimeout($),n.removeEventListener("pointerdown",S),n.removeEventListener("click",p.current);for(const E of k)n.removeEventListener(E,v,!0),n.removeEventListener(E,x)}},[n,l,i,r,s,o]),{onPointerDownCapture:Ft(()=>u.current=!0,"onPointerDownCapture")}}Ft(lz,"usePointerDownOutside");function cz(t,e=globalThis?.document){const n=Lc(t),i=C.useRef(!1);return C.useEffect(()=>{const r=Ft(s=>{s.target&&!i.current&&PS(Gle,n,{originalEvent:s},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",r),()=>e.removeEventListener("focusin",r)},[e,n]),{onFocusCapture:Ft(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Ft(()=>i.current=!1,"onBlurCapture")}}Ft(cz,"useFocusOutside");function Qw(){const t=new CustomEvent(_w);document.dispatchEvent(t)}Ft(Qw,"dispatchUpdate");function PS(t,e,n,{discrete:i}){const r=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),i?sz(r,s):r.dispatchEvent(s)}Ft(PS,"handleAndDispatchCustomEvent");var Yle=Object.defineProperty,Sn=(t,e)=>Yle(t,"name",{value:e,configurable:!0}),Pb="focusScope.autoFocusOnMount",Rb="focusScope.autoFocusOnUnmount",ZA={bubbles:!1,cancelable:!0},qle=C.forwardRef(Sn(function(e,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=e,[u,f]=C.useState(null),h=Lc(s),p=Lc(o),g=C.useRef(null),O=ru(n,f),v=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let S=function(T){if(v.paused||!u)return;const _=T.target;u.contains(_)?g.current=_:ls(g.current,{select:!0})},k=function(T){if(v.paused||!u)return;const _=T.relatedTarget;_!==null&&(u.contains(_)||ls(g.current,{select:!0}))},$=function(T){if(document.activeElement===document.body)for(const Q of T)Q.removedNodes.length>0&&ls(u)};Sn(S,"handleFocusIn"),Sn(k,"handleFocusOut"),Sn($,"handleMutations"),document.addEventListener("focusin",S),document.addEventListener("focusout",k);const E=new MutationObserver($);return u&&E.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",k),E.disconnect()}}},[r,u,v.paused]),C.useEffect(()=>{if(u){BA.add(v);const S=document.activeElement;if(!u.contains(S)){const $=new CustomEvent(Pb,ZA);u.addEventListener(Pb,h),u.dispatchEvent($),$.defaultPrevented||(uz(gz(RS(u)),{select:!0}),document.activeElement===S&&ls(u))}return()=>{u.removeEventListener(Pb,h),setTimeout(()=>{const $=new CustomEvent(Rb,ZA);u.addEventListener(Rb,p),u.dispatchEvent($),$.defaultPrevented||ls(S??document.body,{select:!0}),u.removeEventListener(Rb,p),BA.remove(v)},0)}}},[u,h,p,v]);const x=C.useCallback(S=>{if(!i&&!r||v.paused)return;const k=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,$=document.activeElement;if(k&&$){const E=S.currentTarget,[T,_]=fz(E);T&&_?!S.shiftKey&&$===_?(S.preventDefault(),i&&ls(T,{select:!0})):S.shiftKey&&$===T&&(S.preventDefault(),i&&ls(_,{select:!0})):$===E&&S.preventDefault()}},[i,r,v.paused]);return y.jsx(ji.div,{tabIndex:-1,...l,ref:O,onKeyDown:x})},"FocusScope"));function uz(t,{select:e=!1}={}){const n=document.activeElement;for(const i of t)if(ls(i,{select:e}),document.activeElement!==n)return}Sn(uz,"focusFirst");function fz(t){const e=RS(t),n=Aw(e,t),i=Aw(e.reverse(),t);return[n,i]}Sn(fz,"getTabbableEdges");function RS(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Sn(i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}Sn(RS,"getTabbableCandidates");function Aw(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const i of t)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):dz(i,{upTo:e})))return i}Sn(Aw,"findVisible");function dz(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}Sn(dz,"isHidden");function hz(t){return t instanceof HTMLInputElement&&"select"in t}Sn(hz,"isSelectableInput");function ls(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&hz(t)&&e&&t.select()}}Sn(ls,"focus");var BA=pz();function pz(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=Nw(t,e),t.unshift(e)},remove(e){t=Nw(t,e),t[0]?.resume()}}}Sn(pz,"createFocusScopesStack");function Nw(t,e){const n=[...t],i=n.indexOf(e);return i!==-1&&n.splice(i,1),n}Sn(Nw,"arrayRemove");function gz(t){return t.filter(e=>e.tagName!=="A")}Sn(gz,"removeLinks");var Wle=Object.defineProperty,Fle=(t,e)=>Wle(t,"name",{value:e,configurable:!0}),Hle=C.forwardRef(Fle(function(e,n){const{container:i,...r}=e,[s,o]=C.useState(!1);Mc(()=>o(!0),[]);const l=i||s&&globalThis?.document?.body;return l?SS.createPortal(y.jsx(ji.div,{...r,ref:n}),l):null},"Portal")),Kle=Object.defineProperty,ks=(t,e)=>Kle(t,"name",{value:e,configurable:!0});function mz(t,e){return C.useReducer((n,i)=>e[n][i]??n,t)}ks(mz,"useStateMachine");var jS=ks(t=>{const{present:e,children:n}=t,i=Oz(e),r=typeof n=="function"?n({present:i.isPresent}):C.Children.only(n),s=yz(i.ref,vz(r));return typeof n=="function"||i.isPresent?C.cloneElement(r,{ref:s}):null},"Presence");function Oz(t){const[e,n]=C.useState(),i=C.useRef(null),r=C.useRef(t),s=C.useRef("none"),o=C.useRef(void 0),l=t?"mounted":"unmounted",[u,f]=mz(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{u==="mounted"?(s.current=o.current??zl(i.current),o.current=void 0):s.current="none"},[u]),Mc(()=>{const h=i.current,p=r.current;if(p!==t){const O=s.current,v=zl(h);t?(o.current=v,f("MOUNT")):v==="none"||h?.display==="none"?f("UNMOUNT"):f(p&&O!==v?"ANIMATION_OUT":"UNMOUNT"),r.current=t}},[t,f]),Mc(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,g=ks(v=>{const S=zl(i.current).includes(CSS.escape(v.animationName));if(v.target===e&&S&&(f("ANIMATION_END"),!r.current)){const k=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=k)})}},"handleAnimationEnd"),O=ks(v=>{v.target===e&&(s.current=zl(i.current))},"handleAnimationStart");return e.addEventListener("animationstart",O),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",O),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[e,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:C.useCallback(h=>{if(h){const p=getComputedStyle(h);i.current=p,o.current=zl(p)}else i.current=null;n(h)},[])}}ks(Oz,"usePresence");function Pw(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}ks(Pw,"setRef");function yz(...t){const e=C.useRef(t);return e.current=t,C.useCallback(n=>{const i=e.current;let r=!1;const s=i.map(o=>{const l=Pw(o,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;o<s.length;o++){const l=s[o];typeof l=="function"?l():Pw(i[o],null)}}},[])}ks(yz,"useStableComposedRefs");function zl(t){return t?.animationName||"none"}ks(zl,"getAnimationName");function vz(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}ks(vz,"getElementRef");var Jle=Object.defineProperty,MS=(t,e)=>Jle(t,"name",{value:e,configurable:!0}),cg=0,Pl=null;function ece(t){return LS(),t.children}MS(ece,"FocusGuards");function LS(){C.useEffect(()=>{Pl||(Pl={start:Rw(),end:Rw()});const{start:t,end:e}=Pl;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),cg++,()=>{cg===1&&(Pl?.start.remove(),Pl?.end.remove(),Pl=null),cg=Math.max(0,cg-1)}},[])}MS(LS,"useFocusGuards");function Rw(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}MS(Rw,"createFocusGuard");var kr=function(){return kr=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},kr.apply(this,arguments)};function bz(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function tce(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,s;i<r;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))}var Dg="right-scroll-bar-position",zg="width-before-scroll-bar",nce="with-scroll-bars-hidden",ice="--removed-body-scroll-bar-size";function jb(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function rce(t,e){var n=C.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(i){var r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}})[0];return n.callback=e,n.facade}var sce=typeof window<"u"?C.useLayoutEffect:C.useEffect,IA=new WeakMap;function oce(t,e){var n=rce(null,function(i){return t.forEach(function(r){return jb(r,i)})});return sce(function(){var i=IA.get(n);if(i){var r=new Set(i),s=new Set(t),o=n.current;r.forEach(function(l){s.has(l)||jb(l,null)}),s.forEach(function(l){r.has(l)||jb(l,o)})}IA.set(n,t)},[t]),n}function ace(t){return t}function lce(t,e){e===void 0&&(e=ace);var n=[],i=!1,r={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var o=e(s,i);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(s){for(i=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){i=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(s),o=n}var u=function(){var h=o;o=[],h.forEach(s)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(h){o.push(h),f()},filter:function(h){return o=o.filter(h),n}}}};return r}function cce(t){t===void 0&&(t={});var e=lce(null);return e.options=kr({async:!0,ssr:!1},t),e}var xz=function(t){var e=t.sideCar,n=bz(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=e.read();if(!i)throw new Error("Sidecar medium not found");return C.createElement(i,kr({},n))};xz.isSideCarExport=!0;function uce(t,e){return t.useMedium(e),xz}var wz=cce(),Mb=function(){},PO=C.forwardRef(function(t,e){var n=C.useRef(null),i=C.useState({onScrollCapture:Mb,onWheelCapture:Mb,onTouchMoveCapture:Mb}),r=i[0],s=i[1],o=t.forwardProps,l=t.children,u=t.className,f=t.removeScrollBar,h=t.enabled,p=t.shards,g=t.sideCar,O=t.noRelative,v=t.noIsolation,x=t.inert,S=t.allowPinchZoom,k=t.as,$=k===void 0?"div":k,E=t.gapMode,T=bz(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=g,Q=oce([n,e]),N=kr(kr({},T),r);return C.createElement(C.Fragment,null,h&&C.createElement(_,{sideCar:wz,removeScrollBar:f,shards:p,noRelative:O,noIsolation:v,inert:x,setCallbacks:s,allowPinchZoom:!!S,lockRef:n,gapMode:E}),o?C.cloneElement(C.Children.only(l),kr(kr({},N),{ref:Q})):C.createElement($,kr({},N,{className:u,ref:Q}),l))});PO.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};PO.classNames={fullWidth:zg,zeroRight:Dg};var fce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dce(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=fce();return e&&t.setAttribute("nonce",e),t}function hce(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function pce(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var gce=function(){var t=0,e=null;return{add:function(n){t==0&&(e=dce())&&(hce(e,n),pce(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},mce=function(){var t=gce();return function(e,n){C.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Sz=function(){var t=mce(),e=function(n){var i=n.styles,r=n.dynamic;return t(i,r),null};return e},Oce={left:0,top:0,right:0,gap:0},Lb=function(t){return parseInt(t||"",10)||0},yce=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],i=e[t==="padding"?"paddingTop":"marginTop"],r=e[t==="padding"?"paddingRight":"marginRight"];return[Lb(n),Lb(i),Lb(r)]},vce=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Oce;var e=yce(t),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-n+e[2]-e[0])}},bce=Sz(),cc="data-scroll-locked",xce=function(t,e,n,i){var r=t.left,s=t.top,o=t.right,l=t.gap;return n===void 0&&(n="margin"),`
  .`.concat(nce,` {
   overflow: hidden `).concat(i,`;
   padding-right: `).concat(l,"px ").concat(i,`;
  }
  body[`).concat(cc,`] {
    overflow: hidden `).concat(i,`;
    overscroll-behavior: contain;
    `).concat([e&&"position: relative ".concat(i,";"),n==="margin"&&`
    padding-left: `.concat(r,`px;
    padding-top: `).concat(s,`px;
    padding-right: `).concat(o,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(l,"px ").concat(i,`;
    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(i,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(Dg,` {
    right: `).concat(l,"px ").concat(i,`;
  }
  
  .`).concat(zg,` {
    margin-right: `).concat(l,"px ").concat(i,`;
  }
  
  .`).concat(Dg," .").concat(Dg,` {
    right: 0 `).concat(i,`;
  }
  
  .`).concat(zg," .").concat(zg,` {
    margin-right: 0 `).concat(i,`;
  }
  
  body[`).concat(cc,`] {
    `).concat(ice,": ").concat(l,`px;
  }
`)},GA=function(){var t=parseInt(document.body.getAttribute(cc)||"0",10);return isFinite(t)?t:0},wce=function(){C.useEffect(function(){return document.body.setAttribute(cc,(GA()+1).toString()),function(){var t=GA()-1;t<=0?document.body.removeAttribute(cc):document.body.setAttribute(cc,t.toString())}},[])},Sce=function(t){var e=t.noRelative,n=t.noImportant,i=t.gapMode,r=i===void 0?"margin":i;wce();var s=C.useMemo(function(){return vce(r)},[r]);return C.createElement(bce,{styles:xce(s,!e,r,n?"":"!important")})},jw=!1;if(typeof window<"u")try{var ug=Object.defineProperty({},"passive",{get:function(){return jw=!0,!0}});window.addEventListener("test",ug,ug),window.removeEventListener("test",ug,ug)}catch{jw=!1}var Rl=jw?{passive:!1}:!1,kce=function(t){return t.tagName==="TEXTAREA"},kz=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!kce(t)&&n[e]==="visible")},Ece=function(t){return kz(t,"overflowY")},Tce=function(t){return kz(t,"overflowX")},VA=function(t,e){var n=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=Ez(t,i);if(r){var s=Tz(t,i),o=s[1],l=s[2];if(o>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},Cce=function(t){var e=t.scrollTop,n=t.scrollHeight,i=t.clientHeight;return[e,n,i]},$ce=function(t){var e=t.scrollLeft,n=t.scrollWidth,i=t.clientWidth;return[e,n,i]},Ez=function(t,e){return t==="v"?Ece(e):Tce(e)},Tz=function(t,e){return t==="v"?Cce(e):$ce(e)},_ce=function(t,e){return t==="h"&&e==="rtl"?-1:1},Qce=function(t,e,n,i,r){var s=_ce(t,window.getComputedStyle(e).direction),o=s*i,l=n.target,u=e.contains(l),f=!1,h=o>0,p=0,g=0;do{if(!l)break;var O=Tz(t,l),v=O[0],x=O[1],S=O[2],k=x-S-s*v;(v||k)&&Ez(t,l)&&(p+=k,g+=v);var $=l.parentNode;l=$&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE?$.host:$}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(h&&Math.abs(p)<1||!h&&Math.abs(g)<1)&&(f=!0),f},fg=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},UA=function(t){return[t.deltaX,t.deltaY]},YA=function(t){return t&&"current"in t?t.current:t},Ace=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Nce=function(t){return`
  .block-interactivity-`.concat(t,` {pointer-events: none;}
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},Pce=0,jl=[];function Rce(t){var e=C.useRef([]),n=C.useRef([0,0]),i=C.useRef(),r=C.useState(Pce++)[0],s=C.useState(Sz)[0],o=C.useRef(t);C.useEffect(function(){o.current=t},[t]),C.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var x=tce([t.lockRef.current],(t.shards||[]).map(YA),!0).filter(Boolean);return x.forEach(function(S){return S.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),x.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var l=C.useCallback(function(x,S){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!o.current.allowPinchZoom;var k=fg(x),$=n.current,E="deltaX"in x?x.deltaX:$[0]-k[0],T="deltaY"in x?x.deltaY:$[1]-k[1],_,Q=x.target,N=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in x&&N==="h"&&Q.type==="range")return!1;var R=window.getSelection(),X=R&&R.anchorNode,q=X?X===Q||X.contains(Q):!1;if(q)return!1;var z=VA(N,Q);if(!z)return!0;if(z?_=N:(_=N==="v"?"h":"v",z=VA(N,Q)),!z)return!1;if(!i.current&&"changedTouches"in x&&(E||T)&&(i.current=_),!_)return!0;var Z=i.current||_;return Qce(Z,S,x,Z==="h"?E:T)},[]),u=C.useCallback(function(x){var S=x;if(!(!jl.length||jl[jl.length-1]!==s)){var k="deltaY"in S?UA(S):fg(S),$=e.current.filter(function(_){return _.name===S.type&&(_.target===S.target||S.target===_.shadowParent)&&Ace(_.delta,k)})[0];if($&&$.should){S.cancelable&&S.preventDefault();return}if(!$){var E=(o.current.shards||[]).map(YA).filter(Boolean).filter(function(_){return _.contains(S.target)}),T=E.length>0?l(S,E[0]):!o.current.noIsolation;T&&S.cancelable&&S.preventDefault()}}},[]),f=C.useCallback(function(x,S,k,$){var E={name:x,delta:S,target:k,should:$,shadowParent:jce(k)};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(T){return T!==E})},1)},[]),h=C.useCallback(function(x){n.current=fg(x),i.current=void 0},[]),p=C.useCallback(function(x){f(x.type,UA(x),x.target,l(x,t.lockRef.current))},[]),g=C.useCallback(function(x){f(x.type,fg(x),x.target,l(x,t.lockRef.current))},[]);C.useEffect(function(){return jl.push(s),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Rl),document.addEventListener("touchmove",u,Rl),document.addEventListener("touchstart",h,Rl),function(){jl=jl.filter(function(x){return x!==s}),document.removeEventListener("wheel",u,Rl),document.removeEventListener("touchmove",u,Rl),document.removeEventListener("touchstart",h,Rl)}},[]);var O=t.removeScrollBar,v=t.inert;return C.createElement(C.Fragment,null,v?C.createElement(s,{styles:Nce(r)}):null,O?C.createElement(Sce,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function jce(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Mce=uce(wz,Rce);var Cz=C.forwardRef(function(t,e){return C.createElement(PO,kr({},t,{ref:e,sideCar:Mce}))});Cz.classNames=PO.classNames;var Lce=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ml=new WeakMap,dg=new WeakMap,hg={},Db=0,$z=function(t){return t&&(t.host||$z(t.parentNode))},Dce=function(t,e){return e.map(function(n){if(t.contains(n))return n;var i=$z(n);return i&&t.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},zce=function(t,e,n,i){var r=Dce(e,Array.isArray(t)?t:[t]);hg[n]||(hg[n]=new WeakMap);var s=hg[n],o=[],l=new Set,u=new Set(r),f=function(p){!p||l.has(p)||(l.add(p),f(p.parentNode))};r.forEach(f);var h=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(g){if(l.has(g))h(g);else try{var O=g.getAttribute(i),v=O!==null&&O!=="false",x=(Ml.get(g)||0)+1,S=(s.get(g)||0)+1;Ml.set(g,x),s.set(g,S),o.push(g),x===1&&v&&dg.set(g,!0),S===1&&g.setAttribute(n,"true"),v||g.setAttribute(i,"true")}catch(k){console.error("aria-hidden: cannot operate on ",g,k)}})};return h(e),l.clear(),Db++,function(){o.forEach(function(p){var g=Ml.get(p)-1,O=s.get(p)-1;Ml.set(p,g),s.set(p,O),g||(dg.has(p)||p.removeAttribute(i),dg.delete(p)),O||p.removeAttribute(n)}),Db--,Db||(Ml=new WeakMap,Ml=new WeakMap,dg=new WeakMap,hg={})}},Xce=function(t,e,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=Lce(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),zce(i,r,n,"aria-hidden")):function(){return null}},Zce=Object.defineProperty,_s=(t,e)=>Zce(t,"name",{value:e,configurable:!0}),DS="Dialog",[_z,lfe]=q5(DS),[Bce,Da]=_z(DS),Ice=_s(t=>{const{__scopeDialog:e,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:o=!0}=t,l=C.useRef(null),u=C.useRef(null),[f,h]=H5({prop:i,defaultProp:r??!1,onChange:s,caller:DS}),[p,g]=C.useState(0),[O,v]=C.useState(0);return y.jsx(Bce,{scope:e,triggerRef:l,contentRef:u,contentId:Rr(),titleId:Rr(),descriptionId:Rr(),titlePresent:p>0,descriptionPresent:O>0,setTitleCount:g,setDescriptionCount:v,open:f,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(x=>!x),[h]),modal:o,children:n})},"Dialog"),Qz="DialogPortal",[Gce,Az]=_z(Qz,{forceMount:void 0}),Vce=_s(t=>{const{__scopeDialog:e,forceMount:n,children:i,container:r}=t,s=Da(Qz,e);return y.jsx(Gce,{scope:e,forceMount:n,children:C.Children.map(i,o=>y.jsx(jS,{present:n||s.open,children:y.jsx(Hle,{asChild:!0,container:r,children:o})}))})},"DialogPortal"),Mw="DialogOverlay",Uce=C.forwardRef(_s(function(e,n){const i=Az(Mw,e.__scopeDialog),{forceMount:r=i.forceMount,...s}=e,o=Da(Mw,e.__scopeDialog);return o.modal?y.jsx(jS,{present:r||o.open,children:y.jsx(qce,{...s,ref:n})}):null},"DialogOverlay")),Yce=NS("DialogOverlay.RemoveScroll"),qce=C.forwardRef(_s(function(e,n){const{__scopeDialog:i,...r}=e,s=Da(Mw,i),o=az(),l=ru(n,o);return y.jsx(Cz,{as:Yce,allowPinchZoom:!0,shards:[s.contentRef],children:y.jsx(ji.div,{"data-state":zS(s.open),...r,ref:l,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),Sd="DialogContent",Wce=C.forwardRef(_s(function(e,n){const i=Az(Sd,e.__scopeDialog),{forceMount:r=i.forceMount,...s}=e,o=Da(Sd,e.__scopeDialog);return y.jsx(jS,{present:r||o.open,children:o.modal?y.jsx(Fce,{...s,ref:n}):y.jsx(Hce,{...s,ref:n})})},"DialogContent")),Fce=C.forwardRef(_s(function(e,n){const i=Da(Sd,e.__scopeDialog),r=C.useRef(null),s=ru(n,i.contentRef,r);return C.useEffect(()=>{const o=r.current;if(o)return Xce(o)},[]),y.jsx(Nz,{...e,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:ma(e.onCloseAutoFocus,o=>{o.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:ma(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:ma(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),Hce=C.forwardRef(_s(function(e,n){const i=Da(Sd,e.__scopeDialog),r=C.useRef(!1),s=C.useRef(!1);return y.jsx(Nz,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||i.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;i.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})},"DialogContentNonModal")),Nz=C.forwardRef(_s(function(e,n){const{__scopeDialog:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...l}=e,u=Da(Sd,i);return LS(),y.jsx(y.Fragment,{children:y.jsx(qle,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:y.jsx(Vle,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":zS(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl"));function zS(t){return t?"open":"closed"}_s(zS,"getState");var kf='[cmdk-group=""]',zb='[cmdk-group-items=""]',Kce='[cmdk-group-heading=""]',Pz='[cmdk-item=""]',qA=`${Pz}:not([aria-disabled="true"])`,Lw="cmdk-item-select",Xl="data-value",Jce=(t,e,n)=>mle(t,e,n),Rz=C.createContext(void 0),qd=()=>C.useContext(Rz),jz=C.createContext(void 0),XS=()=>C.useContext(jz),Mz=C.createContext(void 0),Lz=C.forwardRef((t,e)=>{let n=Zl(()=>{var j,Y;return{search:"",value:(Y=(j=t.value)!=null?j:t.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=Zl(()=>new Set),r=Zl(()=>new Map),s=Zl(()=>new Map),o=Zl(()=>new Set),l=Dz(t),{label:u,children:f,value:h,onValueChange:p,filter:g,shouldFilter:O,loop:v,disablePointerSelection:x=!1,vimBindings:S=!0,...k}=t,$=Rr(),E=Rr(),T=Rr(),_=C.useRef(null),Q=uue();Qa(()=>{if(h!==void 0){let j=h.trim();n.current.value=j,N.emit()}},[h]),Qa(()=>{Q(6,F)},[]);let N=C.useMemo(()=>({subscribe:j=>(o.current.add(j),()=>o.current.delete(j)),snapshot:()=>n.current,setState:(j,Y,G)=>{var J,ne,le,H;if(!Object.is(n.current[j],Y)){if(n.current[j]=Y,j==="search")Z(),q(),Q(1,z);else if(j==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ce=document.getElementById(T);ce?ce.focus():(J=document.getElementById($))==null||J.focus()}if(Q(7,()=>{var ce;n.current.selectedItemId=(ce=M())==null?void 0:ce.id,N.emit()}),G||Q(5,F),((ne=l.current)==null?void 0:ne.value)!==void 0){let ce=Y??"";(H=(le=l.current).onValueChange)==null||H.call(le,ce);return}}N.emit()}},emit:()=>{o.current.forEach(j=>j())}}),[]),R=C.useMemo(()=>({value:(j,Y,G)=>{var J;Y!==((J=s.current.get(j))==null?void 0:J.value)&&(s.current.set(j,{value:Y,keywords:G}),n.current.filtered.items.set(j,X(Y,G)),Q(2,()=>{q(),N.emit()}))},item:(j,Y)=>(i.current.add(j),Y&&(r.current.has(Y)?r.current.get(Y).add(j):r.current.set(Y,new Set([j]))),Q(3,()=>{Z(),q(),n.current.value||z(),N.emit()}),()=>{s.current.delete(j),i.current.delete(j),n.current.filtered.items.delete(j);let G=M();Q(4,()=>{Z(),G?.getAttribute("id")===j&&z(),N.emit()})}),group:j=>(r.current.has(j)||r.current.set(j,new Set),()=>{s.current.delete(j),r.current.delete(j)}),filter:()=>l.current.shouldFilter,label:u||t["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:$,inputId:T,labelId:E,listInnerRef:_}),[]);function X(j,Y){var G,J;let ne=(J=(G=l.current)==null?void 0:G.filter)!=null?J:Jce;return j?ne(j,n.current.search,Y):0}function q(){if(!n.current.search||l.current.shouldFilter===!1)return;let j=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(J=>{let ne=r.current.get(J),le=0;ne.forEach(H=>{let ce=j.get(H);le=Math.max(ce,le)}),Y.push([J,le])});let G=_.current;B().sort((J,ne)=>{var le,H;let ce=J.getAttribute("id"),be=ne.getAttribute("id");return((le=j.get(be))!=null?le:0)-((H=j.get(ce))!=null?H:0)}).forEach(J=>{let ne=J.closest(zb);ne?ne.appendChild(J.parentElement===ne?J:J.closest(`${zb} > *`)):G.appendChild(J.parentElement===G?J:J.closest(`${zb} > *`))}),Y.sort((J,ne)=>ne[1]-J[1]).forEach(J=>{var ne;let le=(ne=_.current)==null?void 0:ne.querySelector(`${kf}[${Xl}="${encodeURIComponent(J[0])}"]`);le?.parentElement.appendChild(le)})}function z(){let j=B().find(G=>G.getAttribute("aria-disabled")!=="true"),Y=j?.getAttribute(Xl);N.setState("value",Y||void 0)}function Z(){var j,Y,G,J;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=i.current.size;return}n.current.filtered.groups=new Set;let ne=0;for(let le of i.current){let H=(Y=(j=s.current.get(le))==null?void 0:j.value)!=null?Y:"",ce=(J=(G=s.current.get(le))==null?void 0:G.keywords)!=null?J:[],be=X(H,ce);n.current.filtered.items.set(le,be),be>0&&ne++}for(let[le,H]of r.current)for(let ce of H)if(n.current.filtered.items.get(ce)>0){n.current.filtered.groups.add(le);break}n.current.filtered.count=ne}function F(){var j,Y,G;let J=M();J&&(((j=J.parentElement)==null?void 0:j.firstChild)===J&&((G=(Y=J.closest(kf))==null?void 0:Y.querySelector(Kce))==null||G.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function M(){var j;return(j=_.current)==null?void 0:j.querySelector(`${Pz}[aria-selected="true"]`)}function B(){var j;return Array.from(((j=_.current)==null?void 0:j.querySelectorAll(qA))||[])}function L(j){let Y=B()[j];Y&&N.setState("value",Y.getAttribute(Xl))}function I(j){var Y;let G=M(),J=B(),ne=J.findIndex(H=>H===G),le=J[ne+j];(Y=l.current)!=null&&Y.loop&&(le=ne+j<0?J[J.length-1]:ne+j===J.length?J[0]:J[ne+j]),le&&N.setState("value",le.getAttribute(Xl))}function U(j){let Y=M(),G=Y?.closest(kf),J;for(;G&&!J;)G=j>0?lue(G,kf):cue(G,kf),J=G?.querySelector(qA);J?N.setState("value",J.getAttribute(Xl)):I(j)}let V=()=>L(B().length-1),te=j=>{j.preventDefault(),j.metaKey?V():j.altKey?U(1):I(1)},P=j=>{j.preventDefault(),j.metaKey?L(0):j.altKey?U(-1):I(-1)};return C.createElement(ji.div,{ref:e,tabIndex:-1,...k,"cmdk-root":"",onKeyDown:j=>{var Y;(Y=k.onKeyDown)==null||Y.call(k,j);let G=j.nativeEvent.isComposing||j.keyCode===229;if(!(j.defaultPrevented||G))switch(j.key){case"n":case"j":{S&&j.ctrlKey&&te(j);break}case"ArrowDown":{te(j);break}case"p":case"k":{S&&j.ctrlKey&&P(j);break}case"ArrowUp":{P(j);break}case"Home":{j.preventDefault(),L(0);break}case"End":{j.preventDefault(),V();break}case"Enter":{j.preventDefault();let J=M();if(J){let ne=new Event(Lw);J.dispatchEvent(ne)}}}}},C.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:due},u),RO(t,j=>C.createElement(jz.Provider,{value:N},C.createElement(Rz.Provider,{value:R},j))))}),eue=C.forwardRef((t,e)=>{var n,i;let r=Rr(),s=C.useRef(null),o=C.useContext(Mz),l=qd(),u=Dz(t),f=(i=(n=u.current)==null?void 0:n.forceMount)!=null?i:o?.forceMount;Qa(()=>{if(!f)return l.item(r,o?.id)},[f]);let h=zz(r,s,[t.value,t.children,s],t.keywords),p=XS(),g=To(Q=>Q.value&&Q.value===h.current),O=To(Q=>f||l.filter()===!1?!0:Q.search?Q.filtered.items.get(r)>0:!0);C.useEffect(()=>{let Q=s.current;if(!(!Q||t.disabled))return Q.addEventListener(Lw,v),()=>Q.removeEventListener(Lw,v)},[O,t.onSelect,t.disabled]);function v(){var Q,N;x(),(N=(Q=u.current).onSelect)==null||N.call(Q,h.current)}function x(){p.setState("value",h.current,!0)}if(!O)return null;let{disabled:S,value:k,onSelect:$,forceMount:E,keywords:T,..._}=t;return C.createElement(ji.div,{ref:_a(s,e),..._,id:r,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!g,"data-disabled":!!S,"data-selected":!!g,onPointerMove:S||l.getDisablePointerSelection()?void 0:x,onClick:S?void 0:v},t.children)}),tue=C.forwardRef((t,e)=>{let{heading:n,children:i,forceMount:r,...s}=t,o=Rr(),l=C.useRef(null),u=C.useRef(null),f=Rr(),h=qd(),p=To(O=>r||h.filter()===!1?!0:O.search?O.filtered.groups.has(o):!0);Qa(()=>h.group(o),[]),zz(o,l,[t.value,t.heading,u]);let g=C.useMemo(()=>({id:o,forceMount:r}),[r]);return C.createElement(ji.div,{ref:_a(l,e),...s,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&C.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),RO(t,O=>C.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},C.createElement(Mz.Provider,{value:g},O))))}),nue=C.forwardRef((t,e)=>{let{alwaysRender:n,...i}=t,r=C.useRef(null),s=To(o=>!o.search);return!n&&!s?null:C.createElement(ji.div,{ref:_a(r,e),...i,"cmdk-separator":"",role:"separator"})}),iue=C.forwardRef((t,e)=>{let{onValueChange:n,...i}=t,r=t.value!=null,s=XS(),o=To(f=>f.search),l=To(f=>f.selectedItemId),u=qd();return C.useEffect(()=>{t.value!=null&&s.setState("search",t.value)},[t.value]),C.createElement(ji.input,{ref:e,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":l,id:u.inputId,type:"text",value:r?t.value:o,onChange:f=>{r||s.setState("search",f.target.value),n?.(f.target.value)}})}),rue=C.forwardRef((t,e)=>{let{children:n,label:i="Suggestions",...r}=t,s=C.useRef(null),o=C.useRef(null),l=To(f=>f.selectedItemId),u=qd();return C.useEffect(()=>{if(o.current&&s.current){let f=o.current,h=s.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let O=f.offsetHeight;h.style.setProperty("--cmdk-list-height",O.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(p),g.unobserve(f)}}},[]),C.createElement(ji.div,{ref:_a(s,e),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":i,id:u.listId},RO(t,f=>C.createElement("div",{ref:_a(o,u.listInnerRef),"cmdk-list-sizer":""},f)))}),sue=C.forwardRef((t,e)=>{let{open:n,onOpenChange:i,overlayClassName:r,contentClassName:s,container:o,...l}=t;return C.createElement(Ice,{open:n,onOpenChange:i},C.createElement(Vce,{container:o},C.createElement(Uce,{"cmdk-overlay":"",className:r}),C.createElement(Wce,{"aria-label":t.label,"cmdk-dialog":"",className:s},C.createElement(Lz,{ref:e,...l}))))}),oue=C.forwardRef((t,e)=>To(n=>n.filtered.count===0)?C.createElement(ji.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),aue=C.forwardRef((t,e)=>{let{progress:n,children:i,label:r="Loading...",...s}=t;return C.createElement(ji.div,{ref:e,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},RO(t,o=>C.createElement("div",{"aria-hidden":!0},o)))}),Or=Object.assign(Lz,{List:rue,Item:eue,Input:iue,Group:tue,Separator:nue,Dialog:sue,Empty:oue,Loading:aue});function lue(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function cue(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function Dz(t){let e=C.useRef(t);return Qa(()=>{e.current=t}),e}var Qa=typeof window>"u"?C.useEffect:C.useLayoutEffect;function Zl(t){let e=C.useRef();return e.current===void 0&&(e.current=t()),e}function To(t){let e=XS(),n=()=>t(e.snapshot());return C.useSyncExternalStore(e.subscribe,n,n)}function zz(t,e,n,i=[]){let r=C.useRef(),s=qd();return Qa(()=>{var o;let l=(()=>{var f;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(f=h.current.textContent)==null?void 0:f.trim():r.current}})(),u=i.map(f=>f.trim());s.value(t,l,u),(o=e.current)==null||o.setAttribute(Xl,l),r.current=l}),r}var uue=()=>{let[t,e]=C.useState(),n=Zl(()=>new Map);return Qa(()=>{n.current.forEach(i=>i()),n.current=new Map},[t]),(i,r)=>{n.current.set(i,r),e({})}};function fue(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function RO({asChild:t,children:e},n){return t&&C.isValidElement(e)?C.cloneElement(fue(e),{ref:e.ref},n(e.props.children)):n(e)}var due={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const hue={page:{family:"Screen",tag:"PAGE",shape:"rounded"},screen:{family:"Screen",tag:"SCREEN",shape:"rounded"},modal:{family:"Screen",tag:"MODAL",shape:"rounded"},action:{family:"Action",tag:"ACTION",shape:"rounded"},api:{family:"Action",tag:"API",shape:"rounded"},"cli-command":{family:"Action",tag:"CLI",shape:"rounded"},job:{family:"Action",tag:"JOB",shape:"rounded"},webhook:{family:"Action",tag:"HOOK",shape:"rounded"},email:{family:"Action",tag:"EMAIL",shape:"rounded"},"external-system":{family:"External",tag:"EXTERNAL",shape:"slanted"},handoff:{family:"External",tag:"HANDOFF",shape:"slanted"},subflow:{family:"External",tag:"SUBFLOW",shape:"slanted"},"prompt-entry":{family:"Flow",tag:"ENTRY",shape:"rounded"},"llm-workflow":{family:"Flow",tag:"FLOW",shape:"rounded"},step:{family:"Flow",tag:"STEP",shape:"rounded"},router:{family:"Decision",tag:"ROUTER",shape:"diamond"},"decision-pause":{family:"Decision",tag:"DECISION",shape:"diamond"},terminal:{family:"End",tag:"END",shape:"stadium"}};function jO(t){return hue[t]??{family:"Screen",tag:t.toUpperCase(),shape:"rounded"}}const pue=[{family:"Screen",shape:"rounded"},{family:"Action",shape:"rounded"},{family:"Decision",shape:"diamond"},{family:"External",shape:"slanted"},{family:"End",shape:"stadium"}],gue={unverified:{label:"Unverified",rank:0},inferred:{label:"Inferred",rank:1},"proven-in-code":{label:"Proven in code",rank:2},"proven-by-test":{label:"Proven by test",rank:3},"human-confirmed":{label:"Human confirmed",rank:4}};function MO(t){return t?gue[t]:{label:"Unverified",rank:0}}const mue=2,WA={unverified:"Recorded, but not yet checked against the code.",inferred:"Read from a convention, not traced to a specific line.","proven-in-code":"Traced to the cited line in the code.","proven-by-test":"Backed by a test that exercises it.","human-confirmed":"A person has confirmed this is correct."};function Oue(t){return t?WA[t]:WA.unverified}function yue(t){return t.anchors_total===null?{tone:"unverified",glyph:"○",label:"Not yet checked against code",detail:"Verify the map to see how many cited locations still resolve."}:t.stale?{tone:"stale",glyph:"▲",label:"Map has drifted from code",detail:`${t.anchors_broken??0} of ${t.anchors_total} cited locations no longer resolve.`}:{tone:"fresh",glyph:"●",label:"Matches the code",detail:`All ${t.anchors_total} cited locations still resolve.`}}function vue(t){let e=0;for(const i of t.surfaces)MO(i.trust).rank>=mue&&(e+=1);const n=t.surfaces.length;return{proven:e,unproven:n-e,total:n}}function bue({map:t,journeys:e,onSelectSurface:n,onSelectArea:i,onPickJourney:r}){const[s,o]=C.useState(!1);C.useEffect(()=>{const f=h=>{(h.metaKey||h.ctrlKey)&&h.key.toLowerCase()==="k"&&(h.preventDefault(),h.stopImmediatePropagation(),o(p=>!p))};return window.addEventListener("keydown",f,!0),()=>window.removeEventListener("keydown",f,!0)},[]);const l=f=>{o(!1),f()},u=t.areas??[];return y.jsxs(Or.Dialog,{open:s,onOpenChange:o,label:"Search the map",className:"sm-search",style:{position:"fixed",left:"50%",top:"18%",transform:"translateX(-50%)",zIndex:50,width:"min(560px, 92vw)",background:"var(--color-surface)",color:"var(--color-canvas-fg)",border:"1px solid var(--color-border)",borderRadius:12,boxShadow:"0 12px 40px rgba(0,0,0,0.28)",overflow:"hidden"},children:[y.jsx(Or.Input,{placeholder:"Search surfaces, areas, journeys…",style:{width:"100%",padding:"12px 14px",fontSize:14,background:"transparent",color:"var(--color-canvas-fg)",border:"none",borderBottom:"1px solid var(--color-border)",outline:"none"}}),y.jsxs(Or.List,{style:{maxHeight:360,overflowY:"auto",padding:6},children:[y.jsx(Or.Empty,{style:{padding:"12px 10px",color:"var(--color-muted)",fontSize:13},children:"No matches."}),e.length>0&&y.jsx(Or.Group,{heading:"Journeys",children:e.map(f=>y.jsxs(Or.Item,{value:`journey ${f.label} ${f.id}`,onSelect:()=>l(()=>r(f.id)),className:"sm-search-item",children:[y.jsx("span",{style:{color:"var(--color-muted)",fontSize:11},children:"JOURNEY"}),y.jsx("span",{children:f.label})]},f.id))}),u.length>0&&y.jsx(Or.Group,{heading:"Areas",children:u.map(f=>y.jsxs(Or.Item,{value:`area ${f.label} ${f.id}`,onSelect:()=>l(()=>i(f.id)),className:"sm-search-item",children:[y.jsx("span",{style:{color:"var(--color-muted)",fontSize:11},children:"AREA"}),y.jsx("span",{children:f.label})]},f.id))}),y.jsx(Or.Group,{heading:"Surfaces",children:t.surfaces.map(f=>y.jsxs(Or.Item,{value:`surface ${f.label} ${f.id}`,onSelect:()=>l(()=>n(f.id)),className:"sm-search-item",children:[y.jsx("span",{style:{color:"var(--color-muted)",fontSize:11},children:jO(f.kind).tag}),y.jsx("span",{children:f.label})]},f.id))})]})]})}function Xz(t){return`hsl(${Math.round(t/12*360)} 65% 50% / 0.12)`}function xue({data:t}){const e=t,n=Ue(r=>r.transform[2]),i=Math.min(Math.max(13,13/n),34);return y.jsx("div",{className:"h-full w-full rounded-[14px]",style:{background:Xz(e.colorIndex),border:"1px solid var(--color-border)"},children:y.jsxs("div",{className:"flex items-center gap-2 px-3 pt-2 font-semibold",style:{color:"var(--color-canvas-fg)",fontSize:i,lineHeight:1.1},children:[y.jsx("span",{className:"truncate",children:e.label}),y.jsx("span",{style:{color:"var(--color-muted)",fontSize:"0.8em"},children:e.surfaceCount})]})})}const FA={opacity:0,width:1,height:1,minWidth:1,minHeight:1,border:"none"};function wue({data:t}){const e=t,n=e.surface,i=jO(n.kind),r=MO(n.trust).rank,s=r<2,o=r===0,l=n.label.length>26?`${n.label.slice(0,25)}…`:n.label,u=Ue(O=>O.transform[2]),f=12.5*u>=10,h=9*u>=10,p=u>=1.5,g=e.dead?.4:e.dimmed?.25:o?.72:s?.86:1;return y.jsxs("div",{role:"button",tabIndex:0,"aria-label":`${i.family}: ${n.label}`,onClick:()=>e.onSelect(n.id),onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),e.onSelect(n.id))},className:"relative flex h-full w-full cursor-pointer flex-col items-center justify-center rounded-[10px] px-2",style:{background:"var(--color-surface)",border:e.selected?"2px solid var(--color-accent)":"1.5px solid var(--color-border)",borderStyle:s?"dashed":"solid",opacity:g,filter:o?"saturate(0.55)":void 0,transform:o?"rotate(-0.5deg)":void 0,transition:"opacity 200ms ease, filter 200ms ease",outline:"none"},children:[y.jsx(Rc,{type:"target",position:_e.Left,style:FA,isConnectable:!1}),f&&y.jsx("div",{className:"max-w-full truncate text-center font-semibold",style:{color:"var(--color-canvas-fg)",fontSize:12.5},children:l}),h&&y.jsxs("div",{className:"text-center",style:{color:"var(--color-muted)",fontSize:9,letterSpacing:.4},children:[i.tag,e.dead?" · dead":""]}),p&&n.entry!==void 0&&y.jsx("span",{"aria-hidden":"true",title:"Entry point",className:"absolute left-1.5 top-1",style:{color:"var(--color-accent)",fontSize:10},children:"▶"}),e.guarded&&y.jsx("span",{"aria-hidden":"true",title:"Gated: a guard applies",className:"absolute right-1.5 top-1",style:{color:"var(--color-mod-amber)",fontSize:10},children:"🔒"}),y.jsx(Rc,{type:"source",position:_e.Right,style:FA,isConnectable:!1})]})}const Zz="district::",Sue={district:t=>y.jsx(xue,{...t}),surface:t=>y.jsx(wue,{...t})},HA="paqad.sitemap.wheel";function Xb(t){return`${Zz}${t}`}function kue(t){if(t==null)return;const e={};for(const[n,i]of Object.entries(t))e[n]={x:i.x,y:i.y};return e}function Eue(){const t=()=>document.documentElement.dataset.theme==="dark"?"dark":"light",[e,n]=C.useState(t);return C.useEffect(()=>{const i=new MutationObserver(()=>n(t()));return i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>i.disconnect()},[]),e}function Tue(){const[t,e]=C.useState(()=>localStorage.getItem(HA)==="zoom"?"zoom":"pan"),n=C.useCallback(i=>{localStorage.setItem(HA,i),e(i)},[]);return[t,n]}function Cue({map:t,journeys:e,activeJourneyId:n,walkStationId:i,selectedId:r,focus:s,stored:o,readOnly:l,onSelect:u,onPickJourney:f,onPersistLayout:h,onResetLayout:p}){const{zoomIn:g,zoomOut:O,fitView:v,setCenter:x}=$O(),S=Eue(),[k,$]=Tue(),[E,T]=C.useState(!1),_=C.useMemo(()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,[]),Q=C.useMemo(()=>kue(o),[o]),N=C.useMemo(()=>Yae(t,Q),[t,Q]),R=C.useMemo(()=>I5(t),[t]),X=C.useMemo(()=>e.find(P=>P.id===n)??null,[e,n]),q=C.useMemo(()=>Wae(X),[X]),z=X!==null,Z=C.useMemo(()=>{const P=new Map;for(const j of N.districts)for(const Y of j.cards)P.set(Y.id,qae(j,Y));return P},[N]),F=C.useMemo(()=>{const P=[];for(const j of N.districts){P.push({id:Xb(j.id),type:"district",position:{x:j.x,y:j.y},data:{label:j.label,colorIndex:j.colorIndex,surfaceCount:j.surfaceCount},width:j.width,height:j.height,selectable:!1,draggable:!l,zIndex:0});for(const Y of j.cards)P.push({id:Y.id,type:"surface",parentId:Xb(j.id),extent:"parent",position:{x:Y.x,y:Y.y},data:{surface:Y.surface,dead:R.has(Y.id),selected:r===Y.id,dimmed:z&&!q.has(Y.id),guarded:Lm(Y.surface.guard).length>0,onSelect:u},width:Y.width,height:Y.height,draggable:!1,zIndex:1})}return P},[N,R,r,z,q,u,l]),[M,B,L]=zre(F);C.useEffect(()=>B(F),[F,B]);const I=C.useCallback(()=>{B(P=>{const j={};for(const Y of P){if(Y.type!=="district")continue;const G=Y.id.slice(Zz.length);j[G]={x:Math.round(Y.position.x),y:Math.round(Y.position.y),w:Math.round(Y.width??Y.measured?.width??0),h:Math.round(Y.height??Y.measured?.height??0)}}return h(j),P})},[B,h]),U=C.useMemo(()=>{const P=new Set(t.surfaces.map(Y=>Y.id)),j=[];for(const Y of t.surfaces)(Y.transitions??[]).forEach((G,J)=>{if(!P.has(G.to))return;const ne=Lm(G.guard).length>0||G.guard_text!==void 0;j.push({id:`${Y.id}->${G.to}#${J}`,source:Y.id,target:G.to,type:"smoothstep",label:G.trigger,markerEnd:{type:yd.ArrowClosed,color:"var(--color-muted)"},style:{stroke:"var(--color-muted)",strokeWidth:1.5,strokeDasharray:ne?"6 4":void 0},labelStyle:{fill:"var(--color-muted)",fontSize:10},labelBgStyle:{fill:"var(--color-canvas)",fillOpacity:.9}})});return j},[t]);C.useEffect(()=>{if(i===null)return;const P=Z.get(i);P!==void 0&&x(P.x,P.y,{zoom:1.4,duration:_?0:700})},[i,Z,x,_]);const V=C.useCallback(P=>{v({nodes:[{id:P}],duration:_?0:800,padding:.4,maxZoom:1.5})},[v,_]);C.useEffect(()=>{s!==null&&V(s.id)},[s,V]);const te=C.useCallback(P=>{if(P.key==="+"||P.key==="=")g();else if(P.key==="-")O();else if(P.key==="0")v({padding:.1});else if(P.shiftKey&&P.code==="Digit1")v({padding:.1});else if(P.shiftKey&&P.code==="Digit2"&&r!==null)v({padding:.3,nodes:[{id:r}],maxZoom:1.5});else return;P.preventDefault()},[g,O,v,r]);return y.jsxs("div",{className:"relative h-full w-full",style:{background:"var(--color-canvas)"},onKeyDown:te,children:[y.jsxs(Mre,{nodes:M,edges:U,onNodesChange:L,onNodeDragStop:I,nodeTypes:Sue,colorMode:S,proOptions:{hideAttribution:!0},fitView:!0,fitViewOptions:{padding:.1},minZoom:NA,maxZoom:2,onMoveEnd:(P,j)=>T(ele(j.zoom,NA)),panOnScroll:k==="pan",zoomOnScroll:k==="zoom",zoomOnPinch:!0,zoomOnDoubleClick:!0,panActivationKeyCode:"Space",preventScrolling:!0,onlyRenderVisibleElements:!0,nodesDraggable:!l,nodesConnectable:!1,onNodeClick:(P,j)=>{j.type==="surface"&&u(j.id)},onPaneClick:()=>u(null),children:[y.jsx(Gre,{gap:24,color:"var(--color-border)"}),y.jsx(Hre,{showInteractive:!1}),y.jsx(fse,{pannable:!0,zoomable:!0,nodeColor:P=>P.type==="district"?Xz(P.data.colorIndex):"var(--color-border)",maskColor:"var(--color-canvas)",style:{background:"var(--color-surface)"}}),y.jsx(ale,{journeys:e,activeJourneyId:n,centers:Z,walkStationId:i,reducedMotion:_})]}),y.jsx(bue,{map:t,journeys:e,onSelectSurface:P=>{u(P),V(P)},onSelectArea:P=>V(Xb(P)),onPickJourney:f}),y.jsxs("div",{className:"absolute right-3 top-3 z-10 flex gap-1.5",children:[y.jsxs("button",{type:"button",onClick:()=>$(k==="pan"?"zoom":"pan"),title:"Toggle what the scroll wheel does",className:"rounded-[8px] px-2.5 py-1 text-caption font-medium",style:{background:"var(--color-surface)",color:"var(--color-canvas-fg)",border:"1px solid var(--color-border)"},children:["Scroll: ",k]}),y.jsx("button",{type:"button",onClick:()=>v({padding:.1}),title:"Reset view",className:"rounded-[8px] px-2.5 py-1 text-caption font-medium",style:{background:"var(--color-surface)",color:"var(--color-canvas-fg)",border:"1px solid var(--color-border)"},children:"Reset"}),!l&&o!==null&&Object.keys(o).length>0&&y.jsx("button",{type:"button",onClick:p,title:"Discard the saved district arrangement and revert to the computed layout",className:"rounded-[8px] px-2.5 py-1 text-caption font-medium",style:{background:"var(--color-surface)",color:"var(--color-canvas-fg)",border:"1px solid var(--color-border)"},children:"Reset layout"})]}),E&&y.jsx("div",{className:"absolute bottom-3 left-3 z-10 max-w-[60%] rounded-[8px] px-2.5 py-1 text-caption",style:{background:"var(--color-surface)",color:"var(--color-muted)",border:"1px solid var(--color-border)"},children:"This map is larger than the window at a readable zoom. Use the minimap to move around."})]})}function $ue(t){return y.jsx(f5,{children:y.jsx(Cue,{...t})})}function _ue({surface:t,map:e,journeys:n,onClose:i}){const r=jO(t.kind),s=MO(t.trust),l=Lm(t.guard).map(p=>e.guards?.find(g=>g.id===p)??{id:p}),u=nle(t.evidence),f=n.filter(p=>p.steps.some(g=>g.surface===t.id)),h=(t.transitions??[]).filter(p=>e.surfaces.some(g=>g.id===p.to));return y.jsxs("aside",{className:"flex w-80 shrink-0 flex-col overflow-y-auto border-l p-4",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},"aria-label":`Details for ${t.label}`,children:[y.jsxs("div",{className:"flex items-start gap-2",children:[y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("div",{className:"text-body font-semibold",children:t.label}),y.jsx("div",{className:"text-caption",style:{color:"var(--color-muted)"},children:r.family})]}),y.jsx("button",{type:"button","aria-label":"Close details",onClick:i,className:"rounded-[6px] px-2 py-0.5 text-caption",style:{border:"1px solid var(--color-border)",color:"var(--color-muted)"},children:"Close"})]}),y.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[y.jsx(Zb,{children:r.tag}),y.jsx(Zb,{title:"How strongly this is proven",children:s.label}),t.confidence&&y.jsxs(Zb,{children:[t.confidence," confidence"]})]}),y.jsx("p",{className:"mt-1.5 text-caption",style:{color:"var(--color-muted)"},children:Oue(t.trust)}),t.note&&y.jsx("p",{className:"mt-3 text-secondary",children:t.note}),l.length>0&&y.jsx(pg,{title:"Gated by",children:l.map(p=>y.jsxs("div",{className:"text-secondary",children:[y.jsx("span",{className:"font-medium",children:"label"in p?p.label:p.id}),"requires"in p&&p.requires?y.jsxs("span",{style:{color:"var(--color-muted)"},children:[" — requires ",p.requires]}):null]},p.id))}),f.length>0&&y.jsx(pg,{title:"On these journeys",children:f.map(p=>y.jsx("div",{className:"text-secondary",children:p.label},p.id))}),h.length>0&&y.jsx(pg,{title:"Goes to",children:h.map((p,g)=>y.jsxs("div",{className:"text-secondary",children:[y.jsx("span",{className:"font-medium",children:p.to}),y.jsxs("span",{style:{color:"var(--color-muted)"},children:[" · ",p.trigger]})]},`${p.to}#${g}`))}),y.jsx(pg,{title:"Evidence",children:u.length===0?y.jsx("div",{style:{color:"var(--color-muted)"},children:"No evidence pointer recorded."}):u.map((p,g)=>y.jsxs("div",{className:"font-mono text-caption",style:{color:"var(--color-muted)"},children:[p.file,p.line!==void 0?`:${p.line}`:"",p.note?` — ${p.note}`:""]},g))})]})}function pg({title:t,children:e}){return y.jsxs("div",{className:"mt-4",children:[y.jsx("div",{className:"text-caption font-semibold uppercase tracking-wide",style:{color:"var(--color-muted)"},children:t}),y.jsx("div",{className:"mt-1.5 flex flex-col gap-1",children:e})]})}function Zb({children:t,title:e}){return y.jsx("span",{title:e,className:"rounded-full px-2 py-0.5 text-caption",style:{background:"var(--color-canvas)",color:"var(--color-canvas-fg)",border:"1px solid var(--color-border)"},children:t})}function Que({map:t,selectedId:e,onSelect:n}){const[i,r]=C.useState(""),s=C.useMemo(()=>{const o=i.trim().toLowerCase(),l=h=>o.length===0||h.label.toLowerCase().includes(o)||h.id.toLowerCase().includes(o),u=new Map;for(const h of t.surfaces){if(!l(h))continue;const p=h.area??"",g=u.get(p)??[];g.push(h),u.set(p,g)}const f=h=>h===""?"No district":t.areas?.find(p=>p.id===h)?.label??h;return[...u.entries()].map(([h,p])=>({id:h,label:f(h),surfaces:p})).sort((h,p)=>h.label.localeCompare(p.label))},[t,i]);return y.jsxs("div",{className:"flex h-full flex-col",style:{background:"var(--color-canvas)"},children:[y.jsx("div",{className:"border-b p-3",style:{borderColor:"var(--color-border)"},children:y.jsx("input",{type:"search",value:i,onChange:o=>r(o.target.value),placeholder:"Search surfaces…","aria-label":"Search surfaces",className:"w-full rounded-[8px] px-3 py-1.5 text-body",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)",color:"var(--color-canvas-fg)"}})}),y.jsx("ul",{className:"min-h-0 flex-1 overflow-y-auto p-3",children:s.map(o=>y.jsxs("li",{className:"mb-3",children:[y.jsx("div",{className:"mb-1 text-caption font-semibold uppercase tracking-wide",style:{color:"var(--color-muted)"},children:o.label}),y.jsx("ul",{className:"flex flex-col gap-1",children:o.surfaces.map(l=>{const u=jO(l.kind),f=Lm(l.guard).length>0,h=l.id===e;return y.jsx("li",{children:y.jsxs("button",{type:"button",onClick:()=>n(l.id),className:"flex w-full items-center gap-2 rounded-[8px] px-2.5 py-1.5 text-left",style:{background:h?"var(--color-accent)":"var(--color-surface)",color:h?"#ffffff":"var(--color-canvas-fg)",border:"1px solid var(--color-border)"},children:[y.jsx("span",{className:"min-w-0 flex-1 truncate text-body",children:l.label}),f&&y.jsx("span",{className:"text-caption",style:{color:h?"#fff":"var(--color-mod-amber)"},children:"gated"}),y.jsx("span",{className:"text-caption",style:{color:h?"#fff":"var(--color-muted)"},children:u.tag}),y.jsx("span",{className:"text-caption",style:{color:h?"#fff":"var(--color-muted)"},children:MO(l.trust).label})]})},l.id)})})]},o.id))})]})}function Aue(t){if(t===null)return null;const e=Object.values(t.units);if(e.length===0)return null;let n=0,i=0,r=0,s=null,o=null;for(const f of e)f.state==="done"?n+=1:f.state==="writing"?(i+=1,s===null&&(s=f.label)):f.state==="not_started"&&(r+=1,o===null&&(o=f.label));let l;s!==null?l=`Writing ${s}`:o!==null?l=`Up next: ${o}`:l="All units mapped";const u=n>0?`${n} unit${n===1?"":"s"} finished in a previous session`:null;return{current:l,done:n,writing:i,remaining:r,total:e.length,skipped:u}}function Nue(t){return t==="diamond"?"◇":t==="stadium"?"▢":t==="slanted"?"▱":"▭"}function Pue(){const[t,e]=C.useState(null),[n,i]=C.useState(null),[r,s]=C.useState(null),[o,l]=C.useState(null),[u,f]=C.useState(null),[h,p]=C.useState(!1),[g,O]=C.useState(null),[v,x]=C.useState(null),[S,k]=C.useState(0),[$,E]=C.useState("map"),[T,_]=C.useState(!1),[Q,N]=C.useState(null),R=C.useRef(null),X=C.useMemo(()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,[]),q=Jae(T),z=C.useCallback(()=>{const ne=R.current,le=ne?.requestFullscreen?.bind(ne),H=ce=>{N(ce),_(!0)};le?le().then(()=>H(Qb(!0,!1))).catch(()=>H(Qb(!0,!0))):H(Qb(!1,!1))},[]),Z=C.useCallback(()=>{document.fullscreenElement&&document.exitFullscreen&&document.exitFullscreen().catch(()=>{}),N(null),_(!1)},[]),F=C.useCallback(()=>{T?Z():z()},[T,z,Z]);C.useEffect(()=>{const ne=le=>{const H=le.target,ce=H!==null&&(H.tagName==="INPUT"||H.tagName==="TEXTAREA"||H.isContentEditable),be=Kae(le.key,{active:T,editable:ce});be!=="none"&&(le.preventDefault(),be==="toggle"?F():Z())};return window.addEventListener("keydown",ne),()=>window.removeEventListener("keydown",ne)},[T,F,Z]),C.useEffect(()=>{const ne=()=>{!document.fullscreenElement&&Q==="api"&&(N(null),_(!1))};return document.addEventListener("fullscreenchange",ne),()=>document.removeEventListener("fullscreenchange",ne)},[Q]);const[M,B]=C.useState(null),L=C.useCallback(ne=>{O(ne),B(le=>({id:ne,nonce:(le?.nonce??0)+1}))},[]),I=C.useCallback(()=>{oZ().then(ne=>{e(ne),f(null)}).catch(ne=>f(ne instanceof Error?ne.message:String(ne))),_i().then(ne=>{s(ne.projectName),l(ne.frameworkVersion)}).catch(()=>{}),aZ().then(i).catch(()=>i(null))},[]);C.useEffect(()=>{I()},[I]),C.useEffect(()=>{const ne=new EventSource("/api/events");return ne.addEventListener("open",()=>p(!0)),ne.addEventListener("error",()=>p(!1)),ne.addEventListener("message",()=>I()),()=>ne.close()},[I]);const U=t?.status==="ready"?t:null,V=U?.map??null,te=C.useMemo(()=>U===null||v===null?null:U.journeys.find(ne=>ne.id===v)??null,[U,v]),P=C.useMemo(()=>V===null||g===null?null:V.surfaces.find(ne=>ne.id===g)??null,[V,g]),j=C.useMemo(()=>V===null?{dead:[],dangling:[],broken:[]}:{dead:[...I5(V)],dangling:Fae(V),broken:Hae(V,U?.journeys??[])},[V,U]),Y=j.dead.length+j.dangling.length+j.broken.length,G=C.useMemo(()=>Aue(n),[n]),J=C.useCallback(ne=>{x(ne),k(0)},[]);return C.useEffect(()=>{if(te===null)return;const ne=te.steps[S]?.surface;ne!==void 0&&O(ne)},[te,S]),y.jsx(Qi,{projectName:r,frameworkVersion:o,sseLive:h,hideSidebar:T,children:y.jsxs("div",{ref:R,className:"flex h-full flex-col",style:T&&Q==="css"?{position:"fixed",inset:0,zIndex:50,background:"var(--color-canvas)",transition:`opacity ${tle(X)}ms ease`}:void 0,children:[q.titleBand&&y.jsxs("div",{className:"border-b px-6 py-4",style:{borderColor:"var(--color-border)"},children:[y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx("h1",{className:"text-page font-semibold",children:"Site map"}),y.jsx(Zc,{managedBy:"shared"}),U&&y.jsxs("span",{className:"text-caption",style:{color:"var(--color-muted)"},children:[U.map.surfaces.length," surfaces",U.freshness.generated_from?` · from ${U.freshness.generated_from}`:""]}),y.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[y.jsx(ha,{action:"site-map",label:"Run site map",onDone:I}),U&&y.jsx("button",{type:"button",onClick:F,title:"Full screen (press f, Escape to exit)",className:"rounded-[8px] px-3 py-1 text-caption font-medium",style:{background:"var(--color-surface)",color:"var(--color-canvas-fg)",border:"1px solid var(--color-border)"},children:"Full screen"}),U&&y.jsxs("div",{className:"inline-flex overflow-hidden rounded-[8px] border",style:{borderColor:"var(--color-border)"},children:[y.jsx(JA,{active:$==="map",onClick:()=>E("map"),children:"Map"}),y.jsx(JA,{active:$==="list",onClick:()=>E("list"),children:"List"})]})]})]}),y.jsx(Tn,{children:"How your app really behaves, as a picture you can explore: every screen, journey, and gate, each traceable to the code."})]}),q.titleBand&&G&&y.jsx(Due,{model:G}),q.honestyStrip&&U&&V&&y.jsx(zue,{freshness:U.freshness,map:V}),u&&y.jsxs(Ib,{tone:"red",children:["Could not load the site map: ",u]}),t===null&&!u&&y.jsx(Ib,{tone:"muted",children:"Loading…"}),t?.status==="disabled"&&y.jsxs(Ib,{tone:"muted",children:["The site map is turned off. Enable the ",y.jsx("code",{children:"site_map"})," feature to build and view it."]}),t?.status==="blocked"&&y.jsxs("div",{className:"mx-auto mt-10 max-w-lg px-6 text-center",children:[y.jsx("div",{className:"text-body font-medium",children:"Finish the documentation first"}),y.jsx("p",{className:"mt-2 text-secondary",style:{color:"var(--color-muted)"},children:"The site map is the third step of the same documentation family, so it needs these done first:"}),y.jsx("div",{className:"mt-4 flex flex-col gap-3 text-left",children:t.missing.map(ne=>y.jsxs("div",{className:"rounded-[10px] border p-4",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[y.jsxs("div",{className:"text-body font-medium",children:["Run ",y.jsx("code",{children:ne.workflow})]}),y.jsx("p",{className:"mt-1 text-caption",style:{color:"var(--color-muted)"},children:ne.reason})]},ne.workflow))})]}),t?.status==="empty"&&y.jsxs("div",{className:"mx-auto mt-10 max-w-lg px-6 text-center",children:[y.jsx("div",{className:"text-body font-medium",children:"No site map yet"}),y.jsxs("p",{className:"mt-2 text-secondary",style:{color:"var(--color-muted)"},children:["The AI builds the map from your project's documentation and code, then this area draws it as a picture you can explore. Ask paqad to ",y.jsx("strong",{children:"create the site map"})," to get started."]})]}),U&&V&&y.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[q.journeyBand&&y.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b px-6 py-2.5",style:{borderColor:"var(--color-border)"},children:[y.jsx("span",{className:"text-caption font-medium",style:{color:"var(--color-muted)"},children:"Journey"}),y.jsx(Dm,{active:v===null,onClick:()=>J(null),children:"Whole map"}),U.journeys.map(ne=>y.jsx(Dm,{active:v===ne.id,onClick:()=>J(ne.id),children:ne.label},ne.id)),y.jsxs("div",{className:"ml-auto flex items-center gap-2.5",children:[pue.map(ne=>y.jsxs("span",{className:"inline-flex items-center gap-1 text-caption",style:{color:"var(--color-muted)"},children:[y.jsx("span",{"aria-hidden":"true",children:Nue(ne.shape)}),ne.family]},ne.family)),y.jsx("span",{"aria-hidden":"true",style:{color:"var(--color-border)"},children:"|"}),y.jsx("span",{className:"text-caption",style:{color:"var(--color-muted)"},children:"Solid = proven · Dashed = inferred or unverified"})]})]}),$==="map"&&Y>0&&y.jsx(Rue,{map:V,gaps:j,gapCount:Y,onFocus:L,onPickJourney:J}),y.jsxs("div",{className:"flex min-h-0 flex-1",children:[y.jsxs("div",{className:"relative min-w-0 flex-1",children:[T&&y.jsx(Mue,{journeys:U.journeys,activeJourneyId:v,onPick:J,onExit:Z}),$==="map"?y.jsx($ue,{map:V,journeys:U.journeys,activeJourneyId:v,walkStationId:te?te.steps[S]?.surface??null:null,selectedId:g,focus:M,stored:U.layout??null,readOnly:U.readOnly??!1,onSelect:O,onPickJourney:J,onPersistLayout:ne=>{lZ(ne).catch(le=>f(le instanceof Error?le.message:String(le)))},onResetLayout:()=>{cZ().catch(ne=>f(ne instanceof Error?ne.message:String(ne)))}}):y.jsx(Que,{map:V,selectedId:g,onSelect:O})]}),P&&y.jsx(_ue,{surface:P,map:V,journeys:U.journeys,onClose:()=>O(null)})]}),te&&y.jsx(jue,{journey:te,step:S,onStep:k})]})]})})}function KA(t,e){return t.surfaces.find(n=>n.id===e)?.label??e}function Rue({map:t,gaps:e,gapCount:n,onFocus:i,onPickJourney:r}){const[s,o]=C.useState(!1),l=e.dead.length>0?`${e.dead.length} surface${e.dead.length===1?"":"s"} look dead: no entry, no connections.`:e.broken.length>0?`${e.broken.length} journey step${e.broken.length===1?"":"s"} point to a surface that isn't on the map.`:`${e.dangling.length} transition${e.dangling.length===1?"":"s"} point to a surface that isn't on the map.`,u=e.dead[0]??e.dangling[0]?.from??t.surfaces[0]?.id??null;return y.jsxs("div",{className:"relative flex items-center gap-3 border-b px-6 py-2",style:{borderColor:"var(--color-border)",background:"var(--color-canvas)"},children:[y.jsxs("button",{type:"button",onClick:()=>u!==null&&i(u),className:"truncate text-left text-caption",style:{color:"var(--color-canvas-fg)"},children:[y.jsx("span",{"aria-hidden":"true",style:{color:"var(--color-mod-amber)"},children:"▲"})," ",l]}),y.jsxs("button",{type:"button",onClick:()=>o(f=>!f),className:"ml-auto rounded-full px-2.5 py-0.5 text-caption font-medium",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)",color:"var(--color-muted)"},children:[n," gap",n===1?"":"s"]}),s&&y.jsx("div",{className:"absolute right-6 top-full z-20 mt-1 w-96 max-w-[92vw] overflow-hidden rounded-[10px] border",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:y.jsxs("div",{className:"max-h-72 overflow-y-auto py-1",children:[e.dead.map(f=>y.jsx(Bb,{tag:"DEAD",text:KA(t,f),onClick:()=>{i(f),o(!1)}},`dead:${f}`)),e.dangling.map(f=>y.jsx(Bb,{tag:"DANGLING",text:`${KA(t,f.from)} → ${f.to}`,onClick:()=>{i(f.from),o(!1)}},`dangling:${f.from}->${f.to}`)),e.broken.map(f=>y.jsx(Bb,{tag:"BROKEN",text:`${f.journey} → ${f.surface}`,onClick:()=>{r(f.journey),o(!1)}},`broken:${f.journey}:${f.surface}`))]})})]})}function Bb({tag:t,text:e,onClick:n}){return y.jsxs("button",{type:"button",onClick:n,className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-caption hover:opacity-80",children:[y.jsx("span",{style:{color:"var(--color-muted)",fontSize:10,letterSpacing:.4},children:t}),y.jsx("span",{className:"truncate",style:{color:"var(--color-canvas-fg)"},children:e})]})}function jue({journey:t,step:e,onStep:n}){const i=t.steps[e],r=t.steps.length;return y.jsxs("div",{className:"flex items-center gap-3 border-t px-6 py-3",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[y.jsx("button",{type:"button",disabled:e===0,onClick:()=>n(Math.max(0,e-1)),className:"rounded-[8px] px-3 py-1 text-caption font-medium disabled:opacity-40",style:{border:"1px solid var(--color-border)"},children:"← Back"}),y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsxs("div",{className:"text-caption",style:{color:"var(--color-muted)"},children:["Step ",e+1," of ",r," · ",t.label]}),y.jsxs("div",{className:"truncate text-body",children:[y.jsx("strong",{children:i?.surface}),i?.action?` — ${i.action}`:"",i?.expect?` (expect: ${i.expect})`:""]})]}),y.jsx("button",{type:"button",disabled:e>=r-1,onClick:()=>n(Math.min(r-1,e+1)),className:"rounded-[8px] px-3 py-1 text-caption font-medium disabled:opacity-40",style:{border:"1px solid var(--color-border)"},children:"Next →"})]})}function JA({active:t,onClick:e,children:n}){return y.jsx("button",{type:"button",onClick:e,className:"px-3 py-1 text-caption font-medium",style:{background:t?"var(--color-accent)":"transparent",color:t?"#ffffff":"var(--color-muted)"},children:n})}function Mue({journeys:t,activeJourneyId:e,onPick:n,onExit:i}){return y.jsxs("div",{className:"absolute left-1/2 top-3 z-20 flex max-w-[92%] -translate-x-1/2 items-center gap-2 overflow-x-auto rounded-[10px] border px-3 py-1.5",style:{background:"var(--color-surface)",borderColor:"var(--color-border)",boxShadow:"0 2px 8px rgba(0,0,0,0.12)"},children:[y.jsx("button",{type:"button",onClick:i,title:"Exit full screen (Escape)",className:"shrink-0 rounded-[8px] px-3 py-1 text-caption font-medium",style:{background:"var(--color-canvas)",color:"var(--color-canvas-fg)",border:"1px solid var(--color-border)"},children:"Exit full screen"}),y.jsx("span",{"aria-hidden":"true",style:{color:"var(--color-border)"},children:"|"}),y.jsx(Dm,{active:e===null,onClick:()=>n(null),children:"Whole map"}),t.map(r=>y.jsx(Dm,{active:e===r.id,onClick:()=>n(r.id),children:r.label},r.id))]})}function Dm({active:t,onClick:e,children:n}){return y.jsx("button",{type:"button",onClick:e,className:"rounded-full px-3 py-1 text-caption font-medium",style:{background:t?"var(--color-accent)":"var(--color-surface)",color:t?"#ffffff":"var(--color-canvas-fg)",border:"1px solid var(--color-border)"},children:n})}function Lue(t){return t==="fresh"?"var(--color-mod-green)":t==="stale"?"var(--color-mod-amber)":"var(--color-mod-unknown)"}function Due({model:t}){return y.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 border-b px-6 py-2",style:{borderColor:"var(--color-border)",background:"var(--color-canvas)"},children:[y.jsxs("span",{className:"inline-flex items-center gap-1.5 text-caption font-medium",style:{color:"var(--color-canvas-fg)"},children:[y.jsx("span",{"aria-hidden":"true",style:{color:"var(--color-accent)"},children:"●"}),t.current]}),y.jsxs("span",{className:"text-caption",style:{color:"var(--color-muted)"},children:[y.jsx("strong",{style:{color:"var(--color-canvas-fg)"},children:t.done})," done ·"," ",t.writing," writing · ",t.remaining," to go"]}),t.skipped&&y.jsx("span",{className:"ml-auto text-caption",style:{color:"var(--color-muted)"},children:t.skipped})]})}function zue({freshness:t,map:e}){const n=yue(t),i=vue(e),r=Lue(n.tone);return y.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 border-b px-6 py-2",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[y.jsxs("span",{className:"inline-flex items-center gap-1.5 text-caption font-medium",style:{color:r},children:[y.jsx("span",{"aria-hidden":"true",children:n.glyph}),n.label]}),y.jsx("span",{className:"text-caption",style:{color:"var(--color-muted)"},children:n.detail}),y.jsxs("span",{className:"ml-auto text-caption",style:{color:"var(--color-muted)"},children:[y.jsxs("strong",{style:{color:"var(--color-canvas-fg)"},children:[i.proven," of ",i.total]})," ","surfaces proven in code or stronger",i.unproven>0?` · ${i.unproven} still inferred or unverified`:""]})]})}function Ib({tone:t,children:e}){return y.jsx("div",{className:"mx-6 mt-4 rounded-[10px] border p-4 text-secondary",style:{background:"var(--color-surface)",borderColor:t==="red"?"var(--color-mod-red)":"var(--color-border)",color:t==="muted"?"var(--color-muted)":void 0},children:e})}const Bz={pass:"var(--color-mod-green)",fail:"var(--color-mod-red)",inconclusive:"var(--color-mod-amber)",blocked:"var(--color-mod-amber)"};function eN(t){return t.slice(0,12)}const Xue=[{value:"ocsf",label:"OCSF (recommended)"},{value:"ecs",label:"ECS"},{value:"cef",label:"CEF"},{value:"jsonl",label:"JSONL"}];function Zue({row:t}){const[e,n]=C.useState(!1);return y.jsxs("li",{className:"border-b py-2 text-sm last:border-b-0",style:{borderColor:"var(--color-border)"},children:[y.jsxs("button",{type:"button",className:"flex w-full items-baseline gap-2 text-left",onClick:()=>n(!e),children:[y.jsx("span",{className:"inline-block h-2 w-2 shrink-0 self-center rounded-full",style:{background:Bz[t.verdict]},title:t.verdict}),y.jsxs("span",{children:["Gate ",y.jsx("code",{children:t.code})," ",t.verdict==="pass"?"passed":t.verdict,t.detail?": "+t.detail:""]}),y.jsx("span",{className:"ml-auto shrink-0 text-xs",style:{color:"var(--color-muted)"},children:new Date(t.ts).toLocaleString()})]}),e&&y.jsx("pre",{className:"mt-2 overflow-x-auto rounded p-2 text-xs",style:{background:"var(--color-canvas)",color:"var(--color-muted)"},children:JSON.stringify(t,null,2)})]})}function Bue({citations:t}){const e=new Map;for(const r of t)e.set(r.framework_id+"|"+r.clause_id,r);const n=[...e.values()],i=t[0]?.disclaimer;return y.jsxs("div",{className:"mt-2",children:[y.jsx("div",{className:"text-xs",style:{color:"var(--color-muted)"},children:"Evidence toward"}),y.jsx("ul",{className:"mt-1 flex flex-wrap gap-2 text-xs",children:n.map(r=>y.jsxs("li",{className:"rounded border px-2 py-0.5",style:{borderColor:"var(--color-border)"},title:i,children:[r.framework_title," ",r.clause_id,y.jsxs("span",{style:{color:"var(--color-muted)"},children:[" (",r.evidence_strength,")"]})]},r.framework_id+r.clause_id))})]})}function Iue({receipt:t,onCopy:e,animateSeal:n}){const i=t.authorship?.accepting_human?.name;return y.jsxs("div",{className:"rounded-lg border p-4 text-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{className:"font-medium",children:["Receipt ",eN(t.receipt_hash)]}),y.jsx("span",{className:"text-xs"+(n===!0?" receipt-seal-animate":""),style:{color:t.sealed?"var(--color-mod-green)":"var(--color-mod-red)"},title:t.sealed?"The hash chain recomputes cleanly. This record has not been altered.":"The hash chain breaks at or before this receipt.",children:t.sealed?"✓ sealed":"✗ chain broken"})]}),y.jsxs("div",{className:"mt-1 text-xs",style:{color:"var(--color-muted)"},children:[t.verification_result==="PASSED"?"Verification passed":null,t.verification_result==="FAILED"?"Verification failed":null,t.time_verified?" · "+new Date(t.time_verified).toLocaleString():null," · "+t.signing_mode]}),t.authorship&&y.jsxs("div",{className:"mt-2 text-xs",style:{color:"var(--color-muted)"},children:["Written by ",t.authorship.model_id??t.authorship.agent??"unknown agent",i?", accepted by "+i:""," (",t.authorship.provenance,")"]}),t.reproducibility&&y.jsxs("div",{className:"mt-2 text-xs",style:{color:"var(--color-muted)"},title:"Proves the context the agent saw is replayable from these exact inputs. It does not claim the model would regenerate the same output.",children:["Replayable from frozen context:"," ",y.jsx("code",{children:eN(t.reproducibility.context_hash)})," (",t.reproducibility.determinism,")"]}),t.compliance.length>0&&y.jsx(Bue,{citations:t.compliance}),t.checks.length>0&&y.jsx("ul",{className:"mt-2 flex flex-wrap gap-2 text-xs",children:t.checks.map((r,s)=>y.jsxs("li",{className:"flex items-center gap-1 rounded border px-2 py-0.5",style:{borderColor:"var(--color-border)"},children:[y.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full",style:{background:Bz[r.verdict]}}),r.code,y.jsxs("span",{style:{color:"var(--color-muted)"},children:["(",r.strength_class,")"]}),r.sealed===!1&&y.jsx("span",{style:{color:"var(--color-muted)"},title:"Recorded after this receipt was sealed, so the seal does not cover it",children:"not sealed"})]},r.code+s))}),t.subjects.length>0&&y.jsxs("div",{className:"mt-2 text-xs",style:{color:"var(--color-muted)"},children:["Covers ",t.subjects.length," ",t.subjects.length===1?"file":"files",":"," ",t.subjects.slice(0,3).map(r=>r.name).join(", "),t.subjects.length>3?"…":""]}),y.jsxs("div",{className:"mt-3 flex items-baseline gap-3",children:[y.jsx("button",{type:"button",className:"text-xs",style:{color:"var(--color-accent)"},onClick:e,children:"Copy as PR comment"}),y.jsx("button",{type:"button",className:"text-xs",style:{color:"var(--color-accent)"},onClick:()=>window.open("/api/snapshot/receipt/"+encodeURIComponent(t.receipt_hash),"_blank","noopener"),children:"Share snapshot"})]})]})}function Gue(){const[t,e]=C.useState(null),[n,i]=C.useState(null),[r,s]=C.useState(null),[o,l]=C.useState(""),[u,f]=C.useState(null),[h,p]=C.useState(!1),[g,O]=C.useState(!1),[v,x]=C.useState(!1),[S,k]=C.useState(null),[$,E]=C.useState(null),[T,_]=C.useState(null),Q=C.useRef(null),[N,R]=C.useState("ocsf"),[X,q]=C.useState(""),[z,Z]=C.useState(!1),[F,M]=C.useState(!1),[B,L]=C.useState(null),I=C.useCallback(()=>{Promise.all([rN(o?{verdict:o}:{}),Xg(),$Z()]).then(([G,J,ne])=>{e(G),i(J),s(ne),f(null);const le=J.receipts.length;if(Q.current!==null&&le>Q.current&&_(J.receipts[0]?.receipt_hash??null),Q.current=le,le>0)try{localStorage.setItem("paqad-receipt-viewed","1")}catch{}}).catch(G=>{f(G instanceof Error?G.message:String(G))})},[o]);C.useEffect(()=>{I(),_i().then(G=>{k(G.projectName),E(G.frameworkVersion)}).catch(()=>{})},[I]),C.useEffect(()=>{const G=new EventSource("/api/events");return G.addEventListener("open",()=>x(!0)),G.addEventListener("error",()=>x(!1)),G.addEventListener("dashboard-updated",()=>I()),()=>{G.close()}},[I]);const U=()=>{NZ().then(G=>navigator.clipboard.writeText(G)).then(()=>{p(!0),setTimeout(()=>p(!1),4e3)}).catch(G=>{f(G instanceof Error?G.message:String(G))})},V=()=>{window.open("/api/export/evidence-packet?format=html","_blank")},te=()=>{M(!0),L(null);const G=new URLSearchParams({format:N});X&&G.set("since",X),z&&G.set("redact","true"),fetch(`/api/export/siem?${G.toString()}`).then(async J=>{if(!J.ok){const he=await J.json().catch(()=>null);throw new Error(he?.error??`Export failed (${J.status}).`)}const ne=J.headers.get("x-paqad-event-count")??"0",le=J.headers.get("content-disposition")??"",H=/filename="([^"]+)"/.exec(le)?.[1]??`paqad-siem-${N}.txt`,ce=await J.blob(),be=URL.createObjectURL(ce),Se=document.createElement("a");Se.href=be,Se.download=H,Se.click(),URL.revokeObjectURL(be),f(null),L(`Exported ${ne} events.`)}).catch(J=>{f(J instanceof Error?J.message:String(J))}).finally(()=>M(!1))},P=()=>{AZ().then(G=>navigator.clipboard.writeText(G)).then(()=>{f(null),O(!0)}).catch(G=>{f(G instanceof Error?G.message:String(G))})},j=()=>{if(!r?.document)return;const G=new Blob([JSON.stringify(r.document,null,2)],{type:"application/json"}),J=URL.createObjectURL(G),ne=document.createElement("a");ne.href=J,ne.download="ai-bom.json",ne.click(),URL.revokeObjectURL(J)},Y=r?.document?.properties.filter(G=>G.name.startsWith("paqad:authorship:model"));return y.jsx(Qi,{projectName:S,frameworkVersion:$,sseLive:v,children:y.jsxs("div",{className:"mx-auto w-full max-w-3xl p-6",children:[y.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[y.jsx("h1",{className:"text-xl font-semibold",children:"Trust"}),y.jsxs("div",{className:"flex shrink-0 items-baseline gap-3",children:[y.jsx("button",{type:"button",className:"text-xs",style:{color:"var(--color-accent)"},onClick:V,children:"Export packet"}),y.jsx("button",{type:"button",className:"text-xs",style:{color:"var(--color-accent)"},onClick:P,children:"Copy packet markdown"})]})]}),y.jsx("p",{className:"mt-1 text-sm",style:{color:"var(--color-muted)"},children:Xc.trust}),g&&y.jsx("div",{className:"mt-3",children:y.jsx(nr,{onDone:()=>O(!1),children:"Copied. Paste it into a PR or a release note."})}),y.jsxs("details",{className:"mt-4 rounded-lg border text-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:[y.jsx("summary",{className:"cursor-pointer px-4 py-2 font-medium",children:"Export to your SIEM"}),y.jsxs("div",{className:"border-t px-4 py-3",style:{borderColor:"var(--color-border)"},children:[y.jsx("p",{className:"text-xs",style:{color:"var(--color-muted)"},children:"Project the evidence ledger into the schema your SIEM already ingests. Nothing leaves your machine until you download it."}),y.jsxs("div",{className:"mt-3 flex flex-wrap items-end gap-3",children:[y.jsxs("label",{className:"flex flex-col gap-1 text-xs",style:{color:"var(--color-muted)"},children:["Format",y.jsx("select",{className:"rounded border px-2 py-1 text-xs",style:{background:"var(--color-canvas)",borderColor:"var(--color-border)",color:"var(--color-canvas-fg)"},value:N,onChange:G=>R(G.target.value),children:Xue.map(G=>y.jsx("option",{value:G.value,children:G.label},G.value))})]}),y.jsxs("label",{className:"flex flex-col gap-1 text-xs",style:{color:"var(--color-muted)"},children:["From date",y.jsx("input",{type:"date",className:"rounded border px-2 py-1 text-xs",style:{background:"var(--color-canvas)",borderColor:"var(--color-border)",color:"var(--color-canvas-fg)"},value:X,onChange:G=>q(G.target.value)})]}),y.jsx("button",{type:"button",className:"rounded border px-3 py-1.5 text-xs font-medium",style:{borderColor:"var(--color-accent)",color:"var(--color-accent)"},onClick:te,disabled:F,children:F?"Exporting…":"Download export"})]}),y.jsxs("label",{className:"mt-3 flex items-start gap-2 text-xs",children:[y.jsx("input",{type:"checkbox",className:"mt-0.5",checked:z,onChange:G=>Z(G.target.checked)}),y.jsxs("span",{children:["Redact names and free text",y.jsx("span",{className:"block",style:{color:"var(--color-muted)"},children:"Strips human identities and free-text detail. Use this when you are sharing the export outside your team."})]})]}),B&&y.jsx("div",{className:"mt-3 text-xs",style:{color:"var(--color-mod-green)"},children:B}),y.jsx("div",{className:"mt-3 border-t pt-3",style:{borderColor:"var(--color-border)"},children:y.jsx(Jx,{area:"export",getScope:()=>({format:N,since:X,redact:z}),onApply:G=>{const J=G;(J.format==="ocsf"||J.format==="ecs"||J.format==="cef"||J.format==="jsonl")&&R(J.format),typeof J.since=="string"&&q(J.since),typeof J.redact=="boolean"&&Z(J.redact)}})})]})]}),u&&y.jsx("div",{className:"mt-4 rounded-lg border p-4 text-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-mod-red)"},children:u}),h&&y.jsxs("div",{className:"mt-3 flex items-center gap-2 text-sm",children:[y.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{background:"var(--color-accent)"}}),"Copied. Paste it on the pull request to show the checks really ran."]}),y.jsx("h2",{className:"mt-6 text-base font-semibold",children:"Receipts"}),y.jsx("p",{className:"mt-0.5 text-xs",style:{color:"var(--color-muted)"},children:"Who wrote it, who vouched for it, sealed."}),n&&n.receipts.length===0&&y.jsx("div",{className:"mt-3 rounded-lg border p-6 text-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)",color:"var(--color-muted)"},children:"Your first receipt appears after your first verified change. It proves who wrote what, and that the checks really ran."}),y.jsx("div",{className:"mt-3 flex flex-col gap-3",children:n?.receipts.map(G=>y.jsx(Iue,{receipt:G,onCopy:U,animateSeal:T!==null&&G.receipt_hash===T},G.receipt_hash))}),y.jsx("h2",{className:"mt-8 text-base font-semibold",children:"AI bill of materials"}),y.jsx("p",{className:"mt-0.5 text-xs",style:{color:"var(--color-muted)"},children:"Exactly which AI models touched your code."}),y.jsx("div",{className:"mt-3 rounded-lg border p-4 text-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:r?.document?y.jsxs("div",{className:"flex flex-col gap-3",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("span",{children:[r.document.components.length," ",r.document.components.length===1?"file":"files"," attested",Y&&Y.length>0?" · "+Y.map(G=>G.value).join(", "):""]}),y.jsx("button",{type:"button",className:"shrink-0 text-xs",style:{color:"var(--color-accent)"},onClick:j,children:"Download CycloneDX JSON"})]}),r.document.components.length>0?y.jsx("ul",{className:"flex flex-col gap-1",children:r.document.components.map(G=>y.jsxs("li",{className:"flex items-center justify-between gap-3 font-mono text-xs",children:[y.jsx("span",{className:"truncate",children:G.name}),G.hashes&&G.hashes.length>0?y.jsxs("span",{className:"shrink-0",style:{color:"var(--color-muted)"},children:[G.hashes[0].content.slice(0,12),"…"]}):null]},G.name))}):y.jsx("p",{className:"text-xs",style:{color:"var(--color-muted)"},children:"No files were in the most recent verified change. The bill of materials lists every changed file the next time paqad verifies a change with edits in your working tree."})]}):y.jsx("span",{style:{color:"var(--color-muted)"},children:"The AI-BOM is generated with your first receipt."})}),y.jsxs("div",{className:"mt-8 flex items-baseline justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-base font-semibold",children:"Evidence timeline"}),y.jsx("p",{className:"mt-0.5 text-xs",style:{color:"var(--color-muted)"},children:"A permanent record no one can quietly rewrite."})]}),y.jsxs("select",{className:"rounded border px-2 py-1 text-xs",style:{background:"var(--color-surface)",borderColor:"var(--color-border)",color:"var(--color-canvas-fg)"},value:o,onChange:G=>l(G.target.value),children:[y.jsx("option",{value:"",children:"All verdicts"}),y.jsx("option",{value:"pass",children:"pass"}),y.jsx("option",{value:"fail",children:"fail"}),y.jsx("option",{value:"inconclusive",children:"inconclusive"}),y.jsx("option",{value:"blocked",children:"blocked"})]})]}),y.jsx("div",{className:"mt-2",children:y.jsx(Jx,{area:"trust",getScope:()=>({verdict:o}),onApply:G=>{const J=G;l(typeof J.verdict=="string"?J.verdict:"")}})}),t&&t.rows.length===0&&y.jsx("div",{className:"mt-3 rounded-lg border p-6 text-sm",style:{background:"var(--color-surface)",borderColor:"var(--color-border)",color:"var(--color-muted)"},children:"Evidence appears here the first time a verification gate runs."}),t&&t.rows.length>0&&y.jsx("div",{className:"mt-3 rounded-lg border px-4 py-1",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:y.jsx("ul",{children:t.rows.map(G=>y.jsx(Zue,{row:G},G.content_hash+G.ts))})}),t&&t.rows.length>0&&t.total>t.rows.length&&y.jsxs("div",{className:"mt-2 text-xs",style:{color:"var(--color-muted)"},children:["Showing the latest ",t.rows.length," of ",t.total," entries."]})]})})}function Vue(){const{route:t}=zc();return t==="graph"?y.jsx(TW,{}):t==="approvals"?y.jsx(WZ,{}):t==="trust"?y.jsx(Gue,{}):t==="dashboard"?y.jsx(o4,{}):t==="build"?y.jsx(r0,{area:"build",title:"Build"},"build"):t==="automation"?y.jsx(r0,{area:"automation",title:"Automation"},"automation"):t==="git-workflow"?y.jsx(Hq,{}):t==="instructions"?y.jsx(TH,{}):t==="module-map"?y.jsx(RH,{}):t==="site-map"?y.jsx(Pue,{}):t==="design-tokens"?y.jsx(t8,{}):t==="knowledge"?y.jsx(r0,{area:"knowledge",title:"Knowledge",extra:y.jsx(QH,{})},"knowledge"):t==="setup"?y.jsx(YH,{}):y.jsx(iK,{})}function ZS(t){const e=t instanceof Error?`${t.message}
${t.stack??""}`:String(t);console.error("[paqad-graph fatal]",e);const n=document.getElementById("root");n&&(n.innerHTML=`<pre style="white-space:pre-wrap;padding:1rem;color:#dc2626;font-family:ui-monospace,monospace;font-size:12px">${e.replace(/[<>&]/g,i=>({"<":"&lt;",">":"&gt;","&":"&amp;"})[i])}</pre>`)}window.addEventListener("error",t=>ZS(t.error??t.message));window.addEventListener("unhandledrejection",t=>ZS(t.reason));try{ZZ();const t=document.getElementById("root");if(!t)throw new Error("Missing #root");iZ.createRoot(t).render(y.jsx(C.StrictMode,{children:y.jsx(Vue,{})}))}catch(t){ZS(t)}