bmad-studio 0.2.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -17
- package/package.json +12 -3
- package/packages/client/dist/assets/index-81ZKe-R8.css +1 -0
- package/packages/client/dist/assets/index-DyjtzhqN.js +641 -0
- package/packages/client/dist/index.html +2 -2
- package/packages/server/dist/app.d.ts +2 -1
- package/packages/server/dist/app.d.ts.map +1 -1
- package/packages/server/dist/app.js +68 -3
- package/packages/server/dist/app.js.map +1 -1
- package/packages/server/dist/core/file-store.d.ts +8 -1
- package/packages/server/dist/core/file-store.d.ts.map +1 -1
- package/packages/server/dist/core/file-store.js +26 -3
- package/packages/server/dist/core/file-store.js.map +1 -1
- package/packages/server/dist/core/ide-skill-generator.d.ts +58 -0
- package/packages/server/dist/core/ide-skill-generator.d.ts.map +1 -0
- package/packages/server/dist/core/ide-skill-generator.js +270 -0
- package/packages/server/dist/core/ide-skill-generator.js.map +1 -0
- package/packages/server/dist/core/ide-skill-generator.test.d.ts +2 -0
- package/packages/server/dist/core/ide-skill-generator.test.d.ts.map +1 -0
- package/packages/server/dist/core/ide-skill-generator.test.js +257 -0
- package/packages/server/dist/core/ide-skill-generator.test.js.map +1 -0
- package/packages/server/dist/core/module-installer.d.ts +165 -0
- package/packages/server/dist/core/module-installer.d.ts.map +1 -0
- package/packages/server/dist/core/module-installer.js +445 -0
- package/packages/server/dist/core/module-installer.js.map +1 -0
- package/packages/server/dist/core/module-installer.test.d.ts +2 -0
- package/packages/server/dist/core/module-installer.test.d.ts.map +1 -0
- package/packages/server/dist/core/module-installer.test.js +509 -0
- package/packages/server/dist/core/module-installer.test.js.map +1 -0
- package/packages/server/dist/core/module-registry.d.ts +5 -0
- package/packages/server/dist/core/module-registry.d.ts.map +1 -0
- package/packages/server/dist/core/module-registry.js +109 -0
- package/packages/server/dist/core/module-registry.js.map +1 -0
- package/packages/server/dist/core/module-registry.test.d.ts +2 -0
- package/packages/server/dist/core/module-registry.test.d.ts.map +1 -0
- package/packages/server/dist/core/module-registry.test.js +280 -0
- package/packages/server/dist/core/module-registry.test.js.map +1 -0
- package/packages/server/dist/core/write-service.d.ts +20 -0
- package/packages/server/dist/core/write-service.d.ts.map +1 -1
- package/packages/server/dist/core/write-service.js +113 -1
- package/packages/server/dist/core/write-service.js.map +1 -1
- package/packages/server/dist/core/write-service.test.js +93 -6
- package/packages/server/dist/core/write-service.test.js.map +1 -1
- package/packages/server/dist/index.js +85 -1
- package/packages/server/dist/index.js.map +1 -1
- package/packages/server/dist/parsers/module-yaml-parser.d.ts +16 -0
- package/packages/server/dist/parsers/module-yaml-parser.d.ts.map +1 -0
- package/packages/server/dist/parsers/module-yaml-parser.js +62 -0
- package/packages/server/dist/parsers/module-yaml-parser.js.map +1 -0
- package/packages/server/dist/parsers/module-yaml-parser.test.d.ts +2 -0
- package/packages/server/dist/parsers/module-yaml-parser.test.d.ts.map +1 -0
- package/packages/server/dist/parsers/module-yaml-parser.test.js +156 -0
- package/packages/server/dist/parsers/module-yaml-parser.test.js.map +1 -0
- package/packages/server/dist/parsers/skill-parser.d.ts.map +1 -1
- package/packages/server/dist/parsers/skill-parser.js +41 -4
- package/packages/server/dist/parsers/skill-parser.js.map +1 -1
- package/packages/server/dist/parsers/skill-parser.test.js +4 -3
- package/packages/server/dist/parsers/skill-parser.test.js.map +1 -1
- package/packages/server/dist/plugins/agents-plugin.d.ts.map +1 -1
- package/packages/server/dist/plugins/agents-plugin.js +60 -1
- package/packages/server/dist/plugins/agents-plugin.js.map +1 -1
- package/packages/server/dist/plugins/commands-plugin.d.ts.map +1 -1
- package/packages/server/dist/plugins/commands-plugin.js +37 -10
- package/packages/server/dist/plugins/commands-plugin.js.map +1 -1
- package/packages/server/dist/plugins/datasources-plugin.d.ts.map +1 -1
- package/packages/server/dist/plugins/datasources-plugin.js +101 -0
- package/packages/server/dist/plugins/datasources-plugin.js.map +1 -1
- package/packages/server/dist/plugins/modules-plugin.d.ts.map +1 -1
- package/packages/server/dist/plugins/modules-plugin.js +905 -100
- package/packages/server/dist/plugins/modules-plugin.js.map +1 -1
- package/packages/server/dist/plugins/modules-plugin.test.js +1894 -3
- package/packages/server/dist/plugins/modules-plugin.test.js.map +1 -1
- package/packages/server/dist/plugins/outputs-plugin.d.ts.map +1 -1
- package/packages/server/dist/plugins/outputs-plugin.js +111 -0
- package/packages/server/dist/plugins/outputs-plugin.js.map +1 -1
- package/packages/server/dist/plugins/overview-plugin.d.ts.map +1 -1
- package/packages/server/dist/plugins/overview-plugin.js +35 -2
- package/packages/server/dist/plugins/overview-plugin.js.map +1 -1
- package/packages/server/dist/plugins/search-plugin.d.ts.map +1 -1
- package/packages/server/dist/plugins/search-plugin.js +19 -2
- package/packages/server/dist/plugins/search-plugin.js.map +1 -1
- package/packages/server/dist/plugins/settings-plugin.d.ts.map +1 -1
- package/packages/server/dist/plugins/settings-plugin.js +38 -1
- package/packages/server/dist/plugins/settings-plugin.js.map +1 -1
- package/packages/server/dist/plugins/settings-plugin.test.js +72 -0
- package/packages/server/dist/plugins/settings-plugin.test.js.map +1 -1
- package/packages/server/dist/plugins/teams-plugin.d.ts.map +1 -1
- package/packages/server/dist/plugins/teams-plugin.js +6 -6
- package/packages/server/dist/plugins/teams-plugin.js.map +1 -1
- package/packages/server/dist/plugins/teams-plugin.test.js +43 -0
- package/packages/server/dist/plugins/teams-plugin.test.js.map +1 -1
- package/packages/server/dist/plugins/workflows-plugin.d.ts.map +1 -1
- package/packages/server/dist/plugins/workflows-plugin.js +14 -6
- package/packages/server/dist/plugins/workflows-plugin.js.map +1 -1
- package/packages/shared/src/config.ts +26 -0
- package/packages/shared/src/events.ts +7 -0
- package/packages/shared/src/index.ts +13 -0
- package/packages/shared/src/modules.ts +42 -0
- package/packages/shared/src/registry.ts +26 -0
- package/packages/shared/src/types.test.ts +37 -1
- package/packages/shared/src/workflows.ts +27 -0
- package/packages/client/dist/assets/index-5nXyrx_3.css +0 -1
- package/packages/client/dist/assets/index-DxN3uabX.js +0 -521
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
var HC=t=>{throw TypeError(t)};var Vb=(t,e,n)=>e.has(t)||HC("Cannot "+n);var H=(t,e,n)=>(Vb(t,e,"read from private field"),n?n.call(t):e.get(t)),Ee=(t,e,n)=>e.has(t)?HC("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Se=(t,e,n,r)=>(Vb(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Ge=(t,e,n)=>(Vb(t,e,"access private method"),n);var Vp=(t,e,n,r)=>({set _(i){Se(t,e,i,n)},get _(){return H(t,e,r)}});(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Gg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ub={exports:{}},xd={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var KC;function TX(){if(KC)return xd;KC=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var l=null;if(s!==void 0&&(l=""+s),i.key!==void 0&&(l=""+i.key),"key"in i){s={};for(var c in i)c!=="key"&&(s[c]=i[c])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:l,ref:i!==void 0?i:null,props:s}}return xd.Fragment=e,xd.jsx=n,xd.jsxs=n,xd}var JC;function $X(){return JC||(JC=1,Ub.exports=TX()),Ub.exports}var d=$X(),Wb={exports:{}},_e={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var eN;function EX(){if(eN)return _e;eN=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),O=Symbol.iterator;function x(P){return P===null||typeof P!="object"?null:(P=O&&P[O]||P["@@iterator"],typeof P=="function"?P:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function w(P,U,T){this.props=P,this.context=U,this.refs=k,this.updater=T||v}w.prototype.isReactComponent={},w.prototype.setState=function(P,U){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,U,"setState")},w.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function N(){}N.prototype=w.prototype;function C(P,U,T){this.props=P,this.context=U,this.refs=k,this.updater=T||v}var E=C.prototype=new N;E.constructor=C,S(E,w.prototype),E.isPureReactComponent=!0;var M=Array.isArray;function R(){}var _={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function G(P,U,T){var J=T.ref;return{$$typeof:t,type:P,key:U,ref:J!==void 0?J:null,props:T}}function D(P,U){return G(P.type,U,P.props)}function L(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function Z(P){var U={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(T){return U[T]})}var te=/\/+/g;function I(P,U){return typeof P=="object"&&P!==null&&P.key!=null?Z(""+P.key):U.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(R,R):(P.status="pending",P.then(function(U){P.status==="pending"&&(P.status="fulfilled",P.value=U)},function(U){P.status==="pending"&&(P.status="rejected",P.reason=U)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function X(P,U,T,J,W){var re=typeof P;(re==="undefined"||re==="boolean")&&(P=null);var oe=!1;if(P===null)oe=!0;else switch(re){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(P.$$typeof){case t:case e:oe=!0;break;case p:return oe=P._init,X(oe(P._payload),U,T,J,W)}}if(oe)return W=W(P),oe=J===""?"."+I(P,0):J,M(W)?(T="",oe!=null&&(T=oe.replace(te,"$&/")+"/"),X(W,U,T,"",function(ve){return ve})):W!=null&&(L(W)&&(W=D(W,T+(W.key==null||P&&P.key===W.key?"":(""+W.key).replace(te,"$&/")+"/")+oe)),U.push(W)),1;oe=0;var ce=J===""?".":J+":";if(M(P))for(var me=0;me<P.length;me++)J=P[me],re=ce+I(J,me),oe+=X(J,U,T,re,W);else if(me=x(P),typeof me=="function")for(P=me.call(P),me=0;!(J=P.next()).done;)J=J.value,re=ce+I(J,me++),oe+=X(J,U,T,re,W);else if(re==="object"){if(typeof P.then=="function")return X(B(P),U,T,J,W);throw U=String(P),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return oe}function q(P,U,T){if(P==null)return P;var J=[],W=0;return X(P,J,"","",function(re){return U.call(T,re,W++)}),J}function K(P){if(P._status===-1){var U=P._result;U=U(),U.then(function(T){(P._status===0||P._status===-1)&&(P._status=1,P._result=T)},function(T){(P._status===0||P._status===-1)&&(P._status=2,P._result=T)}),P._status===-1&&(P._status=0,P._result=U)}if(P._status===1)return P._result.default;throw P._result}var ne=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=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(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},$={map:q,forEach:function(P,U,T){q(P,function(){U.apply(this,arguments)},T)},count:function(P){var U=0;return q(P,function(){U++}),U},toArray:function(P){return q(P,function(U){return U})||[]},only:function(P){if(!L(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return _e.Activity=m,_e.Children=$,_e.Component=w,_e.Fragment=n,_e.Profiler=i,_e.PureComponent=C,_e.StrictMode=r,_e.Suspense=u,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,_e.__COMPILER_RUNTIME={__proto__:null,c:function(P){return _.H.useMemoCache(P)}},_e.cache=function(P){return function(){return P.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(P,U,T){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var J=S({},P.props),W=P.key;if(U!=null)for(re in U.key!==void 0&&(W=""+U.key),U)!V.call(U,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&U.ref===void 0||(J[re]=U[re]);var re=arguments.length-2;if(re===1)J.children=T;else if(1<re){for(var oe=Array(re),ce=0;ce<re;ce++)oe[ce]=arguments[ce+2];J.children=oe}return G(P.type,W,J)},_e.createContext=function(P){return P={$$typeof:l,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:s,_context:P},P},_e.createElement=function(P,U,T){var J,W={},re=null;if(U!=null)for(J in U.key!==void 0&&(re=""+U.key),U)V.call(U,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(W[J]=U[J]);var oe=arguments.length-2;if(oe===1)W.children=T;else if(1<oe){for(var ce=Array(oe),me=0;me<oe;me++)ce[me]=arguments[me+2];W.children=ce}if(P&&P.defaultProps)for(J in oe=P.defaultProps,oe)W[J]===void 0&&(W[J]=oe[J]);return G(P,re,W)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(P){return{$$typeof:c,render:P}},_e.isValidElement=L,_e.lazy=function(P){return{$$typeof:p,_payload:{_status:-1,_result:P},_init:K}},_e.memo=function(P,U){return{$$typeof:f,type:P,compare:U===void 0?null:U}},_e.startTransition=function(P){var U=_.T,T={};_.T=T;try{var J=P(),W=_.S;W!==null&&W(T,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(R,ne)}catch(re){ne(re)}finally{U!==null&&T.types!==null&&(U.types=T.types),_.T=U}},_e.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},_e.use=function(P){return _.H.use(P)},_e.useActionState=function(P,U,T){return _.H.useActionState(P,U,T)},_e.useCallback=function(P,U){return _.H.useCallback(P,U)},_e.useContext=function(P){return _.H.useContext(P)},_e.useDebugValue=function(){},_e.useDeferredValue=function(P,U){return _.H.useDeferredValue(P,U)},_e.useEffect=function(P,U){return _.H.useEffect(P,U)},_e.useEffectEvent=function(P){return _.H.useEffectEvent(P)},_e.useId=function(){return _.H.useId()},_e.useImperativeHandle=function(P,U,T){return _.H.useImperativeHandle(P,U,T)},_e.useInsertionEffect=function(P,U){return _.H.useInsertionEffect(P,U)},_e.useLayoutEffect=function(P,U){return _.H.useLayoutEffect(P,U)},_e.useMemo=function(P,U){return _.H.useMemo(P,U)},_e.useOptimistic=function(P,U){return _.H.useOptimistic(P,U)},_e.useReducer=function(P,U,T){return _.H.useReducer(P,U,T)},_e.useRef=function(P){return _.H.useRef(P)},_e.useState=function(P){return _.H.useState(P)},_e.useSyncExternalStore=function(P,U,T){return _.H.useSyncExternalStore(P,U,T)},_e.useTransition=function(){return _.H.useTransition()},_e.version="19.2.4",_e}var tN;function OS(){return tN||(tN=1,Wb.exports=EX()),Wb.exports}var j=OS();const Up=Gg(j);var Gb={exports:{}},bd={},Fb={exports:{}},Hb={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var nN;function PX(){return nN||(nN=1,(function(t){function e(X,q){var K=X.length;X.push(q);e:for(;0<K;){var ne=K-1>>>1,$=X[ne];if(0<i($,q))X[ne]=q,X[K]=$,K=ne;else break e}}function n(X){return X.length===0?null:X[0]}function r(X){if(X.length===0)return null;var q=X[0],K=X.pop();if(K!==q){X[0]=K;e:for(var ne=0,$=X.length,P=$>>>1;ne<P;){var U=2*(ne+1)-1,T=X[U],J=U+1,W=X[J];if(0>i(T,K))J<$&&0>i(W,T)?(X[ne]=W,X[J]=K,ne=J):(X[ne]=T,X[U]=K,ne=U);else if(J<$&&0>i(W,K))X[ne]=W,X[J]=K,ne=J;else break e}}return q}function i(X,q){var K=X.sortIndex-q.sortIndex;return K!==0?K:X.id-q.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 l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}var u=[],f=[],p=1,m=null,O=3,x=!1,v=!1,S=!1,k=!1,w=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function E(X){for(var q=n(f);q!==null;){if(q.callback===null)r(f);else if(q.startTime<=X)r(f),q.sortIndex=q.expirationTime,e(u,q);else break;q=n(f)}}function M(X){if(S=!1,E(X),!v)if(n(u)!==null)v=!0,R||(R=!0,Z());else{var q=n(f);q!==null&&B(M,q.startTime-X)}}var R=!1,_=-1,V=5,G=-1;function D(){return k?!0:!(t.unstable_now()-G<V)}function L(){if(k=!1,R){var X=t.unstable_now();G=X;var q=!0;try{e:{v=!1,S&&(S=!1,N(_),_=-1),x=!0;var K=O;try{t:{for(E(X),m=n(u);m!==null&&!(m.expirationTime>X&&D());){var ne=m.callback;if(typeof ne=="function"){m.callback=null,O=m.priorityLevel;var $=ne(m.expirationTime<=X);if(X=t.unstable_now(),typeof $=="function"){m.callback=$,E(X),q=!0;break t}m===n(u)&&r(u),E(X)}else r(u);m=n(u)}if(m!==null)q=!0;else{var P=n(f);P!==null&&B(M,P.startTime-X),q=!1}}break e}finally{m=null,O=K,x=!1}q=void 0}}finally{q?Z():R=!1}}}var Z;if(typeof C=="function")Z=function(){C(L)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,I=te.port2;te.port1.onmessage=L,Z=function(){I.postMessage(null)}}else Z=function(){w(L,0)};function B(X,q){_=w(function(){X(t.unstable_now())},q)}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(X){X.callback=null},t.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<X?Math.floor(1e3/X):5},t.unstable_getCurrentPriorityLevel=function(){return O},t.unstable_next=function(X){switch(O){case 1:case 2:case 3:var q=3;break;default:q=O}var K=O;O=q;try{return X()}finally{O=K}},t.unstable_requestPaint=function(){k=!0},t.unstable_runWithPriority=function(X,q){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var K=O;O=X;try{return q()}finally{O=K}},t.unstable_scheduleCallback=function(X,q,K){var ne=t.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?ne+K:ne):K=ne,X){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=K+$,X={id:p++,callback:q,priorityLevel:X,startTime:K,expirationTime:$,sortIndex:-1},K>ne?(X.sortIndex=K,e(f,X),n(u)===null&&X===n(f)&&(S?(N(_),_=-1):S=!0,B(M,K-ne))):(X.sortIndex=$,e(u,X),v||x||(v=!0,R||(R=!0,Z()))),X},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(X){var q=O;return function(){var K=O;O=q;try{return X.apply(this,arguments)}finally{O=K}}}})(Hb)),Hb}var rN;function AX(){return rN||(rN=1,Fb.exports=PX()),Fb.exports}var Kb={exports:{}},En={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var iN;function RX(){if(iN)return En;iN=1;var t=OS();function e(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}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 r={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},i=Symbol.for("react.portal");function s(u,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:u,containerInfo:f,implementation:p}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,f){if(u==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return En.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,En.createPortal=function(u,f){var p=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,p)},En.flushSync=function(u){var f=l.T,p=r.p;try{if(l.T=null,r.p=2,u)return u()}finally{l.T=f,r.p=p,r.d.f()}},En.preconnect=function(u,f){typeof u=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(u,f))},En.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},En.preinit=function(u,f){if(typeof u=="string"&&f&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin),O=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(u,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:O,fetchPriority:x}):p==="script"&&r.d.X(u,{crossOrigin:m,integrity:O,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},En.preinitModule=function(u,f){if(typeof u=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=c(f.as,f.crossOrigin);r.d.M(u,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(u)},En.preload=function(u,f){if(typeof u=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin);r.d.L(u,p,{crossOrigin:m,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})}},En.preloadModule=function(u,f){if(typeof u=="string")if(f){var p=c(f.as,f.crossOrigin);r.d.m(u,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(u)},En.requestFormReset=function(u){r.d.r(u)},En.unstable_batchedUpdates=function(u,f){return u(f)},En.useFormState=function(u,f,p){return l.H.useFormState(u,f,p)},En.useFormStatus=function(){return l.H.useHostTransitionStatus()},En.version="19.2.4",En}var sN;function uA(){if(sN)return Kb.exports;sN=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(),Kb.exports=RX(),Kb.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var aN;function _X(){if(aN)return bd;aN=1;var t=AX(),e=OS(),n=uA();function r(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)o+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var o=a,h=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,(o.flags&4098)!==0&&(h=o.return),a=o.return;while(a)}return o.tag===3?h:null}function l(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function c(a){if(a.tag===31){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function u(a){if(s(a)!==a)throw Error(r(188))}function f(a){var o=a.alternate;if(!o){if(o=s(a),o===null)throw Error(r(188));return o!==a?null:a}for(var h=a,g=o;;){var b=h.return;if(b===null)break;var y=b.alternate;if(y===null){if(g=b.return,g!==null){h=g;continue}break}if(b.child===y.child){for(y=b.child;y;){if(y===h)return u(b),a;if(y===g)return u(b),o;y=y.sibling}throw Error(r(188))}if(h.return!==g.return)h=b,g=y;else{for(var Q=!1,A=b.child;A;){if(A===h){Q=!0,h=b,g=y;break}if(A===g){Q=!0,g=b,h=y;break}A=A.sibling}if(!Q){for(A=y.child;A;){if(A===h){Q=!0,h=y,g=b;break}if(A===g){Q=!0,g=y,h=b;break}A=A.sibling}if(!Q)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?a:o}function p(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=p(a),o!==null)return o;a=a.sibling}return null}var m=Object.assign,O=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),C=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function Z(a){return a===null||typeof a!="object"?null:(a=L&&a[L]||a["@@iterator"],typeof a=="function"?a:null)}var te=Symbol.for("react.client.reference");function I(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===te?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case S:return"Fragment";case w:return"Profiler";case k:return"StrictMode";case M:return"Suspense";case R:return"SuspenseList";case G:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case v:return"Portal";case C:return a.displayName||"Context";case N:return(a._context.displayName||"Context")+".Consumer";case E:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case _:return o=a.displayName||null,o!==null?o:I(a.type)||"Memo";case V:o=a._payload,a=a._init;try{return I(a(o))}catch{}}return null}var B=Array.isArray,X=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},ne=[],$=-1;function P(a){return{current:a}}function U(a){0>$||(a.current=ne[$],ne[$]=null,$--)}function T(a,o){$++,ne[$]=a.current,a.current=o}var J=P(null),W=P(null),re=P(null),oe=P(null);function ce(a,o){switch(T(re,o),T(W,a),T(J,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?vC(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=vC(o),a=yC(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}U(J),T(J,a)}function me(){U(J),U(W),U(re)}function ve(a){a.memoizedState!==null&&T(oe,a);var o=J.current,h=yC(o,a.type);o!==h&&(T(W,a),T(J,h))}function Ie(a){W.current===a&&(U(J),U(W)),oe.current===a&&(U(oe),pd._currentValue=K)}var Dt,Rt;function Lt(a){if(Dt===void 0)try{throw Error()}catch(h){var o=h.stack.trim().match(/\n( *(at )?)/);Dt=o&&o[1]||"",Rt=-1<h.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Dt+a+Rt}var er=!1;function Dr(a,o){if(!a||er)return"";er=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(o){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(le){var ae=le}Reflect.construct(a,[],fe)}else{try{fe.call()}catch(le){ae=le}a.call(fe.prototype)}}else{try{throw Error()}catch(le){ae=le}(fe=a())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(le){if(le&&ae&&typeof le.stack=="string")return[le.stack,ae.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=g.DetermineComponentFrameRoot(),Q=y[0],A=y[1];if(Q&&A){var Y=Q.split(`
|
|
44
|
+
`),se=A.split(`
|
|
45
|
+
`);for(b=g=0;g<Y.length&&!Y[g].includes("DetermineComponentFrameRoot");)g++;for(;b<se.length&&!se[b].includes("DetermineComponentFrameRoot");)b++;if(g===Y.length||b===se.length)for(g=Y.length-1,b=se.length-1;1<=g&&0<=b&&Y[g]!==se[b];)b--;for(;1<=g&&0<=b;g--,b--)if(Y[g]!==se[b]){if(g!==1||b!==1)do if(g--,b--,0>b||Y[g]!==se[b]){var ue=`
|
|
46
|
+
`+Y[g].replace(" at new "," at ");return a.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",a.displayName)),ue}while(1<=g&&0<=b);break}}}finally{er=!1,Error.prepareStackTrace=h}return(h=a?a.displayName||a.name:"")?Lt(h):""}function Zn(a,o){switch(a.tag){case 26:case 27:case 5:return Lt(a.type);case 16:return Lt("Lazy");case 13:return a.child!==o&&o!==null?Lt("Suspense Fallback"):Lt("Suspense");case 19:return Lt("SuspenseList");case 0:case 15:return Dr(a.type,!1);case 11:return Dr(a.type.render,!1);case 1:return Dr(a.type,!0);case 31:return Lt("Activity");default:return""}}function yr(a){try{var o="",h=null;do o+=Zn(a,h),h=a,a=a.return;while(a);return o}catch(g){return`
|
|
47
|
+
Error generating stack: `+g.message+`
|
|
48
|
+
`+g.stack}}var fi=Object.prototype.hasOwnProperty,ps=t.unstable_scheduleCallback,ra=t.unstable_cancelCallback,sl=t.unstable_shouldYield,vo=t.unstable_requestPaint,bn=t.unstable_now,yo=t.unstable_getCurrentPriorityLevel,de=t.unstable_ImmediatePriority,xe=t.unstable_UserBlockingPriority,Pe=t.unstable_NormalPriority,Xe=t.unstable_LowPriority,nt=t.unstable_IdlePriority,qe=t.log,ft=t.unstable_setDisableYieldValue,jt=null,Qt=null;function Ft(a){if(typeof qe=="function"&&ft(a),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(jt,a)}catch{}}var ct=Math.clz32?Math.clz32:AO,Ai=Math.log,qn=Math.LN2;function AO(a){return a>>>=0,a===0?32:31-(Ai(a)/qn|0)|0}var Ri=256,Ef=262144,Pf=4194304;function al(a){var o=a&42;if(o!==0)return o;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 Af(a,o,h){var g=a.pendingLanes;if(g===0)return 0;var b=0,y=a.suspendedLanes,Q=a.pingedLanes;a=a.warmLanes;var A=g&134217727;return A!==0?(g=A&~y,g!==0?b=al(g):(Q&=A,Q!==0?b=al(Q):h||(h=A&~a,h!==0&&(b=al(h))))):(A=g&~y,A!==0?b=al(A):Q!==0?b=al(Q):h||(h=g&~a,h!==0&&(b=al(h)))),b===0?0:o!==0&&o!==b&&(o&y)===0&&(y=b&-b,h=o&-o,y>=h||y===32&&(h&4194048)!==0)?o:b}function Cu(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function gD(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 t2(){var a=Pf;return Pf<<=1,(Pf&62914560)===0&&(Pf=4194304),a}function RO(a){for(var o=[],h=0;31>h;h++)o.push(a);return o}function Nu(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function OD(a,o,h,g,b,y){var Q=a.pendingLanes;a.pendingLanes=h,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=h,a.entangledLanes&=h,a.errorRecoveryDisabledLanes&=h,a.shellSuspendCounter=0;var A=a.entanglements,Y=a.expirationTimes,se=a.hiddenUpdates;for(h=Q&~h;0<h;){var ue=31-ct(h),fe=1<<ue;A[ue]=0,Y[ue]=-1;var ae=se[ue];if(ae!==null)for(se[ue]=null,ue=0;ue<ae.length;ue++){var le=ae[ue];le!==null&&(le.lane&=-536870913)}h&=~fe}g!==0&&n2(a,g,0),y!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=y&~(Q&~o))}function n2(a,o,h){a.pendingLanes|=o,a.suspendedLanes&=~o;var g=31-ct(o);a.entangledLanes|=o,a.entanglements[g]=a.entanglements[g]|1073741824|h&261930}function r2(a,o){var h=a.entangledLanes|=o;for(a=a.entanglements;h;){var g=31-ct(h),b=1<<g;b&o|a[g]&o&&(a[g]|=o),h&=~b}}function i2(a,o){var h=o&-o;return h=(h&42)!==0?1:_O(h),(h&(a.suspendedLanes|o))!==0?0:h}function _O(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 MO(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function s2(){var a=q.p;return a!==0?a:(a=window.event,a===void 0?32:BC(a.type))}function a2(a,o){var h=q.p;try{return q.p=a,o()}finally{q.p=h}}var ia=Math.random().toString(36).slice(2),vn="__reactFiber$"+ia,tr="__reactProps$"+ia,So="__reactContainer$"+ia,zO="__reactEvents$"+ia,xD="__reactListeners$"+ia,bD="__reactHandles$"+ia,l2="__reactResources$"+ia,Tu="__reactMarker$"+ia;function DO(a){delete a[vn],delete a[tr],delete a[zO],delete a[xD],delete a[bD]}function wo(a){var o=a[vn];if(o)return o;for(var h=a.parentNode;h;){if(o=h[So]||h[vn]){if(h=o.alternate,o.child!==null||h!==null&&h.child!==null)for(a=NC(a);a!==null;){if(h=a[vn])return h;a=NC(a)}return o}a=h,h=a.parentNode}return null}function ko(a){if(a=a[vn]||a[So]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function $u(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(r(33))}function jo(a){var o=a[l2];return o||(o=a[l2]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function pn(a){a[Tu]=!0}var o2=new Set,c2={};function ll(a,o){Qo(a,o),Qo(a+"Capture",o)}function Qo(a,o){for(c2[a]=o,a=0;a<o.length;a++)o2.add(o[a])}var vD=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]*$"),u2={},d2={};function yD(a){return fi.call(d2,a)?!0:fi.call(u2,a)?!1:vD.test(a)?d2[a]=!0:(u2[a]=!0,!1)}function Rf(a,o,h){if(yD(o))if(h===null)a.removeAttribute(o);else{switch(typeof h){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var g=o.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+h)}}function _f(a,o,h){if(h===null)a.removeAttribute(o);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+h)}}function ms(a,o,h,g){if(g===null)a.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(h);return}a.setAttributeNS(o,h,""+g)}}function Lr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function h2(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function SD(a,o,h){var g=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var b=g.get,y=g.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return b.call(this)},set:function(Q){h=""+Q,y.call(this,Q)}}),Object.defineProperty(a,o,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(Q){h=""+Q},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function LO(a){if(!a._valueTracker){var o=h2(a)?"checked":"value";a._valueTracker=SD(a,o,""+a[o])}}function f2(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var h=o.getValue(),g="";return a&&(g=h2(a)?a.checked?"true":"false":a.value),a=g,a!==h?(o.setValue(a),!0):!1}function Mf(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 wD=/[\n"\\]/g;function Xr(a){return a.replace(wD,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function XO(a,o,h,g,b,y,Q,A){a.name="",Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"?a.type=Q:a.removeAttribute("type"),o!=null?Q==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+Lr(o)):a.value!==""+Lr(o)&&(a.value=""+Lr(o)):Q!=="submit"&&Q!=="reset"||a.removeAttribute("value"),o!=null?ZO(a,Q,Lr(o)):h!=null?ZO(a,Q,Lr(h)):g!=null&&a.removeAttribute("value"),b==null&&y!=null&&(a.defaultChecked=!!y),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?a.name=""+Lr(A):a.removeAttribute("name")}function p2(a,o,h,g,b,y,Q,A){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(a.type=y),o!=null||h!=null){if(!(y!=="submit"&&y!=="reset"||o!=null)){LO(a);return}h=h!=null?""+Lr(h):"",o=o!=null?""+Lr(o):h,A||o===a.value||(a.value=o),a.defaultValue=o}g=g??b,g=typeof g!="function"&&typeof g!="symbol"&&!!g,a.checked=A?a.checked:!!g,a.defaultChecked=!!g,Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"&&(a.name=Q),LO(a)}function ZO(a,o,h){o==="number"&&Mf(a.ownerDocument)===a||a.defaultValue===""+h||(a.defaultValue=""+h)}function Co(a,o,h,g){if(a=a.options,o){o={};for(var b=0;b<h.length;b++)o["$"+h[b]]=!0;for(h=0;h<a.length;h++)b=o.hasOwnProperty("$"+a[h].value),a[h].selected!==b&&(a[h].selected=b),b&&g&&(a[h].defaultSelected=!0)}else{for(h=""+Lr(h),o=null,b=0;b<a.length;b++){if(a[b].value===h){a[b].selected=!0,g&&(a[b].defaultSelected=!0);return}o!==null||a[b].disabled||(o=a[b])}o!==null&&(o.selected=!0)}}function m2(a,o,h){if(o!=null&&(o=""+Lr(o),o!==a.value&&(a.value=o),h==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=h!=null?""+Lr(h):""}function g2(a,o,h,g){if(o==null){if(g!=null){if(h!=null)throw Error(r(92));if(B(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),o=h}h=Lr(o),a.defaultValue=h,g=a.textContent,g===h&&g!==""&&g!==null&&(a.value=g),LO(a)}function No(a,o){if(o){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=o;return}}a.textContent=o}var kD=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 O2(a,o,h){var g=o.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":g?a.setProperty(o,h):typeof h!="number"||h===0||kD.has(o)?o==="float"?a.cssFloat=h:a[o]=(""+h).trim():a[o]=h+"px"}function x2(a,o,h){if(o!=null&&typeof o!="object")throw Error(r(62));if(a=a.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||o!=null&&o.hasOwnProperty(g)||(g.indexOf("--")===0?a.setProperty(g,""):g==="float"?a.cssFloat="":a[g]="");for(var b in o)g=o[b],o.hasOwnProperty(b)&&h[b]!==g&&O2(a,b,g)}else for(var y in o)o.hasOwnProperty(y)&&O2(a,y,o[y])}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 jD=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"]]),QD=/^[\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 zf(a){return QD.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function gs(){}var IO=null;function BO(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var To=null,$o=null;function b2(a){var o=ko(a);if(o&&(a=o.stateNode)){var h=a[tr]||null;e:switch(a=o.stateNode,o.type){case"input":if(XO(a,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),o=h.name,h.type==="radio"&&o!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Xr(""+o)+'"][type="radio"]'),o=0;o<h.length;o++){var g=h[o];if(g!==a&&g.form===a.form){var b=g[tr]||null;if(!b)throw Error(r(90));XO(g,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(o=0;o<h.length;o++)g=h[o],g.form===a.form&&f2(g)}break e;case"textarea":m2(a,h.value,h.defaultValue);break e;case"select":o=h.value,o!=null&&Co(a,!!h.multiple,o,!1)}}}var YO=!1;function v2(a,o,h){if(YO)return a(o,h);YO=!0;try{var g=a(o);return g}finally{if(YO=!1,(To!==null||$o!==null)&&(kp(),To&&(o=To,a=$o,$o=To=null,b2(o),a)))for(o=0;o<a.length;o++)b2(a[o])}}function Eu(a,o){var h=a.stateNode;if(h===null)return null;var g=h[tr]||null;if(g===null)return null;h=g[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(a=a.type,g=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!g;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(r(231,o,typeof h));return h}var Os=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),VO=!1;if(Os)try{var Pu={};Object.defineProperty(Pu,"passive",{get:function(){VO=!0}}),window.addEventListener("test",Pu,Pu),window.removeEventListener("test",Pu,Pu)}catch{VO=!1}var sa=null,UO=null,Df=null;function y2(){if(Df)return Df;var a,o=UO,h=o.length,g,b="value"in sa?sa.value:sa.textContent,y=b.length;for(a=0;a<h&&o[a]===b[a];a++);var Q=h-a;for(g=1;g<=Q&&o[h-g]===b[y-g];g++);return Df=b.slice(a,1<g?1-g:void 0)}function Lf(a){var o=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&o===13&&(a=13)):a=o,a===10&&(a=13),32<=a||a===13?a:0}function Xf(){return!0}function S2(){return!1}function nr(a){function o(h,g,b,y,Q){this._reactName=h,this._targetInst=b,this.type=g,this.nativeEvent=y,this.target=Q,this.currentTarget=null;for(var A in a)a.hasOwnProperty(A)&&(h=a[A],this[A]=h?h(y):y[A]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Xf:S2,this.isPropagationStopped=S2,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Xf)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Xf)},persist:function(){},isPersistent:Xf}),o}var ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zf=nr(ol),Au=m({},ol,{view:0,detail:0}),CD=nr(Au),WO,GO,Ru,qf=m({},Au,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:HO,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!==Ru&&(Ru&&a.type==="mousemove"?(WO=a.screenX-Ru.screenX,GO=a.screenY-Ru.screenY):GO=WO=0,Ru=a),WO)},movementY:function(a){return"movementY"in a?a.movementY:GO}}),w2=nr(qf),ND=m({},qf,{dataTransfer:0}),TD=nr(ND),$D=m({},Au,{relatedTarget:0}),FO=nr($D),ED=m({},ol,{animationName:0,elapsedTime:0,pseudoElement:0}),PD=nr(ED),AD=m({},ol,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),RD=nr(AD),_D=m({},ol,{data:0}),k2=nr(_D),MD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zD={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"},DD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function LD(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=DD[a])?!!o[a]:!1}function HO(){return LD}var XD=m({},Au,{key:function(a){if(a.key){var o=MD[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=Lf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?zD[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:HO,charCode:function(a){return a.type==="keypress"?Lf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Lf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),ZD=nr(XD),qD=m({},qf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),j2=nr(qD),ID=m({},Au,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:HO}),BD=nr(ID),YD=m({},ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),VD=nr(YD),UD=m({},qf,{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}),WD=nr(UD),GD=m({},ol,{newState:0,oldState:0}),FD=nr(GD),HD=[9,13,27,32],KO=Os&&"CompositionEvent"in window,_u=null;Os&&"documentMode"in document&&(_u=document.documentMode);var KD=Os&&"TextEvent"in window&&!_u,Q2=Os&&(!KO||_u&&8<_u&&11>=_u),C2=" ",N2=!1;function T2(a,o){switch(a){case"keyup":return HD.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $2(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Eo=!1;function JD(a,o){switch(a){case"compositionend":return $2(o);case"keypress":return o.which!==32?null:(N2=!0,C2);case"textInput":return a=o.data,a===C2&&N2?null:a;default:return null}}function eL(a,o){if(Eo)return a==="compositionend"||!KO&&T2(a,o)?(a=y2(),Df=UO=sa=null,Eo=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Q2&&o.locale!=="ko"?null:o.data;default:return null}}var tL={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 E2(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!tL[a.type]:o==="textarea"}function P2(a,o,h,g){To?$o?$o.push(g):$o=[g]:To=g,o=Ep(o,"onChange"),0<o.length&&(h=new Zf("onChange","change",null,h,g),a.push({event:h,listeners:o}))}var Mu=null,zu=null;function nL(a){pC(a,0)}function If(a){var o=$u(a);if(f2(o))return a}function A2(a,o){if(a==="change")return o}var R2=!1;if(Os){var JO;if(Os){var ex="oninput"in document;if(!ex){var _2=document.createElement("div");_2.setAttribute("oninput","return;"),ex=typeof _2.oninput=="function"}JO=ex}else JO=!1;R2=JO&&(!document.documentMode||9<document.documentMode)}function M2(){Mu&&(Mu.detachEvent("onpropertychange",z2),zu=Mu=null)}function z2(a){if(a.propertyName==="value"&&If(zu)){var o=[];P2(o,zu,a,BO(a)),v2(nL,o)}}function rL(a,o,h){a==="focusin"?(M2(),Mu=o,zu=h,Mu.attachEvent("onpropertychange",z2)):a==="focusout"&&M2()}function iL(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return If(zu)}function sL(a,o){if(a==="click")return If(o)}function aL(a,o){if(a==="input"||a==="change")return If(o)}function lL(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var Sr=typeof Object.is=="function"?Object.is:lL;function Du(a,o){if(Sr(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var h=Object.keys(a),g=Object.keys(o);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var b=h[g];if(!fi.call(o,b)||!Sr(a[b],o[b]))return!1}return!0}function D2(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function L2(a,o){var h=D2(a);a=0;for(var g;h;){if(h.nodeType===3){if(g=a+h.textContent.length,a<=o&&g>=o)return{node:h,offset:o-a};a=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=D2(h)}}function X2(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?X2(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function Z2(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Mf(a.document);o instanceof a.HTMLIFrameElement;){try{var h=typeof o.contentWindow.location.href=="string"}catch{h=!1}if(h)a=o.contentWindow;else break;o=Mf(a.document)}return o}function tx(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var oL=Os&&"documentMode"in document&&11>=document.documentMode,Po=null,nx=null,Lu=null,rx=!1;function q2(a,o,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;rx||Po==null||Po!==Mf(g)||(g=Po,"selectionStart"in g&&tx(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Lu&&Du(Lu,g)||(Lu=g,g=Ep(nx,"onSelect"),0<g.length&&(o=new Zf("onSelect","select",null,o,h),a.push({event:o,listeners:g}),o.target=Po)))}function cl(a,o){var h={};return h[a.toLowerCase()]=o.toLowerCase(),h["Webkit"+a]="webkit"+o,h["Moz"+a]="moz"+o,h}var Ao={animationend:cl("Animation","AnimationEnd"),animationiteration:cl("Animation","AnimationIteration"),animationstart:cl("Animation","AnimationStart"),transitionrun:cl("Transition","TransitionRun"),transitionstart:cl("Transition","TransitionStart"),transitioncancel:cl("Transition","TransitionCancel"),transitionend:cl("Transition","TransitionEnd")},ix={},I2={};Os&&(I2=document.createElement("div").style,"AnimationEvent"in window||(delete Ao.animationend.animation,delete Ao.animationiteration.animation,delete Ao.animationstart.animation),"TransitionEvent"in window||delete Ao.transitionend.transition);function ul(a){if(ix[a])return ix[a];if(!Ao[a])return a;var o=Ao[a],h;for(h in o)if(o.hasOwnProperty(h)&&h in I2)return ix[a]=o[h];return a}var B2=ul("animationend"),Y2=ul("animationiteration"),V2=ul("animationstart"),cL=ul("transitionrun"),uL=ul("transitionstart"),dL=ul("transitioncancel"),U2=ul("transitionend"),W2=new Map,sx="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(" ");sx.push("scrollEnd");function pi(a,o){W2.set(a,o),ll(o,[a])}var Bf=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=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(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Zr=[],Ro=0,ax=0;function Yf(){for(var a=Ro,o=ax=Ro=0;o<a;){var h=Zr[o];Zr[o++]=null;var g=Zr[o];Zr[o++]=null;var b=Zr[o];Zr[o++]=null;var y=Zr[o];if(Zr[o++]=null,g!==null&&b!==null){var Q=g.pending;Q===null?b.next=b:(b.next=Q.next,Q.next=b),g.pending=b}y!==0&&G2(h,b,y)}}function Vf(a,o,h,g){Zr[Ro++]=a,Zr[Ro++]=o,Zr[Ro++]=h,Zr[Ro++]=g,ax|=g,a.lanes|=g,a=a.alternate,a!==null&&(a.lanes|=g)}function lx(a,o,h,g){return Vf(a,o,h,g),Uf(a)}function dl(a,o){return Vf(a,null,null,o),Uf(a)}function G2(a,o,h){a.lanes|=h;var g=a.alternate;g!==null&&(g.lanes|=h);for(var b=!1,y=a.return;y!==null;)y.childLanes|=h,g=y.alternate,g!==null&&(g.childLanes|=h),y.tag===22&&(a=y.stateNode,a===null||a._visibility&1||(b=!0)),a=y,y=y.return;return a.tag===3?(y=a.stateNode,b&&o!==null&&(b=31-ct(h),a=y.hiddenUpdates,g=a[b],g===null?a[b]=[o]:g.push(o),o.lane=h|536870912),y):null}function Uf(a){if(50<ld)throw ld=0,gb=null,Error(r(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var _o={};function hL(a,o,h,g){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wr(a,o,h,g){return new hL(a,o,h,g)}function ox(a){return a=a.prototype,!(!a||!a.isReactComponent)}function xs(a,o){var h=a.alternate;return h===null?(h=wr(a.tag,o,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=o,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&65011712,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,o=a.dependencies,h.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h.refCleanup=a.refCleanup,h}function F2(a,o){a.flags&=65011714;var h=a.alternate;return h===null?(a.childLanes=0,a.lanes=o,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=h.childLanes,a.lanes=h.lanes,a.child=h.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=h.memoizedProps,a.memoizedState=h.memoizedState,a.updateQueue=h.updateQueue,a.type=h.type,o=h.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function Wf(a,o,h,g,b,y){var Q=0;if(g=a,typeof a=="function")ox(a)&&(Q=1);else if(typeof a=="string")Q=OX(a,h,J.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case G:return a=wr(31,h,o,b),a.elementType=G,a.lanes=y,a;case S:return hl(h.children,b,y,o);case k:Q=8,b|=24;break;case w:return a=wr(12,h,o,b|2),a.elementType=w,a.lanes=y,a;case M:return a=wr(13,h,o,b),a.elementType=M,a.lanes=y,a;case R:return a=wr(19,h,o,b),a.elementType=R,a.lanes=y,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case C:Q=10;break e;case N:Q=9;break e;case E:Q=11;break e;case _:Q=14;break e;case V:Q=16,g=null;break e}Q=29,h=Error(r(130,a===null?"null":typeof a,"")),g=null}return o=wr(Q,h,o,b),o.elementType=a,o.type=g,o.lanes=y,o}function hl(a,o,h,g){return a=wr(7,a,g,o),a.lanes=h,a}function cx(a,o,h){return a=wr(6,a,null,o),a.lanes=h,a}function H2(a){var o=wr(18,null,null,0);return o.stateNode=a,o}function ux(a,o,h){return o=wr(4,a.children!==null?a.children:[],a.key,o),o.lanes=h,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var K2=new WeakMap;function qr(a,o){if(typeof a=="object"&&a!==null){var h=K2.get(a);return h!==void 0?h:(o={value:a,source:o,stack:yr(o)},K2.set(a,o),o)}return{value:a,source:o,stack:yr(o)}}var Mo=[],zo=0,Gf=null,Xu=0,Ir=[],Br=0,aa=null,_i=1,Mi="";function bs(a,o){Mo[zo++]=Xu,Mo[zo++]=Gf,Gf=a,Xu=o}function J2(a,o,h){Ir[Br++]=_i,Ir[Br++]=Mi,Ir[Br++]=aa,aa=a;var g=_i;a=Mi;var b=32-ct(g)-1;g&=~(1<<b),h+=1;var y=32-ct(o)+b;if(30<y){var Q=b-b%5;y=(g&(1<<Q)-1).toString(32),g>>=Q,b-=Q,_i=1<<32-ct(o)+b|h<<b|g,Mi=y+a}else _i=1<<y|h<<b|g,Mi=a}function dx(a){a.return!==null&&(bs(a,1),J2(a,1,0))}function hx(a){for(;a===Gf;)Gf=Mo[--zo],Mo[zo]=null,Xu=Mo[--zo],Mo[zo]=null;for(;a===aa;)aa=Ir[--Br],Ir[Br]=null,Mi=Ir[--Br],Ir[Br]=null,_i=Ir[--Br],Ir[Br]=null}function ej(a,o){Ir[Br++]=_i,Ir[Br++]=Mi,Ir[Br++]=aa,_i=o.id,Mi=o.overflow,aa=a}var yn=null,Et=null,Fe=!1,la=null,Yr=!1,fx=Error(r(519));function oa(a){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Zu(qr(o,a)),fx}function tj(a){var o=a.stateNode,h=a.type,g=a.memoizedProps;switch(o[vn]=a,o[tr]=g,h){case"dialog":Ye("cancel",o),Ye("close",o);break;case"iframe":case"object":case"embed":Ye("load",o);break;case"video":case"audio":for(h=0;h<cd.length;h++)Ye(cd[h],o);break;case"source":Ye("error",o);break;case"img":case"image":case"link":Ye("error",o),Ye("load",o);break;case"details":Ye("toggle",o);break;case"input":Ye("invalid",o),p2(o,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Ye("invalid",o);break;case"textarea":Ye("invalid",o),g2(o,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||o.textContent===""+h||g.suppressHydrationWarning===!0||xC(o.textContent,h)?(g.popover!=null&&(Ye("beforetoggle",o),Ye("toggle",o)),g.onScroll!=null&&Ye("scroll",o),g.onScrollEnd!=null&&Ye("scrollend",o),g.onClick!=null&&(o.onclick=gs),o=!0):o=!1,o||oa(a,!0)}function nj(a){for(yn=a.return;yn;)switch(yn.tag){case 5:case 31:case 13:Yr=!1;return;case 27:case 3:Yr=!0;return;default:yn=yn.return}}function Do(a){if(a!==yn)return!1;if(!Fe)return nj(a),Fe=!0,!1;var o=a.tag,h;if((h=o!==3&&o!==27)&&((h=o===5)&&(h=a.type,h=!(h!=="form"&&h!=="button")||Eb(a.type,a.memoizedProps)),h=!h),h&&Et&&oa(a),nj(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Et=CC(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Et=CC(a)}else o===27?(o=Et,Sa(a.type)?(a=Mb,Mb=null,Et=a):Et=o):Et=yn?Ur(a.stateNode.nextSibling):null;return!0}function fl(){Et=yn=null,Fe=!1}function px(){var a=la;return a!==null&&(ar===null?ar=a:ar.push.apply(ar,a),la=null),a}function Zu(a){la===null?la=[a]:la.push(a)}var mx=P(null),pl=null,vs=null;function ca(a,o,h){T(mx,o._currentValue),o._currentValue=h}function ys(a){a._currentValue=mx.current,U(mx)}function gx(a,o,h){for(;a!==null;){var g=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,g!==null&&(g.childLanes|=o)):g!==null&&(g.childLanes&o)!==o&&(g.childLanes|=o),a===h)break;a=a.return}}function Ox(a,o,h,g){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var y=b.dependencies;if(y!==null){var Q=b.child;y=y.firstContext;e:for(;y!==null;){var A=y;y=b;for(var Y=0;Y<o.length;Y++)if(A.context===o[Y]){y.lanes|=h,A=y.alternate,A!==null&&(A.lanes|=h),gx(y.return,h,a),g||(Q=null);break e}y=A.next}}else if(b.tag===18){if(Q=b.return,Q===null)throw Error(r(341));Q.lanes|=h,y=Q.alternate,y!==null&&(y.lanes|=h),gx(Q,h,a),Q=null}else Q=b.child;if(Q!==null)Q.return=b;else for(Q=b;Q!==null;){if(Q===a){Q=null;break}if(b=Q.sibling,b!==null){b.return=Q.return,Q=b;break}Q=Q.return}b=Q}}function Lo(a,o,h,g){a=null;for(var b=o,y=!1;b!==null;){if(!y){if((b.flags&524288)!==0)y=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var Q=b.alternate;if(Q===null)throw Error(r(387));if(Q=Q.memoizedProps,Q!==null){var A=b.type;Sr(b.pendingProps.value,Q.value)||(a!==null?a.push(A):a=[A])}}else if(b===oe.current){if(Q=b.alternate,Q===null)throw Error(r(387));Q.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(pd):a=[pd])}b=b.return}a!==null&&Ox(o,a,h,g),o.flags|=262144}function Ff(a){for(a=a.firstContext;a!==null;){if(!Sr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function ml(a){pl=a,vs=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Sn(a){return rj(pl,a)}function Hf(a,o){return pl===null&&ml(a),rj(a,o)}function rj(a,o){var h=o._currentValue;if(o={context:o,memoizedValue:h,next:null},vs===null){if(a===null)throw Error(r(308));vs=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else vs=vs.next=o;return h}var fL=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(h,g){a.push(g)}};this.abort=function(){o.aborted=!0,a.forEach(function(h){return h()})}},pL=t.unstable_scheduleCallback,mL=t.unstable_NormalPriority,nn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xx(){return{controller:new fL,data:new Map,refCount:0}}function qu(a){a.refCount--,a.refCount===0&&pL(mL,function(){a.controller.abort()})}var Iu=null,bx=0,Xo=0,Zo=null;function gL(a,o){if(Iu===null){var h=Iu=[];bx=0,Xo=Sb(),Zo={status:"pending",value:void 0,then:function(g){h.push(g)}}}return bx++,o.then(ij,ij),o}function ij(){if(--bx===0&&Iu!==null){Zo!==null&&(Zo.status="fulfilled");var a=Iu;Iu=null,Xo=0,Zo=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function OL(a,o){var h=[],g={status:"pending",value:null,reason:null,then:function(b){h.push(b)}};return a.then(function(){g.status="fulfilled",g.value=o;for(var b=0;b<h.length;b++)(0,h[b])(o)},function(b){for(g.status="rejected",g.reason=b,b=0;b<h.length;b++)(0,h[b])(void 0)}),g}var sj=X.S;X.S=function(a,o){qQ=bn(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&gL(a,o),sj!==null&&sj(a,o)};var gl=P(null);function vx(){var a=gl.current;return a!==null?a:St.pooledCache}function Kf(a,o){o===null?T(gl,gl.current):T(gl,o.pool)}function aj(){var a=vx();return a===null?null:{parent:nn._currentValue,pool:a}}var qo=Error(r(460)),yx=Error(r(474)),Jf=Error(r(542)),ep={then:function(){}};function lj(a){return a=a.status,a==="fulfilled"||a==="rejected"}function oj(a,o,h){switch(h=a[h],h===void 0?a.push(o):h!==o&&(o.then(gs,gs),o=h),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,uj(a),a;default:if(typeof o.status=="string")o.then(gs,gs);else{if(a=St,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=o,a.status="pending",a.then(function(g){if(o.status==="pending"){var b=o;b.status="fulfilled",b.value=g}},function(g){if(o.status==="pending"){var b=o;b.status="rejected",b.reason=g}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,uj(a),a}throw xl=o,qo}}function Ol(a){try{var o=a._init;return o(a._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(xl=h,qo):h}}var xl=null;function cj(){if(xl===null)throw Error(r(459));var a=xl;return xl=null,a}function uj(a){if(a===qo||a===Jf)throw Error(r(483))}var Io=null,Bu=0;function tp(a){var o=Bu;return Bu+=1,Io===null&&(Io=[]),oj(Io,a,o)}function Yu(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function np(a,o){throw o.$$typeof===O?Error(r(525)):(a=Object.prototype.toString.call(o),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function dj(a){function o(ee,F){if(a){var ie=ee.deletions;ie===null?(ee.deletions=[F],ee.flags|=16):ie.push(F)}}function h(ee,F){if(!a)return null;for(;F!==null;)o(ee,F),F=F.sibling;return null}function g(ee){for(var F=new Map;ee!==null;)ee.key!==null?F.set(ee.key,ee):F.set(ee.index,ee),ee=ee.sibling;return F}function b(ee,F){return ee=xs(ee,F),ee.index=0,ee.sibling=null,ee}function y(ee,F,ie){return ee.index=ie,a?(ie=ee.alternate,ie!==null?(ie=ie.index,ie<F?(ee.flags|=67108866,F):ie):(ee.flags|=67108866,F)):(ee.flags|=1048576,F)}function Q(ee){return a&&ee.alternate===null&&(ee.flags|=67108866),ee}function A(ee,F,ie,he){return F===null||F.tag!==6?(F=cx(ie,ee.mode,he),F.return=ee,F):(F=b(F,ie),F.return=ee,F)}function Y(ee,F,ie,he){var Ce=ie.type;return Ce===S?ue(ee,F,ie.props.children,he,ie.key):F!==null&&(F.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===V&&Ol(Ce)===F.type)?(F=b(F,ie.props),Yu(F,ie),F.return=ee,F):(F=Wf(ie.type,ie.key,ie.props,null,ee.mode,he),Yu(F,ie),F.return=ee,F)}function se(ee,F,ie,he){return F===null||F.tag!==4||F.stateNode.containerInfo!==ie.containerInfo||F.stateNode.implementation!==ie.implementation?(F=ux(ie,ee.mode,he),F.return=ee,F):(F=b(F,ie.children||[]),F.return=ee,F)}function ue(ee,F,ie,he,Ce){return F===null||F.tag!==7?(F=hl(ie,ee.mode,he,Ce),F.return=ee,F):(F=b(F,ie),F.return=ee,F)}function fe(ee,F,ie){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=cx(""+F,ee.mode,ie),F.return=ee,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case x:return ie=Wf(F.type,F.key,F.props,null,ee.mode,ie),Yu(ie,F),ie.return=ee,ie;case v:return F=ux(F,ee.mode,ie),F.return=ee,F;case V:return F=Ol(F),fe(ee,F,ie)}if(B(F)||Z(F))return F=hl(F,ee.mode,ie,null),F.return=ee,F;if(typeof F.then=="function")return fe(ee,tp(F),ie);if(F.$$typeof===C)return fe(ee,Hf(ee,F),ie);np(ee,F)}return null}function ae(ee,F,ie,he){var Ce=F!==null?F.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Ce!==null?null:A(ee,F,""+ie,he);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return ie.key===Ce?Y(ee,F,ie,he):null;case v:return ie.key===Ce?se(ee,F,ie,he):null;case V:return ie=Ol(ie),ae(ee,F,ie,he)}if(B(ie)||Z(ie))return Ce!==null?null:ue(ee,F,ie,he,null);if(typeof ie.then=="function")return ae(ee,F,tp(ie),he);if(ie.$$typeof===C)return ae(ee,F,Hf(ee,ie),he);np(ee,ie)}return null}function le(ee,F,ie,he,Ce){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return ee=ee.get(ie)||null,A(F,ee,""+he,Ce);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case x:return ee=ee.get(he.key===null?ie:he.key)||null,Y(F,ee,he,Ce);case v:return ee=ee.get(he.key===null?ie:he.key)||null,se(F,ee,he,Ce);case V:return he=Ol(he),le(ee,F,ie,he,Ce)}if(B(he)||Z(he))return ee=ee.get(ie)||null,ue(F,ee,he,Ce,null);if(typeof he.then=="function")return le(ee,F,ie,tp(he),Ce);if(he.$$typeof===C)return le(ee,F,ie,Hf(F,he),Ce);np(F,he)}return null}function ke(ee,F,ie,he){for(var Ce=null,rt=null,je=F,De=F=0,We=null;je!==null&&De<ie.length;De++){je.index>De?(We=je,je=null):We=je.sibling;var it=ae(ee,je,ie[De],he);if(it===null){je===null&&(je=We);break}a&&je&&it.alternate===null&&o(ee,je),F=y(it,F,De),rt===null?Ce=it:rt.sibling=it,rt=it,je=We}if(De===ie.length)return h(ee,je),Fe&&bs(ee,De),Ce;if(je===null){for(;De<ie.length;De++)je=fe(ee,ie[De],he),je!==null&&(F=y(je,F,De),rt===null?Ce=je:rt.sibling=je,rt=je);return Fe&&bs(ee,De),Ce}for(je=g(je);De<ie.length;De++)We=le(je,ee,De,ie[De],he),We!==null&&(a&&We.alternate!==null&&je.delete(We.key===null?De:We.key),F=y(We,F,De),rt===null?Ce=We:rt.sibling=We,rt=We);return a&&je.forEach(function(Ca){return o(ee,Ca)}),Fe&&bs(ee,De),Ce}function $e(ee,F,ie,he){if(ie==null)throw Error(r(151));for(var Ce=null,rt=null,je=F,De=F=0,We=null,it=ie.next();je!==null&&!it.done;De++,it=ie.next()){je.index>De?(We=je,je=null):We=je.sibling;var Ca=ae(ee,je,it.value,he);if(Ca===null){je===null&&(je=We);break}a&&je&&Ca.alternate===null&&o(ee,je),F=y(Ca,F,De),rt===null?Ce=Ca:rt.sibling=Ca,rt=Ca,je=We}if(it.done)return h(ee,je),Fe&&bs(ee,De),Ce;if(je===null){for(;!it.done;De++,it=ie.next())it=fe(ee,it.value,he),it!==null&&(F=y(it,F,De),rt===null?Ce=it:rt.sibling=it,rt=it);return Fe&&bs(ee,De),Ce}for(je=g(je);!it.done;De++,it=ie.next())it=le(je,ee,De,it.value,he),it!==null&&(a&&it.alternate!==null&&je.delete(it.key===null?De:it.key),F=y(it,F,De),rt===null?Ce=it:rt.sibling=it,rt=it);return a&&je.forEach(function(NX){return o(ee,NX)}),Fe&&bs(ee,De),Ce}function bt(ee,F,ie,he){if(typeof ie=="object"&&ie!==null&&ie.type===S&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:e:{for(var Ce=ie.key;F!==null;){if(F.key===Ce){if(Ce=ie.type,Ce===S){if(F.tag===7){h(ee,F.sibling),he=b(F,ie.props.children),he.return=ee,ee=he;break e}}else if(F.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===V&&Ol(Ce)===F.type){h(ee,F.sibling),he=b(F,ie.props),Yu(he,ie),he.return=ee,ee=he;break e}h(ee,F);break}else o(ee,F);F=F.sibling}ie.type===S?(he=hl(ie.props.children,ee.mode,he,ie.key),he.return=ee,ee=he):(he=Wf(ie.type,ie.key,ie.props,null,ee.mode,he),Yu(he,ie),he.return=ee,ee=he)}return Q(ee);case v:e:{for(Ce=ie.key;F!==null;){if(F.key===Ce)if(F.tag===4&&F.stateNode.containerInfo===ie.containerInfo&&F.stateNode.implementation===ie.implementation){h(ee,F.sibling),he=b(F,ie.children||[]),he.return=ee,ee=he;break e}else{h(ee,F);break}else o(ee,F);F=F.sibling}he=ux(ie,ee.mode,he),he.return=ee,ee=he}return Q(ee);case V:return ie=Ol(ie),bt(ee,F,ie,he)}if(B(ie))return ke(ee,F,ie,he);if(Z(ie)){if(Ce=Z(ie),typeof Ce!="function")throw Error(r(150));return ie=Ce.call(ie),$e(ee,F,ie,he)}if(typeof ie.then=="function")return bt(ee,F,tp(ie),he);if(ie.$$typeof===C)return bt(ee,F,Hf(ee,ie),he);np(ee,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,F!==null&&F.tag===6?(h(ee,F.sibling),he=b(F,ie),he.return=ee,ee=he):(h(ee,F),he=cx(ie,ee.mode,he),he.return=ee,ee=he),Q(ee)):h(ee,F)}return function(ee,F,ie,he){try{Bu=0;var Ce=bt(ee,F,ie,he);return Io=null,Ce}catch(je){if(je===qo||je===Jf)throw je;var rt=wr(29,je,null,ee.mode);return rt.lanes=he,rt.return=ee,rt}finally{}}}var bl=dj(!0),hj=dj(!1),ua=!1;function Sx(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wx(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function da(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ha(a,o,h){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(lt&2)!==0){var b=g.pending;return b===null?o.next=o:(o.next=b.next,b.next=o),g.pending=o,o=Uf(a),G2(a,null,h),o}return Vf(a,g,o,h),Uf(a)}function Vu(a,o,h){if(o=o.updateQueue,o!==null&&(o=o.shared,(h&4194048)!==0)){var g=o.lanes;g&=a.pendingLanes,h|=g,o.lanes=h,r2(a,h)}}function kx(a,o){var h=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var b=null,y=null;if(h=h.firstBaseUpdate,h!==null){do{var Q={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};y===null?b=y=Q:y=y.next=Q,h=h.next}while(h!==null);y===null?b=y=o:y=y.next=o}else b=y=o;h={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:y,shared:g.shared,callbacks:g.callbacks},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=o:a.next=o,h.lastBaseUpdate=o}var jx=!1;function Uu(){if(jx){var a=Zo;if(a!==null)throw a}}function Wu(a,o,h,g){jx=!1;var b=a.updateQueue;ua=!1;var y=b.firstBaseUpdate,Q=b.lastBaseUpdate,A=b.shared.pending;if(A!==null){b.shared.pending=null;var Y=A,se=Y.next;Y.next=null,Q===null?y=se:Q.next=se,Q=Y;var ue=a.alternate;ue!==null&&(ue=ue.updateQueue,A=ue.lastBaseUpdate,A!==Q&&(A===null?ue.firstBaseUpdate=se:A.next=se,ue.lastBaseUpdate=Y))}if(y!==null){var fe=b.baseState;Q=0,ue=se=Y=null,A=y;do{var ae=A.lane&-536870913,le=ae!==A.lane;if(le?(Ue&ae)===ae:(g&ae)===ae){ae!==0&&ae===Xo&&(jx=!0),ue!==null&&(ue=ue.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var ke=a,$e=A;ae=o;var bt=h;switch($e.tag){case 1:if(ke=$e.payload,typeof ke=="function"){fe=ke.call(bt,fe,ae);break e}fe=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=$e.payload,ae=typeof ke=="function"?ke.call(bt,fe,ae):ke,ae==null)break e;fe=m({},fe,ae);break e;case 2:ua=!0}}ae=A.callback,ae!==null&&(a.flags|=64,le&&(a.flags|=8192),le=b.callbacks,le===null?b.callbacks=[ae]:le.push(ae))}else le={lane:ae,tag:A.tag,payload:A.payload,callback:A.callback,next:null},ue===null?(se=ue=le,Y=fe):ue=ue.next=le,Q|=ae;if(A=A.next,A===null){if(A=b.shared.pending,A===null)break;le=A,A=le.next,le.next=null,b.lastBaseUpdate=le,b.shared.pending=null}}while(!0);ue===null&&(Y=fe),b.baseState=Y,b.firstBaseUpdate=se,b.lastBaseUpdate=ue,y===null&&(b.shared.lanes=0),Oa|=Q,a.lanes=Q,a.memoizedState=fe}}function fj(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function pj(a,o){var h=a.callbacks;if(h!==null)for(a.callbacks=null,a=0;a<h.length;a++)fj(h[a],o)}var Bo=P(null),rp=P(0);function mj(a,o){a=$s,T(rp,a),T(Bo,o),$s=a|o.baseLanes}function Qx(){T(rp,$s),T(Bo,Bo.current)}function Cx(){$s=rp.current,U(Bo),U(rp)}var kr=P(null),Vr=null;function fa(a){var o=a.alternate;T(Ht,Ht.current&1),T(kr,a),Vr===null&&(o===null||Bo.current!==null||o.memoizedState!==null)&&(Vr=a)}function Nx(a){T(Ht,Ht.current),T(kr,a),Vr===null&&(Vr=a)}function gj(a){a.tag===22?(T(Ht,Ht.current),T(kr,a),Vr===null&&(Vr=a)):pa()}function pa(){T(Ht,Ht.current),T(kr,kr.current)}function jr(a){U(kr),Vr===a&&(Vr=null),U(Ht)}var Ht=P(0);function ip(a){for(var o=a;o!==null;){if(o.tag===13){var h=o.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Rb(h)||_b(h)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Ss=0,Me=null,Ot=null,rn=null,sp=!1,Yo=!1,vl=!1,ap=0,Gu=0,Vo=null,xL=0;function Zt(){throw Error(r(321))}function Tx(a,o){if(o===null)return!1;for(var h=0;h<o.length&&h<a.length;h++)if(!Sr(a[h],o[h]))return!1;return!0}function $x(a,o,h,g,b,y){return Ss=y,Me=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,X.H=a===null||a.memoizedState===null?Jj:Yx,vl=!1,y=h(g,b),vl=!1,Yo&&(y=xj(o,h,g,b)),Oj(a),y}function Oj(a){X.H=Ku;var o=Ot!==null&&Ot.next!==null;if(Ss=0,rn=Ot=Me=null,sp=!1,Gu=0,Vo=null,o)throw Error(r(300));a===null||sn||(a=a.dependencies,a!==null&&Ff(a)&&(sn=!0))}function xj(a,o,h,g){Me=a;var b=0;do{if(Yo&&(Vo=null),Gu=0,Yo=!1,25<=b)throw Error(r(301));if(b+=1,rn=Ot=null,a.updateQueue!=null){var y=a.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}X.H=eQ,y=o(h,g)}while(Yo);return y}function bL(){var a=X.H,o=a.useState()[0];return o=typeof o.then=="function"?Fu(o):o,a=a.useState()[0],(Ot!==null?Ot.memoizedState:null)!==a&&(Me.flags|=1024),o}function Ex(){var a=ap!==0;return ap=0,a}function Px(a,o,h){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~h}function Ax(a){if(sp){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}sp=!1}Ss=0,rn=Ot=Me=null,Yo=!1,Gu=ap=0,Vo=null}function In(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Me.memoizedState=rn=a:rn=rn.next=a,rn}function Kt(){if(Ot===null){var a=Me.alternate;a=a!==null?a.memoizedState:null}else a=Ot.next;var o=rn===null?Me.memoizedState:rn.next;if(o!==null)rn=o,Ot=a;else{if(a===null)throw Me.alternate===null?Error(r(467)):Error(r(310));Ot=a,a={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},rn===null?Me.memoizedState=rn=a:rn=rn.next=a}return rn}function lp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fu(a){var o=Gu;return Gu+=1,Vo===null&&(Vo=[]),a=oj(Vo,a,o),o=Me,(rn===null?o.memoizedState:rn.next)===null&&(o=o.alternate,X.H=o===null||o.memoizedState===null?Jj:Yx),a}function op(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Fu(a);if(a.$$typeof===C)return Sn(a)}throw Error(r(438,String(a)))}function Rx(a){var o=null,h=Me.updateQueue;if(h!==null&&(o=h.memoCache),o==null){var g=Me.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(o={data:g.data.map(function(b){return b.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),h===null&&(h=lp(),Me.updateQueue=h),h.memoCache=o,h=o.data[o.index],h===void 0)for(h=o.data[o.index]=Array(a),g=0;g<a;g++)h[g]=D;return o.index++,h}function ws(a,o){return typeof o=="function"?o(a):o}function cp(a){var o=Kt();return _x(o,Ot,a)}function _x(a,o,h){var g=a.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var b=a.baseQueue,y=g.pending;if(y!==null){if(b!==null){var Q=b.next;b.next=y.next,y.next=Q}o.baseQueue=b=y,g.pending=null}if(y=a.baseState,b===null)a.memoizedState=y;else{o=b.next;var A=Q=null,Y=null,se=o,ue=!1;do{var fe=se.lane&-536870913;if(fe!==se.lane?(Ue&fe)===fe:(Ss&fe)===fe){var ae=se.revertLane;if(ae===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),fe===Xo&&(ue=!0);else if((Ss&ae)===ae){se=se.next,ae===Xo&&(ue=!0);continue}else fe={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Y===null?(A=Y=fe,Q=y):Y=Y.next=fe,Me.lanes|=ae,Oa|=ae;fe=se.action,vl&&h(y,fe),y=se.hasEagerState?se.eagerState:h(y,fe)}else ae={lane:fe,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Y===null?(A=Y=ae,Q=y):Y=Y.next=ae,Me.lanes|=fe,Oa|=fe;se=se.next}while(se!==null&&se!==o);if(Y===null?Q=y:Y.next=A,!Sr(y,a.memoizedState)&&(sn=!0,ue&&(h=Zo,h!==null)))throw h;a.memoizedState=y,a.baseState=Q,a.baseQueue=Y,g.lastRenderedState=y}return b===null&&(g.lanes=0),[a.memoizedState,g.dispatch]}function Mx(a){var o=Kt(),h=o.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=a;var g=h.dispatch,b=h.pending,y=o.memoizedState;if(b!==null){h.pending=null;var Q=b=b.next;do y=a(y,Q.action),Q=Q.next;while(Q!==b);Sr(y,o.memoizedState)||(sn=!0),o.memoizedState=y,o.baseQueue===null&&(o.baseState=y),h.lastRenderedState=y}return[y,g]}function bj(a,o,h){var g=Me,b=Kt(),y=Fe;if(y){if(h===void 0)throw Error(r(407));h=h()}else h=o();var Q=!Sr((Ot||b).memoizedState,h);if(Q&&(b.memoizedState=h,sn=!0),b=b.queue,Lx(Sj.bind(null,g,b,a),[a]),b.getSnapshot!==o||Q||rn!==null&&rn.memoizedState.tag&1){if(g.flags|=2048,Uo(9,{destroy:void 0},yj.bind(null,g,b,h,o),null),St===null)throw Error(r(349));y||(Ss&127)!==0||vj(g,o,h)}return h}function vj(a,o,h){a.flags|=16384,a={getSnapshot:o,value:h},o=Me.updateQueue,o===null?(o=lp(),Me.updateQueue=o,o.stores=[a]):(h=o.stores,h===null?o.stores=[a]:h.push(a))}function yj(a,o,h,g){o.value=h,o.getSnapshot=g,wj(o)&&kj(a)}function Sj(a,o,h){return h(function(){wj(o)&&kj(a)})}function wj(a){var o=a.getSnapshot;a=a.value;try{var h=o();return!Sr(a,h)}catch{return!0}}function kj(a){var o=dl(a,2);o!==null&&lr(o,a,2)}function zx(a){var o=In();if(typeof a=="function"){var h=a;if(a=h(),vl){Ft(!0);try{h()}finally{Ft(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:a},o}function jj(a,o,h,g){return a.baseState=h,_x(a,Ot,typeof g=="function"?g:ws)}function vL(a,o,h,g,b){if(hp(a))throw Error(r(485));if(a=o.action,a!==null){var y={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(Q){y.listeners.push(Q)}};X.T!==null?h(!0):y.isTransition=!1,g(y),h=o.pending,h===null?(y.next=o.pending=y,Qj(o,y)):(y.next=h.next,o.pending=h.next=y)}}function Qj(a,o){var h=o.action,g=o.payload,b=a.state;if(o.isTransition){var y=X.T,Q={};X.T=Q;try{var A=h(b,g),Y=X.S;Y!==null&&Y(Q,A),Cj(a,o,A)}catch(se){Dx(a,o,se)}finally{y!==null&&Q.types!==null&&(y.types=Q.types),X.T=y}}else try{y=h(b,g),Cj(a,o,y)}catch(se){Dx(a,o,se)}}function Cj(a,o,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){Nj(a,o,g)},function(g){return Dx(a,o,g)}):Nj(a,o,h)}function Nj(a,o,h){o.status="fulfilled",o.value=h,Tj(o),a.state=h,o=a.pending,o!==null&&(h=o.next,h===o?a.pending=null:(h=h.next,o.next=h,Qj(a,h)))}function Dx(a,o,h){var g=a.pending;if(a.pending=null,g!==null){g=g.next;do o.status="rejected",o.reason=h,Tj(o),o=o.next;while(o!==g)}a.action=null}function Tj(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function $j(a,o){return o}function Ej(a,o){if(Fe){var h=St.formState;if(h!==null){e:{var g=Me;if(Fe){if(Et){t:{for(var b=Et,y=Yr;b.nodeType!==8;){if(!y){b=null;break t}if(b=Ur(b.nextSibling),b===null){b=null;break t}}y=b.data,b=y==="F!"||y==="F"?b:null}if(b){Et=Ur(b.nextSibling),g=b.data==="F!";break e}}oa(g)}g=!1}g&&(o=h[0])}}return h=In(),h.memoizedState=h.baseState=o,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$j,lastRenderedState:o},h.queue=g,h=Fj.bind(null,Me,g),g.dispatch=h,g=zx(!1),y=Bx.bind(null,Me,!1,g.queue),g=In(),b={state:o,dispatch:null,action:a,pending:null},g.queue=b,h=vL.bind(null,Me,b,y,h),b.dispatch=h,g.memoizedState=a,[o,h,!1]}function Pj(a){var o=Kt();return Aj(o,Ot,a)}function Aj(a,o,h){if(o=_x(a,o,$j)[0],a=cp(ws)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var g=Fu(o)}catch(Q){throw Q===qo?Jf:Q}else g=o;o=Kt();var b=o.queue,y=b.dispatch;return h!==o.memoizedState&&(Me.flags|=2048,Uo(9,{destroy:void 0},yL.bind(null,b,h),null)),[g,y,a]}function yL(a,o){a.action=o}function Rj(a){var o=Kt(),h=Ot;if(h!==null)return Aj(o,h,a);Kt(),o=o.memoizedState,h=Kt();var g=h.queue.dispatch;return h.memoizedState=a,[o,g,!1]}function Uo(a,o,h,g){return a={tag:a,create:h,deps:g,inst:o,next:null},o=Me.updateQueue,o===null&&(o=lp(),Me.updateQueue=o),h=o.lastEffect,h===null?o.lastEffect=a.next=a:(g=h.next,h.next=a,a.next=g,o.lastEffect=a),a}function _j(){return Kt().memoizedState}function up(a,o,h,g){var b=In();Me.flags|=a,b.memoizedState=Uo(1|o,{destroy:void 0},h,g===void 0?null:g)}function dp(a,o,h,g){var b=Kt();g=g===void 0?null:g;var y=b.memoizedState.inst;Ot!==null&&g!==null&&Tx(g,Ot.memoizedState.deps)?b.memoizedState=Uo(o,y,h,g):(Me.flags|=a,b.memoizedState=Uo(1|o,y,h,g))}function Mj(a,o){up(8390656,8,a,o)}function Lx(a,o){dp(2048,8,a,o)}function SL(a){Me.flags|=4;var o=Me.updateQueue;if(o===null)o=lp(),Me.updateQueue=o,o.events=[a];else{var h=o.events;h===null?o.events=[a]:h.push(a)}}function zj(a){var o=Kt().memoizedState;return SL({ref:o,nextImpl:a}),function(){if((lt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function Dj(a,o){return dp(4,2,a,o)}function Lj(a,o){return dp(4,4,a,o)}function Xj(a,o){if(typeof o=="function"){a=a();var h=o(a);return function(){typeof h=="function"?h():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function Zj(a,o,h){h=h!=null?h.concat([a]):null,dp(4,4,Xj.bind(null,o,a),h)}function Xx(){}function qj(a,o){var h=Kt();o=o===void 0?null:o;var g=h.memoizedState;return o!==null&&Tx(o,g[1])?g[0]:(h.memoizedState=[a,o],a)}function Ij(a,o){var h=Kt();o=o===void 0?null:o;var g=h.memoizedState;if(o!==null&&Tx(o,g[1]))return g[0];if(g=a(),vl){Ft(!0);try{a()}finally{Ft(!1)}}return h.memoizedState=[g,o],g}function Zx(a,o,h){return h===void 0||(Ss&1073741824)!==0&&(Ue&261930)===0?a.memoizedState=o:(a.memoizedState=h,a=BQ(),Me.lanes|=a,Oa|=a,h)}function Bj(a,o,h,g){return Sr(h,o)?h:Bo.current!==null?(a=Zx(a,h,g),Sr(a,o)||(sn=!0),a):(Ss&42)===0||(Ss&1073741824)!==0&&(Ue&261930)===0?(sn=!0,a.memoizedState=h):(a=BQ(),Me.lanes|=a,Oa|=a,o)}function Yj(a,o,h,g,b){var y=q.p;q.p=y!==0&&8>y?y:8;var Q=X.T,A={};X.T=A,Bx(a,!1,o,h);try{var Y=b(),se=X.S;if(se!==null&&se(A,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var ue=OL(Y,g);Hu(a,o,ue,Nr(a))}else Hu(a,o,g,Nr(a))}catch(fe){Hu(a,o,{then:function(){},status:"rejected",reason:fe},Nr())}finally{q.p=y,Q!==null&&A.types!==null&&(Q.types=A.types),X.T=Q}}function wL(){}function qx(a,o,h,g){if(a.tag!==5)throw Error(r(476));var b=Vj(a).queue;Yj(a,b,o,K,h===null?wL:function(){return Uj(a),h(g)})}function Vj(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:K},next:null};var h={};return o.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:h},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function Uj(a){var o=Vj(a);o.next===null&&(o=a.alternate.memoizedState),Hu(a,o.next.queue,{},Nr())}function Ix(){return Sn(pd)}function Wj(){return Kt().memoizedState}function Gj(){return Kt().memoizedState}function kL(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var h=Nr();a=da(h);var g=ha(o,a,h);g!==null&&(lr(g,o,h),Vu(g,o,h)),o={cache:xx()},a.payload=o;return}o=o.return}}function jL(a,o,h){var g=Nr();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},hp(a)?Hj(o,h):(h=lx(a,o,h,g),h!==null&&(lr(h,a,g),Kj(h,o,g)))}function Fj(a,o,h){var g=Nr();Hu(a,o,h,g)}function Hu(a,o,h,g){var b={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(hp(a))Hj(o,b);else{var y=a.alternate;if(a.lanes===0&&(y===null||y.lanes===0)&&(y=o.lastRenderedReducer,y!==null))try{var Q=o.lastRenderedState,A=y(Q,h);if(b.hasEagerState=!0,b.eagerState=A,Sr(A,Q))return Vf(a,o,b,0),St===null&&Yf(),!1}catch{}finally{}if(h=lx(a,o,b,g),h!==null)return lr(h,a,g),Kj(h,o,g),!0}return!1}function Bx(a,o,h,g){if(g={lane:2,revertLane:Sb(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},hp(a)){if(o)throw Error(r(479))}else o=lx(a,h,g,2),o!==null&&lr(o,a,2)}function hp(a){var o=a.alternate;return a===Me||o!==null&&o===Me}function Hj(a,o){Yo=sp=!0;var h=a.pending;h===null?o.next=o:(o.next=h.next,h.next=o),a.pending=o}function Kj(a,o,h){if((h&4194048)!==0){var g=o.lanes;g&=a.pendingLanes,h|=g,o.lanes=h,r2(a,h)}}var Ku={readContext:Sn,use:op,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useLayoutEffect:Zt,useInsertionEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useSyncExternalStore:Zt,useId:Zt,useHostTransitionStatus:Zt,useFormState:Zt,useActionState:Zt,useOptimistic:Zt,useMemoCache:Zt,useCacheRefresh:Zt};Ku.useEffectEvent=Zt;var Jj={readContext:Sn,use:op,useCallback:function(a,o){return In().memoizedState=[a,o===void 0?null:o],a},useContext:Sn,useEffect:Mj,useImperativeHandle:function(a,o,h){h=h!=null?h.concat([a]):null,up(4194308,4,Xj.bind(null,o,a),h)},useLayoutEffect:function(a,o){return up(4194308,4,a,o)},useInsertionEffect:function(a,o){up(4,2,a,o)},useMemo:function(a,o){var h=In();o=o===void 0?null:o;var g=a();if(vl){Ft(!0);try{a()}finally{Ft(!1)}}return h.memoizedState=[g,o],g},useReducer:function(a,o,h){var g=In();if(h!==void 0){var b=h(o);if(vl){Ft(!0);try{h(o)}finally{Ft(!1)}}}else b=o;return g.memoizedState=g.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},g.queue=a,a=a.dispatch=jL.bind(null,Me,a),[g.memoizedState,a]},useRef:function(a){var o=In();return a={current:a},o.memoizedState=a},useState:function(a){a=zx(a);var o=a.queue,h=Fj.bind(null,Me,o);return o.dispatch=h,[a.memoizedState,h]},useDebugValue:Xx,useDeferredValue:function(a,o){var h=In();return Zx(h,a,o)},useTransition:function(){var a=zx(!1);return a=Yj.bind(null,Me,a.queue,!0,!1),In().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,h){var g=Me,b=In();if(Fe){if(h===void 0)throw Error(r(407));h=h()}else{if(h=o(),St===null)throw Error(r(349));(Ue&127)!==0||vj(g,o,h)}b.memoizedState=h;var y={value:h,getSnapshot:o};return b.queue=y,Mj(Sj.bind(null,g,y,a),[a]),g.flags|=2048,Uo(9,{destroy:void 0},yj.bind(null,g,y,h,o),null),h},useId:function(){var a=In(),o=St.identifierPrefix;if(Fe){var h=Mi,g=_i;h=(g&~(1<<32-ct(g)-1)).toString(32)+h,o="_"+o+"R_"+h,h=ap++,0<h&&(o+="H"+h.toString(32)),o+="_"}else h=xL++,o="_"+o+"r_"+h.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:Ix,useFormState:Ej,useActionState:Ej,useOptimistic:function(a){var o=In();o.memoizedState=o.baseState=a;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=h,o=Bx.bind(null,Me,!0,h),h.dispatch=o,[a,o]},useMemoCache:Rx,useCacheRefresh:function(){return In().memoizedState=kL.bind(null,Me)},useEffectEvent:function(a){var o=In(),h={impl:a};return o.memoizedState=h,function(){if((lt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},Yx={readContext:Sn,use:op,useCallback:qj,useContext:Sn,useEffect:Lx,useImperativeHandle:Zj,useInsertionEffect:Dj,useLayoutEffect:Lj,useMemo:Ij,useReducer:cp,useRef:_j,useState:function(){return cp(ws)},useDebugValue:Xx,useDeferredValue:function(a,o){var h=Kt();return Bj(h,Ot.memoizedState,a,o)},useTransition:function(){var a=cp(ws)[0],o=Kt().memoizedState;return[typeof a=="boolean"?a:Fu(a),o]},useSyncExternalStore:bj,useId:Wj,useHostTransitionStatus:Ix,useFormState:Pj,useActionState:Pj,useOptimistic:function(a,o){var h=Kt();return jj(h,Ot,a,o)},useMemoCache:Rx,useCacheRefresh:Gj};Yx.useEffectEvent=zj;var eQ={readContext:Sn,use:op,useCallback:qj,useContext:Sn,useEffect:Lx,useImperativeHandle:Zj,useInsertionEffect:Dj,useLayoutEffect:Lj,useMemo:Ij,useReducer:Mx,useRef:_j,useState:function(){return Mx(ws)},useDebugValue:Xx,useDeferredValue:function(a,o){var h=Kt();return Ot===null?Zx(h,a,o):Bj(h,Ot.memoizedState,a,o)},useTransition:function(){var a=Mx(ws)[0],o=Kt().memoizedState;return[typeof a=="boolean"?a:Fu(a),o]},useSyncExternalStore:bj,useId:Wj,useHostTransitionStatus:Ix,useFormState:Rj,useActionState:Rj,useOptimistic:function(a,o){var h=Kt();return Ot!==null?jj(h,Ot,a,o):(h.baseState=a,[a,h.queue.dispatch])},useMemoCache:Rx,useCacheRefresh:Gj};eQ.useEffectEvent=zj;function Vx(a,o,h,g){o=a.memoizedState,h=h(g,o),h=h==null?o:m({},o,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var Ux={enqueueSetState:function(a,o,h){a=a._reactInternals;var g=Nr(),b=da(g);b.payload=o,h!=null&&(b.callback=h),o=ha(a,b,g),o!==null&&(lr(o,a,g),Vu(o,a,g))},enqueueReplaceState:function(a,o,h){a=a._reactInternals;var g=Nr(),b=da(g);b.tag=1,b.payload=o,h!=null&&(b.callback=h),o=ha(a,b,g),o!==null&&(lr(o,a,g),Vu(o,a,g))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var h=Nr(),g=da(h);g.tag=2,o!=null&&(g.callback=o),o=ha(a,g,h),o!==null&&(lr(o,a,h),Vu(o,a,h))}};function tQ(a,o,h,g,b,y,Q){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(g,y,Q):o.prototype&&o.prototype.isPureReactComponent?!Du(h,g)||!Du(b,y):!0}function nQ(a,o,h,g){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(h,g),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(h,g),o.state!==a&&Ux.enqueueReplaceState(o,o.state,null)}function yl(a,o){var h=o;if("ref"in o){h={};for(var g in o)g!=="ref"&&(h[g]=o[g])}if(a=a.defaultProps){h===o&&(h=m({},h));for(var b in a)h[b]===void 0&&(h[b]=a[b])}return h}function rQ(a){Bf(a)}function iQ(a){console.error(a)}function sQ(a){Bf(a)}function fp(a,o){try{var h=a.onUncaughtError;h(o.value,{componentStack:o.stack})}catch(g){setTimeout(function(){throw g})}}function aQ(a,o,h){try{var g=a.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Wx(a,o,h){return h=da(h),h.tag=3,h.payload={element:null},h.callback=function(){fp(a,o)},h}function lQ(a){return a=da(a),a.tag=3,a}function oQ(a,o,h,g){var b=h.type.getDerivedStateFromError;if(typeof b=="function"){var y=g.value;a.payload=function(){return b(y)},a.callback=function(){aQ(o,h,g)}}var Q=h.stateNode;Q!==null&&typeof Q.componentDidCatch=="function"&&(a.callback=function(){aQ(o,h,g),typeof b!="function"&&(xa===null?xa=new Set([this]):xa.add(this));var A=g.stack;this.componentDidCatch(g.value,{componentStack:A!==null?A:""})})}function QL(a,o,h,g,b){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(o=h.alternate,o!==null&&Lo(o,h,b,!0),h=kr.current,h!==null){switch(h.tag){case 31:case 13:return Vr===null?jp():h.alternate===null&&qt===0&&(qt=3),h.flags&=-257,h.flags|=65536,h.lanes=b,g===ep?h.flags|=16384:(o=h.updateQueue,o===null?h.updateQueue=new Set([g]):o.add(g),bb(a,g,b)),!1;case 22:return h.flags|=65536,g===ep?h.flags|=16384:(o=h.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=o):(h=o.retryQueue,h===null?o.retryQueue=new Set([g]):h.add(g)),bb(a,g,b)),!1}throw Error(r(435,h.tag))}return bb(a,g,b),jp(),!1}if(Fe)return o=kr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=b,g!==fx&&(a=Error(r(422),{cause:g}),Zu(qr(a,h)))):(g!==fx&&(o=Error(r(423),{cause:g}),Zu(qr(o,h))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,g=qr(g,h),b=Wx(a.stateNode,g,b),kx(a,b),qt!==4&&(qt=2)),!1;var y=Error(r(520),{cause:g});if(y=qr(y,h),ad===null?ad=[y]:ad.push(y),qt!==4&&(qt=2),o===null)return!0;g=qr(g,h),h=o;do{switch(h.tag){case 3:return h.flags|=65536,a=b&-b,h.lanes|=a,a=Wx(h.stateNode,g,a),kx(h,a),!1;case 1:if(o=h.type,y=h.stateNode,(h.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(xa===null||!xa.has(y))))return h.flags|=65536,b&=-b,h.lanes|=b,b=lQ(b),oQ(b,a,h,g),kx(h,b),!1}h=h.return}while(h!==null);return!1}var Gx=Error(r(461)),sn=!1;function wn(a,o,h,g){o.child=a===null?hj(o,null,h,g):bl(o,a.child,h,g)}function cQ(a,o,h,g,b){h=h.render;var y=o.ref;if("ref"in g){var Q={};for(var A in g)A!=="ref"&&(Q[A]=g[A])}else Q=g;return ml(o),g=$x(a,o,h,Q,y,b),A=Ex(),a!==null&&!sn?(Px(a,o,b),ks(a,o,b)):(Fe&&A&&dx(o),o.flags|=1,wn(a,o,g,b),o.child)}function uQ(a,o,h,g,b){if(a===null){var y=h.type;return typeof y=="function"&&!ox(y)&&y.defaultProps===void 0&&h.compare===null?(o.tag=15,o.type=y,dQ(a,o,y,g,b)):(a=Wf(h.type,null,g,o,o.mode,b),a.ref=o.ref,a.return=o,o.child=a)}if(y=a.child,!rb(a,b)){var Q=y.memoizedProps;if(h=h.compare,h=h!==null?h:Du,h(Q,g)&&a.ref===o.ref)return ks(a,o,b)}return o.flags|=1,a=xs(y,g),a.ref=o.ref,a.return=o,o.child=a}function dQ(a,o,h,g,b){if(a!==null){var y=a.memoizedProps;if(Du(y,g)&&a.ref===o.ref)if(sn=!1,o.pendingProps=g=y,rb(a,b))(a.flags&131072)!==0&&(sn=!0);else return o.lanes=a.lanes,ks(a,o,b)}return Fx(a,o,h,g,b)}function hQ(a,o,h,g){var b=g.children,y=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((o.flags&128)!==0){if(y=y!==null?y.baseLanes|h:h,a!==null){for(g=o.child=a.child,b=0;g!==null;)b=b|g.lanes|g.childLanes,g=g.sibling;g=b&~y}else g=0,o.child=null;return fQ(a,o,y,h,g)}if((h&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&Kf(o,y!==null?y.cachePool:null),y!==null?mj(o,y):Qx(),gj(o);else return g=o.lanes=536870912,fQ(a,o,y!==null?y.baseLanes|h:h,h,g)}else y!==null?(Kf(o,y.cachePool),mj(o,y),pa(),o.memoizedState=null):(a!==null&&Kf(o,null),Qx(),pa());return wn(a,o,b,h),o.child}function Ju(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function fQ(a,o,h,g,b){var y=vx();return y=y===null?null:{parent:nn._currentValue,pool:y},o.memoizedState={baseLanes:h,cachePool:y},a!==null&&Kf(o,null),Qx(),gj(o),a!==null&&Lo(a,o,g,!0),o.childLanes=b,null}function pp(a,o){return o=gp({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function pQ(a,o,h){return bl(o,a.child,null,h),a=pp(o,o.pendingProps),a.flags|=2,jr(o),o.memoizedState=null,a}function CL(a,o,h){var g=o.pendingProps,b=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(Fe){if(g.mode==="hidden")return a=pp(o,g),o.lanes=536870912,Ju(null,a);if(Nx(o),(a=Et)?(a=QC(a,Yr),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:aa!==null?{id:_i,overflow:Mi}:null,retryLane:536870912,hydrationErrors:null},h=H2(a),h.return=o,o.child=h,yn=o,Et=null)):a=null,a===null)throw oa(o);return o.lanes=536870912,null}return pp(o,g)}var y=a.memoizedState;if(y!==null){var Q=y.dehydrated;if(Nx(o),b)if(o.flags&256)o.flags&=-257,o=pQ(a,o,h);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(r(558));else if(sn||Lo(a,o,h,!1),b=(h&a.childLanes)!==0,sn||b){if(g=St,g!==null&&(Q=i2(g,h),Q!==0&&Q!==y.retryLane))throw y.retryLane=Q,dl(a,Q),lr(g,a,Q),Gx;jp(),o=pQ(a,o,h)}else a=y.treeContext,Et=Ur(Q.nextSibling),yn=o,Fe=!0,la=null,Yr=!1,a!==null&&ej(o,a),o=pp(o,g),o.flags|=4096;return o}return a=xs(a.child,{mode:g.mode,children:g.children}),a.ref=o.ref,o.child=a,a.return=o,a}function mp(a,o){var h=o.ref;if(h===null)a!==null&&a.ref!==null&&(o.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(a===null||a.ref!==h)&&(o.flags|=4194816)}}function Fx(a,o,h,g,b){return ml(o),h=$x(a,o,h,g,void 0,b),g=Ex(),a!==null&&!sn?(Px(a,o,b),ks(a,o,b)):(Fe&&g&&dx(o),o.flags|=1,wn(a,o,h,b),o.child)}function mQ(a,o,h,g,b,y){return ml(o),o.updateQueue=null,h=xj(o,g,h,b),Oj(a),g=Ex(),a!==null&&!sn?(Px(a,o,y),ks(a,o,y)):(Fe&&g&&dx(o),o.flags|=1,wn(a,o,h,y),o.child)}function gQ(a,o,h,g,b){if(ml(o),o.stateNode===null){var y=_o,Q=h.contextType;typeof Q=="object"&&Q!==null&&(y=Sn(Q)),y=new h(g,y),o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Ux,o.stateNode=y,y._reactInternals=o,y=o.stateNode,y.props=g,y.state=o.memoizedState,y.refs={},Sx(o),Q=h.contextType,y.context=typeof Q=="object"&&Q!==null?Sn(Q):_o,y.state=o.memoizedState,Q=h.getDerivedStateFromProps,typeof Q=="function"&&(Vx(o,h,Q,g),y.state=o.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(Q=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),Q!==y.state&&Ux.enqueueReplaceState(y,y.state,null),Wu(o,g,y,b),Uu(),y.state=o.memoizedState),typeof y.componentDidMount=="function"&&(o.flags|=4194308),g=!0}else if(a===null){y=o.stateNode;var A=o.memoizedProps,Y=yl(h,A);y.props=Y;var se=y.context,ue=h.contextType;Q=_o,typeof ue=="object"&&ue!==null&&(Q=Sn(ue));var fe=h.getDerivedStateFromProps;ue=typeof fe=="function"||typeof y.getSnapshotBeforeUpdate=="function",A=o.pendingProps!==A,ue||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(A||se!==Q)&&nQ(o,y,g,Q),ua=!1;var ae=o.memoizedState;y.state=ae,Wu(o,g,y,b),Uu(),se=o.memoizedState,A||ae!==se||ua?(typeof fe=="function"&&(Vx(o,h,fe,g),se=o.memoizedState),(Y=ua||tQ(o,h,Y,g,ae,se,Q))?(ue||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(o.flags|=4194308)):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=g,o.memoizedState=se),y.props=g,y.state=se,y.context=Q,g=Y):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),g=!1)}else{y=o.stateNode,wx(a,o),Q=o.memoizedProps,ue=yl(h,Q),y.props=ue,fe=o.pendingProps,ae=y.context,se=h.contextType,Y=_o,typeof se=="object"&&se!==null&&(Y=Sn(se)),A=h.getDerivedStateFromProps,(se=typeof A=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(Q!==fe||ae!==Y)&&nQ(o,y,g,Y),ua=!1,ae=o.memoizedState,y.state=ae,Wu(o,g,y,b),Uu();var le=o.memoizedState;Q!==fe||ae!==le||ua||a!==null&&a.dependencies!==null&&Ff(a.dependencies)?(typeof A=="function"&&(Vx(o,h,A,g),le=o.memoizedState),(ue=ua||tQ(o,h,ue,g,ae,le,Y)||a!==null&&a.dependencies!==null&&Ff(a.dependencies))?(se||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(g,le,Y),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(g,le,Y)),typeof y.componentDidUpdate=="function"&&(o.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof y.componentDidUpdate!="function"||Q===a.memoizedProps&&ae===a.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||Q===a.memoizedProps&&ae===a.memoizedState||(o.flags|=1024),o.memoizedProps=g,o.memoizedState=le),y.props=g,y.state=le,y.context=Y,g=ue):(typeof y.componentDidUpdate!="function"||Q===a.memoizedProps&&ae===a.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||Q===a.memoizedProps&&ae===a.memoizedState||(o.flags|=1024),g=!1)}return y=g,mp(a,o),g=(o.flags&128)!==0,y||g?(y=o.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:y.render(),o.flags|=1,a!==null&&g?(o.child=bl(o,a.child,null,b),o.child=bl(o,null,h,b)):wn(a,o,h,b),o.memoizedState=y.state,a=o.child):a=ks(a,o,b),a}function OQ(a,o,h,g){return fl(),o.flags|=256,wn(a,o,h,g),o.child}var Hx={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kx(a){return{baseLanes:a,cachePool:aj()}}function Jx(a,o,h){return a=a!==null?a.childLanes&~h:0,o&&(a|=Cr),a}function xQ(a,o,h){var g=o.pendingProps,b=!1,y=(o.flags&128)!==0,Q;if((Q=y)||(Q=a!==null&&a.memoizedState===null?!1:(Ht.current&2)!==0),Q&&(b=!0,o.flags&=-129),Q=(o.flags&32)!==0,o.flags&=-33,a===null){if(Fe){if(b?fa(o):pa(),(a=Et)?(a=QC(a,Yr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:aa!==null?{id:_i,overflow:Mi}:null,retryLane:536870912,hydrationErrors:null},h=H2(a),h.return=o,o.child=h,yn=o,Et=null)):a=null,a===null)throw oa(o);return _b(a)?o.lanes=32:o.lanes=536870912,null}var A=g.children;return g=g.fallback,b?(pa(),b=o.mode,A=gp({mode:"hidden",children:A},b),g=hl(g,b,h,null),A.return=o,g.return=o,A.sibling=g,o.child=A,g=o.child,g.memoizedState=Kx(h),g.childLanes=Jx(a,Q,h),o.memoizedState=Hx,Ju(null,g)):(fa(o),eb(o,A))}var Y=a.memoizedState;if(Y!==null&&(A=Y.dehydrated,A!==null)){if(y)o.flags&256?(fa(o),o.flags&=-257,o=tb(a,o,h)):o.memoizedState!==null?(pa(),o.child=a.child,o.flags|=128,o=null):(pa(),A=g.fallback,b=o.mode,g=gp({mode:"visible",children:g.children},b),A=hl(A,b,h,null),A.flags|=2,g.return=o,A.return=o,g.sibling=A,o.child=g,bl(o,a.child,null,h),g=o.child,g.memoizedState=Kx(h),g.childLanes=Jx(a,Q,h),o.memoizedState=Hx,o=Ju(null,g));else if(fa(o),_b(A)){if(Q=A.nextSibling&&A.nextSibling.dataset,Q)var se=Q.dgst;Q=se,g=Error(r(419)),g.stack="",g.digest=Q,Zu({value:g,source:null,stack:null}),o=tb(a,o,h)}else if(sn||Lo(a,o,h,!1),Q=(h&a.childLanes)!==0,sn||Q){if(Q=St,Q!==null&&(g=i2(Q,h),g!==0&&g!==Y.retryLane))throw Y.retryLane=g,dl(a,g),lr(Q,a,g),Gx;Rb(A)||jp(),o=tb(a,o,h)}else Rb(A)?(o.flags|=192,o.child=a.child,o=null):(a=Y.treeContext,Et=Ur(A.nextSibling),yn=o,Fe=!0,la=null,Yr=!1,a!==null&&ej(o,a),o=eb(o,g.children),o.flags|=4096);return o}return b?(pa(),A=g.fallback,b=o.mode,Y=a.child,se=Y.sibling,g=xs(Y,{mode:"hidden",children:g.children}),g.subtreeFlags=Y.subtreeFlags&65011712,se!==null?A=xs(se,A):(A=hl(A,b,h,null),A.flags|=2),A.return=o,g.return=o,g.sibling=A,o.child=g,Ju(null,g),g=o.child,A=a.child.memoizedState,A===null?A=Kx(h):(b=A.cachePool,b!==null?(Y=nn._currentValue,b=b.parent!==Y?{parent:Y,pool:Y}:b):b=aj(),A={baseLanes:A.baseLanes|h,cachePool:b}),g.memoizedState=A,g.childLanes=Jx(a,Q,h),o.memoizedState=Hx,Ju(a.child,g)):(fa(o),h=a.child,a=h.sibling,h=xs(h,{mode:"visible",children:g.children}),h.return=o,h.sibling=null,a!==null&&(Q=o.deletions,Q===null?(o.deletions=[a],o.flags|=16):Q.push(a)),o.child=h,o.memoizedState=null,h)}function eb(a,o){return o=gp({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function gp(a,o){return a=wr(22,a,null,o),a.lanes=0,a}function tb(a,o,h){return bl(o,a.child,null,h),a=eb(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function bQ(a,o,h){a.lanes|=o;var g=a.alternate;g!==null&&(g.lanes|=o),gx(a.return,o,h)}function nb(a,o,h,g,b,y){var Q=a.memoizedState;Q===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:b,treeForkCount:y}:(Q.isBackwards=o,Q.rendering=null,Q.renderingStartTime=0,Q.last=g,Q.tail=h,Q.tailMode=b,Q.treeForkCount=y)}function vQ(a,o,h){var g=o.pendingProps,b=g.revealOrder,y=g.tail;g=g.children;var Q=Ht.current,A=(Q&2)!==0;if(A?(Q=Q&1|2,o.flags|=128):Q&=1,T(Ht,Q),wn(a,o,g,h),g=Fe?Xu:0,!A&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&bQ(a,h,o);else if(a.tag===19)bQ(a,h,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(h=o.child,b=null;h!==null;)a=h.alternate,a!==null&&ip(a)===null&&(b=h),h=h.sibling;h=b,h===null?(b=o.child,o.child=null):(b=h.sibling,h.sibling=null),nb(o,!1,b,h,y,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,b=o.child,o.child=null;b!==null;){if(a=b.alternate,a!==null&&ip(a)===null){o.child=b;break}a=b.sibling,b.sibling=h,h=b,b=a}nb(o,!0,h,null,y,g);break;case"together":nb(o,!1,null,null,void 0,g);break;default:o.memoizedState=null}return o.child}function ks(a,o,h){if(a!==null&&(o.dependencies=a.dependencies),Oa|=o.lanes,(h&o.childLanes)===0)if(a!==null){if(Lo(a,o,h,!1),(h&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(r(153));if(o.child!==null){for(a=o.child,h=xs(a,a.pendingProps),o.child=h,h.return=o;a.sibling!==null;)a=a.sibling,h=h.sibling=xs(a,a.pendingProps),h.return=o;h.sibling=null}return o.child}function rb(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&Ff(a)))}function NL(a,o,h){switch(o.tag){case 3:ce(o,o.stateNode.containerInfo),ca(o,nn,a.memoizedState.cache),fl();break;case 27:case 5:ve(o);break;case 4:ce(o,o.stateNode.containerInfo);break;case 10:ca(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Nx(o),null;break;case 13:var g=o.memoizedState;if(g!==null)return g.dehydrated!==null?(fa(o),o.flags|=128,null):(h&o.child.childLanes)!==0?xQ(a,o,h):(fa(o),a=ks(a,o,h),a!==null?a.sibling:null);fa(o);break;case 19:var b=(a.flags&128)!==0;if(g=(h&o.childLanes)!==0,g||(Lo(a,o,h,!1),g=(h&o.childLanes)!==0),b){if(g)return vQ(a,o,h);o.flags|=128}if(b=o.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),T(Ht,Ht.current),g)break;return null;case 22:return o.lanes=0,hQ(a,o,h,o.pendingProps);case 24:ca(o,nn,a.memoizedState.cache)}return ks(a,o,h)}function yQ(a,o,h){if(a!==null)if(a.memoizedProps!==o.pendingProps)sn=!0;else{if(!rb(a,h)&&(o.flags&128)===0)return sn=!1,NL(a,o,h);sn=(a.flags&131072)!==0}else sn=!1,Fe&&(o.flags&1048576)!==0&&J2(o,Xu,o.index);switch(o.lanes=0,o.tag){case 16:e:{var g=o.pendingProps;if(a=Ol(o.elementType),o.type=a,typeof a=="function")ox(a)?(g=yl(a,g),o.tag=1,o=gQ(null,o,a,g,h)):(o.tag=0,o=Fx(null,o,a,g,h));else{if(a!=null){var b=a.$$typeof;if(b===E){o.tag=11,o=cQ(null,o,a,g,h);break e}else if(b===_){o.tag=14,o=uQ(null,o,a,g,h);break e}}throw o=I(a)||a,Error(r(306,o,""))}}return o;case 0:return Fx(a,o,o.type,o.pendingProps,h);case 1:return g=o.type,b=yl(g,o.pendingProps),gQ(a,o,g,b,h);case 3:e:{if(ce(o,o.stateNode.containerInfo),a===null)throw Error(r(387));g=o.pendingProps;var y=o.memoizedState;b=y.element,wx(a,o),Wu(o,g,null,h);var Q=o.memoizedState;if(g=Q.cache,ca(o,nn,g),g!==y.cache&&Ox(o,[nn],h,!0),Uu(),g=Q.element,y.isDehydrated)if(y={element:g,isDehydrated:!1,cache:Q.cache},o.updateQueue.baseState=y,o.memoizedState=y,o.flags&256){o=OQ(a,o,g,h);break e}else if(g!==b){b=qr(Error(r(424)),o),Zu(b),o=OQ(a,o,g,h);break e}else{switch(a=o.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(Et=Ur(a.firstChild),yn=o,Fe=!0,la=null,Yr=!0,h=hj(o,null,g,h),o.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(fl(),g===b){o=ks(a,o,h);break e}wn(a,o,g,h)}o=o.child}return o;case 26:return mp(a,o),a===null?(h=PC(o.type,null,o.pendingProps,null))?o.memoizedState=h:Fe||(h=o.type,a=o.pendingProps,g=Pp(re.current).createElement(h),g[vn]=o,g[tr]=a,kn(g,h,a),pn(g),o.stateNode=g):o.memoizedState=PC(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return ve(o),a===null&&Fe&&(g=o.stateNode=TC(o.type,o.pendingProps,re.current),yn=o,Yr=!0,b=Et,Sa(o.type)?(Mb=b,Et=Ur(g.firstChild)):Et=b),wn(a,o,o.pendingProps.children,h),mp(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&Fe&&((b=g=Et)&&(g=iX(g,o.type,o.pendingProps,Yr),g!==null?(o.stateNode=g,yn=o,Et=Ur(g.firstChild),Yr=!1,b=!0):b=!1),b||oa(o)),ve(o),b=o.type,y=o.pendingProps,Q=a!==null?a.memoizedProps:null,g=y.children,Eb(b,y)?g=null:Q!==null&&Eb(b,Q)&&(o.flags|=32),o.memoizedState!==null&&(b=$x(a,o,bL,null,null,h),pd._currentValue=b),mp(a,o),wn(a,o,g,h),o.child;case 6:return a===null&&Fe&&((a=h=Et)&&(h=sX(h,o.pendingProps,Yr),h!==null?(o.stateNode=h,yn=o,Et=null,a=!0):a=!1),a||oa(o)),null;case 13:return xQ(a,o,h);case 4:return ce(o,o.stateNode.containerInfo),g=o.pendingProps,a===null?o.child=bl(o,null,g,h):wn(a,o,g,h),o.child;case 11:return cQ(a,o,o.type,o.pendingProps,h);case 7:return wn(a,o,o.pendingProps,h),o.child;case 8:return wn(a,o,o.pendingProps.children,h),o.child;case 12:return wn(a,o,o.pendingProps.children,h),o.child;case 10:return g=o.pendingProps,ca(o,o.type,g.value),wn(a,o,g.children,h),o.child;case 9:return b=o.type._context,g=o.pendingProps.children,ml(o),b=Sn(b),g=g(b),o.flags|=1,wn(a,o,g,h),o.child;case 14:return uQ(a,o,o.type,o.pendingProps,h);case 15:return dQ(a,o,o.type,o.pendingProps,h);case 19:return vQ(a,o,h);case 31:return CL(a,o,h);case 22:return hQ(a,o,h,o.pendingProps);case 24:return ml(o),g=Sn(nn),a===null?(b=vx(),b===null&&(b=St,y=xx(),b.pooledCache=y,y.refCount++,y!==null&&(b.pooledCacheLanes|=h),b=y),o.memoizedState={parent:g,cache:b},Sx(o),ca(o,nn,b)):((a.lanes&h)!==0&&(wx(a,o),Wu(o,null,null,h),Uu()),b=a.memoizedState,y=o.memoizedState,b.parent!==g?(b={parent:g,cache:g},o.memoizedState=b,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=b),ca(o,nn,g)):(g=y.cache,ca(o,nn,g),g!==b.cache&&Ox(o,[nn],h,!0))),wn(a,o,o.pendingProps.children,h),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function js(a){a.flags|=4}function ib(a,o,h,g,b){if((o=(a.mode&32)!==0)&&(o=!1),o){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(WQ())a.flags|=8192;else throw xl=ep,yx}else a.flags&=-16777217}function SQ(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!zC(o))if(WQ())a.flags|=8192;else throw xl=ep,yx}function Op(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?t2():536870912,a.lanes|=o,Ho|=o)}function ed(a,o){if(!Fe)switch(a.tailMode){case"hidden":o=a.tail;for(var h=null;o!==null;)o.alternate!==null&&(h=o),o=o.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function Pt(a){var o=a.alternate!==null&&a.alternate.child===a.child,h=0,g=0;if(o)for(var b=a.child;b!==null;)h|=b.lanes|b.childLanes,g|=b.subtreeFlags&65011712,g|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)h|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=g,a.childLanes=h,o}function TL(a,o,h){var g=o.pendingProps;switch(hx(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(o),null;case 1:return Pt(o),null;case 3:return h=o.stateNode,g=null,a!==null&&(g=a.memoizedState.cache),o.memoizedState.cache!==g&&(o.flags|=2048),ys(nn),me(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(a===null||a.child===null)&&(Do(o)?js(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,px())),Pt(o),null;case 26:var b=o.type,y=o.memoizedState;return a===null?(js(o),y!==null?(Pt(o),SQ(o,y)):(Pt(o),ib(o,b,null,g,h))):y?y!==a.memoizedState?(js(o),Pt(o),SQ(o,y)):(Pt(o),o.flags&=-16777217):(a=a.memoizedProps,a!==g&&js(o),Pt(o),ib(o,b,a,g,h)),null;case 27:if(Ie(o),h=re.current,b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==g&&js(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return Pt(o),null}a=J.current,Do(o)?tj(o):(a=TC(b,g,h),o.stateNode=a,js(o))}return Pt(o),null;case 5:if(Ie(o),b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==g&&js(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return Pt(o),null}if(y=J.current,Do(o))tj(o);else{var Q=Pp(re.current);switch(y){case 1:y=Q.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:y=Q.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":y=Q.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":y=Q.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":y=Q.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof g.is=="string"?Q.createElement("select",{is:g.is}):Q.createElement("select"),g.multiple?y.multiple=!0:g.size&&(y.size=g.size);break;default:y=typeof g.is=="string"?Q.createElement(b,{is:g.is}):Q.createElement(b)}}y[vn]=o,y[tr]=g;e:for(Q=o.child;Q!==null;){if(Q.tag===5||Q.tag===6)y.appendChild(Q.stateNode);else if(Q.tag!==4&&Q.tag!==27&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===o)break e;for(;Q.sibling===null;){if(Q.return===null||Q.return===o)break e;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}o.stateNode=y;e:switch(kn(y,b,g),b){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&js(o)}}return Pt(o),ib(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,h),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==g&&js(o);else{if(typeof g!="string"&&o.stateNode===null)throw Error(r(166));if(a=re.current,Do(o)){if(a=o.stateNode,h=o.memoizedProps,g=null,b=yn,b!==null)switch(b.tag){case 27:case 5:g=b.memoizedProps}a[vn]=o,a=!!(a.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||xC(a.nodeValue,h)),a||oa(o,!0)}else a=Pp(a).createTextNode(g),a[vn]=o,o.stateNode=a}return Pt(o),null;case 31:if(h=o.memoizedState,a===null||a.memoizedState!==null){if(g=Do(o),h!==null){if(a===null){if(!g)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[vn]=o}else fl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Pt(o),a=!1}else h=px(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=h),a=!0;if(!a)return o.flags&256?(jr(o),o):(jr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Pt(o),null;case 13:if(g=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=Do(o),g!==null&&g.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=o.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[vn]=o}else fl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Pt(o),b=!1}else b=px(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return o.flags&256?(jr(o),o):(jr(o),null)}return jr(o),(o.flags&128)!==0?(o.lanes=h,o):(h=g!==null,a=a!==null&&a.memoizedState!==null,h&&(g=o.child,b=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(b=g.alternate.memoizedState.cachePool.pool),y=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(y=g.memoizedState.cachePool.pool),y!==b&&(g.flags|=2048)),h!==a&&h&&(o.child.flags|=8192),Op(o,o.updateQueue),Pt(o),null);case 4:return me(),a===null&&Qb(o.stateNode.containerInfo),Pt(o),null;case 10:return ys(o.type),Pt(o),null;case 19:if(U(Ht),g=o.memoizedState,g===null)return Pt(o),null;if(b=(o.flags&128)!==0,y=g.rendering,y===null)if(b)ed(g,!1);else{if(qt!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(y=ip(a),y!==null){for(o.flags|=128,ed(g,!1),a=y.updateQueue,o.updateQueue=a,Op(o,a),o.subtreeFlags=0,a=h,h=o.child;h!==null;)F2(h,a),h=h.sibling;return T(Ht,Ht.current&1|2),Fe&&bs(o,g.treeForkCount),o.child}a=a.sibling}g.tail!==null&&bn()>Sp&&(o.flags|=128,b=!0,ed(g,!1),o.lanes=4194304)}else{if(!b)if(a=ip(y),a!==null){if(o.flags|=128,b=!0,a=a.updateQueue,o.updateQueue=a,Op(o,a),ed(g,!0),g.tail===null&&g.tailMode==="hidden"&&!y.alternate&&!Fe)return Pt(o),null}else 2*bn()-g.renderingStartTime>Sp&&h!==536870912&&(o.flags|=128,b=!0,ed(g,!1),o.lanes=4194304);g.isBackwards?(y.sibling=o.child,o.child=y):(a=g.last,a!==null?a.sibling=y:o.child=y,g.last=y)}return g.tail!==null?(a=g.tail,g.rendering=a,g.tail=a.sibling,g.renderingStartTime=bn(),a.sibling=null,h=Ht.current,T(Ht,b?h&1|2:h&1),Fe&&bs(o,g.treeForkCount),a):(Pt(o),null);case 22:case 23:return jr(o),Cx(),g=o.memoizedState!==null,a!==null?a.memoizedState!==null!==g&&(o.flags|=8192):g&&(o.flags|=8192),g?(h&536870912)!==0&&(o.flags&128)===0&&(Pt(o),o.subtreeFlags&6&&(o.flags|=8192)):Pt(o),h=o.updateQueue,h!==null&&Op(o,h.retryQueue),h=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),g=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(g=o.memoizedState.cachePool.pool),g!==h&&(o.flags|=2048),a!==null&&U(gl),null;case 24:return h=null,a!==null&&(h=a.memoizedState.cache),o.memoizedState.cache!==h&&(o.flags|=2048),ys(nn),Pt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function $L(a,o){switch(hx(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return ys(nn),me(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return Ie(o),null;case 31:if(o.memoizedState!==null){if(jr(o),o.alternate===null)throw Error(r(340));fl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(jr(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));fl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return U(Ht),null;case 4:return me(),null;case 10:return ys(o.type),null;case 22:case 23:return jr(o),Cx(),a!==null&&U(gl),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return ys(nn),null;case 25:return null;default:return null}}function wQ(a,o){switch(hx(o),o.tag){case 3:ys(nn),me();break;case 26:case 27:case 5:Ie(o);break;case 4:me();break;case 31:o.memoizedState!==null&&jr(o);break;case 13:jr(o);break;case 19:U(Ht);break;case 10:ys(o.type);break;case 22:case 23:jr(o),Cx(),a!==null&&U(gl);break;case 24:ys(nn)}}function td(a,o){try{var h=o.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var b=g.next;h=b;do{if((h.tag&a)===a){g=void 0;var y=h.create,Q=h.inst;g=y(),Q.destroy=g}h=h.next}while(h!==b)}}catch(A){mt(o,o.return,A)}}function ma(a,o,h){try{var g=o.updateQueue,b=g!==null?g.lastEffect:null;if(b!==null){var y=b.next;g=y;do{if((g.tag&a)===a){var Q=g.inst,A=Q.destroy;if(A!==void 0){Q.destroy=void 0,b=o;var Y=h,se=A;try{se()}catch(ue){mt(b,Y,ue)}}}g=g.next}while(g!==y)}}catch(ue){mt(o,o.return,ue)}}function kQ(a){var o=a.updateQueue;if(o!==null){var h=a.stateNode;try{pj(o,h)}catch(g){mt(a,a.return,g)}}}function jQ(a,o,h){h.props=yl(a.type,a.memoizedProps),h.state=a.memoizedState;try{h.componentWillUnmount()}catch(g){mt(a,o,g)}}function nd(a,o){try{var h=a.ref;if(h!==null){switch(a.tag){case 26:case 27:case 5:var g=a.stateNode;break;case 30:g=a.stateNode;break;default:g=a.stateNode}typeof h=="function"?a.refCleanup=h(g):h.current=g}}catch(b){mt(a,o,b)}}function zi(a,o){var h=a.ref,g=a.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(b){mt(a,o,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(b){mt(a,o,b)}else h.current=null}function QQ(a){var o=a.type,h=a.memoizedProps,g=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(b){mt(a,a.return,b)}}function sb(a,o,h){try{var g=a.stateNode;KL(g,a.type,h,o),g[tr]=o}catch(b){mt(a,a.return,b)}}function CQ(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Sa(a.type)||a.tag===4}function ab(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||CQ(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&&Sa(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 lb(a,o,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,o?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(a,o):(o=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,o.appendChild(a),h=h._reactRootContainer,h!=null||o.onclick!==null||(o.onclick=gs));else if(g!==4&&(g===27&&Sa(a.type)&&(h=a.stateNode,o=null),a=a.child,a!==null))for(lb(a,o,h),a=a.sibling;a!==null;)lb(a,o,h),a=a.sibling}function xp(a,o,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,o?h.insertBefore(a,o):h.appendChild(a);else if(g!==4&&(g===27&&Sa(a.type)&&(h=a.stateNode),a=a.child,a!==null))for(xp(a,o,h),a=a.sibling;a!==null;)xp(a,o,h),a=a.sibling}function NQ(a){var o=a.stateNode,h=a.memoizedProps;try{for(var g=a.type,b=o.attributes;b.length;)o.removeAttributeNode(b[0]);kn(o,g,h),o[vn]=a,o[tr]=h}catch(y){mt(a,a.return,y)}}var Qs=!1,an=!1,ob=!1,TQ=typeof WeakSet=="function"?WeakSet:Set,mn=null;function EL(a,o){if(a=a.containerInfo,Tb=Lp,a=Z2(a),tx(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var b=g.anchorOffset,y=g.focusNode;g=g.focusOffset;try{h.nodeType,y.nodeType}catch{h=null;break e}var Q=0,A=-1,Y=-1,se=0,ue=0,fe=a,ae=null;t:for(;;){for(var le;fe!==h||b!==0&&fe.nodeType!==3||(A=Q+b),fe!==y||g!==0&&fe.nodeType!==3||(Y=Q+g),fe.nodeType===3&&(Q+=fe.nodeValue.length),(le=fe.firstChild)!==null;)ae=fe,fe=le;for(;;){if(fe===a)break t;if(ae===h&&++se===b&&(A=Q),ae===y&&++ue===g&&(Y=Q),(le=fe.nextSibling)!==null)break;fe=ae,ae=fe.parentNode}fe=le}h=A===-1||Y===-1?null:{start:A,end:Y}}else h=null}h=h||{start:0,end:0}}else h=null;for($b={focusedElem:a,selectionRange:h},Lp=!1,mn=o;mn!==null;)if(o=mn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,mn=a;else for(;mn!==null;){switch(o=mn,y=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(h=0;h<a.length;h++)b=a[h],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&y!==null){a=void 0,h=o,b=y.memoizedProps,y=y.memoizedState,g=h.stateNode;try{var ke=yl(h.type,b);a=g.getSnapshotBeforeUpdate(ke,y),g.__reactInternalSnapshotBeforeUpdate=a}catch($e){mt(h,h.return,$e)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,h=a.nodeType,h===9)Ab(a);else if(h===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Ab(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(r(163))}if(a=o.sibling,a!==null){a.return=o.return,mn=a;break}mn=o.return}}function $Q(a,o,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Ns(a,h),g&4&&td(5,h);break;case 1:if(Ns(a,h),g&4)if(a=h.stateNode,o===null)try{a.componentDidMount()}catch(Q){mt(h,h.return,Q)}else{var b=yl(h.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(b,o,a.__reactInternalSnapshotBeforeUpdate)}catch(Q){mt(h,h.return,Q)}}g&64&&kQ(h),g&512&&nd(h,h.return);break;case 3:if(Ns(a,h),g&64&&(a=h.updateQueue,a!==null)){if(o=null,h.child!==null)switch(h.child.tag){case 27:case 5:o=h.child.stateNode;break;case 1:o=h.child.stateNode}try{pj(a,o)}catch(Q){mt(h,h.return,Q)}}break;case 27:o===null&&g&4&&NQ(h);case 26:case 5:Ns(a,h),o===null&&g&4&&QQ(h),g&512&&nd(h,h.return);break;case 12:Ns(a,h);break;case 31:Ns(a,h),g&4&&AQ(a,h);break;case 13:Ns(a,h),g&4&&RQ(a,h),g&64&&(a=h.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(h=XL.bind(null,h),aX(a,h))));break;case 22:if(g=h.memoizedState!==null||Qs,!g){o=o!==null&&o.memoizedState!==null||an,b=Qs;var y=an;Qs=g,(an=o)&&!y?Ts(a,h,(h.subtreeFlags&8772)!==0):Ns(a,h),Qs=b,an=y}break;case 30:break;default:Ns(a,h)}}function EQ(a){var o=a.alternate;o!==null&&(a.alternate=null,EQ(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&DO(o)),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 _t=null,rr=!1;function Cs(a,o,h){for(h=h.child;h!==null;)PQ(a,o,h),h=h.sibling}function PQ(a,o,h){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(jt,h)}catch{}switch(h.tag){case 26:an||zi(h,o),Cs(a,o,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:an||zi(h,o);var g=_t,b=rr;Sa(h.type)&&(_t=h.stateNode,rr=!1),Cs(a,o,h),dd(h.stateNode),_t=g,rr=b;break;case 5:an||zi(h,o);case 6:if(g=_t,b=rr,_t=null,Cs(a,o,h),_t=g,rr=b,_t!==null)if(rr)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(h.stateNode)}catch(y){mt(h,o,y)}else try{_t.removeChild(h.stateNode)}catch(y){mt(h,o,y)}break;case 18:_t!==null&&(rr?(a=_t,kC(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,h.stateNode),sc(a)):kC(_t,h.stateNode));break;case 4:g=_t,b=rr,_t=h.stateNode.containerInfo,rr=!0,Cs(a,o,h),_t=g,rr=b;break;case 0:case 11:case 14:case 15:ma(2,h,o),an||ma(4,h,o),Cs(a,o,h);break;case 1:an||(zi(h,o),g=h.stateNode,typeof g.componentWillUnmount=="function"&&jQ(h,o,g)),Cs(a,o,h);break;case 21:Cs(a,o,h);break;case 22:an=(g=an)||h.memoizedState!==null,Cs(a,o,h),an=g;break;default:Cs(a,o,h)}}function AQ(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{sc(a)}catch(h){mt(o,o.return,h)}}}function RQ(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{sc(a)}catch(h){mt(o,o.return,h)}}function PL(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new TQ),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new TQ),o;default:throw Error(r(435,a.tag))}}function bp(a,o){var h=PL(a);o.forEach(function(g){if(!h.has(g)){h.add(g);var b=ZL.bind(null,a,g);g.then(b,b)}})}function ir(a,o){var h=o.deletions;if(h!==null)for(var g=0;g<h.length;g++){var b=h[g],y=a,Q=o,A=Q;e:for(;A!==null;){switch(A.tag){case 27:if(Sa(A.type)){_t=A.stateNode,rr=!1;break e}break;case 5:_t=A.stateNode,rr=!1;break e;case 3:case 4:_t=A.stateNode.containerInfo,rr=!0;break e}A=A.return}if(_t===null)throw Error(r(160));PQ(y,Q,b),_t=null,rr=!1,y=b.alternate,y!==null&&(y.return=null),b.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)_Q(o,a),o=o.sibling}var mi=null;function _Q(a,o){var h=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:ir(o,a),sr(a),g&4&&(ma(3,a,a.return),td(3,a),ma(5,a,a.return));break;case 1:ir(o,a),sr(a),g&512&&(an||h===null||zi(h,h.return)),g&64&&Qs&&(a=a.updateQueue,a!==null&&(g=a.callbacks,g!==null&&(h=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var b=mi;if(ir(o,a),sr(a),g&512&&(an||h===null||zi(h,h.return)),g&4){var y=h!==null?h.memoizedState:null;if(g=a.memoizedState,h===null)if(g===null)if(a.stateNode===null){e:{g=a.type,h=a.memoizedProps,b=b.ownerDocument||b;t:switch(g){case"title":y=b.getElementsByTagName("title")[0],(!y||y[Tu]||y[vn]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=b.createElement(g),b.head.insertBefore(y,b.querySelector("head > title"))),kn(y,g,h),y[vn]=a,pn(y),g=y;break e;case"link":var Q=_C("link","href",b).get(g+(h.href||""));if(Q){for(var A=0;A<Q.length;A++)if(y=Q[A],y.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&y.getAttribute("rel")===(h.rel==null?null:h.rel)&&y.getAttribute("title")===(h.title==null?null:h.title)&&y.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){Q.splice(A,1);break t}}y=b.createElement(g),kn(y,g,h),b.head.appendChild(y);break;case"meta":if(Q=_C("meta","content",b).get(g+(h.content||""))){for(A=0;A<Q.length;A++)if(y=Q[A],y.getAttribute("content")===(h.content==null?null:""+h.content)&&y.getAttribute("name")===(h.name==null?null:h.name)&&y.getAttribute("property")===(h.property==null?null:h.property)&&y.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&y.getAttribute("charset")===(h.charSet==null?null:h.charSet)){Q.splice(A,1);break t}}y=b.createElement(g),kn(y,g,h),b.head.appendChild(y);break;default:throw Error(r(468,g))}y[vn]=a,pn(y),g=y}a.stateNode=g}else MC(b,a.type,a.stateNode);else a.stateNode=RC(b,g,a.memoizedProps);else y!==g?(y===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):y.count--,g===null?MC(b,a.type,a.stateNode):RC(b,g,a.memoizedProps)):g===null&&a.stateNode!==null&&sb(a,a.memoizedProps,h.memoizedProps)}break;case 27:ir(o,a),sr(a),g&512&&(an||h===null||zi(h,h.return)),h!==null&&g&4&&sb(a,a.memoizedProps,h.memoizedProps);break;case 5:if(ir(o,a),sr(a),g&512&&(an||h===null||zi(h,h.return)),a.flags&32){b=a.stateNode;try{No(b,"")}catch(ke){mt(a,a.return,ke)}}g&4&&a.stateNode!=null&&(b=a.memoizedProps,sb(a,b,h!==null?h.memoizedProps:b)),g&1024&&(ob=!0);break;case 6:if(ir(o,a),sr(a),g&4){if(a.stateNode===null)throw Error(r(162));g=a.memoizedProps,h=a.stateNode;try{h.nodeValue=g}catch(ke){mt(a,a.return,ke)}}break;case 3:if(_p=null,b=mi,mi=Ap(o.containerInfo),ir(o,a),mi=b,sr(a),g&4&&h!==null&&h.memoizedState.isDehydrated)try{sc(o.containerInfo)}catch(ke){mt(a,a.return,ke)}ob&&(ob=!1,MQ(a));break;case 4:g=mi,mi=Ap(a.stateNode.containerInfo),ir(o,a),sr(a),mi=g;break;case 12:ir(o,a),sr(a);break;case 31:ir(o,a),sr(a),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,bp(a,g)));break;case 13:ir(o,a),sr(a),a.child.flags&8192&&a.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(yp=bn()),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,bp(a,g)));break;case 22:b=a.memoizedState!==null;var Y=h!==null&&h.memoizedState!==null,se=Qs,ue=an;if(Qs=se||b,an=ue||Y,ir(o,a),an=ue,Qs=se,sr(a),g&8192)e:for(o=a.stateNode,o._visibility=b?o._visibility&-2:o._visibility|1,b&&(h===null||Y||Qs||an||Sl(a)),h=null,o=a;;){if(o.tag===5||o.tag===26){if(h===null){Y=h=o;try{if(y=Y.stateNode,b)Q=y.style,typeof Q.setProperty=="function"?Q.setProperty("display","none","important"):Q.display="none";else{A=Y.stateNode;var fe=Y.memoizedProps.style,ae=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;A.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(ke){mt(Y,Y.return,ke)}}}else if(o.tag===6){if(h===null){Y=o;try{Y.stateNode.nodeValue=b?"":Y.memoizedProps}catch(ke){mt(Y,Y.return,ke)}}}else if(o.tag===18){if(h===null){Y=o;try{var le=Y.stateNode;b?jC(le,!0):jC(Y.stateNode,!1)}catch(ke){mt(Y,Y.return,ke)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===a)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;h===o&&(h=null),o=o.return}h===o&&(h=null),o.sibling.return=o.return,o=o.sibling}g&4&&(g=a.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,bp(a,h))));break;case 19:ir(o,a),sr(a),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,bp(a,g)));break;case 30:break;case 21:break;default:ir(o,a),sr(a)}}function sr(a){var o=a.flags;if(o&2){try{for(var h,g=a.return;g!==null;){if(CQ(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var b=h.stateNode,y=ab(a);xp(a,y,b);break;case 5:var Q=h.stateNode;h.flags&32&&(No(Q,""),h.flags&=-33);var A=ab(a);xp(a,A,Q);break;case 3:case 4:var Y=h.stateNode.containerInfo,se=ab(a);lb(a,se,Y);break;default:throw Error(r(161))}}catch(ue){mt(a,a.return,ue)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function MQ(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;MQ(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function Ns(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)$Q(a,o.alternate,o),o=o.sibling}function Sl(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:ma(4,o,o.return),Sl(o);break;case 1:zi(o,o.return);var h=o.stateNode;typeof h.componentWillUnmount=="function"&&jQ(o,o.return,h),Sl(o);break;case 27:dd(o.stateNode);case 26:case 5:zi(o,o.return),Sl(o);break;case 22:o.memoizedState===null&&Sl(o);break;case 30:Sl(o);break;default:Sl(o)}a=a.sibling}}function Ts(a,o,h){for(h=h&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var g=o.alternate,b=a,y=o,Q=y.flags;switch(y.tag){case 0:case 11:case 15:Ts(b,y,h),td(4,y);break;case 1:if(Ts(b,y,h),g=y,b=g.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(se){mt(g,g.return,se)}if(g=y,b=g.updateQueue,b!==null){var A=g.stateNode;try{var Y=b.shared.hiddenCallbacks;if(Y!==null)for(b.shared.hiddenCallbacks=null,b=0;b<Y.length;b++)fj(Y[b],A)}catch(se){mt(g,g.return,se)}}h&&Q&64&&kQ(y),nd(y,y.return);break;case 27:NQ(y);case 26:case 5:Ts(b,y,h),h&&g===null&&Q&4&&QQ(y),nd(y,y.return);break;case 12:Ts(b,y,h);break;case 31:Ts(b,y,h),h&&Q&4&&AQ(b,y);break;case 13:Ts(b,y,h),h&&Q&4&&RQ(b,y);break;case 22:y.memoizedState===null&&Ts(b,y,h),nd(y,y.return);break;case 30:break;default:Ts(b,y,h)}o=o.sibling}}function cb(a,o){var h=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==h&&(a!=null&&a.refCount++,h!=null&&qu(h))}function ub(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&qu(a))}function gi(a,o,h,g){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)zQ(a,o,h,g),o=o.sibling}function zQ(a,o,h,g){var b=o.flags;switch(o.tag){case 0:case 11:case 15:gi(a,o,h,g),b&2048&&td(9,o);break;case 1:gi(a,o,h,g);break;case 3:gi(a,o,h,g),b&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&qu(a)));break;case 12:if(b&2048){gi(a,o,h,g),a=o.stateNode;try{var y=o.memoizedProps,Q=y.id,A=y.onPostCommit;typeof A=="function"&&A(Q,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(Y){mt(o,o.return,Y)}}else gi(a,o,h,g);break;case 31:gi(a,o,h,g);break;case 13:gi(a,o,h,g);break;case 23:break;case 22:y=o.stateNode,Q=o.alternate,o.memoizedState!==null?y._visibility&2?gi(a,o,h,g):rd(a,o):y._visibility&2?gi(a,o,h,g):(y._visibility|=2,Wo(a,o,h,g,(o.subtreeFlags&10256)!==0||!1)),b&2048&&cb(Q,o);break;case 24:gi(a,o,h,g),b&2048&&ub(o.alternate,o);break;default:gi(a,o,h,g)}}function Wo(a,o,h,g,b){for(b=b&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var y=a,Q=o,A=h,Y=g,se=Q.flags;switch(Q.tag){case 0:case 11:case 15:Wo(y,Q,A,Y,b),td(8,Q);break;case 23:break;case 22:var ue=Q.stateNode;Q.memoizedState!==null?ue._visibility&2?Wo(y,Q,A,Y,b):rd(y,Q):(ue._visibility|=2,Wo(y,Q,A,Y,b)),b&&se&2048&&cb(Q.alternate,Q);break;case 24:Wo(y,Q,A,Y,b),b&&se&2048&&ub(Q.alternate,Q);break;default:Wo(y,Q,A,Y,b)}o=o.sibling}}function rd(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var h=a,g=o,b=g.flags;switch(g.tag){case 22:rd(h,g),b&2048&&cb(g.alternate,g);break;case 24:rd(h,g),b&2048&&ub(g.alternate,g);break;default:rd(h,g)}o=o.sibling}}var id=8192;function Go(a,o,h){if(a.subtreeFlags&id)for(a=a.child;a!==null;)DQ(a,o,h),a=a.sibling}function DQ(a,o,h){switch(a.tag){case 26:Go(a,o,h),a.flags&id&&a.memoizedState!==null&&xX(h,mi,a.memoizedState,a.memoizedProps);break;case 5:Go(a,o,h);break;case 3:case 4:var g=mi;mi=Ap(a.stateNode.containerInfo),Go(a,o,h),mi=g;break;case 22:a.memoizedState===null&&(g=a.alternate,g!==null&&g.memoizedState!==null?(g=id,id=16777216,Go(a,o,h),id=g):Go(a,o,h));break;default:Go(a,o,h)}}function LQ(a){var o=a.alternate;if(o!==null&&(a=o.child,a!==null)){o.child=null;do o=a.sibling,a.sibling=null,a=o;while(a!==null)}}function sd(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var h=0;h<o.length;h++){var g=o[h];mn=g,ZQ(g,a)}LQ(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)XQ(a),a=a.sibling}function XQ(a){switch(a.tag){case 0:case 11:case 15:sd(a),a.flags&2048&&ma(9,a,a.return);break;case 3:sd(a);break;case 12:sd(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,vp(a)):sd(a);break;default:sd(a)}}function vp(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var h=0;h<o.length;h++){var g=o[h];mn=g,ZQ(g,a)}LQ(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:ma(8,o,o.return),vp(o);break;case 22:h=o.stateNode,h._visibility&2&&(h._visibility&=-3,vp(o));break;default:vp(o)}a=a.sibling}}function ZQ(a,o){for(;mn!==null;){var h=mn;switch(h.tag){case 0:case 11:case 15:ma(8,h,o);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:qu(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,mn=g;else e:for(h=a;mn!==null;){g=mn;var b=g.sibling,y=g.return;if(EQ(g),g===h){mn=null;break e}if(b!==null){b.return=y,mn=b;break e}mn=y}}}var AL={getCacheForType:function(a){var o=Sn(nn),h=o.data.get(a);return h===void 0&&(h=a(),o.data.set(a,h)),h},cacheSignal:function(){return Sn(nn).controller.signal}},RL=typeof WeakMap=="function"?WeakMap:Map,lt=0,St=null,Be=null,Ue=0,pt=0,Qr=null,ga=!1,Fo=!1,db=!1,$s=0,qt=0,Oa=0,wl=0,hb=0,Cr=0,Ho=0,ad=null,ar=null,fb=!1,yp=0,qQ=0,Sp=1/0,wp=null,xa=null,un=0,ba=null,Ko=null,Es=0,pb=0,mb=null,IQ=null,ld=0,gb=null;function Nr(){return(lt&2)!==0&&Ue!==0?Ue&-Ue:X.T!==null?Sb():s2()}function BQ(){if(Cr===0)if((Ue&536870912)===0||Fe){var a=Ef;Ef<<=1,(Ef&3932160)===0&&(Ef=262144),Cr=a}else Cr=536870912;return a=kr.current,a!==null&&(a.flags|=32),Cr}function lr(a,o,h){(a===St&&(pt===2||pt===9)||a.cancelPendingCommit!==null)&&(Jo(a,0),va(a,Ue,Cr,!1)),Nu(a,h),((lt&2)===0||a!==St)&&(a===St&&((lt&2)===0&&(wl|=h),qt===4&&va(a,Ue,Cr,!1)),Di(a))}function YQ(a,o,h){if((lt&6)!==0)throw Error(r(327));var g=!h&&(o&127)===0&&(o&a.expiredLanes)===0||Cu(a,o),b=g?zL(a,o):xb(a,o,!0),y=g;do{if(b===0){Fo&&!g&&va(a,o,0,!1);break}else{if(h=a.current.alternate,y&&!_L(h)){b=xb(a,o,!1),y=!1;continue}if(b===2){if(y=o,a.errorRecoveryDisabledLanes&y)var Q=0;else Q=a.pendingLanes&-536870913,Q=Q!==0?Q:Q&536870912?536870912:0;if(Q!==0){o=Q;e:{var A=a;b=ad;var Y=A.current.memoizedState.isDehydrated;if(Y&&(Jo(A,Q).flags|=256),Q=xb(A,Q,!1),Q!==2){if(db&&!Y){A.errorRecoveryDisabledLanes|=y,wl|=y,b=4;break e}y=ar,ar=b,y!==null&&(ar===null?ar=y:ar.push.apply(ar,y))}b=Q}if(y=!1,b!==2)continue}}if(b===1){Jo(a,0),va(a,o,0,!0);break}e:{switch(g=a,y=b,y){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:va(g,o,Cr,!ga);break e;case 2:ar=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(b=yp+300-bn(),10<b)){if(va(g,o,Cr,!ga),Af(g,0,!0)!==0)break e;Es=o,g.timeoutHandle=SC(VQ.bind(null,g,h,ar,wp,fb,o,Cr,wl,Ho,ga,y,"Throttled",-0,0),b);break e}VQ(g,h,ar,wp,fb,o,Cr,wl,Ho,ga,y,null,-0,0)}}break}while(!0);Di(a)}function VQ(a,o,h,g,b,y,Q,A,Y,se,ue,fe,ae,le){if(a.timeoutHandle=-1,fe=o.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gs},DQ(o,y,fe);var ke=(y&62914560)===y?yp-bn():(y&4194048)===y?qQ-bn():0;if(ke=bX(fe,ke),ke!==null){Es=y,a.cancelPendingCommit=ke(eC.bind(null,a,o,y,h,g,b,Q,A,Y,ue,fe,null,ae,le)),va(a,y,Q,!se);return}}eC(a,o,y,h,g,b,Q,A,Y)}function _L(a){for(var o=a;;){var h=o.tag;if((h===0||h===11||h===15)&&o.flags&16384&&(h=o.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var b=h[g],y=b.getSnapshot;b=b.value;try{if(!Sr(y(),b))return!1}catch{return!1}}if(h=o.child,o.subtreeFlags&16384&&h!==null)h.return=o,o=h;else{if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function va(a,o,h,g){o&=~hb,o&=~wl,a.suspendedLanes|=o,a.pingedLanes&=~o,g&&(a.warmLanes|=o),g=a.expirationTimes;for(var b=o;0<b;){var y=31-ct(b),Q=1<<y;g[y]=-1,b&=~Q}h!==0&&n2(a,h,o)}function kp(){return(lt&6)===0?(od(0),!1):!0}function Ob(){if(Be!==null){if(pt===0)var a=Be.return;else a=Be,vs=pl=null,Ax(a),Io=null,Bu=0,a=Be;for(;a!==null;)wQ(a.alternate,a),a=a.return;Be=null}}function Jo(a,o){var h=a.timeoutHandle;h!==-1&&(a.timeoutHandle=-1,tX(h)),h=a.cancelPendingCommit,h!==null&&(a.cancelPendingCommit=null,h()),Es=0,Ob(),St=a,Be=h=xs(a.current,null),Ue=o,pt=0,Qr=null,ga=!1,Fo=Cu(a,o),db=!1,Ho=Cr=hb=wl=Oa=qt=0,ar=ad=null,fb=!1,(o&8)!==0&&(o|=o&32);var g=a.entangledLanes;if(g!==0)for(a=a.entanglements,g&=o;0<g;){var b=31-ct(g),y=1<<b;o|=a[b],g&=~y}return $s=o,Yf(),h}function UQ(a,o){Me=null,X.H=Ku,o===qo||o===Jf?(o=cj(),pt=3):o===yx?(o=cj(),pt=4):pt=o===Gx?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Qr=o,Be===null&&(qt=1,fp(a,qr(o,a.current)))}function WQ(){var a=kr.current;return a===null?!0:(Ue&4194048)===Ue?Vr===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?a===Vr:!1}function GQ(){var a=X.H;return X.H=Ku,a===null?Ku:a}function FQ(){var a=X.A;return X.A=AL,a}function jp(){qt=4,ga||(Ue&4194048)!==Ue&&kr.current!==null||(Fo=!0),(Oa&134217727)===0&&(wl&134217727)===0||St===null||va(St,Ue,Cr,!1)}function xb(a,o,h){var g=lt;lt|=2;var b=GQ(),y=FQ();(St!==a||Ue!==o)&&(wp=null,Jo(a,o)),o=!1;var Q=qt;e:do try{if(pt!==0&&Be!==null){var A=Be,Y=Qr;switch(pt){case 8:Ob(),Q=6;break e;case 3:case 2:case 9:case 6:kr.current===null&&(o=!0);var se=pt;if(pt=0,Qr=null,ec(a,A,Y,se),h&&Fo){Q=0;break e}break;default:se=pt,pt=0,Qr=null,ec(a,A,Y,se)}}ML(),Q=qt;break}catch(ue){UQ(a,ue)}while(!0);return o&&a.shellSuspendCounter++,vs=pl=null,lt=g,X.H=b,X.A=y,Be===null&&(St=null,Ue=0,Yf()),Q}function ML(){for(;Be!==null;)HQ(Be)}function zL(a,o){var h=lt;lt|=2;var g=GQ(),b=FQ();St!==a||Ue!==o?(wp=null,Sp=bn()+500,Jo(a,o)):Fo=Cu(a,o);e:do try{if(pt!==0&&Be!==null){o=Be;var y=Qr;t:switch(pt){case 1:pt=0,Qr=null,ec(a,o,y,1);break;case 2:case 9:if(lj(y)){pt=0,Qr=null,KQ(o);break}o=function(){pt!==2&&pt!==9||St!==a||(pt=7),Di(a)},y.then(o,o);break e;case 3:pt=7;break e;case 4:pt=5;break e;case 7:lj(y)?(pt=0,Qr=null,KQ(o)):(pt=0,Qr=null,ec(a,o,y,7));break;case 5:var Q=null;switch(Be.tag){case 26:Q=Be.memoizedState;case 5:case 27:var A=Be;if(Q?zC(Q):A.stateNode.complete){pt=0,Qr=null;var Y=A.sibling;if(Y!==null)Be=Y;else{var se=A.return;se!==null?(Be=se,Qp(se)):Be=null}break t}}pt=0,Qr=null,ec(a,o,y,5);break;case 6:pt=0,Qr=null,ec(a,o,y,6);break;case 8:Ob(),qt=6;break e;default:throw Error(r(462))}}DL();break}catch(ue){UQ(a,ue)}while(!0);return vs=pl=null,X.H=g,X.A=b,lt=h,Be!==null?0:(St=null,Ue=0,Yf(),qt)}function DL(){for(;Be!==null&&!sl();)HQ(Be)}function HQ(a){var o=yQ(a.alternate,a,$s);a.memoizedProps=a.pendingProps,o===null?Qp(a):Be=o}function KQ(a){var o=a,h=o.alternate;switch(o.tag){case 15:case 0:o=mQ(h,o,o.pendingProps,o.type,void 0,Ue);break;case 11:o=mQ(h,o,o.pendingProps,o.type.render,o.ref,Ue);break;case 5:Ax(o);default:wQ(h,o),o=Be=F2(o,$s),o=yQ(h,o,$s)}a.memoizedProps=a.pendingProps,o===null?Qp(a):Be=o}function ec(a,o,h,g){vs=pl=null,Ax(o),Io=null,Bu=0;var b=o.return;try{if(QL(a,b,o,h,Ue)){qt=1,fp(a,qr(h,a.current)),Be=null;return}}catch(y){if(b!==null)throw Be=b,y;qt=1,fp(a,qr(h,a.current)),Be=null;return}o.flags&32768?(Fe||g===1?a=!0:Fo||(Ue&536870912)!==0?a=!1:(ga=a=!0,(g===2||g===9||g===3||g===6)&&(g=kr.current,g!==null&&g.tag===13&&(g.flags|=16384))),JQ(o,a)):Qp(o)}function Qp(a){var o=a;do{if((o.flags&32768)!==0){JQ(o,ga);return}a=o.return;var h=TL(o.alternate,o,$s);if(h!==null){Be=h;return}if(o=o.sibling,o!==null){Be=o;return}Be=o=a}while(o!==null);qt===0&&(qt=5)}function JQ(a,o){do{var h=$L(a.alternate,a);if(h!==null){h.flags&=32767,Be=h;return}if(h=a.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!o&&(a=a.sibling,a!==null)){Be=a;return}Be=a=h}while(a!==null);qt=6,Be=null}function eC(a,o,h,g,b,y,Q,A,Y){a.cancelPendingCommit=null;do Cp();while(un!==0);if((lt&6)!==0)throw Error(r(327));if(o!==null){if(o===a.current)throw Error(r(177));if(y=o.lanes|o.childLanes,y|=ax,OD(a,h,y,Q,A,Y),a===St&&(Be=St=null,Ue=0),Ko=o,ba=a,Es=h,pb=y,mb=b,IQ=g,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,qL(Pe,function(){return sC(),null})):(a.callbackNode=null,a.callbackPriority=0),g=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||g){g=X.T,X.T=null,b=q.p,q.p=2,Q=lt,lt|=4;try{EL(a,o,h)}finally{lt=Q,q.p=b,X.T=g}}un=1,tC(),nC(),rC()}}function tC(){if(un===1){un=0;var a=ba,o=Ko,h=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||h){h=X.T,X.T=null;var g=q.p;q.p=2;var b=lt;lt|=4;try{_Q(o,a);var y=$b,Q=Z2(a.containerInfo),A=y.focusedElem,Y=y.selectionRange;if(Q!==A&&A&&A.ownerDocument&&X2(A.ownerDocument.documentElement,A)){if(Y!==null&&tx(A)){var se=Y.start,ue=Y.end;if(ue===void 0&&(ue=se),"selectionStart"in A)A.selectionStart=se,A.selectionEnd=Math.min(ue,A.value.length);else{var fe=A.ownerDocument||document,ae=fe&&fe.defaultView||window;if(ae.getSelection){var le=ae.getSelection(),ke=A.textContent.length,$e=Math.min(Y.start,ke),bt=Y.end===void 0?$e:Math.min(Y.end,ke);!le.extend&&$e>bt&&(Q=bt,bt=$e,$e=Q);var ee=L2(A,$e),F=L2(A,bt);if(ee&&F&&(le.rangeCount!==1||le.anchorNode!==ee.node||le.anchorOffset!==ee.offset||le.focusNode!==F.node||le.focusOffset!==F.offset)){var ie=fe.createRange();ie.setStart(ee.node,ee.offset),le.removeAllRanges(),$e>bt?(le.addRange(ie),le.extend(F.node,F.offset)):(ie.setEnd(F.node,F.offset),le.addRange(ie))}}}}for(fe=[],le=A;le=le.parentNode;)le.nodeType===1&&fe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<fe.length;A++){var he=fe[A];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}Lp=!!Tb,$b=Tb=null}finally{lt=b,q.p=g,X.T=h}}a.current=o,un=2}}function nC(){if(un===2){un=0;var a=ba,o=Ko,h=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||h){h=X.T,X.T=null;var g=q.p;q.p=2;var b=lt;lt|=4;try{$Q(a,o.alternate,o)}finally{lt=b,q.p=g,X.T=h}}un=3}}function rC(){if(un===4||un===3){un=0,vo();var a=ba,o=Ko,h=Es,g=IQ;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?un=5:(un=0,Ko=ba=null,iC(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(xa=null),MO(h),o=o.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(jt,o,void 0,(o.current.flags&128)===128)}catch{}if(g!==null){o=X.T,b=q.p,q.p=2,X.T=null;try{for(var y=a.onRecoverableError,Q=0;Q<g.length;Q++){var A=g[Q];y(A.value,{componentStack:A.stack})}}finally{X.T=o,q.p=b}}(Es&3)!==0&&Cp(),Di(a),b=a.pendingLanes,(h&261930)!==0&&(b&42)!==0?a===gb?ld++:(ld=0,gb=a):ld=0,od(0)}}function iC(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,qu(o)))}function Cp(){return tC(),nC(),rC(),sC()}function sC(){if(un!==5)return!1;var a=ba,o=pb;pb=0;var h=MO(Es),g=X.T,b=q.p;try{q.p=32>h?32:h,X.T=null,h=mb,mb=null;var y=ba,Q=Es;if(un=0,Ko=ba=null,Es=0,(lt&6)!==0)throw Error(r(331));var A=lt;if(lt|=4,XQ(y.current),zQ(y,y.current,Q,h),lt=A,od(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(jt,y)}catch{}return!0}finally{q.p=b,X.T=g,iC(a,o)}}function aC(a,o,h){o=qr(h,o),o=Wx(a.stateNode,o,2),a=ha(a,o,2),a!==null&&(Nu(a,2),Di(a))}function mt(a,o,h){if(a.tag===3)aC(a,a,h);else for(;o!==null;){if(o.tag===3){aC(o,a,h);break}else if(o.tag===1){var g=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(xa===null||!xa.has(g))){a=qr(h,a),h=lQ(2),g=ha(o,h,2),g!==null&&(oQ(h,g,o,a),Nu(g,2),Di(g));break}}o=o.return}}function bb(a,o,h){var g=a.pingCache;if(g===null){g=a.pingCache=new RL;var b=new Set;g.set(o,b)}else b=g.get(o),b===void 0&&(b=new Set,g.set(o,b));b.has(h)||(db=!0,b.add(h),a=LL.bind(null,a,o,h),o.then(a,a))}function LL(a,o,h){var g=a.pingCache;g!==null&&g.delete(o),a.pingedLanes|=a.suspendedLanes&h,a.warmLanes&=~h,St===a&&(Ue&h)===h&&(qt===4||qt===3&&(Ue&62914560)===Ue&&300>bn()-yp?(lt&2)===0&&Jo(a,0):hb|=h,Ho===Ue&&(Ho=0)),Di(a)}function lC(a,o){o===0&&(o=t2()),a=dl(a,o),a!==null&&(Nu(a,o),Di(a))}function XL(a){var o=a.memoizedState,h=0;o!==null&&(h=o.retryLane),lC(a,h)}function ZL(a,o){var h=0;switch(a.tag){case 31:case 13:var g=a.stateNode,b=a.memoizedState;b!==null&&(h=b.retryLane);break;case 19:g=a.stateNode;break;case 22:g=a.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(o),lC(a,h)}function qL(a,o){return ps(a,o)}var Np=null,tc=null,vb=!1,Tp=!1,yb=!1,ya=0;function Di(a){a!==tc&&a.next===null&&(tc===null?Np=tc=a:tc=tc.next=a),Tp=!0,vb||(vb=!0,BL())}function od(a,o){if(!yb&&Tp){yb=!0;do for(var h=!1,g=Np;g!==null;){if(a!==0){var b=g.pendingLanes;if(b===0)var y=0;else{var Q=g.suspendedLanes,A=g.pingedLanes;y=(1<<31-ct(42|a)+1)-1,y&=b&~(Q&~A),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(h=!0,dC(g,y))}else y=Ue,y=Af(g,g===St?y:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(y&3)===0||Cu(g,y)||(h=!0,dC(g,y));g=g.next}while(h);yb=!1}}function IL(){oC()}function oC(){Tp=vb=!1;var a=0;ya!==0&&eX()&&(a=ya);for(var o=bn(),h=null,g=Np;g!==null;){var b=g.next,y=cC(g,o);y===0?(g.next=null,h===null?Np=b:h.next=b,b===null&&(tc=h)):(h=g,(a!==0||(y&3)!==0)&&(Tp=!0)),g=b}un!==0&&un!==5||od(a),ya!==0&&(ya=0)}function cC(a,o){for(var h=a.suspendedLanes,g=a.pingedLanes,b=a.expirationTimes,y=a.pendingLanes&-62914561;0<y;){var Q=31-ct(y),A=1<<Q,Y=b[Q];Y===-1?((A&h)===0||(A&g)!==0)&&(b[Q]=gD(A,o)):Y<=o&&(a.expiredLanes|=A),y&=~A}if(o=St,h=Ue,h=Af(a,a===o?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),g=a.callbackNode,h===0||a===o&&(pt===2||pt===9)||a.cancelPendingCommit!==null)return g!==null&&g!==null&&ra(g),a.callbackNode=null,a.callbackPriority=0;if((h&3)===0||Cu(a,h)){if(o=h&-h,o===a.callbackPriority)return o;switch(g!==null&&ra(g),MO(h)){case 2:case 8:h=xe;break;case 32:h=Pe;break;case 268435456:h=nt;break;default:h=Pe}return g=uC.bind(null,a),h=ps(h,g),a.callbackPriority=o,a.callbackNode=h,o}return g!==null&&g!==null&&ra(g),a.callbackPriority=2,a.callbackNode=null,2}function uC(a,o){if(un!==0&&un!==5)return a.callbackNode=null,a.callbackPriority=0,null;var h=a.callbackNode;if(Cp()&&a.callbackNode!==h)return null;var g=Ue;return g=Af(a,a===St?g:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),g===0?null:(YQ(a,g,o),cC(a,bn()),a.callbackNode!=null&&a.callbackNode===h?uC.bind(null,a):null)}function dC(a,o){if(Cp())return null;YQ(a,o,!0)}function BL(){nX(function(){(lt&6)!==0?ps(de,IL):oC()})}function Sb(){if(ya===0){var a=Xo;a===0&&(a=Ri,Ri<<=1,(Ri&261888)===0&&(Ri=256)),ya=a}return ya}function hC(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:zf(""+a)}function fC(a,o){var h=o.ownerDocument.createElement("input");return h.name=o.name,h.value=o.value,a.id&&h.setAttribute("form",a.id),o.parentNode.insertBefore(h,o),a=new FormData(a),h.parentNode.removeChild(h),a}function YL(a,o,h,g,b){if(o==="submit"&&h&&h.stateNode===b){var y=hC((b[tr]||null).action),Q=g.submitter;Q&&(o=(o=Q[tr]||null)?hC(o.formAction):Q.getAttribute("formAction"),o!==null&&(y=o,Q=null));var A=new Zf("action","action",null,g,b);a.push({event:A,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(ya!==0){var Y=Q?fC(b,Q):new FormData(b);qx(h,{pending:!0,data:Y,method:b.method,action:y},null,Y)}}else typeof y=="function"&&(A.preventDefault(),Y=Q?fC(b,Q):new FormData(b),qx(h,{pending:!0,data:Y,method:b.method,action:y},y,Y))},currentTarget:b}]})}}for(var wb=0;wb<sx.length;wb++){var kb=sx[wb],VL=kb.toLowerCase(),UL=kb[0].toUpperCase()+kb.slice(1);pi(VL,"on"+UL)}pi(B2,"onAnimationEnd"),pi(Y2,"onAnimationIteration"),pi(V2,"onAnimationStart"),pi("dblclick","onDoubleClick"),pi("focusin","onFocus"),pi("focusout","onBlur"),pi(cL,"onTransitionRun"),pi(uL,"onTransitionStart"),pi(dL,"onTransitionCancel"),pi(U2,"onTransitionEnd"),Qo("onMouseEnter",["mouseout","mouseover"]),Qo("onMouseLeave",["mouseout","mouseover"]),Qo("onPointerEnter",["pointerout","pointerover"]),Qo("onPointerLeave",["pointerout","pointerover"]),ll("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ll("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ll("onBeforeInput",["compositionend","keypress","textInput","paste"]),ll("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ll("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ll("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cd="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(" "),WL=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cd));function pC(a,o){o=(o&4)!==0;for(var h=0;h<a.length;h++){var g=a[h],b=g.event;g=g.listeners;e:{var y=void 0;if(o)for(var Q=g.length-1;0<=Q;Q--){var A=g[Q],Y=A.instance,se=A.currentTarget;if(A=A.listener,Y!==y&&b.isPropagationStopped())break e;y=A,b.currentTarget=se;try{y(b)}catch(ue){Bf(ue)}b.currentTarget=null,y=Y}else for(Q=0;Q<g.length;Q++){if(A=g[Q],Y=A.instance,se=A.currentTarget,A=A.listener,Y!==y&&b.isPropagationStopped())break e;y=A,b.currentTarget=se;try{y(b)}catch(ue){Bf(ue)}b.currentTarget=null,y=Y}}}}function Ye(a,o){var h=o[zO];h===void 0&&(h=o[zO]=new Set);var g=a+"__bubble";h.has(g)||(mC(o,a,2,!1),h.add(g))}function jb(a,o,h){var g=0;o&&(g|=4),mC(h,a,g,o)}var $p="_reactListening"+Math.random().toString(36).slice(2);function Qb(a){if(!a[$p]){a[$p]=!0,o2.forEach(function(h){h!=="selectionchange"&&(WL.has(h)||jb(h,!1,a),jb(h,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[$p]||(o[$p]=!0,jb("selectionchange",!1,o))}}function mC(a,o,h,g){switch(BC(o)){case 2:var b=SX;break;case 8:b=wX;break;default:b=Zb}h=b.bind(null,o,h,a),b=void 0,!VO||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(b=!0),g?b!==void 0?a.addEventListener(o,h,{capture:!0,passive:b}):a.addEventListener(o,h,!0):b!==void 0?a.addEventListener(o,h,{passive:b}):a.addEventListener(o,h,!1)}function Cb(a,o,h,g,b){var y=g;if((o&1)===0&&(o&2)===0&&g!==null)e:for(;;){if(g===null)return;var Q=g.tag;if(Q===3||Q===4){var A=g.stateNode.containerInfo;if(A===b)break;if(Q===4)for(Q=g.return;Q!==null;){var Y=Q.tag;if((Y===3||Y===4)&&Q.stateNode.containerInfo===b)return;Q=Q.return}for(;A!==null;){if(Q=wo(A),Q===null)return;if(Y=Q.tag,Y===5||Y===6||Y===26||Y===27){g=y=Q;continue e}A=A.parentNode}}g=g.return}v2(function(){var se=y,ue=BO(h),fe=[];e:{var ae=W2.get(a);if(ae!==void 0){var le=Zf,ke=a;switch(a){case"keypress":if(Lf(h)===0)break e;case"keydown":case"keyup":le=ZD;break;case"focusin":ke="focus",le=FO;break;case"focusout":ke="blur",le=FO;break;case"beforeblur":case"afterblur":le=FO;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=w2;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=TD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=BD;break;case B2:case Y2:case V2:le=PD;break;case U2:le=VD;break;case"scroll":case"scrollend":le=CD;break;case"wheel":le=WD;break;case"copy":case"cut":case"paste":le=RD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=j2;break;case"toggle":case"beforetoggle":le=FD}var $e=(o&4)!==0,bt=!$e&&(a==="scroll"||a==="scrollend"),ee=$e?ae!==null?ae+"Capture":null:ae;$e=[];for(var F=se,ie;F!==null;){var he=F;if(ie=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ie===null||ee===null||(he=Eu(F,ee),he!=null&&$e.push(ud(F,he,ie))),bt)break;F=F.return}0<$e.length&&(ae=new le(ae,ke,null,h,ue),fe.push({event:ae,listeners:$e}))}}if((o&7)===0){e:{if(ae=a==="mouseover"||a==="pointerover",le=a==="mouseout"||a==="pointerout",ae&&h!==IO&&(ke=h.relatedTarget||h.fromElement)&&(wo(ke)||ke[So]))break e;if((le||ae)&&(ae=ue.window===ue?ue:(ae=ue.ownerDocument)?ae.defaultView||ae.parentWindow:window,le?(ke=h.relatedTarget||h.toElement,le=se,ke=ke?wo(ke):null,ke!==null&&(bt=s(ke),$e=ke.tag,ke!==bt||$e!==5&&$e!==27&&$e!==6)&&(ke=null)):(le=null,ke=se),le!==ke)){if($e=w2,he="onMouseLeave",ee="onMouseEnter",F="mouse",(a==="pointerout"||a==="pointerover")&&($e=j2,he="onPointerLeave",ee="onPointerEnter",F="pointer"),bt=le==null?ae:$u(le),ie=ke==null?ae:$u(ke),ae=new $e(he,F+"leave",le,h,ue),ae.target=bt,ae.relatedTarget=ie,he=null,wo(ue)===se&&($e=new $e(ee,F+"enter",ke,h,ue),$e.target=ie,$e.relatedTarget=bt,he=$e),bt=he,le&&ke)t:{for($e=GL,ee=le,F=ke,ie=0,he=ee;he;he=$e(he))ie++;he=0;for(var Ce=F;Ce;Ce=$e(Ce))he++;for(;0<ie-he;)ee=$e(ee),ie--;for(;0<he-ie;)F=$e(F),he--;for(;ie--;){if(ee===F||F!==null&&ee===F.alternate){$e=ee;break t}ee=$e(ee),F=$e(F)}$e=null}else $e=null;le!==null&&gC(fe,ae,le,$e,!1),ke!==null&&bt!==null&&gC(fe,bt,ke,$e,!0)}}e:{if(ae=se?$u(se):window,le=ae.nodeName&&ae.nodeName.toLowerCase(),le==="select"||le==="input"&&ae.type==="file")var rt=A2;else if(E2(ae))if(R2)rt=aL;else{rt=iL;var je=rL}else le=ae.nodeName,!le||le.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?se&&qO(se.elementType)&&(rt=A2):rt=sL;if(rt&&(rt=rt(a,se))){P2(fe,rt,h,ue);break e}je&&je(a,ae,se),a==="focusout"&&se&&ae.type==="number"&&se.memoizedProps.value!=null&&ZO(ae,"number",ae.value)}switch(je=se?$u(se):window,a){case"focusin":(E2(je)||je.contentEditable==="true")&&(Po=je,nx=se,Lu=null);break;case"focusout":Lu=nx=Po=null;break;case"mousedown":rx=!0;break;case"contextmenu":case"mouseup":case"dragend":rx=!1,q2(fe,h,ue);break;case"selectionchange":if(oL)break;case"keydown":case"keyup":q2(fe,h,ue)}var De;if(KO)e:{switch(a){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else Eo?T2(a,h)&&(We="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(We="onCompositionStart");We&&(Q2&&h.locale!=="ko"&&(Eo||We!=="onCompositionStart"?We==="onCompositionEnd"&&Eo&&(De=y2()):(sa=ue,UO="value"in sa?sa.value:sa.textContent,Eo=!0)),je=Ep(se,We),0<je.length&&(We=new k2(We,a,null,h,ue),fe.push({event:We,listeners:je}),De?We.data=De:(De=$2(h),De!==null&&(We.data=De)))),(De=KD?JD(a,h):eL(a,h))&&(We=Ep(se,"onBeforeInput"),0<We.length&&(je=new k2("onBeforeInput","beforeinput",null,h,ue),fe.push({event:je,listeners:We}),je.data=De)),YL(fe,a,se,h,ue)}pC(fe,o)})}function ud(a,o,h){return{instance:a,listener:o,currentTarget:h}}function Ep(a,o){for(var h=o+"Capture",g=[];a!==null;){var b=a,y=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||y===null||(b=Eu(a,h),b!=null&&g.unshift(ud(a,b,y)),b=Eu(a,o),b!=null&&g.push(ud(a,b,y))),a.tag===3)return g;a=a.return}return[]}function GL(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function gC(a,o,h,g,b){for(var y=o._reactName,Q=[];h!==null&&h!==g;){var A=h,Y=A.alternate,se=A.stateNode;if(A=A.tag,Y!==null&&Y===g)break;A!==5&&A!==26&&A!==27||se===null||(Y=se,b?(se=Eu(h,y),se!=null&&Q.unshift(ud(h,se,Y))):b||(se=Eu(h,y),se!=null&&Q.push(ud(h,se,Y)))),h=h.return}Q.length!==0&&a.push({event:o,listeners:Q})}var FL=/\r\n?/g,HL=/\u0000|\uFFFD/g;function OC(a){return(typeof a=="string"?a:""+a).replace(FL,`
|
|
49
|
+
`).replace(HL,"")}function xC(a,o){return o=OC(o),OC(a)===o}function xt(a,o,h,g,b,y){switch(h){case"children":typeof g=="string"?o==="body"||o==="textarea"&&g===""||No(a,g):(typeof g=="number"||typeof g=="bigint")&&o!=="body"&&No(a,""+g);break;case"className":_f(a,"class",g);break;case"tabIndex":_f(a,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":_f(a,h,g);break;case"style":x2(a,g,y);break;case"data":if(o!=="object"){_f(a,"data",g);break}case"src":case"href":if(g===""&&(o!=="a"||h!=="href")){a.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){a.removeAttribute(h);break}g=zf(""+g),a.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){a.setAttribute(h,"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 y=="function"&&(h==="formAction"?(o!=="input"&&xt(a,o,"name",b.name,b,null),xt(a,o,"formEncType",b.formEncType,b,null),xt(a,o,"formMethod",b.formMethod,b,null),xt(a,o,"formTarget",b.formTarget,b,null)):(xt(a,o,"encType",b.encType,b,null),xt(a,o,"method",b.method,b,null),xt(a,o,"target",b.target,b,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){a.removeAttribute(h);break}g=zf(""+g),a.setAttribute(h,g);break;case"onClick":g!=null&&(a.onclick=gs);break;case"onScroll":g!=null&&Ye("scroll",a);break;case"onScrollEnd":g!=null&&Ye("scrollend",a);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=h}}break;case"multiple":a.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":a.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){a.removeAttribute("xlink:href");break}h=zf(""+g),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(h,""+g):a.removeAttribute(h);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":g&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(h,""):a.removeAttribute(h);break;case"capture":case"download":g===!0?a.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(h,g):a.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?a.setAttribute(h,g):a.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?a.removeAttribute(h):a.setAttribute(h,g);break;case"popover":Ye("beforetoggle",a),Ye("toggle",a),Rf(a,"popover",g);break;case"xlinkActuate":ms(a,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":ms(a,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":ms(a,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":ms(a,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":ms(a,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":ms(a,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":ms(a,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":ms(a,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":ms(a,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Rf(a,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=jD.get(h)||h,Rf(a,h,g))}}function Nb(a,o,h,g,b,y){switch(h){case"style":x2(a,g,y);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=h}}break;case"children":typeof g=="string"?No(a,g):(typeof g=="number"||typeof g=="bigint")&&No(a,""+g);break;case"onScroll":g!=null&&Ye("scroll",a);break;case"onScrollEnd":g!=null&&Ye("scrollend",a);break;case"onClick":g!=null&&(a.onclick=gs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!c2.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(b=h.endsWith("Capture"),o=h.slice(2,b?h.length-7:void 0),y=a[tr]||null,y=y!=null?y[h]:null,typeof y=="function"&&a.removeEventListener(o,y,b),typeof g=="function")){typeof y!="function"&&y!==null&&(h in a?a[h]=null:a.hasAttribute(h)&&a.removeAttribute(h)),a.addEventListener(o,g,b);break e}h in a?a[h]=g:g===!0?a.setAttribute(h,""):Rf(a,h,g)}}}function kn(a,o,h){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",a),Ye("load",a);var g=!1,b=!1,y;for(y in h)if(h.hasOwnProperty(y)){var Q=h[y];if(Q!=null)switch(y){case"src":g=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:xt(a,o,y,Q,h,null)}}b&&xt(a,o,"srcSet",h.srcSet,h,null),g&&xt(a,o,"src",h.src,h,null);return;case"input":Ye("invalid",a);var A=y=Q=b=null,Y=null,se=null;for(g in h)if(h.hasOwnProperty(g)){var ue=h[g];if(ue!=null)switch(g){case"name":b=ue;break;case"type":Q=ue;break;case"checked":Y=ue;break;case"defaultChecked":se=ue;break;case"value":y=ue;break;case"defaultValue":A=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,o));break;default:xt(a,o,g,ue,h,null)}}p2(a,y,A,Y,se,Q,b,!1);return;case"select":Ye("invalid",a),g=Q=y=null;for(b in h)if(h.hasOwnProperty(b)&&(A=h[b],A!=null))switch(b){case"value":y=A;break;case"defaultValue":Q=A;break;case"multiple":g=A;default:xt(a,o,b,A,h,null)}o=y,h=Q,a.multiple=!!g,o!=null?Co(a,!!g,o,!1):h!=null&&Co(a,!!g,h,!0);return;case"textarea":Ye("invalid",a),y=b=g=null;for(Q in h)if(h.hasOwnProperty(Q)&&(A=h[Q],A!=null))switch(Q){case"value":g=A;break;case"defaultValue":b=A;break;case"children":y=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(91));break;default:xt(a,o,Q,A,h,null)}g2(a,g,b,y);return;case"option":for(Y in h)if(h.hasOwnProperty(Y)&&(g=h[Y],g!=null))switch(Y){case"selected":a.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:xt(a,o,Y,g,h,null)}return;case"dialog":Ye("beforetoggle",a),Ye("toggle",a),Ye("cancel",a),Ye("close",a);break;case"iframe":case"object":Ye("load",a);break;case"video":case"audio":for(g=0;g<cd.length;g++)Ye(cd[g],a);break;case"image":Ye("error",a),Ye("load",a);break;case"details":Ye("toggle",a);break;case"embed":case"source":case"link":Ye("error",a),Ye("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 h)if(h.hasOwnProperty(se)&&(g=h[se],g!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:xt(a,o,se,g,h,null)}return;default:if(qO(o)){for(ue in h)h.hasOwnProperty(ue)&&(g=h[ue],g!==void 0&&Nb(a,o,ue,g,h,void 0));return}}for(A in h)h.hasOwnProperty(A)&&(g=h[A],g!=null&&xt(a,o,A,g,h,null))}function KL(a,o,h,g){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,y=null,Q=null,A=null,Y=null,se=null,ue=null;for(le in h){var fe=h[le];if(h.hasOwnProperty(le)&&fe!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":Y=fe;default:g.hasOwnProperty(le)||xt(a,o,le,null,g,fe)}}for(var ae in g){var le=g[ae];if(fe=h[ae],g.hasOwnProperty(ae)&&(le!=null||fe!=null))switch(ae){case"type":y=le;break;case"name":b=le;break;case"checked":se=le;break;case"defaultChecked":ue=le;break;case"value":Q=le;break;case"defaultValue":A=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,o));break;default:le!==fe&&xt(a,o,ae,le,g,fe)}}XO(a,Q,A,Y,se,ue,y,b);return;case"select":le=Q=A=ae=null;for(y in h)if(Y=h[y],h.hasOwnProperty(y)&&Y!=null)switch(y){case"value":break;case"multiple":le=Y;default:g.hasOwnProperty(y)||xt(a,o,y,null,g,Y)}for(b in g)if(y=g[b],Y=h[b],g.hasOwnProperty(b)&&(y!=null||Y!=null))switch(b){case"value":ae=y;break;case"defaultValue":A=y;break;case"multiple":Q=y;default:y!==Y&&xt(a,o,b,y,g,Y)}o=A,h=Q,g=le,ae!=null?Co(a,!!h,ae,!1):!!g!=!!h&&(o!=null?Co(a,!!h,o,!0):Co(a,!!h,h?[]:"",!1));return;case"textarea":le=ae=null;for(A in h)if(b=h[A],h.hasOwnProperty(A)&&b!=null&&!g.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:xt(a,o,A,null,g,b)}for(Q in g)if(b=g[Q],y=h[Q],g.hasOwnProperty(Q)&&(b!=null||y!=null))switch(Q){case"value":ae=b;break;case"defaultValue":le=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==y&&xt(a,o,Q,b,g,y)}m2(a,ae,le);return;case"option":for(var ke in h)if(ae=h[ke],h.hasOwnProperty(ke)&&ae!=null&&!g.hasOwnProperty(ke))switch(ke){case"selected":a.selected=!1;break;default:xt(a,o,ke,null,g,ae)}for(Y in g)if(ae=g[Y],le=h[Y],g.hasOwnProperty(Y)&&ae!==le&&(ae!=null||le!=null))switch(Y){case"selected":a.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:xt(a,o,Y,ae,g,le)}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 $e in h)ae=h[$e],h.hasOwnProperty($e)&&ae!=null&&!g.hasOwnProperty($e)&&xt(a,o,$e,null,g,ae);for(se in g)if(ae=g[se],le=h[se],g.hasOwnProperty(se)&&ae!==le&&(ae!=null||le!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,o));break;default:xt(a,o,se,ae,g,le)}return;default:if(qO(o)){for(var bt in h)ae=h[bt],h.hasOwnProperty(bt)&&ae!==void 0&&!g.hasOwnProperty(bt)&&Nb(a,o,bt,void 0,g,ae);for(ue in g)ae=g[ue],le=h[ue],!g.hasOwnProperty(ue)||ae===le||ae===void 0&&le===void 0||Nb(a,o,ue,ae,g,le);return}}for(var ee in h)ae=h[ee],h.hasOwnProperty(ee)&&ae!=null&&!g.hasOwnProperty(ee)&&xt(a,o,ee,null,g,ae);for(fe in g)ae=g[fe],le=h[fe],!g.hasOwnProperty(fe)||ae===le||ae==null&&le==null||xt(a,o,fe,ae,g,le)}function bC(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function JL(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var b=h[g],y=b.transferSize,Q=b.initiatorType,A=b.duration;if(y&&A&&bC(Q)){for(Q=0,A=b.responseEnd,g+=1;g<h.length;g++){var Y=h[g],se=Y.startTime;if(se>A)break;var ue=Y.transferSize,fe=Y.initiatorType;ue&&bC(fe)&&(Y=Y.responseEnd,Q+=ue*(Y<A?1:(A-se)/(Y-se)))}if(--g,o+=8*(y+Q)/(b.duration/1e3),a++,10<a)break}}if(0<a)return o/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Tb=null,$b=null;function Pp(a){return a.nodeType===9?a:a.ownerDocument}function vC(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 yC(a,o){if(a===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&o==="foreignObject"?0:a}function Eb(a,o){return a==="textarea"||a==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Pb=null;function eX(){var a=window.event;return a&&a.type==="popstate"?a===Pb?!1:(Pb=a,!0):(Pb=null,!1)}var SC=typeof setTimeout=="function"?setTimeout:void 0,tX=typeof clearTimeout=="function"?clearTimeout:void 0,wC=typeof Promise=="function"?Promise:void 0,nX=typeof queueMicrotask=="function"?queueMicrotask:typeof wC<"u"?function(a){return wC.resolve(null).then(a).catch(rX)}:SC;function rX(a){setTimeout(function(){throw a})}function Sa(a){return a==="head"}function kC(a,o){var h=o,g=0;do{var b=h.nextSibling;if(a.removeChild(h),b&&b.nodeType===8)if(h=b.data,h==="/$"||h==="/&"){if(g===0){a.removeChild(b),sc(o);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")dd(a.ownerDocument.documentElement);else if(h==="head"){h=a.ownerDocument.head,dd(h);for(var y=h.firstChild;y;){var Q=y.nextSibling,A=y.nodeName;y[Tu]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&y.rel.toLowerCase()==="stylesheet"||h.removeChild(y),y=Q}}else h==="body"&&dd(a.ownerDocument.body);h=b}while(h);sc(o)}function jC(a,o){var h=a;a=0;do{var g=h.nextSibling;if(h.nodeType===1?o?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(o?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(a===0)break;a--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||a++;h=g}while(h)}function Ab(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var h=o;switch(o=o.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Ab(h),DO(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}a.removeChild(h)}}function iX(a,o,h,g){for(;a.nodeType===1;){var b=h;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!g&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(g){if(!a[Tu])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(y=a.getAttribute("rel"),y==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(y!==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(y=a.getAttribute("src"),(y!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&y&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var y=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===y)return a}else return a;if(a=Ur(a.nextSibling),a===null)break}return null}function sX(a,o,h){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!h||(a=Ur(a.nextSibling),a===null))return null;return a}function QC(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=Ur(a.nextSibling),a===null))return null;return a}function Rb(a){return a.data==="$?"||a.data==="$~"}function _b(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function aX(a,o){var h=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||h.readyState!=="loading")o();else{var g=function(){o(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),a._reactRetry=g}}function Ur(a){for(;a!=null;a=a.nextSibling){var o=a.nodeType;if(o===1||o===3)break;if(o===8){if(o=a.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return a}var Mb=null;function CC(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"||h==="/&"){if(o===0)return Ur(a.nextSibling);o--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||o++}a=a.nextSibling}return null}function NC(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(o===0)return a;o--}else h!=="/$"&&h!=="/&"||o++}a=a.previousSibling}return null}function TC(a,o,h){switch(o=Pp(h),a){case"html":if(a=o.documentElement,!a)throw Error(r(452));return a;case"head":if(a=o.head,!a)throw Error(r(453));return a;case"body":if(a=o.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function dd(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);DO(a)}var Wr=new Map,$C=new Set;function Ap(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Ps=q.d;q.d={f:lX,r:oX,D:cX,C:uX,L:dX,m:hX,X:pX,S:fX,M:mX};function lX(){var a=Ps.f(),o=kp();return a||o}function oX(a){var o=ko(a);o!==null&&o.tag===5&&o.type==="form"?Uj(o):Ps.r(a)}var nc=typeof document>"u"?null:document;function EC(a,o,h){var g=nc;if(g&&typeof o=="string"&&o){var b=Xr(o);b='link[rel="'+a+'"][href="'+b+'"]',typeof h=="string"&&(b+='[crossorigin="'+h+'"]'),$C.has(b)||($C.add(b),a={rel:a,crossOrigin:h,href:o},g.querySelector(b)===null&&(o=g.createElement("link"),kn(o,"link",a),pn(o),g.head.appendChild(o)))}}function cX(a){Ps.D(a),EC("dns-prefetch",a,null)}function uX(a,o){Ps.C(a,o),EC("preconnect",a,o)}function dX(a,o,h){Ps.L(a,o,h);var g=nc;if(g&&a&&o){var b='link[rel="preload"][as="'+Xr(o)+'"]';o==="image"&&h&&h.imageSrcSet?(b+='[imagesrcset="'+Xr(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(b+='[imagesizes="'+Xr(h.imageSizes)+'"]')):b+='[href="'+Xr(a)+'"]';var y=b;switch(o){case"style":y=rc(a);break;case"script":y=ic(a)}Wr.has(y)||(a=m({rel:"preload",href:o==="image"&&h&&h.imageSrcSet?void 0:a,as:o},h),Wr.set(y,a),g.querySelector(b)!==null||o==="style"&&g.querySelector(hd(y))||o==="script"&&g.querySelector(fd(y))||(o=g.createElement("link"),kn(o,"link",a),pn(o),g.head.appendChild(o)))}}function hX(a,o){Ps.m(a,o);var h=nc;if(h&&a){var g=o&&typeof o.as=="string"?o.as:"script",b='link[rel="modulepreload"][as="'+Xr(g)+'"][href="'+Xr(a)+'"]',y=b;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=ic(a)}if(!Wr.has(y)&&(a=m({rel:"modulepreload",href:a},o),Wr.set(y,a),h.querySelector(b)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(fd(y)))return}g=h.createElement("link"),kn(g,"link",a),pn(g),h.head.appendChild(g)}}}function fX(a,o,h){Ps.S(a,o,h);var g=nc;if(g&&a){var b=jo(g).hoistableStyles,y=rc(a);o=o||"default";var Q=b.get(y);if(!Q){var A={loading:0,preload:null};if(Q=g.querySelector(hd(y)))A.loading=5;else{a=m({rel:"stylesheet",href:a,"data-precedence":o},h),(h=Wr.get(y))&&zb(a,h);var Y=Q=g.createElement("link");pn(Y),kn(Y,"link",a),Y._p=new Promise(function(se,ue){Y.onload=se,Y.onerror=ue}),Y.addEventListener("load",function(){A.loading|=1}),Y.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Rp(Q,o,g)}Q={type:"stylesheet",instance:Q,count:1,state:A},b.set(y,Q)}}}function pX(a,o){Ps.X(a,o);var h=nc;if(h&&a){var g=jo(h).hoistableScripts,b=ic(a),y=g.get(b);y||(y=h.querySelector(fd(b)),y||(a=m({src:a,async:!0},o),(o=Wr.get(b))&&Db(a,o),y=h.createElement("script"),pn(y),kn(y,"link",a),h.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},g.set(b,y))}}function mX(a,o){Ps.M(a,o);var h=nc;if(h&&a){var g=jo(h).hoistableScripts,b=ic(a),y=g.get(b);y||(y=h.querySelector(fd(b)),y||(a=m({src:a,async:!0,type:"module"},o),(o=Wr.get(b))&&Db(a,o),y=h.createElement("script"),pn(y),kn(y,"link",a),h.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},g.set(b,y))}}function PC(a,o,h,g){var b=(b=re.current)?Ap(b):null;if(!b)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(o=rc(h.href),h=jo(b).hoistableStyles,g=h.get(o),g||(g={type:"style",instance:null,count:0,state:null},h.set(o,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){a=rc(h.href);var y=jo(b).hoistableStyles,Q=y.get(a);if(Q||(b=b.ownerDocument||b,Q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(a,Q),(y=b.querySelector(hd(a)))&&!y._p&&(Q.instance=y,Q.state.loading=5),Wr.has(a)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Wr.set(a,h),y||gX(b,a,h,Q.state))),o&&g===null)throw Error(r(528,""));return Q}if(o&&g!==null)throw Error(r(529,""));return null;case"script":return o=h.async,h=h.src,typeof h=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=ic(h),h=jo(b).hoistableScripts,g=h.get(o),g||(g={type:"script",instance:null,count:0,state:null},h.set(o,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function rc(a){return'href="'+Xr(a)+'"'}function hd(a){return'link[rel="stylesheet"]['+a+"]"}function AC(a){return m({},a,{"data-precedence":a.precedence,precedence:null})}function gX(a,o,h,g){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?g.loading=1:(o=a.createElement("link"),g.preload=o,o.addEventListener("load",function(){return g.loading|=1}),o.addEventListener("error",function(){return g.loading|=2}),kn(o,"link",h),pn(o),a.head.appendChild(o))}function ic(a){return'[src="'+Xr(a)+'"]'}function fd(a){return"script[async]"+a}function RC(a,o,h){if(o.count++,o.instance===null)switch(o.type){case"style":var g=a.querySelector('style[data-href~="'+Xr(h.href)+'"]');if(g)return o.instance=g,pn(g),g;var b=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(a.ownerDocument||a).createElement("style"),pn(g),kn(g,"style",b),Rp(g,h.precedence,a),o.instance=g;case"stylesheet":b=rc(h.href);var y=a.querySelector(hd(b));if(y)return o.state.loading|=4,o.instance=y,pn(y),y;g=AC(h),(b=Wr.get(b))&&zb(g,b),y=(a.ownerDocument||a).createElement("link"),pn(y);var Q=y;return Q._p=new Promise(function(A,Y){Q.onload=A,Q.onerror=Y}),kn(y,"link",g),o.state.loading|=4,Rp(y,h.precedence,a),o.instance=y;case"script":return y=ic(h.src),(b=a.querySelector(fd(y)))?(o.instance=b,pn(b),b):(g=h,(b=Wr.get(y))&&(g=m({},h),Db(g,b)),a=a.ownerDocument||a,b=a.createElement("script"),pn(b),kn(b,"link",g),a.head.appendChild(b),o.instance=b);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(g=o.instance,o.state.loading|=4,Rp(g,h.precedence,a));return o.instance}function Rp(a,o,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=g.length?g[g.length-1]:null,y=b,Q=0;Q<g.length;Q++){var A=g[Q];if(A.dataset.precedence===o)y=A;else if(y!==b)break}y?y.parentNode.insertBefore(a,y.nextSibling):(o=h.nodeType===9?h.head:h,o.insertBefore(a,o.firstChild))}function zb(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function Db(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var _p=null;function _C(a,o,h){if(_p===null){var g=new Map,b=_p=new Map;b.set(h,g)}else b=_p,g=b.get(h),g||(g=new Map,b.set(h,g));if(g.has(a))return g;for(g.set(a,null),h=h.getElementsByTagName(a),b=0;b<h.length;b++){var y=h[b];if(!(y[Tu]||y[vn]||a==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var Q=y.getAttribute(o)||"";Q=a+Q;var A=g.get(Q);A?A.push(y):g.set(Q,[y])}}return g}function MC(a,o,h){a=a.ownerDocument||a,a.head.insertBefore(h,o==="title"?a.querySelector("head > title"):null)}function OX(a,o,h){if(h===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return a=o.disabled,typeof o.precedence=="string"&&a==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function zC(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function xX(a,o,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var b=rc(g.href),y=o.querySelector(hd(b));if(y){o=y._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=Mp.bind(a),o.then(a,a)),h.state.loading|=4,h.instance=y,pn(y);return}y=o.ownerDocument||o,g=AC(g),(b=Wr.get(b))&&zb(g,b),y=y.createElement("link"),pn(y);var Q=y;Q._p=new Promise(function(A,Y){Q.onload=A,Q.onerror=Y}),kn(y,"link",g),h.instance=y}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(h,o),(o=h.state.preload)&&(h.state.loading&3)===0&&(a.count++,h=Mp.bind(a),o.addEventListener("load",h),o.addEventListener("error",h))}}var Lb=0;function bX(a,o){return a.stylesheets&&a.count===0&&Dp(a,a.stylesheets),0<a.count||0<a.imgCount?function(h){var g=setTimeout(function(){if(a.stylesheets&&Dp(a,a.stylesheets),a.unsuspend){var y=a.unsuspend;a.unsuspend=null,y()}},6e4+o);0<a.imgBytes&&Lb===0&&(Lb=62500*JL());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Dp(a,a.stylesheets),a.unsuspend)){var y=a.unsuspend;a.unsuspend=null,y()}},(a.imgBytes>Lb?50:800)+o);return a.unsuspend=h,function(){a.unsuspend=null,clearTimeout(g),clearTimeout(b)}}:null}function Mp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dp(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var zp=null;function Dp(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,zp=new Map,o.forEach(vX,a),zp=null,Mp.call(a))}function vX(a,o){if(!(o.state.loading&4)){var h=zp.get(a);if(h)var g=h.get(null);else{h=new Map,zp.set(a,h);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<b.length;y++){var Q=b[y];(Q.nodeName==="LINK"||Q.getAttribute("media")!=="not all")&&(h.set(Q.dataset.precedence,Q),g=Q)}g&&h.set(null,g)}b=o.instance,Q=b.getAttribute("data-precedence"),y=h.get(Q)||g,y===g&&h.set(null,b),h.set(Q,b),this.count++,g=Mp.bind(this),b.addEventListener("load",g),b.addEventListener("error",g),y?y.parentNode.insertBefore(b,y.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),o.state.loading|=4}}var pd={$$typeof:C,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function yX(a,o,h,g,b,y,Q,A,Y){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=RO(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=RO(0),this.hiddenUpdates=RO(null),this.identifierPrefix=g,this.onUncaughtError=b,this.onCaughtError=y,this.onRecoverableError=Q,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function DC(a,o,h,g,b,y,Q,A,Y,se,ue,fe){return a=new yX(a,o,h,Q,Y,se,ue,fe,A),o=1,y===!0&&(o|=24),y=wr(3,null,null,o),a.current=y,y.stateNode=a,o=xx(),o.refCount++,a.pooledCache=o,o.refCount++,y.memoizedState={element:g,isDehydrated:h,cache:o},Sx(y),a}function LC(a){return a?(a=_o,a):_o}function XC(a,o,h,g,b,y){b=LC(b),g.context===null?g.context=b:g.pendingContext=b,g=da(o),g.payload={element:h},y=y===void 0?null:y,y!==null&&(g.callback=y),h=ha(a,g,o),h!==null&&(lr(h,a,o),Vu(h,a,o))}function ZC(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<o?h:o}}function Xb(a,o){ZC(a,o),(a=a.alternate)&&ZC(a,o)}function qC(a){if(a.tag===13||a.tag===31){var o=dl(a,67108864);o!==null&&lr(o,a,67108864),Xb(a,67108864)}}function IC(a){if(a.tag===13||a.tag===31){var o=Nr();o=_O(o);var h=dl(a,o);h!==null&&lr(h,a,o),Xb(a,o)}}var Lp=!0;function SX(a,o,h,g){var b=X.T;X.T=null;var y=q.p;try{q.p=2,Zb(a,o,h,g)}finally{q.p=y,X.T=b}}function wX(a,o,h,g){var b=X.T;X.T=null;var y=q.p;try{q.p=8,Zb(a,o,h,g)}finally{q.p=y,X.T=b}}function Zb(a,o,h,g){if(Lp){var b=qb(g);if(b===null)Cb(a,o,g,Xp,h),YC(a,g);else if(jX(b,a,o,h,g))g.stopPropagation();else if(YC(a,g),o&4&&-1<kX.indexOf(a)){for(;b!==null;){var y=ko(b);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var Q=al(y.pendingLanes);if(Q!==0){var A=y;for(A.pendingLanes|=2,A.entangledLanes|=2;Q;){var Y=1<<31-ct(Q);A.entanglements[1]|=Y,Q&=~Y}Di(y),(lt&6)===0&&(Sp=bn()+500,od(0))}}break;case 31:case 13:A=dl(y,2),A!==null&&lr(A,y,2),kp(),Xb(y,2)}if(y=qb(g),y===null&&Cb(a,o,g,Xp,h),y===b)break;b=y}b!==null&&g.stopPropagation()}else Cb(a,o,g,null,h)}}function qb(a){return a=BO(a),Ib(a)}var Xp=null;function Ib(a){if(Xp=null,a=wo(a),a!==null){var o=s(a);if(o===null)a=null;else{var h=o.tag;if(h===13){if(a=l(o),a!==null)return a;a=null}else if(h===31){if(a=c(o),a!==null)return a;a=null}else if(h===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return Xp=a,null}function BC(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(yo()){case de:return 2;case xe:return 8;case Pe:case Xe:return 32;case nt:return 268435456;default:return 32}default:return 32}}var Bb=!1,wa=null,ka=null,ja=null,md=new Map,gd=new Map,Qa=[],kX="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 YC(a,o){switch(a){case"focusin":case"focusout":wa=null;break;case"dragenter":case"dragleave":ka=null;break;case"mouseover":case"mouseout":ja=null;break;case"pointerover":case"pointerout":md.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":gd.delete(o.pointerId)}}function Od(a,o,h,g,b,y){return a===null||a.nativeEvent!==y?(a={blockedOn:o,domEventName:h,eventSystemFlags:g,nativeEvent:y,targetContainers:[b]},o!==null&&(o=ko(o),o!==null&&qC(o)),a):(a.eventSystemFlags|=g,o=a.targetContainers,b!==null&&o.indexOf(b)===-1&&o.push(b),a)}function jX(a,o,h,g,b){switch(o){case"focusin":return wa=Od(wa,a,o,h,g,b),!0;case"dragenter":return ka=Od(ka,a,o,h,g,b),!0;case"mouseover":return ja=Od(ja,a,o,h,g,b),!0;case"pointerover":var y=b.pointerId;return md.set(y,Od(md.get(y)||null,a,o,h,g,b)),!0;case"gotpointercapture":return y=b.pointerId,gd.set(y,Od(gd.get(y)||null,a,o,h,g,b)),!0}return!1}function VC(a){var o=wo(a.target);if(o!==null){var h=s(o);if(h!==null){if(o=h.tag,o===13){if(o=l(h),o!==null){a.blockedOn=o,a2(a.priority,function(){IC(h)});return}}else if(o===31){if(o=c(h),o!==null){a.blockedOn=o,a2(a.priority,function(){IC(h)});return}}else if(o===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Zp(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var h=qb(a.nativeEvent);if(h===null){h=a.nativeEvent;var g=new h.constructor(h.type,h);IO=g,h.target.dispatchEvent(g),IO=null}else return o=ko(h),o!==null&&qC(o),a.blockedOn=h,!1;o.shift()}return!0}function UC(a,o,h){Zp(a)&&h.delete(o)}function QX(){Bb=!1,wa!==null&&Zp(wa)&&(wa=null),ka!==null&&Zp(ka)&&(ka=null),ja!==null&&Zp(ja)&&(ja=null),md.forEach(UC),gd.forEach(UC)}function qp(a,o){a.blockedOn===o&&(a.blockedOn=null,Bb||(Bb=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,QX)))}var Ip=null;function WC(a){Ip!==a&&(Ip=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ip===a&&(Ip=null);for(var o=0;o<a.length;o+=3){var h=a[o],g=a[o+1],b=a[o+2];if(typeof g!="function"){if(Ib(g||h)===null)continue;break}var y=ko(h);y!==null&&(a.splice(o,3),o-=3,qx(y,{pending:!0,data:b,method:h.method,action:g},g,b))}}))}function sc(a){function o(Y){return qp(Y,a)}wa!==null&&qp(wa,a),ka!==null&&qp(ka,a),ja!==null&&qp(ja,a),md.forEach(o),gd.forEach(o);for(var h=0;h<Qa.length;h++){var g=Qa[h];g.blockedOn===a&&(g.blockedOn=null)}for(;0<Qa.length&&(h=Qa[0],h.blockedOn===null);)VC(h),h.blockedOn===null&&Qa.shift();if(h=(a.ownerDocument||a).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var b=h[g],y=h[g+1],Q=b[tr]||null;if(typeof y=="function")Q||WC(h);else if(Q){var A=null;if(y&&y.hasAttribute("formAction")){if(b=y,Q=y[tr]||null)A=Q.formAction;else if(Ib(b)!==null)continue}else A=Q.action;typeof A=="function"?h[g+1]=A:(h.splice(g,3),g-=3),WC(h)}}}function GC(){function a(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(Q){return b=Q})},focusReset:"manual",scroll:"manual"})}function o(){b!==null&&(b(),b=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),b!==null&&(b(),b=null)}}}function Yb(a){this._internalRoot=a}Bp.prototype.render=Yb.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(r(409));var h=o.current,g=Nr();XC(h,g,a,o,null,null)},Bp.prototype.unmount=Yb.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;XC(a.current,2,null,a,null,null),kp(),o[So]=null}};function Bp(a){this._internalRoot=a}Bp.prototype.unstable_scheduleHydration=function(a){if(a){var o=s2();a={blockedOn:null,target:a,priority:o};for(var h=0;h<Qa.length&&o!==0&&o<Qa[h].priority;h++);Qa.splice(h,0,a),h===0&&VC(a)}};var FC=e.version;if(FC!=="19.2.4")throw Error(r(527,FC,"19.2.4"));q.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=f(o),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var CX={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:X,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yp.isDisabled&&Yp.supportsFiber)try{jt=Yp.inject(CX),Qt=Yp}catch{}}return bd.createRoot=function(a,o){if(!i(a))throw Error(r(299));var h=!1,g="",b=rQ,y=iQ,Q=sQ;return o!=null&&(o.unstable_strictMode===!0&&(h=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(y=o.onCaughtError),o.onRecoverableError!==void 0&&(Q=o.onRecoverableError)),o=DC(a,1,!1,null,null,h,g,null,b,y,Q,GC),a[So]=o.current,Qb(a),new Yb(o)},bd.hydrateRoot=function(a,o,h){if(!i(a))throw Error(r(299));var g=!1,b="",y=rQ,Q=iQ,A=sQ,Y=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(b=h.identifierPrefix),h.onUncaughtError!==void 0&&(y=h.onUncaughtError),h.onCaughtError!==void 0&&(Q=h.onCaughtError),h.onRecoverableError!==void 0&&(A=h.onRecoverableError),h.formState!==void 0&&(Y=h.formState)),o=DC(a,1,!0,o,h??null,g,b,Y,y,Q,A,GC),o.context=LC(null),h=o.current,g=Nr(),g=_O(g),b=da(g),b.callback=null,ha(h,b,g),h=g,o.current.lanes=h,Nu(o,h),Di(o),a[So]=o.current,Qb(a),new Bp(o)},bd.version="19.2.4",bd}var lN;function MX(){if(lN)return Gb.exports;lN=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(),Gb.exports=_X(),Gb.exports}var zX=MX();/**
|
|
50
|
+
* react-router v7.13.1
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var oN="popstate";function cN(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function DX(t={}){function e(r,i){var f;let s=(f=i.state)==null?void 0:f.masked,{pathname:l,search:c,hash:u}=s||r.location;return s0("",{pathname:l,search:c,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:mh(i)}return XX(e,n,null,t)}function Xt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function ki(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function LX(){return Math.random().toString(36).substring(2,10)}function uN(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function s0(t,e,n=null,r,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?uu(e):e,state:n,key:e&&e.key||r||LX(),unstable_mask:i}}function mh({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function uu(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function XX(t,e,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,l=i.history,c="POP",u=null,f=p();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function p(){return(l.state||{idx:null}).idx}function m(){c="POP";let k=p(),w=k==null?null:k-f;f=k,u&&u({action:c,location:S.location,delta:w})}function O(k,w){c="PUSH";let N=cN(k)?k:s0(S.location,k,w);f=p()+1;let C=uN(N,f),E=S.createHref(N.unstable_mask||N);try{l.pushState(C,"",E)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;i.location.assign(E)}s&&u&&u({action:c,location:S.location,delta:1})}function x(k,w){c="REPLACE";let N=cN(k)?k:s0(S.location,k,w);f=p();let C=uN(N,f),E=S.createHref(N.unstable_mask||N);l.replaceState(C,"",E),s&&u&&u({action:c,location:S.location,delta:0})}function v(k){return ZX(k)}let S={get action(){return c},get location(){return t(i,l)},listen(k){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(oN,m),u=k,()=>{i.removeEventListener(oN,m),u=null}},createHref(k){return e(i,k)},createURL:v,encodeLocation(k){let w=v(k);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:O,replace:x,go(k){return l.go(k)}};return S}function ZX(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Xt(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:mh(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function dA(t,e,n="/"){return qX(t,e,n,!1)}function qX(t,e,n,r){let i=typeof e=="string"?uu(e):e,s=Vs(i.pathname||"/",n);if(s==null)return null;let l=hA(t);IX(l);let c=null;for(let u=0;c==null&&u<l.length;++u){let f=eZ(s);c=KX(l[u],f,r)}return c}function hA(t,e=[],n=[],r="",i=!1){let s=(l,c,u=i,f)=>{let p={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&u)return;Xt(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let m=ns([r,p.relativePath]),O=n.concat(p);l.children&&l.children.length>0&&(Xt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),hA(l.children,e,O,m,u)),!(l.path==null&&!l.index)&&e.push({path:m,score:FX(m,l.index),routesMeta:O})};return t.forEach((l,c)=>{var u;if(l.path===""||!((u=l.path)!=null&&u.includes("?")))s(l,c);else for(let f of fA(l.path))s(l,c,!0,f)}),e}function fA(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let l=fA(r.join("/")),c=[];return c.push(...l.map(u=>u===""?s:[s,u].join("/"))),i&&c.push(...l),c.map(u=>t.startsWith("/")&&u===""?"/":u)}function IX(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:HX(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var BX=/^:[\w-]+$/,YX=3,VX=2,UX=1,WX=10,GX=-2,dN=t=>t==="*";function FX(t,e){let n=t.split("/"),r=n.length;return n.some(dN)&&(r+=GX),e&&(r+=VX),n.filter(i=>!dN(i)).reduce((i,s)=>i+(BX.test(s)?YX:s===""?UX:WX),r)}function HX(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function KX(t,e,n=!1){let{routesMeta:r}=t,i={},s="/",l=[];for(let c=0;c<r.length;++c){let u=r[c],f=c===r.length-1,p=s==="/"?e:e.slice(s.length)||"/",m=Fm({path:u.relativePath,caseSensitive:u.caseSensitive,end:f},p),O=u.route;if(!m&&f&&n&&!r[r.length-1].route.index&&(m=Fm({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},p)),!m)return null;Object.assign(i,m.params),l.push({params:i,pathname:ns([s,m.pathname]),pathnameBase:iZ(ns([s,m.pathnameBase])),route:O}),m.pathnameBase!=="/"&&(s=ns([s,m.pathnameBase]))}return l}function Fm(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=JX(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],l=s.replace(/(.)\/+$/,"$1"),c=i.slice(1);return{params:r.reduce((f,{paramName:p,isOptional:m},O)=>{if(p==="*"){let v=c[O]||"";l=s.slice(0,s.length-v.length).replace(/(.)\/+$/,"$1")}const x=c[O];return m&&!x?f[p]=void 0:f[p]=(x||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:l,pattern:t}}function JX(t,e=!1,n=!0){ki(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,u,f,p)=>{if(r.push({paramName:c,isOptional:u!=null}),u){let m=p.charAt(f+l.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function eZ(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ki(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function Vs(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}var tZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function nZ(t,e="/"){let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?uu(t):t,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=hN(n.substring(1),"/"):s=hN(n,e)):s=e,{pathname:s,search:sZ(r),hash:aZ(i)}}function hN(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Jb(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function rZ(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function pA(t){let e=rZ(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function xS(t,e,n,r=!1){let i;typeof t=="string"?i=uu(t):(i={...t},Xt(!i.pathname||!i.pathname.includes("?"),Jb("?","pathname","search",i)),Xt(!i.pathname||!i.pathname.includes("#"),Jb("#","pathname","hash",i)),Xt(!i.search||!i.search.includes("#"),Jb("#","search","hash",i)));let s=t===""||i.pathname==="",l=s?"/":i.pathname,c;if(l==null)c=n;else{let m=e.length-1;if(!r&&l.startsWith("..")){let O=l.split("/");for(;O[0]==="..";)O.shift(),m-=1;i.pathname=O.join("/")}c=m>=0?e[m]:"/"}let u=nZ(i,c),f=l&&l!=="/"&&l.endsWith("/"),p=(s||l===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(f||p)&&(u.pathname+="/"),u}var ns=t=>t.join("/").replace(/\/\/+/g,"/"),iZ=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),sZ=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,aZ=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,lZ=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function oZ(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function cZ(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var mA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gA(t,e){let n=t;if(typeof n!="string"||!tZ.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(mA)try{let s=new URL(window.location.href),l=n.startsWith("//")?new URL(s.protocol+n):new URL(n),c=Vs(l.pathname,e);l.origin===s.origin&&c!=null?n=c+l.search+l.hash:i=!0}catch{ki(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var OA=["POST","PUT","PATCH","DELETE"];new Set(OA);var uZ=["GET",...OA];new Set(uZ);var du=j.createContext(null);du.displayName="DataRouter";var Fg=j.createContext(null);Fg.displayName="DataRouterState";var dZ=j.createContext(!1),xA=j.createContext({isTransitioning:!1});xA.displayName="ViewTransition";var hZ=j.createContext(new Map);hZ.displayName="Fetchers";var fZ=j.createContext(null);fZ.displayName="Await";var oi=j.createContext(null);oi.displayName="Navigation";var tf=j.createContext(null);tf.displayName="Location";var Qi=j.createContext({outlet:null,matches:[],isDataRoute:!1});Qi.displayName="Route";var bS=j.createContext(null);bS.displayName="RouteError";var bA="REACT_ROUTER_ERROR",pZ="REDIRECT",mZ="ROUTE_ERROR_RESPONSE";function gZ(t){if(t.startsWith(`${bA}:${pZ}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function OZ(t){if(t.startsWith(`${bA}:${mZ}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new lZ(e.status,e.statusText,e.data)}catch{}}function xZ(t,{relative:e}={}){Xt(nf(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=j.useContext(oi),{hash:i,pathname:s,search:l}=rf(t,{relative:e}),c=s;return n!=="/"&&(c=s==="/"?n:ns([n,s])),r.createHref({pathname:c,search:l,hash:i})}function nf(){return j.useContext(tf)!=null}function us(){return Xt(nf(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(tf).location}var vA="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function yA(t){j.useContext(oi).static||j.useLayoutEffect(t)}function ds(){let{isDataRoute:t}=j.useContext(Qi);return t?AZ():bZ()}function bZ(){Xt(nf(),"useNavigate() may be used only in the context of a <Router> component.");let t=j.useContext(du),{basename:e,navigator:n}=j.useContext(oi),{matches:r}=j.useContext(Qi),{pathname:i}=us(),s=JSON.stringify(pA(r)),l=j.useRef(!1);return yA(()=>{l.current=!0}),j.useCallback((u,f={})=>{if(ki(l.current,vA),!l.current)return;if(typeof u=="number"){n.go(u);return}let p=xS(u,JSON.parse(s),i,f.relative==="path");t==null&&e!=="/"&&(p.pathname=p.pathname==="/"?e:ns([e,p.pathname])),(f.replace?n.replace:n.push)(p,f.state,f)},[e,n,s,i,t])}var vZ=j.createContext(null);function yZ(t){let e=j.useContext(Qi).outlet;return j.useMemo(()=>e&&j.createElement(vZ.Provider,{value:t},e),[e,t])}function SA(){let{matches:t}=j.useContext(Qi),e=t[t.length-1];return e?e.params:{}}function rf(t,{relative:e}={}){let{matches:n}=j.useContext(Qi),{pathname:r}=us(),i=JSON.stringify(pA(n));return j.useMemo(()=>xS(t,JSON.parse(i),r,e==="path"),[t,i,r,e])}function SZ(t,e){return wA(t,e)}function wA(t,e,n){var k;Xt(nf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=j.useContext(oi),{matches:i}=j.useContext(Qi),s=i[i.length-1],l=s?s.params:{},c=s?s.pathname:"/",u=s?s.pathnameBase:"/",f=s&&s.route;{let w=f&&f.path||"";jA(c,!f||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let p=us(),m;if(e){let w=typeof e=="string"?uu(e):e;Xt(u==="/"||((k=w.pathname)==null?void 0:k.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${w.pathname}" was given in the \`location\` prop.`),m=w}else m=p;let O=m.pathname||"/",x=O;if(u!=="/"){let w=u.replace(/^\//,"").split("/");x="/"+O.replace(/^\//,"").split("/").slice(w.length).join("/")}let v=dA(t,{pathname:x});ki(f||v!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),ki(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=CZ(v&&v.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:ns([u,r.encodeLocation?r.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?u:ns([u,r.encodeLocation?r.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),i,n);return e&&S?j.createElement(tf.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},S):S}function wZ(){let t=PZ(),e=oZ(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:s},"ErrorBoundary")," or"," ",j.createElement("code",{style:s},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},e),n?j.createElement("pre",{style:i},n):null,l)}var kZ=j.createElement(wZ,null),kA=class extends j.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=OZ(t.digest);n&&(t=n)}let e=t!==void 0?j.createElement(Qi.Provider,{value:this.props.routeContext},j.createElement(bS.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?j.createElement(jZ,{error:t},e):e}};kA.contextType=dZ;var ev=new WeakMap;function jZ({children:t,error:e}){let{basename:n}=j.useContext(oi);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=gZ(e.digest);if(r){let i=ev.get(e);if(i)throw i;let s=gA(r.location,n);if(mA&&!ev.get(e))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw ev.set(e,l),l}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function QZ({routeContext:t,match:e,children:n}){let r=j.useContext(du);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),j.createElement(Qi.Provider,{value:t},n)}function CZ(t,e=[],n){let r=n==null?void 0:n.state;if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let i=t,s=r==null?void 0:r.errors;if(s!=null){let p=i.findIndex(m=>m.route.id&&(s==null?void 0:s[m.route.id])!==void 0);Xt(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,p+1))}let l=!1,c=-1;if(n&&r){l=r.renderFallback;for(let p=0;p<i.length;p++){let m=i[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(c=p),m.route.id){let{loaderData:O,errors:x}=r,v=m.route.loader&&!O.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||v){n.isStatic&&(l=!0),c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}}let u=n==null?void 0:n.onError,f=r&&u?(p,m)=>{var O,x;u(p,{location:r.location,params:((x=(O=r.matches)==null?void 0:O[0])==null?void 0:x.params)??{},unstable_pattern:cZ(r.matches),errorInfo:m})}:void 0;return i.reduceRight((p,m,O)=>{let x,v=!1,S=null,k=null;r&&(x=s&&m.route.id?s[m.route.id]:void 0,S=m.route.errorElement||kZ,l&&(c<0&&O===0?(jA("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,k=null):c===O&&(v=!0,k=m.route.hydrateFallbackElement||null)));let w=e.concat(i.slice(0,O+1)),N=()=>{let C;return x?C=S:v?C=k:m.route.Component?C=j.createElement(m.route.Component,null):m.route.element?C=m.route.element:C=p,j.createElement(QZ,{match:m,routeContext:{outlet:p,matches:w,isDataRoute:r!=null},children:C})};return r&&(m.route.ErrorBoundary||m.route.errorElement||O===0)?j.createElement(kA,{location:r.location,revalidation:r.revalidation,component:S,error:x,children:N(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:f}):N()},null)}function vS(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function NZ(t){let e=j.useContext(du);return Xt(e,vS(t)),e}function TZ(t){let e=j.useContext(Fg);return Xt(e,vS(t)),e}function $Z(t){let e=j.useContext(Qi);return Xt(e,vS(t)),e}function yS(t){let e=$Z(t),n=e.matches[e.matches.length-1];return Xt(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function EZ(){return yS("useRouteId")}function PZ(){var r;let t=j.useContext(bS),e=TZ("useRouteError"),n=yS("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function AZ(){let{router:t}=NZ("useNavigate"),e=yS("useNavigate"),n=j.useRef(!1);return yA(()=>{n.current=!0}),j.useCallback(async(i,s={})=>{ki(n.current,vA),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...s}))},[t,e])}var fN={};function jA(t,e,n){!e&&!fN[t]&&(fN[t]=!0,ki(!1,n))}j.memo(RZ);function RZ({routes:t,future:e,state:n,isStatic:r,onError:i}){return wA(t,void 0,{state:n,isStatic:r,onError:i})}function _Z(t){return yZ(t.context)}function gn(t){Xt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function MZ({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:i,static:s=!1,unstable_useTransitions:l}){Xt(!nf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:c,navigator:i,static:s,unstable_useTransitions:l,future:{}}),[c,i,s,l]);typeof n=="string"&&(n=uu(n));let{pathname:f="/",search:p="",hash:m="",state:O=null,key:x="default",unstable_mask:v}=n,S=j.useMemo(()=>{let k=Vs(f,c);return k==null?null:{location:{pathname:k,search:p,hash:m,state:O,key:x,unstable_mask:v},navigationType:r}},[c,f,p,m,O,x,r,v]);return ki(S!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:j.createElement(oi.Provider,{value:u},j.createElement(tf.Provider,{children:e,value:S}))}function zZ({children:t,location:e}){return SZ(a0(t),e)}function a0(t,e=[]){let n=[];return j.Children.forEach(t,(r,i)=>{if(!j.isValidElement(r))return;let s=[...e,i];if(r.type===j.Fragment){n.push.apply(n,a0(r.props.children,s));return}Xt(r.type===gn,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Xt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=a0(r.props.children,s)),n.push(l)}),n}var jm="get",Qm="application/x-www-form-urlencoded";function Hg(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function DZ(t){return Hg(t)&&t.tagName.toLowerCase()==="button"}function LZ(t){return Hg(t)&&t.tagName.toLowerCase()==="form"}function XZ(t){return Hg(t)&&t.tagName.toLowerCase()==="input"}function ZZ(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function qZ(t,e){return t.button===0&&(!e||e==="_self")&&!ZZ(t)}function l0(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function IZ(t,e){let n=l0(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(s=>{n.append(i,s)})}),n}var Wp=null;function BZ(){if(Wp===null)try{new FormData(document.createElement("form"),0),Wp=!1}catch{Wp=!0}return Wp}var YZ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function tv(t){return t!=null&&!YZ.has(t)?(ki(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Qm}"`),null):t}function VZ(t,e){let n,r,i,s,l;if(LZ(t)){let c=t.getAttribute("action");r=c?Vs(c,e):null,n=t.getAttribute("method")||jm,i=tv(t.getAttribute("enctype"))||Qm,s=new FormData(t)}else if(DZ(t)||XZ(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=t.getAttribute("formaction")||c.getAttribute("action");if(r=u?Vs(u,e):null,n=t.getAttribute("formmethod")||c.getAttribute("method")||jm,i=tv(t.getAttribute("formenctype"))||tv(c.getAttribute("enctype"))||Qm,s=new FormData(c,t),!BZ()){let{name:f,type:p,value:m}=t;if(p==="image"){let O=f?`${f}.`:"";s.append(`${O}x`,"0"),s.append(`${O}y`,"0")}else f&&s.append(f,m)}}else{if(Hg(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=jm,r=null,i=Qm,l=t}return s&&i==="text/plain"&&(l=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function SS(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function UZ(t,e,n,r){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:e&&Vs(i.pathname,e)==="/"?i.pathname=`${e.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function WZ(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function GZ(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function FZ(t,e,n){let r=await Promise.all(t.map(async i=>{let s=e.routes[i.route.id];if(s){let l=await WZ(s,n);return l.links?l.links():[]}return[]}));return e6(r.flat(1).filter(GZ).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function pN(t,e,n,r,i,s){let l=(u,f)=>n[f]?u.route.id!==n[f].route.id:!0,c=(u,f)=>{var p;return n[f].pathname!==u.pathname||((p=n[f].route.path)==null?void 0:p.endsWith("*"))&&n[f].params["*"]!==u.params["*"]};return s==="assets"?e.filter((u,f)=>l(u,f)||c(u,f)):s==="data"?e.filter((u,f)=>{var m;let p=r.routes[u.route.id];if(!p||!p.hasLoader)return!1;if(l(u,f)||c(u,f))return!0;if(u.route.shouldRevalidate){let O=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof O=="boolean")return O}return!0}):[]}function HZ(t,e,{includeHydrateFallback:n}={}){return KZ(t.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function KZ(t){return[...new Set(t)]}function JZ(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function e6(t,e){let n=new Set;return new Set(e),t.reduce((r,i)=>{let s=JSON.stringify(JZ(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function QA(){let t=j.useContext(du);return SS(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function t6(){let t=j.useContext(Fg);return SS(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var wS=j.createContext(void 0);wS.displayName="FrameworkContext";function CA(){let t=j.useContext(wS);return SS(t,"You must render this element inside a <HydratedRouter> element"),t}function n6(t,e){let n=j.useContext(wS),[r,i]=j.useState(!1),[s,l]=j.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:f,onMouseLeave:p,onTouchStart:m}=e,O=j.useRef(null);j.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let S=w=>{w.forEach(N=>{l(N.isIntersecting)})},k=new IntersectionObserver(S,{threshold:.5});return O.current&&k.observe(O.current),()=>{k.disconnect()}}},[t]),j.useEffect(()=>{if(r){let S=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(S)}}},[r]);let x=()=>{i(!0)},v=()=>{i(!1),l(!1)};return n?t!=="intent"?[s,O,{}]:[s,O,{onFocus:vd(c,x),onBlur:vd(u,v),onMouseEnter:vd(f,x),onMouseLeave:vd(p,v),onTouchStart:vd(m,x)}]:[!1,O,{}]}function vd(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function r6({page:t,...e}){let{router:n}=QA(),r=j.useMemo(()=>dA(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?j.createElement(s6,{page:t,matches:r,...e}):null}function i6(t){let{manifest:e,routeModules:n}=CA(),[r,i]=j.useState([]);return j.useEffect(()=>{let s=!1;return FZ(t,e,n).then(l=>{s||i(l)}),()=>{s=!0}},[t,e,n]),r}function s6({page:t,matches:e,...n}){let r=us(),{future:i,manifest:s,routeModules:l}=CA(),{basename:c}=QA(),{loaderData:u,matches:f}=t6(),p=j.useMemo(()=>pN(t,e,f,s,r,"data"),[t,e,f,s,r]),m=j.useMemo(()=>pN(t,e,f,s,r,"assets"),[t,e,f,s,r]),O=j.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let S=new Set,k=!1;if(e.forEach(N=>{var E;let C=s.routes[N.route.id];!C||!C.hasLoader||(!p.some(M=>M.route.id===N.route.id)&&N.route.id in u&&((E=l[N.route.id])!=null&&E.shouldRevalidate)||C.hasClientLoader?k=!0:S.add(N.route.id))}),S.size===0)return[];let w=UZ(t,c,i.unstable_trailingSlashAwareDataRequests,"data");return k&&S.size>0&&w.searchParams.set("_routes",e.filter(N=>S.has(N.route.id)).map(N=>N.route.id).join(",")),[w.pathname+w.search]},[c,i.unstable_trailingSlashAwareDataRequests,u,r,s,p,e,t,l]),x=j.useMemo(()=>HZ(m,s),[m,s]),v=i6(m);return j.createElement(j.Fragment,null,O.map(S=>j.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),x.map(S=>j.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),v.map(({key:S,link:k})=>j.createElement("link",{key:S,nonce:n.nonce,...k,crossOrigin:k.crossOrigin??n.crossOrigin})))}function a6(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var l6=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{l6&&(window.__reactRouterVersion="7.13.1")}catch{}function o6({basename:t,children:e,unstable_useTransitions:n,window:r}){let i=j.useRef();i.current==null&&(i.current=DX({window:r,v5Compat:!0}));let s=i.current,[l,c]=j.useState({action:s.action,location:s.location}),u=j.useCallback(f=>{n===!1?c(f):j.startTransition(()=>c(f))},[n]);return j.useLayoutEffect(()=>s.listen(u),[s,u]),j.createElement(MZ,{basename:t,children:e,location:l.location,navigationType:l.action,navigator:s,unstable_useTransitions:n})}var NA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zt=j.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:l,unstable_mask:c,state:u,target:f,to:p,preventScrollReset:m,viewTransition:O,unstable_defaultShouldRevalidate:x,...v},S){let{basename:k,navigator:w,unstable_useTransitions:N}=j.useContext(oi),C=typeof p=="string"&&NA.test(p),E=gA(p,k);p=E.to;let M=xZ(p,{relative:i}),R=us(),_=null;if(c){let B=xS(c,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);k!=="/"&&(B.pathname=B.pathname==="/"?k:ns([k,B.pathname])),_=w.createHref(B)}let[V,G,D]=n6(r,v),L=d6(p,{replace:l,unstable_mask:c,state:u,target:f,preventScrollReset:m,relative:i,viewTransition:O,unstable_defaultShouldRevalidate:x,unstable_useTransitions:N});function Z(B){e&&e(B),B.defaultPrevented||L(B)}let te=!(E.isExternal||s),I=j.createElement("a",{...v,...D,href:(te?_:void 0)||E.absoluteURL||M,onClick:te?Z:e,ref:a6(S,G),target:f,"data-discover":!C&&n==="render"?"true":void 0});return V&&!C?j.createElement(j.Fragment,null,I,j.createElement(r6,{page:M})):I});zt.displayName="Link";var kS=j.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:l,viewTransition:c,children:u,...f},p){let m=rf(l,{relative:f.relative}),O=us(),x=j.useContext(Fg),{navigator:v,basename:S}=j.useContext(oi),k=x!=null&&O6(m)&&c===!0,w=v.encodeLocation?v.encodeLocation(m).pathname:m.pathname,N=O.pathname,C=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(N=N.toLowerCase(),C=C?C.toLowerCase():null,w=w.toLowerCase()),C&&S&&(C=Vs(C,S)||C);const E=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let M=N===w||!i&&N.startsWith(w)&&N.charAt(E)==="/",R=C!=null&&(C===w||!i&&C.startsWith(w)&&C.charAt(w.length)==="/"),_={isActive:M,isPending:R,isTransitioning:k},V=M?e:void 0,G;typeof r=="function"?G=r(_):G=[r,M?"active":null,R?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let D=typeof s=="function"?s(_):s;return j.createElement(zt,{...f,"aria-current":V,className:G,ref:p,style:D,to:l,viewTransition:c},typeof u=="function"?u(_):u)});kS.displayName="NavLink";var c6=j.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:i,state:s,method:l=jm,action:c,onSubmit:u,relative:f,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:O,...x},v)=>{let{unstable_useTransitions:S}=j.useContext(oi),k=m6(),w=g6(c,{relative:f}),N=l.toLowerCase()==="get"?"get":"post",C=typeof c=="string"&&NA.test(c),E=M=>{if(u&&u(M),M.defaultPrevented)return;M.preventDefault();let R=M.nativeEvent.submitter,_=(R==null?void 0:R.getAttribute("formmethod"))||l,V=()=>k(R||M.currentTarget,{fetcherKey:e,method:_,navigate:n,replace:i,state:s,relative:f,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:O});S&&n!==!1?j.startTransition(()=>V()):V()};return j.createElement("form",{ref:v,method:N,action:w,onSubmit:r?u:E,...x,"data-discover":!C&&t==="render"?"true":void 0})});c6.displayName="Form";function u6(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function TA(t){let e=j.useContext(du);return Xt(e,u6(t)),e}function d6(t,{target:e,replace:n,unstable_mask:r,state:i,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:u,unstable_useTransitions:f}={}){let p=ds(),m=us(),O=rf(t,{relative:l});return j.useCallback(x=>{if(qZ(x,e)){x.preventDefault();let v=n!==void 0?n:mh(m)===mh(O),S=()=>p(t,{replace:v,unstable_mask:r,state:i,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:u});f?j.startTransition(()=>S()):S()}},[m,p,O,n,r,i,e,t,s,l,c,u,f])}function h6(t){ki(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=j.useRef(l0(t)),n=j.useRef(!1),r=us(),i=j.useMemo(()=>IZ(r.search,n.current?null:e.current),[r.search]),s=ds(),l=j.useCallback((c,u)=>{const f=l0(typeof c=="function"?c(new URLSearchParams(i)):c);n.current=!0,s("?"+f,u)},[s,i]);return[i,l]}var f6=0,p6=()=>`__${String(++f6)}__`;function m6(){let{router:t}=TA("useSubmit"),{basename:e}=j.useContext(oi),n=EZ(),r=t.fetch,i=t.navigate;return j.useCallback(async(s,l={})=>{let{action:c,method:u,encType:f,formData:p,body:m}=VZ(s,e);if(l.navigate===!1){let O=l.fetcherKey||p6();await r(O,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:m,formMethod:l.method||u,formEncType:l.encType||f,flushSync:l.flushSync})}else await i(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:m,formMethod:l.method||u,formEncType:l.encType||f,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,i,e,n])}function g6(t,{relative:e}={}){let{basename:n}=j.useContext(oi),r=j.useContext(Qi);Xt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...rf(t||".",{relative:e})},l=us();if(t==null){s.search=l.search;let c=new URLSearchParams(s.search),u=c.getAll("index");if(u.some(p=>p==="")){c.delete("index"),u.filter(m=>m).forEach(m=>c.append("index",m));let p=c.toString();s.search=p?`?${p}`:""}}return(!t||t===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:ns([n,s.pathname])),mh(s)}function O6(t,{relative:e}={}){let n=j.useContext(xA);Xt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=TA("useViewTransitionState"),i=rf(t,{relative:e});if(!n.isTransitioning)return!1;let s=Vs(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Vs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Fm(i.pathname,l)!=null||Fm(i.pathname,s)!=null}var x6=uA(),sf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Il,za,Pc,eA,b6=(eA=class extends sf{constructor(){super();Ee(this,Il);Ee(this,za);Ee(this,Pc);Se(this,Pc,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){H(this,za)||this.setEventListener(H(this,Pc))}onUnsubscribe(){var e;this.hasListeners()||((e=H(this,za))==null||e.call(this),Se(this,za,void 0))}setEventListener(e){var n;Se(this,Pc,e),(n=H(this,za))==null||n.call(this),Se(this,za,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){H(this,Il)!==e&&(Se(this,Il,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof H(this,Il)=="boolean"?H(this,Il):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Il=new WeakMap,za=new WeakMap,Pc=new WeakMap,eA),jS=new b6,v6={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Da,gS,tA,y6=(tA=class{constructor(){Ee(this,Da,v6);Ee(this,gS,!1)}setTimeoutProvider(t){Se(this,Da,t)}setTimeout(t,e){return H(this,Da).setTimeout(t,e)}clearTimeout(t){H(this,Da).clearTimeout(t)}setInterval(t,e){return H(this,Da).setInterval(t,e)}clearInterval(t){H(this,Da).clearInterval(t)}},Da=new WeakMap,gS=new WeakMap,tA),Dl=new y6;function S6(t){setTimeout(t,0)}var w6=typeof window>"u"||"Deno"in globalThis;function hr(){}function k6(t,e){return typeof t=="function"?t(e):t}function o0(t){return typeof t=="number"&&t>=0&&t!==1/0}function $A(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Wa(t,e){return typeof t=="function"?t(e):t}function Fr(t,e){return typeof t=="function"?t(e):t}function mN(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:c}=t;if(l){if(r){if(e.queryHash!==QS(l,e.options))return!1}else if(!Oh(e.queryKey,l))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||i&&i!==e.state.fetchStatus||s&&!s(e))}function gN(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(gh(e.options.mutationKey)!==gh(s))return!1}else if(!Oh(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function QS(t,e){return((e==null?void 0:e.queryKeyHashFn)||gh)(t)}function gh(t){return JSON.stringify(t,(e,n)=>u0(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Oh(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Oh(t[n],e[n])):!1}var j6=Object.prototype.hasOwnProperty;function EA(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=ON(t)&&ON(e);if(!r&&!(u0(t)&&u0(e)))return e;const s=(r?t:Object.keys(t)).length,l=r?e:Object.keys(e),c=l.length,u=r?new Array(c):{};let f=0;for(let p=0;p<c;p++){const m=r?p:l[p],O=t[m],x=e[m];if(O===x){u[m]=O,(r?p<s:j6.call(t,m))&&f++;continue}if(O===null||x===null||typeof O!="object"||typeof x!="object"){u[m]=x;continue}const v=EA(O,x,n+1);u[m]=v,v===O&&f++}return s===c&&f===s?t:u}function c0(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function ON(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function u0(t){if(!xN(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!xN(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function xN(t){return Object.prototype.toString.call(t)==="[object Object]"}function Q6(t){return new Promise(e=>{Dl.setTimeout(e,t)})}function d0(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?EA(t,e):e}function C6(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function N6(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var CS=Symbol();function PA(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===CS?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function AA(t,e){return typeof t=="function"?t(...e):!!t}function T6(t,e,n){let r=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),t}var xh=(()=>{let t=()=>w6;return{isServer(){return t()},setIsServer(e){t=e}}})();function h0(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}var $6=S6;function E6(){let t=[],e=0,n=c=>{c()},r=c=>{c()},i=$6;const s=c=>{e?t.push(c):i(()=>{n(c)})},l=()=>{const c=t;t=[],c.length&&i(()=>{r(()=>{c.forEach(u=>{n(u)})})})};return{batch:c=>{let u;e++;try{u=c()}finally{e--,e||l()}return u},batchCalls:c=>(...u)=>{s(()=>{c(...u)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var Cn=E6(),Ac,La,Rc,nA,P6=(nA=class extends sf{constructor(){super();Ee(this,Ac,!0);Ee(this,La);Ee(this,Rc);Se(this,Rc,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){H(this,La)||this.setEventListener(H(this,Rc))}onUnsubscribe(){var e;this.hasListeners()||((e=H(this,La))==null||e.call(this),Se(this,La,void 0))}setEventListener(e){var n;Se(this,Rc,e),(n=H(this,La))==null||n.call(this),Se(this,La,e(this.setOnline.bind(this)))}setOnline(e){H(this,Ac)!==e&&(Se(this,Ac,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return H(this,Ac)}},Ac=new WeakMap,La=new WeakMap,Rc=new WeakMap,nA),Hm=new P6;function A6(t){return Math.min(1e3*2**t,3e4)}function RA(t){return(t??"online")==="online"?Hm.isOnline():!0}var f0=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function _A(t){let e=!1,n=0,r;const i=h0(),s=()=>i.status!=="pending",l=S=>{var k;if(!s()){const w=new f0(S);O(w),(k=t.onCancel)==null||k.call(t,w)}},c=()=>{e=!0},u=()=>{e=!1},f=()=>jS.isFocused()&&(t.networkMode==="always"||Hm.isOnline())&&t.canRun(),p=()=>RA(t.networkMode)&&t.canRun(),m=S=>{s()||(r==null||r(),i.resolve(S))},O=S=>{s()||(r==null||r(),i.reject(S))},x=()=>new Promise(S=>{var k;r=w=>{(s()||f())&&S(w)},(k=t.onPause)==null||k.call(t)}).then(()=>{var S;r=void 0,s()||(S=t.onContinue)==null||S.call(t)}),v=()=>{if(s())return;let S;const k=n===0?t.initialPromise:void 0;try{S=k??t.fn()}catch(w){S=Promise.reject(w)}Promise.resolve(S).then(m).catch(w=>{var R;if(s())return;const N=t.retry??(xh.isServer()?0:3),C=t.retryDelay??A6,E=typeof C=="function"?C(n,w):C,M=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,w);if(e||!M){O(w);return}n++,(R=t.onFail)==null||R.call(t,n,w),Q6(E).then(()=>f()?void 0:x()).then(()=>{e?O(w):v()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r==null||r(),i),cancelRetry:c,continueRetry:u,canStart:p,start:()=>(p()?v():x().then(v),i)}}var Bl,rA,MA=(rA=class{constructor(){Ee(this,Bl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),o0(this.gcTime)&&Se(this,Bl,Dl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(xh.isServer()?1/0:300*1e3))}clearGcTimeout(){H(this,Bl)&&(Dl.clearTimeout(H(this,Bl)),Se(this,Bl,void 0))}},Bl=new WeakMap,rA),Yl,_c,Gr,Vl,On,Fh,Ul,_r,zA,Rs,iA,R6=(iA=class extends MA{constructor(e){super();Ee(this,_r);Ee(this,Yl);Ee(this,_c);Ee(this,Gr);Ee(this,Vl);Ee(this,On);Ee(this,Fh);Ee(this,Ul);Se(this,Ul,!1),Se(this,Fh,e.defaultOptions),this.setOptions(e.options),this.observers=[],Se(this,Vl,e.client),Se(this,Gr,H(this,Vl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Se(this,Yl,vN(this.options)),this.state=e.state??H(this,Yl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=H(this,On))==null?void 0:e.promise}setOptions(e){if(this.options={...H(this,Fh),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=vN(this.options);n.data!==void 0&&(this.setState(bN(n.data,n.dataUpdatedAt)),Se(this,Yl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&H(this,Gr).remove(this)}setData(e,n){const r=d0(this.state.data,e,this.options);return Ge(this,_r,Rs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Ge(this,_r,Rs).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=H(this,On))==null?void 0:r.promise;return(i=H(this,On))==null||i.cancel(e),n?n.then(hr).catch(hr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return H(this,Yl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Fr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===CS||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Wa(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!$A(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=H(this,On))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=H(this,On))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),H(this,Gr).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(H(this,On)&&(H(this,Ul)||Ge(this,_r,zA).call(this)?H(this,On).cancel({revert:!0}):H(this,On).cancelRetry()),this.scheduleGc()),H(this,Gr).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ge(this,_r,Rs).call(this,{type:"invalidate"})}async fetch(e,n){var u,f,p,m,O,x,v,S,k,w,N,C;if(this.state.fetchStatus!=="idle"&&((u=H(this,On))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(H(this,On))return H(this,On).continueRetry(),H(this,On).promise}if(e&&this.setOptions(e),!this.options.queryFn){const E=this.observers.find(M=>M.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,i=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Se(this,Ul,!0),r.signal)})},s=()=>{const E=PA(this.options,n),R=(()=>{const _={client:H(this,Vl),queryKey:this.queryKey,meta:this.meta};return i(_),_})();return Se(this,Ul,!1),this.options.persister?this.options.persister(E,R,this):E(R)},c=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:H(this,Vl),state:this.state,fetchFn:s};return i(E),E})();(f=this.options.behavior)==null||f.onFetch(c,this),Se(this,_c,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=c.fetchOptions)==null?void 0:p.meta))&&Ge(this,_r,Rs).call(this,{type:"fetch",meta:(m=c.fetchOptions)==null?void 0:m.meta}),Se(this,On,_A({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:E=>{E instanceof f0&&E.revert&&this.setState({...H(this,_c),fetchStatus:"idle"}),r.abort()},onFail:(E,M)=>{Ge(this,_r,Rs).call(this,{type:"failed",failureCount:E,error:M})},onPause:()=>{Ge(this,_r,Rs).call(this,{type:"pause"})},onContinue:()=>{Ge(this,_r,Rs).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const E=await H(this,On).start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(O=H(this,Gr).config).onSuccess)==null||x.call(O,E,this),(S=(v=H(this,Gr).config).onSettled)==null||S.call(v,E,this.state.error,this),E}catch(E){if(E instanceof f0){if(E.silent)return H(this,On).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw Ge(this,_r,Rs).call(this,{type:"error",error:E}),(w=(k=H(this,Gr).config).onError)==null||w.call(k,E,this),(C=(N=H(this,Gr).config).onSettled)==null||C.call(N,this.state.data,E,this),E}finally{this.scheduleGc()}}},Yl=new WeakMap,_c=new WeakMap,Gr=new WeakMap,Vl=new WeakMap,On=new WeakMap,Fh=new WeakMap,Ul=new WeakMap,_r=new WeakSet,zA=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Rs=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...DA(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...bN(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Se(this,_c,e.manual?i:void 0),i;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Cn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),H(this,Gr).notify({query:this,type:"updated",action:e})})},iA);function DA(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:RA(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function bN(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vN(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ur,He,Hh,Bn,Wl,Mc,Ms,Xa,Kh,zc,Dc,Gl,Fl,Za,Lc,ht,Md,p0,m0,g0,O0,x0,b0,v0,LA,sA,_6=(sA=class extends sf{constructor(e,n){super();Ee(this,ht);Ee(this,ur);Ee(this,He);Ee(this,Hh);Ee(this,Bn);Ee(this,Wl);Ee(this,Mc);Ee(this,Ms);Ee(this,Xa);Ee(this,Kh);Ee(this,zc);Ee(this,Dc);Ee(this,Gl);Ee(this,Fl);Ee(this,Za);Ee(this,Lc,new Set);this.options=n,Se(this,ur,e),Se(this,Xa,null),Se(this,Ms,h0()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(H(this,He).addObserver(this),yN(H(this,He),this.options)?Ge(this,ht,Md).call(this):this.updateResult(),Ge(this,ht,O0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return y0(H(this,He),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return y0(H(this,He),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ge(this,ht,x0).call(this),Ge(this,ht,b0).call(this),H(this,He).removeObserver(this)}setOptions(e){const n=this.options,r=H(this,He);if(this.options=H(this,ur).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Fr(this.options.enabled,H(this,He))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ge(this,ht,v0).call(this),H(this,He).setOptions(this.options),n._defaulted&&!c0(this.options,n)&&H(this,ur).getQueryCache().notify({type:"observerOptionsUpdated",query:H(this,He),observer:this});const i=this.hasListeners();i&&SN(H(this,He),r,this.options,n)&&Ge(this,ht,Md).call(this),this.updateResult(),i&&(H(this,He)!==r||Fr(this.options.enabled,H(this,He))!==Fr(n.enabled,H(this,He))||Wa(this.options.staleTime,H(this,He))!==Wa(n.staleTime,H(this,He)))&&Ge(this,ht,p0).call(this);const s=Ge(this,ht,m0).call(this);i&&(H(this,He)!==r||Fr(this.options.enabled,H(this,He))!==Fr(n.enabled,H(this,He))||s!==H(this,Za))&&Ge(this,ht,g0).call(this,s)}getOptimisticResult(e){const n=H(this,ur).getQueryCache().build(H(this,ur),e),r=this.createResult(n,e);return z6(this,r)&&(Se(this,Bn,r),Se(this,Mc,this.options),Se(this,Wl,H(this,He).state)),r}getCurrentResult(){return H(this,Bn)}trackResult(e,n){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&H(this,Ms).status==="pending"&&H(this,Ms).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){H(this,Lc).add(e)}getCurrentQuery(){return H(this,He)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=H(this,ur).defaultQueryOptions(e),r=H(this,ur).getQueryCache().build(H(this,ur),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Ge(this,ht,Md).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),H(this,Bn)))}createResult(e,n){var G;const r=H(this,He),i=this.options,s=H(this,Bn),l=H(this,Wl),c=H(this,Mc),f=e!==r?e.state:H(this,Hh),{state:p}=e;let m={...p},O=!1,x;if(n._optimisticResults){const D=this.hasListeners(),L=!D&&yN(e,n),Z=D&&SN(e,r,n,i);(L||Z)&&(m={...m,...DA(p.data,e.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:v,errorUpdatedAt:S,status:k}=m;x=m.data;let w=!1;if(n.placeholderData!==void 0&&x===void 0&&k==="pending"){let D;s!=null&&s.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(D=s.data,w=!0):D=typeof n.placeholderData=="function"?n.placeholderData((G=H(this,Dc))==null?void 0:G.state.data,H(this,Dc)):n.placeholderData,D!==void 0&&(k="success",x=d0(s==null?void 0:s.data,D,n),O=!0)}if(n.select&&x!==void 0&&!w)if(s&&x===(l==null?void 0:l.data)&&n.select===H(this,Kh))x=H(this,zc);else try{Se(this,Kh,n.select),x=n.select(x),x=d0(s==null?void 0:s.data,x,n),Se(this,zc,x),Se(this,Xa,null)}catch(D){Se(this,Xa,D)}H(this,Xa)&&(v=H(this,Xa),x=H(this,zc),S=Date.now(),k="error");const N=m.fetchStatus==="fetching",C=k==="pending",E=k==="error",M=C&&N,R=x!==void 0,V={status:k,fetchStatus:m.fetchStatus,isPending:C,isSuccess:k==="success",isError:E,isInitialLoading:M,isLoading:M,data:x,dataUpdatedAt:m.dataUpdatedAt,error:v,errorUpdatedAt:S,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:N,isRefetching:N&&!C,isLoadingError:E&&!R,isPaused:m.fetchStatus==="paused",isPlaceholderData:O,isRefetchError:E&&R,isStale:NS(e,n),refetch:this.refetch,promise:H(this,Ms),isEnabled:Fr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const D=V.data!==void 0,L=V.status==="error"&&!D,Z=B=>{L?B.reject(V.error):D&&B.resolve(V.data)},te=()=>{const B=Se(this,Ms,V.promise=h0());Z(B)},I=H(this,Ms);switch(I.status){case"pending":e.queryHash===r.queryHash&&Z(I);break;case"fulfilled":(L||V.data!==I.value)&&te();break;case"rejected":(!L||V.error!==I.reason)&&te();break}}return V}updateResult(){const e=H(this,Bn),n=this.createResult(H(this,He),this.options);if(Se(this,Wl,H(this,He).state),Se(this,Mc,this.options),H(this,Wl).data!==void 0&&Se(this,Dc,H(this,He)),c0(n,e))return;Se(this,Bn,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!H(this,Lc).size)return!0;const l=new Set(s??H(this,Lc));return this.options.throwOnError&&l.add("error"),Object.keys(H(this,Bn)).some(c=>{const u=c;return H(this,Bn)[u]!==e[u]&&l.has(u)})};Ge(this,ht,LA).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ge(this,ht,O0).call(this)}},ur=new WeakMap,He=new WeakMap,Hh=new WeakMap,Bn=new WeakMap,Wl=new WeakMap,Mc=new WeakMap,Ms=new WeakMap,Xa=new WeakMap,Kh=new WeakMap,zc=new WeakMap,Dc=new WeakMap,Gl=new WeakMap,Fl=new WeakMap,Za=new WeakMap,Lc=new WeakMap,ht=new WeakSet,Md=function(e){Ge(this,ht,v0).call(this);let n=H(this,He).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(hr)),n},p0=function(){Ge(this,ht,x0).call(this);const e=Wa(this.options.staleTime,H(this,He));if(xh.isServer()||H(this,Bn).isStale||!o0(e))return;const r=$A(H(this,Bn).dataUpdatedAt,e)+1;Se(this,Gl,Dl.setTimeout(()=>{H(this,Bn).isStale||this.updateResult()},r))},m0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(H(this,He)):this.options.refetchInterval)??!1},g0=function(e){Ge(this,ht,b0).call(this),Se(this,Za,e),!(xh.isServer()||Fr(this.options.enabled,H(this,He))===!1||!o0(H(this,Za))||H(this,Za)===0)&&Se(this,Fl,Dl.setInterval(()=>{(this.options.refetchIntervalInBackground||jS.isFocused())&&Ge(this,ht,Md).call(this)},H(this,Za)))},O0=function(){Ge(this,ht,p0).call(this),Ge(this,ht,g0).call(this,Ge(this,ht,m0).call(this))},x0=function(){H(this,Gl)&&(Dl.clearTimeout(H(this,Gl)),Se(this,Gl,void 0))},b0=function(){H(this,Fl)&&(Dl.clearInterval(H(this,Fl)),Se(this,Fl,void 0))},v0=function(){const e=H(this,ur).getQueryCache().build(H(this,ur),this.options);if(e===H(this,He))return;const n=H(this,He);Se(this,He,e),Se(this,Hh,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},LA=function(e){Cn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(H(this,Bn))}),H(this,ur).getQueryCache().notify({query:H(this,He),type:"observerResultsUpdated"})})},sA);function M6(t,e){return Fr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function yN(t,e){return M6(t,e)||t.state.data!==void 0&&y0(t,e,e.refetchOnMount)}function y0(t,e,n){if(Fr(e.enabled,t)!==!1&&Wa(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&NS(t,e)}return!1}function SN(t,e,n,r){return(t!==e||Fr(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&NS(t,n)}function NS(t,e){return Fr(e.enabled,t)!==!1&&t.isStaleByTime(Wa(e.staleTime,t))}function z6(t,e){return!c0(t.getCurrentResult(),e)}function wN(t){return{onFetch:(e,n)=>{var p,m,O,x,v;const r=e.options,i=(O=(m=(p=e.fetchOptions)==null?void 0:p.meta)==null?void 0:m.fetchMore)==null?void 0:O.direction,s=((x=e.state.data)==null?void 0:x.pages)||[],l=((v=e.state.data)==null?void 0:v.pageParams)||[];let c={pages:[],pageParams:[]},u=0;const f=async()=>{let S=!1;const k=C=>{T6(C,()=>e.signal,()=>S=!0)},w=PA(e.options,e.fetchOptions),N=async(C,E,M)=>{if(S)return Promise.reject();if(E==null&&C.pages.length)return Promise.resolve(C);const _=(()=>{const L={client:e.client,queryKey:e.queryKey,pageParam:E,direction:M?"backward":"forward",meta:e.options.meta};return k(L),L})(),V=await w(_),{maxPages:G}=e.options,D=M?N6:C6;return{pages:D(C.pages,V,G),pageParams:D(C.pageParams,E,G)}};if(i&&s.length){const C=i==="backward",E=C?D6:kN,M={pages:s,pageParams:l},R=E(r,M);c=await N(M,R,C)}else{const C=t??s.length;do{const E=u===0?l[0]??r.initialPageParam:kN(r,c);if(u>0&&E==null)break;c=await N(c,E),u++}while(u<C)}return c};e.options.persister?e.fetchFn=()=>{var S,k;return(k=(S=e.options).persister)==null?void 0:k.call(S,f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=f}}}function kN(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function D6(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Jh,Yi,Pn,Hl,Vi,$a,aA,L6=(aA=class extends MA{constructor(e){super();Ee(this,Vi);Ee(this,Jh);Ee(this,Yi);Ee(this,Pn);Ee(this,Hl);Se(this,Jh,e.client),this.mutationId=e.mutationId,Se(this,Pn,e.mutationCache),Se(this,Yi,[]),this.state=e.state||X6(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){H(this,Yi).includes(e)||(H(this,Yi).push(e),this.clearGcTimeout(),H(this,Pn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Se(this,Yi,H(this,Yi).filter(n=>n!==e)),this.scheduleGc(),H(this,Pn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){H(this,Yi).length||(this.state.status==="pending"?this.scheduleGc():H(this,Pn).remove(this))}continue(){var e;return((e=H(this,Hl))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var l,c,u,f,p,m,O,x,v,S,k,w,N,C,E,M,R,_;const n=()=>{Ge(this,Vi,$a).call(this,{type:"continue"})},r={client:H(this,Jh),meta:this.options.meta,mutationKey:this.options.mutationKey};Se(this,Hl,_A({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(V,G)=>{Ge(this,Vi,$a).call(this,{type:"failed",failureCount:V,error:G})},onPause:()=>{Ge(this,Vi,$a).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>H(this,Pn).canRun(this)}));const i=this.state.status==="pending",s=!H(this,Hl).canStart();try{if(i)n();else{Ge(this,Vi,$a).call(this,{type:"pending",variables:e,isPaused:s}),H(this,Pn).config.onMutate&&await H(this,Pn).config.onMutate(e,this,r);const G=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,e,r));G!==this.state.context&&Ge(this,Vi,$a).call(this,{type:"pending",context:G,variables:e,isPaused:s})}const V=await H(this,Hl).start();return await((f=(u=H(this,Pn).config).onSuccess)==null?void 0:f.call(u,V,e,this.state.context,this,r)),await((m=(p=this.options).onSuccess)==null?void 0:m.call(p,V,e,this.state.context,r)),await((x=(O=H(this,Pn).config).onSettled)==null?void 0:x.call(O,V,null,this.state.variables,this.state.context,this,r)),await((S=(v=this.options).onSettled)==null?void 0:S.call(v,V,null,e,this.state.context,r)),Ge(this,Vi,$a).call(this,{type:"success",data:V}),V}catch(V){try{await((w=(k=H(this,Pn).config).onError)==null?void 0:w.call(k,V,e,this.state.context,this,r))}catch(G){Promise.reject(G)}try{await((C=(N=this.options).onError)==null?void 0:C.call(N,V,e,this.state.context,r))}catch(G){Promise.reject(G)}try{await((M=(E=H(this,Pn).config).onSettled)==null?void 0:M.call(E,void 0,V,this.state.variables,this.state.context,this,r))}catch(G){Promise.reject(G)}try{await((_=(R=this.options).onSettled)==null?void 0:_.call(R,void 0,V,e,this.state.context,r))}catch(G){Promise.reject(G)}throw Ge(this,Vi,$a).call(this,{type:"error",error:V}),V}finally{H(this,Pn).runNext(this)}}},Jh=new WeakMap,Yi=new WeakMap,Pn=new WeakMap,Hl=new WeakMap,Vi=new WeakSet,$a=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Cn.batch(()=>{H(this,Yi).forEach(r=>{r.onMutationUpdate(e)}),H(this,Pn).notify({mutation:this,type:"updated",action:e})})},aA);function X6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zs,Oi,ef,lA,Z6=(lA=class extends sf{constructor(e={}){super();Ee(this,zs);Ee(this,Oi);Ee(this,ef);this.config=e,Se(this,zs,new Set),Se(this,Oi,new Map),Se(this,ef,0)}build(e,n,r){const i=new L6({client:e,mutationCache:this,mutationId:++Vp(this,ef)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){H(this,zs).add(e);const n=Gp(e);if(typeof n=="string"){const r=H(this,Oi).get(n);r?r.push(e):H(this,Oi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(H(this,zs).delete(e)){const n=Gp(e);if(typeof n=="string"){const r=H(this,Oi).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&H(this,Oi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Gp(e);if(typeof n=="string"){const r=H(this,Oi).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=Gp(e);if(typeof n=="string"){const i=(r=H(this,Oi).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Cn.batch(()=>{H(this,zs).forEach(e=>{this.notify({type:"removed",mutation:e})}),H(this,zs).clear(),H(this,Oi).clear()})}getAll(){return Array.from(H(this,zs))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>gN(n,r))}findAll(e={}){return this.getAll().filter(n=>gN(e,n))}notify(e){Cn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Cn.batch(()=>Promise.all(e.map(n=>n.continue().catch(hr))))}},zs=new WeakMap,Oi=new WeakMap,ef=new WeakMap,lA);function Gp(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Ui,oA,q6=(oA=class extends sf{constructor(e={}){super();Ee(this,Ui);this.config=e,Se(this,Ui,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??QS(i,n);let l=this.get(s);return l||(l=new R6({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){H(this,Ui).has(e.queryHash)||(H(this,Ui).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=H(this,Ui).get(e.queryHash);n&&(e.destroy(),n===e&&H(this,Ui).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Cn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return H(this,Ui).get(e)}getAll(){return[...H(this,Ui).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>mN(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>mN(e,r)):n}notify(e){Cn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Cn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Cn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ui=new WeakMap,oA),It,qa,Ia,Xc,Zc,Ba,qc,Ic,cA,I6=(cA=class{constructor(t={}){Ee(this,It);Ee(this,qa);Ee(this,Ia);Ee(this,Xc);Ee(this,Zc);Ee(this,Ba);Ee(this,qc);Ee(this,Ic);Se(this,It,t.queryCache||new q6),Se(this,qa,t.mutationCache||new Z6),Se(this,Ia,t.defaultOptions||{}),Se(this,Xc,new Map),Se(this,Zc,new Map),Se(this,Ba,0)}mount(){Vp(this,Ba)._++,H(this,Ba)===1&&(Se(this,qc,jS.subscribe(async t=>{t&&(await this.resumePausedMutations(),H(this,It).onFocus())})),Se(this,Ic,Hm.subscribe(async t=>{t&&(await this.resumePausedMutations(),H(this,It).onOnline())})))}unmount(){var t,e;Vp(this,Ba)._--,H(this,Ba)===0&&((t=H(this,qc))==null||t.call(this),Se(this,qc,void 0),(e=H(this,Ic))==null||e.call(this),Se(this,Ic,void 0))}isFetching(t){return H(this,It).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return H(this,qa).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=H(this,It).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=H(this,It).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Wa(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return H(this,It).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=H(this,It).get(r.queryHash),s=i==null?void 0:i.state.data,l=k6(e,s);if(l!==void 0)return H(this,It).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(t,e,n){return Cn.batch(()=>H(this,It).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=H(this,It).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=H(this,It);Cn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=H(this,It);return Cn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Cn.batch(()=>H(this,It).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(hr).catch(hr)}invalidateQueries(t,e={}){return Cn.batch(()=>(H(this,It).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Cn.batch(()=>H(this,It).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(hr)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(hr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=H(this,It).build(this,e);return n.isStaleByTime(Wa(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(hr).catch(hr)}fetchInfiniteQuery(t){return t.behavior=wN(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(hr).catch(hr)}ensureInfiniteQueryData(t){return t.behavior=wN(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Hm.isOnline()?H(this,qa).resumePausedMutations():Promise.resolve()}getQueryCache(){return H(this,It)}getMutationCache(){return H(this,qa)}getDefaultOptions(){return H(this,Ia)}setDefaultOptions(t){Se(this,Ia,t)}setQueryDefaults(t,e){H(this,Xc).set(gh(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...H(this,Xc).values()],n={};return e.forEach(r=>{Oh(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){H(this,Zc).set(gh(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...H(this,Zc).values()],n={};return e.forEach(r=>{Oh(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...H(this,Ia).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=QS(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===CS&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...H(this,Ia).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){H(this,It).clear(),H(this,qa).clear()}},It=new WeakMap,qa=new WeakMap,Ia=new WeakMap,Xc=new WeakMap,Zc=new WeakMap,Ba=new WeakMap,qc=new WeakMap,Ic=new WeakMap,cA),XA=j.createContext(void 0),tl=t=>{const e=j.useContext(XA);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},B6=({client:t,children:e})=>(j.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),d.jsx(XA.Provider,{value:t,children:e})),ZA=j.createContext(!1),Y6=()=>j.useContext(ZA);ZA.Provider;function V6(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var U6=j.createContext(V6()),W6=()=>j.useContext(U6),G6=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?AA(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},F6=t=>{j.useEffect(()=>{t.clearReset()},[t])},H6=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||AA(n,[t.error,r])),K6=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},J6=(t,e)=>t.isLoading&&t.isFetching&&!e,eq=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,jN=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function tq(t,e,n){var O,x,v,S;const r=Y6(),i=W6(),s=tl(),l=s.defaultQueryOptions(t);(x=(O=s.getDefaultOptions().queries)==null?void 0:O._experimental_beforeQuery)==null||x.call(O,l);const c=s.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",K6(l),G6(l,i,c),F6(i);const u=!s.getQueryCache().get(l.queryHash),[f]=j.useState(()=>new e(s,l)),p=f.getOptimisticResult(l),m=!r&&t.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(k=>{const w=m?f.subscribe(Cn.batchCalls(k)):hr;return f.updateResult(),w},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),j.useEffect(()=>{f.setOptions(l)},[l,f]),eq(l,p))throw jN(l,f,i);if(H6({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw p.error;if((S=(v=s.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||S.call(v,l,p),l.experimental_prefetchInRender&&!xh.isServer()&&J6(p,r)){const k=u?jN(l,f,i):c==null?void 0:c.promise;k==null||k.catch(hr).finally(()=>{f.updateResult()})}return l.notifyOnChangeProps?p:f.trackResult(p)}function Hs(t,e){return tq(t,_6)}const qA=j.createContext({notifications:[],notify:()=>{},dismiss:()=>{}});function co(){return j.useContext(qA)}let nq=0;function rq({children:t}){const[e,n]=j.useState([]),r=j.useCallback(s=>{n(l=>l.filter(c=>c.id!==s))},[]),i=j.useCallback((s,l,c)=>{const u=String(++nq),f=s==="error"||s==="warning";n(p=>[...p.slice(-2),{id:u,type:s,message:l,details:c,persistent:f}]),f||setTimeout(()=>r(u),s==="success"?3e3:5e3)},[r]);return d.jsxs(qA.Provider,{value:{notifications:e,notify:i,dismiss:r},children:[t,d.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm",children:e.map(s=>d.jsxs("div",{role:"alert","aria-live":"polite",className:`px-4 py-3 rounded-md shadow-lg border text-sm ${s.type==="success"?"bg-[var(--color-surface-raised)] border-[var(--color-success)] text-[var(--color-success)]":s.type==="warning"?"bg-[var(--color-surface-raised)] border-[var(--color-warning)] text-[var(--color-warning)]":s.type==="error"?"bg-[var(--color-surface-raised)] border-[var(--color-error)] text-[var(--color-error)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] text-[var(--color-text)]"}`,children:[d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsx("p",{children:s.message}),s.persistent&&d.jsx("button",{onClick:()=>r(s.id),className:"text-[var(--color-muted)] hover:text-[var(--color-text)] shrink-0","aria-label":"Dismiss notification",children:"x"})]}),s.details&&d.jsxs("details",{className:"mt-2 text-xs text-[var(--color-muted)]",children:[d.jsx("summary",{className:"cursor-pointer",children:"Details"}),d.jsx("pre",{className:"mt-1 whitespace-pre-wrap font-[var(--font-mono)]",children:s.details})]})]},s.id))})]})}/**
|
|
61
|
+
* @license lucide-react v0.577.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const IA=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
|
|
66
|
+
* @license lucide-react v0.577.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const iq=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
71
|
+
* @license lucide-react v0.577.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const sq=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
76
|
+
* @license lucide-react v0.577.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const QN=t=>{const e=sq(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
81
|
+
* @license lucide-react v0.577.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/var aq={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
86
|
+
* @license lucide-react v0.577.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const lq=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
|
|
91
|
+
* @license lucide-react v0.577.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const oq=j.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:l,...c},u)=>j.createElement("svg",{ref:u,...aq,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:IA("lucide",i),...!s&&!lq(c)&&{"aria-hidden":"true"},...c},[...l.map(([f,p])=>j.createElement(f,p)),...Array.isArray(s)?s:[s]]));/**
|
|
96
|
+
* @license lucide-react v0.577.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const ye=(t,e)=>{const n=j.forwardRef(({className:r,...i},s)=>j.createElement(oq,{ref:s,iconNode:e,className:IA(`lucide-${iq(QN(t))}`,`lucide-${t}`,r),...i}));return n.displayName=QN(t),n};/**
|
|
101
|
+
* @license lucide-react v0.577.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const cq=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Km=ye("arrow-left",cq);/**
|
|
106
|
+
* @license lucide-react v0.577.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const uq=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Jm=ye("arrow-right",uq);/**
|
|
111
|
+
* @license lucide-react v0.577.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const dq=[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],BA=ye("book-marked",dq);/**
|
|
116
|
+
* @license lucide-react v0.577.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const hq=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],TS=ye("book-open",hq);/**
|
|
121
|
+
* @license lucide-react v0.577.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const fq=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],pq=ye("bot",fq);/**
|
|
126
|
+
* @license lucide-react v0.577.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const mq=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],YA=ye("briefcase",mq);/**
|
|
131
|
+
* @license lucide-react v0.577.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const gq=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],VA=ye("check",gq);/**
|
|
136
|
+
* @license lucide-react v0.577.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const Oq=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],gr=ye("chevron-down",Oq);/**
|
|
141
|
+
* @license lucide-react v0.577.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const xq=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],yi=ye("chevron-right",xq);/**
|
|
146
|
+
* @license lucide-react v0.577.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const bq=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],UA=ye("circle-alert",bq);/**
|
|
151
|
+
* @license lucide-react v0.577.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const vq=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],bh=ye("circle-check-big",vq);/**
|
|
156
|
+
* @license lucide-react v0.577.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const yq=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],Sq=ye("circle-arrow-up",yq);/**
|
|
161
|
+
* @license lucide-react v0.577.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const wq=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],WA=ye("circle-check",wq);/**
|
|
166
|
+
* @license lucide-react v0.577.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const kq=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],jq=ye("circle-question-mark",kq);/**
|
|
171
|
+
* @license lucide-react v0.577.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const Qq=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Cq=ye("circle",Qq);/**
|
|
176
|
+
* @license lucide-react v0.577.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const Nq=[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]],Tq=ye("cog",Nq);/**
|
|
181
|
+
* @license lucide-react v0.577.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const $q=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Eq=ye("copy",$q);/**
|
|
186
|
+
* @license lucide-react v0.577.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const Pq=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],GA=ye("database",Pq);/**
|
|
191
|
+
* @license lucide-react v0.577.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const Aq=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],eg=ye("download",Aq);/**
|
|
196
|
+
* @license lucide-react v0.577.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const Rq=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],FA=ye("external-link",Rq);/**
|
|
201
|
+
* @license lucide-react v0.577.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const _q=[["path",{d:"M5 5.5A3.5 3.5 0 0 1 8.5 2H12v7H8.5A3.5 3.5 0 0 1 5 5.5z",key:"1340ok"}],["path",{d:"M12 2h3.5a3.5 3.5 0 1 1 0 7H12V2z",key:"1hz3m3"}],["path",{d:"M12 12.5a3.5 3.5 0 1 1 7 0 3.5 3.5 0 1 1-7 0z",key:"1oz8n2"}],["path",{d:"M5 19.5A3.5 3.5 0 0 1 8.5 16H12v3.5a3.5 3.5 0 1 1-7 0z",key:"1ff65i"}],["path",{d:"M5 12.5A3.5 3.5 0 0 1 8.5 9H12v7H8.5A3.5 3.5 0 0 1 5 12.5z",key:"pdip6e"}]],Mq=ye("figma",_q);/**
|
|
206
|
+
* @license lucide-react v0.577.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const zq=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],Dq=ye("file-braces",zq);/**
|
|
211
|
+
* @license lucide-react v0.577.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const Lq=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],Xq=ye("file-code",Lq);/**
|
|
216
|
+
* @license lucide-react v0.577.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const Zq=[["path",{d:"M4 11V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-1",key:"1q9hii"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]],CN=ye("file-input",Zq);/**
|
|
221
|
+
* @license lucide-react v0.577.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const qq=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],vh=ye("file-output",qq);/**
|
|
226
|
+
* @license lucide-react v0.577.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const Iq=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],rs=ye("file-text",Iq);/**
|
|
231
|
+
* @license lucide-react v0.577.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const Bq=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],Yq=ye("file-type",Bq);/**
|
|
236
|
+
* @license lucide-react v0.577.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const Vq=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Uq=ye("file",Vq);/**
|
|
241
|
+
* @license lucide-react v0.577.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const Wq=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],S0=ye("folder-open",Wq);/**
|
|
246
|
+
* @license lucide-react v0.577.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const Gq=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],HA=ye("folder-tree",Gq);/**
|
|
251
|
+
* @license lucide-react v0.577.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const Fq=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Hq=ye("folder",Fq);/**
|
|
256
|
+
* @license lucide-react v0.577.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const Kq=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Or=ye("git-branch",Kq);/**
|
|
261
|
+
* @license lucide-react v0.577.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const Jq=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],eI=ye("git-commit-horizontal",Jq);/**
|
|
266
|
+
* @license lucide-react v0.577.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const tI=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],KA=ye("git-merge",tI);/**
|
|
271
|
+
* @license lucide-react v0.577.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const nI=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],JA=ye("github",nI);/**
|
|
276
|
+
* @license lucide-react v0.577.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const rI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],iI=ye("globe",rI);/**
|
|
281
|
+
* @license lucide-react v0.577.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const sI=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],aI=ye("grip-vertical",sI);/**
|
|
286
|
+
* @license lucide-react v0.577.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const lI=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],oI=ye("heart",lI);/**
|
|
291
|
+
* @license lucide-react v0.577.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const cI=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],uI=ye("image",cI);/**
|
|
296
|
+
* @license lucide-react v0.577.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const dI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],eR=ye("info",dI);/**
|
|
301
|
+
* @license lucide-react v0.577.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const hI=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],yh=ye("layers",hI);/**
|
|
306
|
+
* @license lucide-react v0.577.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const fI=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],pI=ye("layout-dashboard",fI);/**
|
|
311
|
+
* @license lucide-react v0.577.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const mI=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],gI=ye("lightbulb",mI);/**
|
|
316
|
+
* @license lucide-react v0.577.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const OI=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],xI=ye("link-2",OI);/**
|
|
321
|
+
* @license lucide-react v0.577.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const bI=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],is=ye("loader-circle",bI);/**
|
|
326
|
+
* @license lucide-react v0.577.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const vI=[["path",{d:"M5 12h14",key:"1ays0h"}]],yI=ye("minus",vI);/**
|
|
331
|
+
* @license lucide-react v0.577.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const SI=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Sc=ye("monitor",SI);/**
|
|
336
|
+
* @license lucide-react v0.577.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/const wI=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],kI=ye("moon",wI);/**
|
|
341
|
+
* @license lucide-react v0.577.0 - ISC
|
|
342
|
+
*
|
|
343
|
+
* This source code is licensed under the ISC license.
|
|
344
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
+
*/const jI=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],$S=ye("package",jI);/**
|
|
346
|
+
* @license lucide-react v0.577.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/const QI=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Kl=ye("pencil",QI);/**
|
|
351
|
+
* @license lucide-react v0.577.0 - ISC
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the ISC license.
|
|
354
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/const CI=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],NI=ye("play",CI);/**
|
|
356
|
+
* @license lucide-react v0.577.0 - ISC
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the ISC license.
|
|
359
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
+
*/const TI=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],tR=ye("plug",TI);/**
|
|
361
|
+
* @license lucide-react v0.577.0 - ISC
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the ISC license.
|
|
364
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/const $I=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Yt=ye("plus",$I);/**
|
|
366
|
+
* @license lucide-react v0.577.0 - ISC
|
|
367
|
+
*
|
|
368
|
+
* This source code is licensed under the ISC license.
|
|
369
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
+
*/const EI=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ES=ye("refresh-cw",EI);/**
|
|
371
|
+
* @license lucide-react v0.577.0 - ISC
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the ISC license.
|
|
374
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/const PI=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],AI=ye("rocket",PI);/**
|
|
376
|
+
* @license lucide-react v0.577.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/const RI=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Bc=ye("save",RI);/**
|
|
381
|
+
* @license lucide-react v0.577.0 - ISC
|
|
382
|
+
*
|
|
383
|
+
* This source code is licensed under the ISC license.
|
|
384
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
+
*/const _I=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]],MI=ye("scale",_I);/**
|
|
386
|
+
* @license lucide-react v0.577.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/const zI=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],hs=ye("search",zI);/**
|
|
391
|
+
* @license lucide-react v0.577.0 - ISC
|
|
392
|
+
*
|
|
393
|
+
* This source code is licensed under the ISC license.
|
|
394
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
+
*/const DI=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],w0=ye("settings",DI);/**
|
|
396
|
+
* @license lucide-react v0.577.0 - ISC
|
|
397
|
+
*
|
|
398
|
+
* This source code is licensed under the ISC license.
|
|
399
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
+
*/const LI=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],XI=ye("skip-forward",LI);/**
|
|
401
|
+
* @license lucide-react v0.577.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/const ZI=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],qI=ye("sun",ZI);/**
|
|
406
|
+
* @license lucide-react v0.577.0 - ISC
|
|
407
|
+
*
|
|
408
|
+
* This source code is licensed under the ISC license.
|
|
409
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
+
*/const II=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],BI=ye("table",II);/**
|
|
411
|
+
* @license lucide-react v0.577.0 - ISC
|
|
412
|
+
*
|
|
413
|
+
* This source code is licensed under the ISC license.
|
|
414
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
+
*/const YI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],VI=ye("target",YI);/**
|
|
416
|
+
* @license lucide-react v0.577.0 - ISC
|
|
417
|
+
*
|
|
418
|
+
* This source code is licensed under the ISC license.
|
|
419
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
+
*/const UI=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],uo=ye("trash-2",UI);/**
|
|
421
|
+
* @license lucide-react v0.577.0 - ISC
|
|
422
|
+
*
|
|
423
|
+
* This source code is licensed under the ISC license.
|
|
424
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
+
*/const WI=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Us=ye("triangle-alert",WI);/**
|
|
426
|
+
* @license lucide-react v0.577.0 - ISC
|
|
427
|
+
*
|
|
428
|
+
* This source code is licensed under the ISC license.
|
|
429
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
+
*/const GI=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],tg=ye("upload",GI);/**
|
|
431
|
+
* @license lucide-react v0.577.0 - ISC
|
|
432
|
+
*
|
|
433
|
+
* This source code is licensed under the ISC license.
|
|
434
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
+
*/const FI=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],Kg=ye("users-round",FI);/**
|
|
436
|
+
* @license lucide-react v0.577.0 - ISC
|
|
437
|
+
*
|
|
438
|
+
* This source code is licensed under the ISC license.
|
|
439
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
+
*/const HI=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Tn=ye("users",HI);/**
|
|
441
|
+
* @license lucide-react v0.577.0 - ISC
|
|
442
|
+
*
|
|
443
|
+
* This source code is licensed under the ISC license.
|
|
444
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
+
*/const KI=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wt=ye("x",KI);/**
|
|
446
|
+
* @license lucide-react v0.577.0 - ISC
|
|
447
|
+
*
|
|
448
|
+
* This source code is licensed under the ISC license.
|
|
449
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
+
*/const JI=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Si=ye("zap",JI),nR="bmad-studio-theme";function eB(){const t=localStorage.getItem(nR);return t==="dark"||t==="light"?t:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function rR(t){t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem(nR,t)}function iR(){const e=(document.documentElement.classList.contains("dark")?"dark":"light")==="dark"?"light":"dark";return rR(e),e}const NN=t=>{let e;const n=new Set,r=(f,p)=>{const m=typeof f=="function"?f(e):f;if(!Object.is(m,e)){const O=e;e=p??(typeof m!="object"||m===null)?m:Object.assign({},e,m),n.forEach(x=>x(e,O))}},i=()=>e,c={setState:r,getState:i,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f))},u=e=t(r,i,c);return c},tB=(t=>t?NN(t):NN),nB=t=>t;function rB(t,e=nB){const n=Up.useSyncExternalStore(t.subscribe,Up.useCallback(()=>e(t.getState()),[t,e]),Up.useCallback(()=>e(t.getInitialState()),[t,e]));return Up.useDebugValue(n),n}const TN=t=>{const e=tB(t),n=r=>rB(e,r);return Object.assign(n,e),n},iB=(t=>t?TN(t):TN),Sh=iB(t=>({theme:document.documentElement.classList.contains("dark")?"dark":"light",setTheme:e=>t({theme:e})})),$N=1e3,sB=3e4;class aB{constructor(e){this.ws=null,this.retryMs=$N,this.retryTimer=null,this.handlers=[],this.statusHandlers=[],this.closed=!1,this.url=e}connect(){if(!this.closed)try{this.ws=new WebSocket(this.url),this.ws.onopen=()=>{this.retryMs=$N,this.notifyStatus(!0)},this.ws.onmessage=e=>{try{const n=JSON.parse(e.data);for(const r of this.handlers)r(n)}catch{}},this.ws.onclose=()=>{this.notifyStatus(!1),this.scheduleReconnect()},this.ws.onerror=()=>{}}catch{this.scheduleReconnect()}}scheduleReconnect(){this.closed||(this.retryTimer=setTimeout(()=>{this.retryMs=Math.min(this.retryMs*2,sB),this.connect()},this.retryMs))}notifyStatus(e){for(const n of this.statusHandlers)n(e)}onMessage(e){return this.handlers.push(e),()=>{this.handlers=this.handlers.filter(n=>n!==e)}}onStatusChange(e){return this.statusHandlers.push(e),()=>{this.statusHandlers=this.statusHandlers.filter(n=>n!==e)}}close(){this.closed=!0,this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.ws&&(this.ws.close(),this.ws=null)}}function lB(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function oB(t){const e=j.useRef(null),[n,r]=j.useState(!1),i=j.useCallback(s=>{t==null||t(s)},[t]);return j.useEffect(()=>{const s=new aB(lB());e.current=s,s.onStatusChange(r);const l=s.onMessage(i);return s.connect(),()=>{l(),s.close()}},[i]),{connected:n}}const At={"step-based":{label:"Step Workflow",description:"A single agent follows a structured sequence of numbered steps — like a recipe. The workflow gives one agent clear, ordered instructions to follow.",bestFor:["Creating a single document","Running a focused analysis","Guided single-session tasks"]},"agent-based":{label:"Agent Workflow",description:"Multiple specialist agents in sequence. Each phase is handed to a different agent — like a relay race where the baton passes between experts.",bestFor:["Sprint planning","Architecture design","Multi-phase deliverables needing different expertise"]},composite:{label:"Composite Workflow",description:"Combines step-based and agent-based sections. Some phases are handled by a single agent following steps, others hand off to specialist agents.",bestFor:["Complex processes needing both structured steps and agent handoffs","Workflows with parallel tracks"]}},k0="BMAD Studio";function cB(t){const e=t==null?void 0:t.appTitle;if(typeof e!="string")return k0;const n=e.trim();return n||k0}function uB(){const[t,e]=j.useState(k0);return j.useEffect(()=>{let n=!1;const r=new AbortController;return fetch("/api/settings",{cache:"no-store",signal:r.signal}).then(i=>i.ok?i.json():null).then(i=>{n||e(cB(i))}).catch(i=>{(i==null?void 0:i.name)!=="AbortError"&&console.warn("[useAppTitle] failed to load /api/settings:",i)}),()=>{n=!0,r.abort()}},[]),j.useEffect(()=>{document.title=t},[t]),t}const dB=[{to:"/",label:"Home",icon:pI}],hB={label:"Outputs",icon:vh,items:[{to:"/outputs",label:"Browse All",icon:vh}]},fB={label:"Toolkit",icon:yh,items:[{to:"/toolkit",label:"View All",icon:yh},{to:"/agents",label:"Agents",icon:Tn,badgeKey:"agents"},{to:"/commands",label:"Agent Triggers",icon:TS},{to:"/teams",label:"Teams",icon:Kg,badgeKey:"teams"},{to:"/skills",label:"Skills",icon:Si,badgeKey:"skills"},{to:"/workflows",label:"Workflows",icon:Or,badgeKey:"workflows"}]},pB={label:"Settings",icon:w0,items:[{to:"/settings",label:"Preferences",icon:w0},{to:"/modules",label:"Modules",icon:$S,badgeKey:"modules"},{to:"/connections",label:"IDE Connections",icon:tR,badgeKey:"connections"},{to:"/files",label:"All Files",icon:HA}]};function sR({to:t,label:e,icon:n,badge:r,indent:i=!1}){return d.jsxs(kS,{to:t,end:t==="/",className:({isActive:s})=>`flex items-center gap-3 ${i?"pl-8 pr-3":"px-3"} py-2 min-h-[36px] rounded-md text-sm transition-colors ${s?"text-[var(--color-accent)] font-bold bg-[var(--color-surface-raised)]":"text-[var(--color-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-surface-raised)]"}`,children:[d.jsx(n,{size:i?15:18}),d.jsx("span",{className:"flex-1",children:e}),r!==void 0&&r>0&&d.jsx("span",{className:"text-[10px] font-bold px-1.5 py-0.5 rounded-full bg-[var(--color-accent)]/10 text-[var(--color-accent)]",children:r})]})}function nv({group:t,badgeCounts:e}){const[n,r]=j.useState(!0),i=t.icon;return d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>r(!n),className:"w-full flex items-center gap-3 px-3 py-2 min-h-[36px] rounded-md text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] hover:text-[var(--color-text)] transition-colors cursor-pointer",children:[d.jsx(i,{size:16}),d.jsx("span",{className:"flex-1 text-left",children:t.label}),d.jsx(gr,{size:12,className:`transition-transform ${n?"":"-rotate-90"}`})]}),n&&d.jsx("div",{className:"space-y-0.5",children:t.items.map(s=>d.jsx(sR,{to:s.to,label:s.label,icon:s.icon,badge:s.badgeKey?e[s.badgeKey]:void 0,indent:!0},s.to))})]})}function mB(){const t=Sh(C=>C.theme),e=Sh(C=>C.setTheme),[n,r]=j.useState({}),i=j.useRef(null),[s,l]=j.useState(null),[c,u]=j.useState([]),[f,p]=j.useState(!1),[m,O]=j.useState(!1),x=j.useRef(null),v=j.useCallback(()=>{Promise.all([fetch("/api/overview").then(C=>C.json()).catch(()=>null),fetch("/api/modules").then(C=>C.json()).catch(()=>null)]).then(([C,E])=>{var R,_,V,G,D;const M={};C!=null&&C.sections&&(M.agents=((R=C.sections.team)==null?void 0:R.count)??0,M.teams=((_=C.sections.teams)==null?void 0:_.count)??0,M.skills=((V=C.sections.toolkit)==null?void 0:V.count)??0,M.workflows=((G=C.sections.process)==null?void 0:G.count)??0,M.connections=((D=C.sections.ideConfigs)==null?void 0:D.count)??0),Array.isArray(E)&&(M.modules=E.length),r(M)})},[]);j.useEffect(()=>{v(),Promise.all([fetch("/api/project").then(C=>C.json()).catch(()=>null),fetch("/api/projects").then(C=>C.json()).catch(()=>[])]).then(([C,E])=>{C&&l(C),Array.isArray(E)&&u(E)})},[v]),j.useEffect(()=>{if(!f)return;function C(E){x.current&&!x.current.contains(E.target)&&p(!1)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[f]),oB(j.useCallback(C=>{if(C.type==="project:switched"){l({name:C.projectName,path:C.projectRoot}),O(!1),v(),window.location.href="/";return}i.current&&clearTimeout(i.current),i.current=setTimeout(v,200)},[v]));async function S(C){if(confirm("Switch project? Any unsaved changes will be lost.")){O(!0),p(!1);try{const E=await fetch("/api/project/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:C})});if(!E.ok){const M=await E.json().catch(()=>({}));alert(M.message??"Failed to switch project"),O(!1)}}catch{alert("Failed to switch project"),O(!1)}}}const k=uB();function w(){const C=iR();e(C)}const N=c.filter(C=>C.path!==(s==null?void 0:s.path));return d.jsxs("aside",{className:"w-60 h-screen flex flex-col border-r border-[var(--color-border-subtle)] bg-[var(--color-bg)]",children:[d.jsxs("div",{className:"px-4 py-4 border-b border-[var(--color-border-subtle)]",children:[d.jsx("h1",{className:"text-base font-extrabold text-[var(--color-text)] mb-1",children:k}),(s==null?void 0:s.name)&&d.jsxs("div",{className:"relative",ref:x,children:[d.jsxs("button",{onClick:()=>p(C=>!C),disabled:m,className:"flex items-center gap-1.5 text-xs text-[var(--color-muted)] hover:text-[var(--color-text)] transition-colors max-w-full",title:s.path??void 0,children:[m?d.jsx(is,{size:12,className:"shrink-0 animate-spin"}):d.jsx(S0,{size:12,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:m?"Switching...":s.name}),!m&&N.length>0&&d.jsx(gr,{size:11,className:"shrink-0"})]}),f&&!m&&N.length>0&&d.jsxs("div",{className:"absolute left-0 top-full mt-1 w-56 bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl z-50 overflow-hidden",children:[d.jsx("div",{className:"px-3 py-2 border-b border-[var(--color-border-subtle)]",children:d.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Switch Project"})}),N.slice(0,5).map(C=>d.jsxs("button",{onClick:()=>S(C.path),className:"w-full text-left px-3 py-2.5 hover:bg-[var(--color-surface-raised)] transition-colors cursor-pointer",children:[d.jsx("p",{className:"text-xs font-bold text-[var(--color-text)] truncate",children:C.name}),d.jsx("p",{className:"text-[10px] text-[var(--color-muted)] truncate mt-0.5",title:C.path,children:C.path})]},C.path))]})]})]}),d.jsxs("nav",{className:"flex-1 px-2 space-y-0.5 overflow-y-auto pt-1","aria-label":"Main navigation",children:[dB.map(C=>d.jsx(sR,{to:C.to,label:C.label,icon:C.icon,badge:C.badgeKey?n[C.badgeKey]:void 0},C.to)),d.jsx("div",{className:"my-2 border-t border-[var(--color-border-subtle)]"}),d.jsx(nv,{group:hB,badgeCounts:n}),d.jsx("div",{className:"my-2 border-t border-[var(--color-border-subtle)]"}),d.jsx(nv,{group:fB,badgeCounts:n}),d.jsx("div",{className:"my-2 border-t border-[var(--color-border-subtle)]"}),d.jsx(nv,{group:pB,badgeCounts:n})]}),d.jsxs("div",{className:"px-3 py-3 border-t border-[var(--color-border-subtle)] space-y-1",children:[d.jsxs(kS,{to:"/about",className:({isActive:C})=>`flex items-center gap-2 px-3 py-2 min-h-[44px] w-full rounded-md text-sm transition-colors ${C?"text-[var(--color-accent)] font-bold bg-[var(--color-surface-raised)]":"text-[var(--color-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-surface-raised)]"}`,children:[d.jsx(eR,{size:18}),d.jsx("span",{children:"About"})]}),d.jsxs("button",{onClick:w,className:"flex items-center gap-2 px-3 py-2 min-h-[44px] w-full rounded-md text-sm text-[var(--color-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-surface-raised)] transition-colors",children:[t==="dark"?d.jsx(qI,{size:18}):d.jsx(kI,{size:18}),d.jsx("span",{children:t==="dark"?"Light mode":"Dark mode"})]})]})]})}const gB={agents:"Agents",teams:"Teams",skills:"Skills",workflows:"Workflows",outputs:"Outputs",connections:"Connections",workspace:"Workspace",modules:"Modules",packages:"Packages",files:"Files",settings:"Settings"};function OB(){return d.jsx("button",{onClick:()=>document.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0})),className:"p-1.5 rounded-md text-[var(--color-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-surface-raised)] transition-colors",title:"Search (⌘K)","aria-label":"Search",children:d.jsx(hs,{size:16})})}function xB(){const e=us().pathname.split("/").filter(Boolean);return d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("nav",{"aria-label":"Breadcrumb",className:"text-sm text-[var(--color-muted)]",children:e.length>0?d.jsxs("ol",{className:"flex items-center gap-1",children:[d.jsx("li",{children:d.jsx(zt,{to:"/",className:"hover:text-[var(--color-text)] transition-colors",children:"Home"})}),e.map((n,r)=>{const i="/"+e.slice(0,r+1).join("/"),s=gB[n]||n,l=r===e.length-1;return d.jsxs("li",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"text-[var(--color-border-subtle)]",children:"/"}),l?d.jsx("span",{className:"text-[var(--color-text)]",children:s}):d.jsx(zt,{to:i,className:"hover:text-[var(--color-text)] transition-colors",children:s})]},i)})]}):d.jsx("span",{})}),d.jsx(OB,{})]})}const bB={agent:{label:"Agent",color:"text-[var(--color-accent)]",bg:"bg-blue-500/10",Icon:Tn},skill:{label:"Skill",color:"text-[var(--color-success)]",bg:"bg-green-500/10",Icon:Si},workflow:{label:"Workflow",color:"text-purple-400",bg:"bg-purple-500/10",Icon:Or},team:{label:"Team",color:"text-orange-400",bg:"bg-orange-500/10",Icon:Kg}};function vB(t){switch(t.type){case"agent":return`/agents/${t.id}`;case"skill":return`/skills?detail=${t.id}`;case"workflow":return`/workflows?detail=${t.id}`;case"team":return`/teams?detail=${t.id}`}}function yB(){const[t,e]=j.useState(!1),[n,r]=j.useState(""),[i,s]=j.useState([]),[l,c]=j.useState(0),u=j.useRef(null),f=ds(),p=j.useCallback(()=>{r(""),s([]),c(0),e(!0)},[]),m=j.useCallback(()=>{e(!1)},[]);j.useEffect(()=>{function v(S){(S.metaKey||S.ctrlKey)&&S.key==="k"&&(S.preventDefault(),t?m():p()),S.key==="Escape"&&t&&m()}return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[t,p,m]),j.useEffect(()=>{t&&setTimeout(()=>{var v;return(v=u.current)==null?void 0:v.focus()},10)},[t]),j.useEffect(()=>{if(!n.trim()){s([]);return}const v=new AbortController;return fetch(`/api/search?q=${encodeURIComponent(n)}`,{signal:v.signal}).then(S=>S.json()).then(S=>{s(S),c(0)}).catch(()=>{}),()=>v.abort()},[n]);function O(v){f(vB(v)),m()}function x(v){v.key==="ArrowDown"?(v.preventDefault(),c(S=>Math.min(S+1,i.length-1))):v.key==="ArrowUp"?(v.preventDefault(),c(S=>Math.max(S-1,0))):v.key==="Enter"&&i[l]&&O(i[l])}return t?d.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[18vh] bg-black/40 backdrop-blur-sm",onClick:m,children:d.jsxs("div",{className:"w-full max-w-lg bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-xl shadow-2xl overflow-hidden",onClick:v=>v.stopPropagation(),onKeyDown:x,children:[d.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-[var(--color-border-subtle)]",children:[d.jsx(hs,{size:18,className:"text-[var(--color-muted)] shrink-0"}),d.jsx("input",{ref:u,type:"text",placeholder:"Search agents, skills, workflows, teams...",value:n,onChange:v=>r(v.target.value),className:"flex-1 bg-transparent text-sm text-[var(--color-text)] outline-none placeholder:text-[var(--color-muted)]"}),d.jsx("kbd",{className:"text-xs text-[var(--color-muted)] px-1.5 py-0.5 rounded border border-[var(--color-border-subtle)] shrink-0",children:"esc"})]}),i.length>0&&d.jsx("div",{className:"max-h-72 overflow-y-auto py-1.5",children:i.map((v,S)=>{const k=bB[v.type],w=k.Icon;return d.jsxs("button",{onClick:()=>O(v),className:`w-full px-4 py-2.5 text-left flex items-center gap-3 text-sm transition-colors ${S===l?"bg-[var(--color-surface-raised)]":"hover:bg-[var(--color-surface-raised)]/60"}`,children:[d.jsx("div",{className:`w-8 h-8 rounded-md flex items-center justify-center shrink-0 ${k.bg}`,children:v.icon?d.jsx("span",{className:"text-base leading-none","aria-hidden":"true",children:v.icon}):d.jsx(w,{size:15,className:k.color})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"font-bold text-[var(--color-text)] truncate",children:v.title||v.name}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] truncate",children:v.description})]}),d.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[v.module&&d.jsx("span",{className:"text-xs text-[var(--color-muted)] font-[var(--font-mono)]",children:v.module}),d.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded font-bold uppercase ${k.color} ${k.bg}`,children:k.label})]})]},`${v.type}-${v.id}`)})}),n.trim()&&i.length===0&&d.jsxs("div",{className:"px-4 py-8 text-center text-sm text-[var(--color-muted)]",children:["No results for ",d.jsxs("strong",{className:"text-[var(--color-text)]",children:['"',n,'"']})]}),!n&&d.jsxs("div",{className:"px-4 py-4 flex items-center justify-between text-xs text-[var(--color-muted)]",children:[d.jsx("span",{children:"Search across agents, skills, workflows, and teams"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("kbd",{className:"px-1.5 py-0.5 rounded border border-[var(--color-border-subtle)]",children:"↑↓"}),"navigate"]}),d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("kbd",{className:"px-1.5 py-0.5 rounded border border-[var(--color-border-subtle)]",children:"↵"}),"open"]})]})]})]})}):null}function SB(){return d.jsxs("div",{className:"flex h-screen overflow-hidden",children:[d.jsx(mB,{}),d.jsx("main",{className:"flex-1 overflow-y-auto",children:d.jsxs("div",{className:"px-8 py-6",children:[d.jsx(xB,{}),d.jsx(_Z,{})]})}),d.jsx(yB,{})]})}function Ci({icon:t,title:e,description:n,actions:r}){return d.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[d.jsx(t,{size:48,className:"text-[var(--color-muted)] mb-4",strokeWidth:1.5}),d.jsx("h2",{className:"text-lg font-bold text-[var(--color-text)] mb-2",children:e}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] max-w-md mb-6",children:n}),r&&d.jsx("div",{className:"flex gap-3",children:r})]})}function EN(t){const e=new Date(t);if(isNaN(e.getTime()))return t;const r=new Date().getTime()-e.getTime(),i=Math.floor(r/1e3),s=Math.floor(i/60),l=Math.floor(s/60),c=Math.floor(l/24);return c<0?e.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}):c===0?l===0?s<=1?"just now":`${s}m ago`:`${l}h ago`:c===1?"yesterday":c<=7?`${c} days ago`:e.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function wB(t){const e=t.split("-"),n=e[0],r=e[1],i=e.slice(2).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ");return i?`${n}.${r} ${i}`:t}function aR(t){return t.replace("epic-","Epic ")}const kB={done:{color:"var(--color-success)",label:"Done"},"in-progress":{color:"var(--color-warning)",label:"In Progress"},review:{color:"var(--color-accent)",label:"Review"},"ready-for-dev":{color:"var(--color-info, var(--color-accent))",label:"Ready"},backlog:{color:"var(--color-muted)",label:"Backlog"}};function jB({epic:t}){const[e,n]=j.useState(t.status==="in-progress"),r=t.stories.filter(s=>s.status==="done").length,i=t.status==="done";return d.jsxs("div",{className:"border border-[var(--color-border-subtle)] rounded-lg overflow-hidden",children:[d.jsxs("button",{onClick:()=>n(!e),className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-[var(--color-bg)] transition-colors cursor-pointer",children:[d.jsx(gr,{size:14,className:`text-[var(--color-muted)] transition-transform ${e?"":"-rotate-90"}`}),d.jsx("span",{className:"text-xs font-bold flex-1",children:aR(t.id)}),d.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[r,"/",t.storyCount]}),i?d.jsx(WA,{size:12,className:"text-[var(--color-success)]"}):d.jsx("span",{className:"w-2 h-2 rounded-full bg-[var(--color-warning)]"})]}),e&&d.jsx("div",{className:"border-t border-[var(--color-border-subtle)] px-3 py-2 space-y-1",children:t.stories.map(s=>{const l=kB[s.status]??{color:"var(--color-muted)",label:s.status};return d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:l.color}}),d.jsx("span",{className:"text-[var(--color-text)] truncate flex-1",children:wB(s.id)}),d.jsx("span",{className:"shrink-0 text-[var(--color-muted)]",children:l.label})]},s.id)})})]})}function QB({health:t}){var i;const{sprint:e,recentOutputs:n,outputCounts:r}=t;return d.jsxs("section",{className:"mb-10 border-b border-[var(--color-border-subtle)] pb-10",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Project Status"}),d.jsx(zt,{to:"/outputs",className:"text-sm font-bold text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:"View all outputs →"})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[d.jsxs("div",{className:"rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] p-5",children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-3",children:"Sprint Status"}),e?d.jsxs("div",{className:"space-y-3",children:[e.activeEpics.length>0?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.activeEpics.map(s=>d.jsx("span",{className:"px-2 py-0.5 text-xs font-bold rounded-full bg-[var(--color-accent)]/10 text-[var(--color-accent)]",children:aR(s)},s)),d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:"active"})]}),e.storyCounts.total>0&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between text-xs text-[var(--color-muted)] mb-1.5",children:[d.jsxs("span",{children:[e.storyCounts.done," / ",e.storyCounts.total," stories done"]}),d.jsxs("span",{children:[Math.round(e.storyCounts.done/e.storyCounts.total*100),"%"]})]}),d.jsx("div",{className:"h-2 rounded-full bg-[var(--color-bg)] overflow-hidden",children:d.jsx("div",{className:"h-full rounded-full bg-[var(--color-accent)] transition-all",style:{width:`${e.storyCounts.done/e.storyCounts.total*100}%`}})})]})]}):d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"No active epics — all epics complete or backlog."}),e.epicDetails&&e.epicDetails.length>0&&d.jsx("div",{className:"space-y-1.5 pt-1",children:e.epicDetails.slice(0,5).map(s=>d.jsx(jB,{epic:s},s.id))}),!((i=e.epicDetails)!=null&&i.length)&&e.activeEpics.length===0&&d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"No epics defined yet."}),e.lastUpdated&&d.jsxs("p",{className:"text-xs text-[var(--color-muted)] pt-1",children:["Updated ",EN(e.lastUpdated)]})]}):d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"No sprint-status.yaml found in _bmad-output."})]}),d.jsxs("div",{className:"rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] p-5",children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-3",children:"Output Hub"}),r.total>0?d.jsxs("div",{className:"space-y-3",children:[d.jsx("div",{className:"flex gap-2 flex-wrap",children:[{label:"Analysis",count:r.brainstorming},{label:"Planning",count:r.planning},{label:"Implementation",count:r.implementation}].filter(s=>s.count>0).map(s=>d.jsxs(zt,{to:"/outputs",className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg bg-[var(--color-bg)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors text-xs",children:[d.jsx("span",{className:"font-bold",children:s.label}),d.jsx("span",{className:"text-[var(--color-muted)]",children:s.count})]},s.label))}),n.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-bold text-[var(--color-muted)] mb-2",children:"Recent"}),d.jsx("div",{className:"space-y-1.5",children:n.slice(0,5).map(s=>{const l=EN(s.modifiedAt);return d.jsxs(zt,{to:`/outputs?path=${encodeURIComponent(s.path)}`,className:"flex items-center gap-2 text-xs hover:text-[var(--color-accent)] transition-colors group",children:[d.jsx(rs,{size:11,className:"text-[var(--color-muted)] shrink-0 group-hover:text-[var(--color-accent)]"}),d.jsx("span",{className:"truncate text-[var(--color-text)] group-hover:text-[var(--color-accent)]",children:s.name.replace(/\.(md|yaml|yml)$/,"")}),d.jsx("span",{className:"text-[var(--color-muted)] shrink-0 ml-auto",children:l})]},s.path)})})]})]}):d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"No outputs yet. Run BMAD workflows to generate artifacts."})]})]})]})}const CB=["1-analysis","2-planning","3-solutioning","4-implementation"];function NB(t){const e=t.replace(/^\d+-/,"");return e.charAt(0).toUpperCase()+e.slice(1)}const TB=new Set(["QS","QD","QQ"]),PN=["SP","CS","DS","CR","ER"];function yd({cmd:t,variant:e="default"}){var i;const n={required:"border-[var(--color-accent)] bg-[var(--color-accent)]/5",cycle:"border-[var(--color-accent)]/40 bg-[var(--color-accent)]/5",default:"border-[var(--color-border-subtle)] bg-[var(--color-surface-raised)]",dim:"border-[var(--color-border-subtle)]/50 bg-[var(--color-surface-raised)]/50 opacity-60"},r=e==="default"&&t.required?"required":e;return d.jsxs("div",{title:`${t.name}
|
|
451
|
+
${t.description}`,className:`inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs border transition-colors ${n[r]}`,children:[t.agentTitle&&d.jsx("span",{className:"text-xs leading-none",role:"img",children:((i=t.agentTitle.match(new RegExp("\\p{Emoji_Presentation}","u")))==null?void 0:i[0])??""}),d.jsx("span",{className:"font-[var(--font-mono)] font-bold",children:t.code}),d.jsx("span",{className:"text-[var(--color-muted)] hidden sm:inline truncate max-w-[80px]",children:t.name})]})}function $B({commands:t}){const e=ds(),{phaseGroups:n,quickFlowCmds:r,anytimeCmds:i,buildCycleCmds:s,implSupportCmds:l}=j.useMemo(()=>{const c=new Map,u=[],f=[];for(const v of t){if(TB.has(v.code)){u.push(v);continue}const S=v.phase||"anytime";S==="anytime"?f.push(v):(c.has(S)||c.set(S,[]),c.get(S).push(v))}for(const[,v]of c)v.sort((S,k)=>(S.sequence??999)-(k.sequence??999));const p=c.get("4-implementation")??[],m=new Set(PN),O=PN.map(v=>p.find(S=>S.code===v)).filter(Boolean),x=p.filter(v=>!m.has(v.code));return{phaseGroups:c,quickFlowCmds:u,anytimeCmds:f,buildCycleCmds:O,implSupportCmds:x}},[t]);return n.size===0&&i.length===0?null:d.jsxs("section",{className:"border-b border-[var(--color-border-subtle)] pb-10 mb-10",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"The BMAD Process"}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:"Workflow lifecycle from analysis to implementation"})]}),d.jsx("button",{onClick:()=>e("/commands"),className:"text-sm font-bold text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors cursor-pointer",children:"View all triggers →"})]}),d.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-3",children:CB.map(c=>{const u=n.get(c)??[],f=u.length===0,p=c==="4-implementation",m=p?[]:u;return d.jsxs("div",{className:`rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-surface-raised)] p-3 ${f?"opacity-40":""}`,children:[d.jsxs("div",{className:"flex items-center gap-1.5 mb-3",children:[d.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-accent)]",children:NB(c)}),d.jsxs("span",{className:"text-[10px] text-[var(--color-muted)]",children:["(",u.length,")"]})]}),p?d.jsxs("div",{className:"px-1 space-y-2",children:[s.length>0&&d.jsxs("div",{className:"rounded-md border border-[var(--color-accent)]/20 bg-[var(--color-accent)]/[0.03] p-2",children:[d.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[d.jsx(ES,{size:11,className:"text-[var(--color-accent)]"}),d.jsx("span",{className:"text-xs font-bold text-[var(--color-accent)]",children:"Build Cycle"})]}),d.jsx("div",{className:"flex flex-wrap items-center gap-1",children:s.map((O,x)=>d.jsxs("span",{className:"contents",children:[d.jsx(yd,{cmd:O,variant:"cycle"}),x<s.length-1&&d.jsx(Jm,{size:10,className:"text-[var(--color-muted)] shrink-0"})]},O.code))})]}),l.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1.5",children:l.map(O=>d.jsx(yd,{cmd:O},`${O.code}-${O.module}`))})]}):d.jsxs("div",{className:"flex flex-wrap gap-1.5 px-1",children:[m.map(O=>d.jsx(yd,{cmd:O},`${O.code}-${O.module}`)),f&&d.jsx("span",{className:"text-xs text-[var(--color-muted)] italic",children:"No commands"})]})]},c)})}),r.length>0&&d.jsxs("div",{className:"mt-3 pt-3 border-t border-dashed border-[var(--color-border-subtle)]",children:[d.jsxs("div",{className:"flex items-center gap-2 px-1",children:[d.jsx(XI,{size:14,className:"text-[var(--color-accent)] shrink-0"}),d.jsx("span",{className:"text-xs font-bold text-[var(--color-accent)]",children:"Quick Flow"}),d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:"Skip phases 1–3 for small changes"}),d.jsx("div",{className:"flex-1 border-t border-dashed border-[var(--color-accent)]/30 mx-2"}),d.jsx(Jm,{size:12,className:"text-[var(--color-accent)]/50 shrink-0"})]}),d.jsx("div",{className:"flex flex-wrap gap-1.5 px-1 mt-2 ml-6",children:r.map(c=>d.jsx(yd,{cmd:c},`${c.code}-${c.module}`))})]}),i.length>0&&d.jsxs("div",{className:"mt-3 pt-3 border-t border-[var(--color-border-subtle)]",children:[d.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-2 px-1",children:["Anytime (",i.length,")"]}),d.jsx("div",{className:"flex flex-wrap gap-1.5 px-1",children:i.map(c=>d.jsx(yd,{cmd:c},`${c.code}-${c.module}`))})]})]})}function EB(){var u;const[t,e]=j.useState(null),[n,r]=j.useState([]),[i,s]=j.useState(null),[l,c]=j.useState(!0);return j.useEffect(()=>{Promise.all([fetch("/api/overview").then(f=>f.json()),fetch("/api/commands").then(f=>f.json()).catch(()=>[]),fetch("/api/project-health").then(f=>f.json()).catch(()=>null)]).then(([f,p,m])=>{e(f),r(p),m&&s(m),c(!1)}).catch(()=>c(!1))},[]),l?d.jsx("div",{className:"space-y-8",children:[1,2,3].map(f=>d.jsx("div",{className:"h-32 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"},f))}):t!=null&&t.detected?d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-extrabold mb-6",children:"Home"}),((u=t.projectHealth)==null?void 0:u.projectDescription)&&d.jsxs("div",{className:"mb-8 rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-surface-raised)] p-5",children:[d.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-2",children:"Project Context"}),d.jsx("p",{className:"text-sm text-[var(--color-text)] leading-relaxed",children:t.projectHealth.projectDescription})]}),t.projectHealth&&!t.projectHealth.hasProjectContext&&d.jsxs("div",{className:"mb-6 flex items-center gap-3 rounded-lg border border-[var(--color-warning)]/40 bg-[var(--color-warning)]/5 px-4 py-3",children:[d.jsx(Us,{size:18,className:"text-[var(--color-warning)] shrink-0"}),d.jsxs("p",{className:"text-sm text-[var(--color-text)] flex-1",children:[d.jsx("span",{className:"font-bold",children:"Project context not configured"})," — AI agents won't know your conventions."]}),d.jsx(zt,{to:"/workspace",className:"shrink-0 text-sm font-bold text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:"Create Project Context →"})]}),d.jsxs("div",{className:"space-y-0",children:[i&&d.jsx(QB,{health:i}),t.toolkitStats&&d.jsxs("section",{className:"mb-10 border-b border-[var(--color-border-subtle)] pb-10",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Toolkit"}),d.jsx(zt,{to:"/toolkit",className:"text-sm font-bold text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:"View Toolkit →"})]}),d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[{to:"/agents",count:t.toolkitStats.totalAgents,label:"Agents",icon:"👤"},{to:"/skills",count:t.toolkitStats.totalSkills,label:"Skills",icon:"⚡"},{to:"/workflows",count:t.toolkitStats.totalWorkflows,label:"Workflows",icon:"🔀"},{to:"/teams",count:t.toolkitStats.totalTeams,label:"Teams",icon:"👥"}].map(f=>d.jsxs(zt,{to:f.to,className:"flex flex-col items-center gap-2 p-4 rounded-lg bg-[var(--color-surface-raised)] hover:border-[var(--color-accent)] border border-[var(--color-border-subtle)] transition-colors",children:[d.jsx("span",{className:"text-xl",children:f.icon}),d.jsx("span",{className:"text-2xl font-extrabold text-[var(--color-text)]",children:f.count}),d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:f.label})]},f.to))})]}),n.length>0&&d.jsx($B,{commands:n})]})]}):d.jsx(Ci,{icon:AI,title:"Welcome to BMAD Studio",description:"No BMAD project detected. Start by creating a BMAD project or point Studio to an existing one with --dir."})}async function PB(){const t=await fetch("/api/agents");if(!t.ok)throw new Error("Failed to fetch agents");return t.json()}function lR(){return Hs({queryKey:["agents"],queryFn:PB,staleTime:3e4})}function PS({onClick:t,selected:e,children:n}){return d.jsx("div",{onClick:t,onKeyDown:t?r=>r.key==="Enter"&&t():void 0,role:t?"button":void 0,tabIndex:t?0:void 0,className:`p-4 rounded-lg bg-[var(--color-surface-raised)] border transition-colors cursor-pointer ${e?"border-[var(--color-accent)]":"border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:n})}function AS({emoji:t,fallbackIcon:e,fallbackInitial:n}){return t?d.jsx("span",{className:"w-9 h-9 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] flex items-center justify-center shrink-0 text-lg leading-none",role:"img",children:t}):e?d.jsx("span",{className:"w-9 h-9 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] flex items-center justify-center shrink-0 text-[var(--color-muted)]",children:e}):n?d.jsx("span",{className:"w-9 h-9 rounded-lg bg-[var(--color-accent)] text-white text-sm font-bold flex items-center justify-center shrink-0",children:n.charAt(0).toUpperCase()}):null}function RS({icon:t,title:e,subtitle:n,indicator:r}){return d.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[t,d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-bold text-sm truncate",children:e}),r]}),n&&d.jsx("p",{className:"text-xs text-[var(--color-muted)] truncate",children:n})]})]})}function _S({children:t}){return d.jsx("div",{className:"mb-3",children:t})}function MS({text:t,lines:e=2}){const n=e===1?"line-clamp-1":e===3?"line-clamp-3":"line-clamp-2";return d.jsx("p",{className:`text-xs text-[var(--color-muted)] ${n}`,children:t})}function zS({left:t,right:e}){return d.jsxs("div",{className:"flex items-center justify-between text-xs text-[var(--color-muted)]",children:[d.jsx("div",{className:"flex items-center gap-2",children:t}),d.jsx("div",{className:"flex items-center gap-2",children:e})]})}function oR({module:t}){return t?d.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)] shrink-0",children:t}):null}function AB({color:t,title:e}){const n=t==="warning"?"bg-[var(--color-warning)]":t==="success"?"bg-[var(--color-success)]":"bg-[var(--color-error)]";return d.jsx("span",{className:`w-2 h-2 rounded-full ${n} shrink-0`,title:e})}function DS({children:t}){return d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:t})}function RB({agent:t}){const e=ds(),n=t.title||t.role||t.name,r=t.title?t.name:void 0;return d.jsxs(PS,{onClick:()=>e(`/agents/${t.id}`),children:[d.jsx(RS,{icon:d.jsx(AS,{emoji:t.icon,fallbackInitial:t.name}),title:n,subtitle:r,indicator:t.hasOverrides?d.jsx(AB,{color:"warning",title:"Has overrides"}):void 0}),d.jsx(_S,{children:t.role?d.jsx(MS,{text:t.role}):d.jsx("div",{className:"h-4"})}),d.jsx(zS,{left:d.jsxs("span",{children:[t.skillCount," skills"]}),right:d.jsx(oR,{module:t.module})})]})}const AN=/^[a-z][a-z0-9-]*$/;function RN({onClose:t,onCreated:e}){const n=tl(),[r,i]=j.useState(""),[s,l]=j.useState(""),[c,u]=j.useState(""),[f,p]=j.useState(""),[m,O]=j.useState(""),[x,v]=j.useState(new Set),[S,k]=j.useState(""),[w,N]=j.useState(""),[C,E]=j.useState([]),[M,R]=j.useState([]),[_,V]=j.useState(!1),[G,D]=j.useState(null),[L,Z]=j.useState(!1);j.useEffect(()=>{fetch("/api/modules").then(q=>q.json()).then(q=>{const K=q;if(E(K.filter(ne=>ne.name!=="bmm"&&ne.name!=="core")),K.length>0){const ne=K.find($=>$.name!=="bmm"&&$.name!=="core");ne&&N(ne.name)}}).catch(()=>{}),fetch("/api/skills").then(q=>q.json()).then(q=>R(q)).catch(()=>{})},[]);const te=_&&r&&!AN.test(r)?"Name must be lowercase letters, numbers, and hyphens only":null,I=M.filter(q=>{if(!S)return!0;const K=S.toLowerCase();return q.name.toLowerCase().includes(K)||q.description.toLowerCase().includes(K)}),B=q=>{v(K=>{const ne=new Set(K);return ne.has(q)?ne.delete(q):ne.add(q),ne})},X=async q=>{var K;if(q.preventDefault(),!(!r||!AN.test(r)||!w)){Z(!0),D(null);try{const ne=await fetch("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r,title:s||r,icon:c||void 0,role:f,persona:m,skills:Array.from(x),module:w})});if(!ne.ok){const $=await ne.json();throw new Error(((K=$.error)==null?void 0:K.message)??"Failed to create agent")}await n.invalidateQueries({queryKey:["agents"]}),e()}catch(ne){D(ne instanceof Error?ne.message:"Failed to create agent")}finally{Z(!1)}}};return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[d.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:t}),d.jsxs("div",{className:"relative w-full max-w-lg bg-[var(--color-bg)] rounded-xl border border-[var(--color-border-subtle)] shadow-2xl flex flex-col max-h-[90vh]",children:[d.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[var(--color-border-subtle)] shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Tn,{size:18,className:"text-[var(--color-accent)]"}),d.jsx("h2",{className:"text-lg font-bold",children:"New Agent"})]}),d.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)] transition-colors",children:d.jsx(Wt,{size:18})})]}),d.jsxs("form",{onSubmit:X,className:"flex flex-col flex-1 overflow-hidden",children:[d.jsxs("div",{className:"px-6 py-5 space-y-4 overflow-y-auto flex-1",children:[d.jsxs("div",{className:"flex gap-3",children:[d.jsxs("div",{className:"flex-1",children:[d.jsxs("label",{className:"block text-xs font-bold mb-1",children:["ID / Name ",d.jsx("span",{className:"text-[var(--color-error)]",children:"*"})]}),d.jsx("input",{value:r,onChange:q=>i(q.target.value),onBlur:()=>V(!0),placeholder:"my-agent",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] outline-none min-h-[36px]"}),te&&d.jsx("p",{className:"text-xs text-[var(--color-error)] mt-1",children:te}),d.jsx("p",{className:"text-[11px] text-[var(--color-muted)] mt-1",children:"Kebab-case ID used for invocation: /my-agent"})]}),d.jsxs("div",{className:"w-20",children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Icon"}),d.jsx("input",{value:c,onChange:q=>u(q.target.value),placeholder:"🤖",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] outline-none min-h-[36px] text-center"})]})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-xs font-bold mb-1",children:["Parent Module ",d.jsx("span",{className:"text-[var(--color-error)]",children:"*"})]}),C.length>0?d.jsx("select",{value:w,onChange:q=>N(q.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] outline-none min-h-[36px]",children:C.map(q=>d.jsx("option",{value:q.name,children:q.name},q.name))}):d.jsx("p",{className:"text-xs text-[var(--color-muted)] py-2",children:"No custom modules found. Create a module first."})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Display Title"}),d.jsx("input",{value:s,onChange:q=>l(q.target.value),placeholder:"e.g. Frontend Developer",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] outline-none min-h-[36px]"}),d.jsx("p",{className:"text-[11px] text-[var(--color-muted)] mt-1",children:"Human-readable name shown in the UI. Defaults to ID if left blank."})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Role / Capabilities"}),d.jsx("input",{value:f,onChange:q=>p(q.target.value),placeholder:"e.g. React specialist, component design, accessibility",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] outline-none min-h-[36px]"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Persona Instructions"}),d.jsx("textarea",{value:m,onChange:q=>O(q.target.value),placeholder:"Describe how this agent should behave, its communication style, and what it specialises in...",rows:4,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] outline-none resize-none"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-xs font-bold mb-1",children:["Skills (",x.size," selected)"]}),d.jsx("input",{value:S,onChange:q=>k(q.target.value),placeholder:"Search skills...",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] outline-none min-h-[36px] mb-2"}),d.jsx("div",{className:"max-h-36 overflow-y-auto space-y-1 rounded-md border border-[var(--color-border-subtle)] p-1",children:I.length===0?d.jsx("p",{className:"text-xs text-[var(--color-muted)] p-2",children:"No skills found"}):I.map(q=>d.jsxs("button",{type:"button",onClick:()=>B(q.id),className:`w-full text-left px-2 py-1.5 rounded text-xs transition-colors flex items-center gap-2 ${x.has(q.id)?"bg-[var(--color-accent)]/10 text-[var(--color-accent)]":"hover:bg-[var(--color-surface-raised)] text-[var(--color-text)]"}`,children:[d.jsx("span",{className:`w-3.5 h-3.5 rounded border shrink-0 flex items-center justify-center text-[9px] ${x.has(q.id)?"bg-[var(--color-accent)] border-[var(--color-accent)] text-white":"border-[var(--color-border-subtle)]"}`,children:x.has(q.id)?"✓":""}),d.jsx("span",{className:"font-bold",children:q.name}),d.jsx("span",{className:"text-[var(--color-muted)] truncate",children:q.description})]},q.id))})]}),G&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:G})]}),d.jsxs("div",{className:"px-6 py-4 border-t border-[var(--color-border-subtle)] flex justify-end gap-3 shrink-0",children:[d.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsx("button",{type:"submit",disabled:!r||!!te||!w||L,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:L?"Creating...":"Create Agent"})]})]})]})]})}function Jg({title:t,count:e,modules:n,moduleCounts:r,activeModule:i,onModuleChange:s,search:l,onSearchChange:c,searchPlaceholder:u,filteredCount:f,actions:p}){return d.jsxs("div",{className:"mb-6",children:[d.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[d.jsxs("h1",{className:"text-2xl font-extrabold shrink-0",children:[t," (",e,")"]}),n.length>0&&d.jsxs("div",{className:"flex gap-1 flex-wrap",children:[d.jsx("button",{onClick:()=>s("all"),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${i==="all"?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"All"}),n.map(m=>d.jsxs("button",{onClick:()=>s(m),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${i===m?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:[m,r&&r[m]!==void 0&&d.jsxs("span",{className:"ml-1 text-xs opacity-60",children:["(",r[m],")"]})]},m))]}),d.jsxs("div",{className:"flex items-center gap-3 ml-auto shrink-0",children:[d.jsxs("div",{className:"relative",children:[d.jsx(hs,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),d.jsx("input",{type:"text",placeholder:u??`Search ${t.toLowerCase()}...`,value:l,onChange:m=>c(m.target.value),className:"pl-9 pr-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-text)] placeholder:text-[var(--color-muted)] outline-none focus:border-[var(--color-accent)] w-64"})]}),p]})]}),f!==void 0&&f!==e&&d.jsxs("p",{className:"text-xs text-[var(--color-muted)] mt-3",children:["Showing ",f," of ",e," ",t.toLowerCase()]})]})}function LS({className:t=""}){return d.jsx("div",{className:`rounded-lg bg-[var(--color-surface-raised)] animate-pulse ${t}`})}function cR({count:t=3,height:e="h-16"}){return d.jsx("div",{className:"space-y-3",children:Array.from({length:t},(n,r)=>d.jsx(LS,{className:e},r))})}function eO({count:t=3}){return d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:t},(e,n)=>d.jsx(LS,{className:"h-24"},n))})}function _B(){const{data:t,isLoading:e,error:n,refetch:r}=lR(),[i,s]=j.useState("all"),[l,c]=j.useState(""),[u,f]=j.useState(!1),p=j.useMemo(()=>{if(!t)return[];const x=new Set;for(const v of t)v.module&&x.add(v.module);return Array.from(x).sort()},[t]),m=j.useMemo(()=>{if(!t)return{};const x={};for(const v of t)v.module&&(x[v.module]=(x[v.module]??0)+1);return x},[t]),O=j.useMemo(()=>{if(!t)return[];let x=t;if(i!=="all"&&(x=x.filter(v=>v.module===i)),l){const v=l.toLowerCase();x=x.filter(S=>S.name.toLowerCase().includes(v)||S.title.toLowerCase().includes(v)||S.role.toLowerCase().includes(v))}return x},[t,i,l]);return e?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"Agents"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"AI agents defined in your BMAD project — each with a role, persona, and assigned skills."}),d.jsx(eO,{count:4})]}):n?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"Agents"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"AI agents defined in your BMAD project — each with a role, persona, and assigned skills."}),d.jsxs("p",{className:"text-[var(--color-error)]",children:["Failed to load agents: ",n.message]})]}):!t||t.length===0?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"Agents"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"AI agents defined in your BMAD project — each with a role, persona, and assigned skills."}),d.jsx(Ci,{icon:Tn,title:"No agents found",description:"Agents are AI personas with defined roles, skills, and communication styles. Each agent specialises in a domain — like a developer, analyst, or project manager — and is invoked by name in your IDE. Install a module to get a curated set of agents, or create a custom one.",actions:d.jsxs(d.Fragment,{children:[d.jsx(zt,{to:"/modules",className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Browse Modules"}),d.jsx("button",{onClick:()=>f(!0),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"New Agent"})]})}),u&&d.jsx(RN,{onClose:()=>f(!1),onCreated:()=>{f(!1),r()}})]}):d.jsxs("div",{children:[d.jsx(Jg,{title:"Agents",count:t.length,modules:p,moduleCounts:m,activeModule:i,onModuleChange:s,search:l,onSearchChange:c,filteredCount:i!=="all"||l?O.length:void 0,actions:d.jsxs("button",{onClick:()=>f(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[d.jsx(Yt,{size:14}),"New Agent"]})}),d.jsx(DS,{children:O.map(x=>d.jsx(RB,{agent:x},x.id))}),O.length===0&&d.jsx("p",{className:"text-center text-sm text-[var(--color-muted)] py-8",children:"No agents match the current filter"}),u&&d.jsx(RN,{onClose:()=>f(!1),onCreated:()=>{f(!1),r()}})]})}async function MB(t){const e=await fetch(`/api/agents/${t}`);if(!e.ok)throw new Error(`Failed to fetch agent ${t}`);return e.json()}function uR(t){return Hs({queryKey:["agents",{id:t}],queryFn:()=>MB(t),enabled:!!t})}function XS(){return Hs({queryKey:["workflows"],queryFn:async()=>{const t=await fetch("/api/workflows");if(!t.ok)throw new Error("Failed to fetch workflows");return t.json()},staleTime:3e4})}function zB(t){return Hs({queryKey:["workflows",{id:t}],queryFn:async()=>{const e=await fetch(`/api/workflows/${t}`);if(!e.ok)throw new Error(`Failed to fetch workflow ${t}`);return e.json()},enabled:!!t})}function ZS(){return Hs({queryKey:["teams"],queryFn:async()=>{const t=await fetch("/api/teams");if(!t.ok)throw new Error("Failed to fetch teams");return t.json()},staleTime:3e4})}function DB(t){return Hs({queryKey:["teams",{id:t}],queryFn:async()=>{const e=await fetch(`/api/teams/${t}`);if(!e.ok)throw new Error(`Failed to fetch team ${t}`);return e.json()},enabled:!!t})}function LB(t){return Hs({queryKey:["teams",{id:t,include:"party"}],queryFn:async()=>{const e=await fetch(`/api/teams/${t}/party`);if(!e.ok)throw new Error(`Failed to fetch party CSV for ${t}`);return e.json()},enabled:!!t})}var XB=Symbol.for("preact-signals");function tO(){if(Xs>1)Xs--;else{var t,e=!1;for((function(){var i=rg;for(rg=void 0;i!==void 0;)i.S.v===i.v&&(i.S.i=i.i),i=i.o})();Hd!==void 0;){var n=Hd;for(Hd=void 0,ng++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&hR(n))try{n.c()}catch(i){e||(t=i,e=!0)}n=r}}if(ng=0,Xs--,e)throw t}}function Jl(t){if(Xs>0)return t();j0=++ZB,Xs++;try{return t()}finally{tO()}}var ut=void 0;function yt(t){var e=ut;ut=void 0;try{return t()}finally{ut=e}}var Hd=void 0,Xs=0,ng=0,ZB=0,j0=0,rg=void 0,ig=0;function dR(t){if(ut!==void 0){var e=t.n;if(e===void 0||e.t!==ut)return e={i:0,S:t,p:ut.s,n:void 0,t:ut,e:void 0,x:void 0,r:e},ut.s!==void 0&&(ut.s.n=e),ut.s=e,t.n=e,32&ut.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=ut.s,e.n=void 0,ut.s.n=e,ut.s=e),e}}function Kn(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched,this.name=e==null?void 0:e.name}Kn.prototype.brand=XB;Kn.prototype.h=function(){return!0};Kn.prototype.S=function(t){var e=this,n=this.t;n!==t&&t.e===void 0&&(t.x=n,this.t=t,n!==void 0?n.e=t:yt(function(){var r;(r=e.W)==null||r.call(e)}))};Kn.prototype.U=function(t){var e=this;if(this.t!==void 0){var n=t.e,r=t.x;n!==void 0&&(n.x=r,t.e=void 0),r!==void 0&&(r.e=n,t.x=void 0),t===this.t&&(this.t=r,r===void 0&&yt(function(){var i;(i=e.Z)==null||i.call(e)}))}};Kn.prototype.subscribe=function(t){var e=this;return ci(function(){var n=e.value,r=ut;ut=void 0;try{t(n)}finally{ut=r}},{name:"sub"})};Kn.prototype.valueOf=function(){return this.value};Kn.prototype.toString=function(){return this.value+""};Kn.prototype.toJSON=function(){return this.value};Kn.prototype.peek=function(){var t=ut;ut=void 0;try{return this.value}finally{ut=t}};Object.defineProperty(Kn.prototype,"value",{get:function(){var t=dR(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(ng>100)throw new Error("Cycle detected");(function(n){Xs!==0&&ng===0&&n.l!==j0&&(n.l=j0,rg={S:n,v:n.v,i:n.i,o:rg})})(this),this.v=t,this.i++,ig++,Xs++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{tO()}}}});function af(t,e){return new Kn(t,e)}function hR(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function fR(t){for(var e=t.s;e!==void 0;e=e.n){var n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function pR(t){for(var e=t.s,n=void 0;e!==void 0;){var r=e.p;e.i===-1?(e.S.U(e),r!==void 0&&(r.n=e.n),e.n!==void 0&&(e.n.p=r)):n=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=r}t.s=n}function ho(t,e){Kn.call(this,void 0),this.x=t,this.s=void 0,this.g=ig-1,this.f=4,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched,this.name=e==null?void 0:e.name}ho.prototype=new Kn;ho.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ig))return!0;if(this.g=ig,this.f|=1,this.i>0&&!hR(this))return this.f&=-2,!0;var t=ut;try{fR(this),ut=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return ut=t,pR(this),this.f&=-2,!0};ho.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}Kn.prototype.S.call(this,t)};ho.prototype.U=function(t){if(this.t!==void 0&&(Kn.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};ho.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(ho.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=dR(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function _N(t,e){return new ho(t,e)}function mR(t){var e=t.m;if(t.m=void 0,typeof e=="function"){Xs++;var n=ut;ut=void 0;try{e()}catch(r){throw t.f&=-2,t.f|=8,qS(t),r}finally{ut=n,tO()}}}function qS(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,mR(t)}function qB(t){if(ut!==this)throw new Error("Out-of-order effect");pR(this),ut=t,this.f&=-2,8&this.f&&qS(this),tO()}function hu(t,e){this.x=t,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=e==null?void 0:e.name}hu.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.m=e)}finally{t()}};hu.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,mR(this),fR(this),Xs++;var t=ut;return ut=this,qB.bind(this,t)};hu.prototype.N=function(){2&this.f||(this.f|=2,this.u=Hd,Hd=this)};hu.prototype.d=function(){this.f|=8,1&this.f||qS(this)};hu.prototype.dispose=function(){this.d()};function ci(t,e){var n=new hu(t,e);try{n.c()}catch(i){throw n.d(),i}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var IB=Object.create,IS=Object.defineProperty,BB=Object.defineProperties,YB=Object.getOwnPropertyDescriptor,VB=Object.getOwnPropertyDescriptors,MN=Object.getOwnPropertySymbols,UB=Object.prototype.hasOwnProperty,WB=Object.prototype.propertyIsEnumerable,GB=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),fu=t=>{throw TypeError(t)},Q0=(t,e,n)=>e in t?IS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,FB=(t,e)=>{for(var n in e||(e={}))UB.call(e,n)&&Q0(t,n,e[n]);if(MN)for(var n of MN(e))WB.call(e,n)&&Q0(t,n,e[n]);return t},HB=(t,e)=>BB(t,VB(e)),zN=(t,e)=>IS(t,"name",{value:e,configurable:!0}),KB=t=>{var e;return[,,,IB((e=void 0)!=null?e:null)]},gR=["class","method","getter","setter","accessor","field","value","get","set"],zd=t=>t!==void 0&&typeof t!="function"?fu("Function expected"):t,JB=(t,e,n,r,i)=>({kind:gR[t],name:e,metadata:r,addInitializer:s=>n._?fu("Already initialized"):i.push(zd(s||null))}),OR=(t,e)=>Q0(e,GB("metadata"),t[3]),kl=(t,e,n,r)=>{for(var i=0,s=t[e>>1],l=s&&s.length;i<l;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},pu=(t,e,n,r,i,s)=>{var l,c,u,f,p,m=e&7,O=!!(e&8),x=!!(e&16),v=m>3?t.length+1:m?O?1:2:0,S=gR[m+5],k=m>3&&(t[v-1]=[]),w=t[v]||(t[v]=[]),N=m&&(!x&&!O&&(i=i.prototype),m<5&&(m>3||!x)&&YB(m<4?i:{get[n](){return Al(this,s)},set[n](E){return Aa(this,s,E)}},n));m?x&&m<4&&zN(s,(m>2?"set ":m>1?"get ":"")+n):zN(i,n);for(var C=r.length-1;C>=0;C--)f=JB(m,n,u={},t[3],w),m&&(f.static=O,f.private=x,p=f.access={has:x?E=>e8(i,E):E=>n in E},m^3&&(p.get=x?E=>(m^1?Al:t8)(E,i,m^4?s:N.get):E=>E[n]),m>2&&(p.set=x?(E,M)=>Aa(E,i,M,m^4?s:N.set):(E,M)=>E[n]=M)),c=(0,r[C])(m?m<4?x?s:N[S]:m>4?void 0:{get:N.get,set:N.set}:i,f),u._=1,m^4||c===void 0?zd(c)&&(m>4?k.unshift(c):m?x?s=c:N[S]=c:i=c):typeof c!="object"||c===null?fu("Object expected"):(zd(l=c.get)&&(N.get=l),zd(l=c.set)&&(N.set=l),zd(l=c.init)&&k.unshift(l));return m||OR(t,i),N&&IS(i,n,N),x?m^4?s:N:i},BS=(t,e,n)=>e.has(t)||fu("Cannot "+n),e8=(t,e)=>Object(e)!==e?fu('Cannot use the "in" operator on this value'):t.has(e),Al=(t,e,n)=>(BS(t,e,"read from private field"),n?n.call(t):e.get(t)),Fp=(t,e,n)=>e.has(t)?fu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Aa=(t,e,n,r)=>(BS(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),t8=(t,e,n)=>(BS(t,e,"access private method"),n);function sg(t,e){if(e){let n;return _N(()=>{const r=t();return r&&n&&e(n,r)?n:(n=r,r)})}return _N(t)}function Yc(t,e){if(Object.is(t,e))return!0;if(t===null||e===null)return!1;if(typeof t=="function"&&typeof e=="function")return t===e;if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}if(Array.isArray(t))return!Array.isArray(e)||t.length!==e.length?!1:!t.some((r,i)=>!Yc(r,e[i]));if(typeof t=="object"&&typeof e=="object"){const n=Object.keys(t),r=Object.keys(e);return n.length!==r.length?!1:!n.some(s=>!Yc(t[s],e[s]))}return!1}function at({get:t},e){return{init(n){return af(n)},get(){return t.call(this).value},set(n){const r=t.call(this);r.peek()!==n&&(r.value=n)}}}function en(t,e){const n=new WeakMap;return function(){let r=n.get(this);return r||(r=sg(t.bind(this)),n.set(this,r)),r.value}}function rv(t=!0){return function(e,n){n.addInitializer(function(){const r=n.kind==="field"?this:n.static?this:Object.getPrototypeOf(this),i=Object.getOwnPropertyDescriptor(r,n.name);i&&Object.defineProperty(r,n.name,HB(FB({},i),{enumerable:t}))})}}function lf(...t){const e=t.map(n=>ci(n));return()=>e.forEach(n=>n())}var xR,bR,vR,yR,SR,wR,Yn,YS,iv,C0,N0,An,VS,sv,kR,T0,US,av,$0,E0;wR=[at],SR=[at],yR=[at],vR=[rv()],bR=[rv()],xR=[rv()];var fo=class{constructor(t,e=Object.is){this.defaultValue=t,this.equals=e,kl(Yn,5,this),Fp(this,An),Fp(this,YS,kl(Yn,8,this)),kl(Yn,11,this),Fp(this,VS,kl(Yn,12,this)),kl(Yn,15,this),Fp(this,US,kl(Yn,16,this)),kl(Yn,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return Al(this,An,$0)}get initial(){return Al(this,An,C0)}get previous(){return Al(this,An,kR)}set current(t){const e=yt(()=>Al(this,An,$0));t&&e&&this.equals(e,t)||Jl(()=>{Al(this,An,C0)||Aa(this,An,t,N0),Aa(this,An,e,T0),Aa(this,An,t,E0)})}reset(t=this.defaultValue){Jl(()=>{Aa(this,An,void 0,T0),Aa(this,An,t,N0),Aa(this,An,t,E0)})}};Yn=KB();YS=new WeakMap;An=new WeakSet;VS=new WeakMap;US=new WeakMap;iv=pu(Yn,20,"#initial",wR,An,YS),C0=iv.get,N0=iv.set;sv=pu(Yn,20,"#previous",SR,An,VS),kR=sv.get,T0=sv.set;av=pu(Yn,20,"#current",yR,An,US),$0=av.get,E0=av.set;pu(Yn,2,"current",vR,fo);pu(Yn,2,"initial",bR,fo);pu(Yn,2,"previous",xR,fo);OR(Yn,fo);function lv(t){return yt(()=>{const e={};for(const n in t)e[n]=t[n];return e})}var n8=Object.create,jR=Object.defineProperty,r8=Object.getOwnPropertyDescriptor,DN=Object.getOwnPropertySymbols,i8=Object.prototype.hasOwnProperty,s8=Object.prototype.propertyIsEnumerable,QR=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),nO=t=>{throw TypeError(t)},LN=Math.pow,P0=(t,e,n)=>e in t?jR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,a8=(t,e)=>{for(var n in e||(e={}))i8.call(e,n)&&P0(t,n,e[n]);if(DN)for(var n of DN(e))s8.call(e,n)&&P0(t,n,e[n]);return t},l8=t=>{var e;return[,,,n8((e=t==null?void 0:t[QR("metadata")])!=null?e:null)]},CR=["class","method","getter","setter","accessor","field","value","get","set"],NR=t=>t!==void 0&&typeof t!="function"?nO("Function expected"):t,o8=(t,e,n,r,i)=>({kind:CR[t],name:e,metadata:r,addInitializer:s=>n._?nO("Already initialized"):i.push(NR(s||null))}),c8=(t,e)=>P0(e,QR("metadata"),t[3]),u8=(t,e,n,r)=>{for(var i=0,s=t[e>>1],l=s&&s.length;i<l;i++)s[i].call(n);return r},TR=(t,e,n,r,i,s)=>{for(var l,c,u,f,p=e&7,m=!1,O=!1,x=2,v=CR[p+5],S=t[x]||(t[x]=[]),k=(i=i.prototype,r8(i,n)),w=r.length-1;w>=0;w--)u=o8(p,n,c={},t[3],S),u.static=m,u.private=O,f=u.access={has:N=>n in N},f.get=N=>N[n],l=(0,r[w])(k[v],u),c._=1,NR(l)&&(k[v]=l);return k&&jR(i,n,k),i},$R=(t,e,n)=>e.has(t)||nO("Cannot "+n),d8=(t,e,n)=>($R(t,e,"read from private field"),e.get(t)),h8=(t,e,n)=>e.has(t)?nO("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),f8=(t,e,n,r)=>($R(t,e,"write to private field"),e.set(t,n),n),Gi=class A0{constructor(e,n){this.x=e,this.y=n}static delta(e,n){return new A0(e.x-n.x,e.y-n.y)}static distance(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}static equals(e,n){return e.x===n.x&&e.y===n.y}static from({x:e,y:n}){return new A0(e,n)}},of=class Cl{constructor(e,n,r,i){this.left=e,this.top=n,this.width=r,this.height=i,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(e,n){const{top:r,left:i,width:s,height:l,scale:c}=this,u=new Cl(i+e,r+n,s,l);return u.scale=a8({},c),u}get boundingRectangle(){const{width:e,height:n,left:r,top:i,right:s,bottom:l}=this;return{width:e,height:n,left:r,top:i,right:s,bottom:l}}get center(){const{left:e,top:n,right:r,bottom:i}=this;return new Gi((e+r)/2,(n+i)/2)}get area(){const{width:e,height:n}=this;return e*n}equals(e){if(!(e instanceof Cl))return!1;const{left:n,top:r,width:i,height:s}=this;return n===e.left&&r===e.top&&i===e.width&&s===e.height}containsPoint(e){const{top:n,left:r,bottom:i,right:s}=this;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=s}intersectionArea(e){return e instanceof Cl?p8(this,e):0}intersectionRatio(e){const{area:n}=this,r=this.intersectionArea(e);return r/(e.area+n-r)}get bottom(){const{top:e,height:n}=this;return e+n}get right(){const{left:e,width:n}=this;return e+n}get aspectRatio(){const{width:e,height:n}=this;return e/n}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:e,left:n,width:r,height:i}){return new Cl(n,e,r,i)}static delta(e,n,r={x:"center",y:"center"}){const i=(s,l)=>{const c=r[l],u=l==="x"?s.left:s.top,f=l==="x"?s.width:s.height;return c=="start"?u:c=="end"?u+f:u+f/2};return Gi.delta({x:i(e,"x"),y:i(e,"y")},{x:i(n,"x"),y:i(n,"y")})}static intersectionRatio(e,n){return Cl.from(e).intersectionRatio(Cl.from(n))}};function p8(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height),l=i-r,c=s-n;return r<i&&n<s?l*c:0}var ER,PR,R0,Cm,cf,rO=class extends(R0=fo,PR=[en],ER=[en],R0){constructor(e){const n=Gi.from(e);super(n,(r,i)=>Gi.equals(r,i)),u8(cf,5,this),h8(this,Cm,0),this.velocity={x:0,y:0}}get delta(){return Gi.delta(this.current,this.initial)}get direction(){const{current:e,previous:n}=this;if(!n)return null;const r={x:e.x-n.x,y:e.y-n.y};return!r.x&&!r.y?null:Math.abs(r.x)>Math.abs(r.y)?r.x>0?"right":"left":r.y>0?"down":"up"}get current(){return super.current}set current(e){const{current:n}=this,r=Gi.from(e),i={x:r.x-n.x,y:r.y-n.y},s=Date.now(),l=s-d8(this,Cm),c=u=>Math.round(u/l*100);Jl(()=>{f8(this,Cm,s),this.velocity={x:c(i.x),y:c(i.y)},super.current=r})}reset(e=this.defaultValue){super.reset(Gi.from(e)),this.velocity={x:0,y:0}}};cf=l8(R0);Cm=new WeakMap;TR(cf,2,"delta",PR,rO);TR(cf,2,"direction",ER,rO);c8(cf,rO);function _0({x:t,y:e},n){const r=Math.abs(t),i=Math.abs(e);return typeof n=="number"?Math.sqrt(LN(r,2)+LN(i,2))>n:"x"in n&&"y"in n?r>n.x&&i>n.y:"x"in n?r>n.x:"y"in n?i>n.y:!1}var AR=(t=>(t.Horizontal="x",t.Vertical="y",t))(AR||{}),RR=Object.values(AR),m8=Object.create,WS=Object.defineProperty,g8=Object.defineProperties,O8=Object.getOwnPropertyDescriptor,x8=Object.getOwnPropertyDescriptors,ag=Object.getOwnPropertySymbols,_R=Object.prototype.hasOwnProperty,MR=Object.prototype.propertyIsEnumerable,zR=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),mu=t=>{throw TypeError(t)},M0=(t,e,n)=>e in t?WS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,DR=(t,e)=>{for(var n in e||(e={}))_R.call(e,n)&&M0(t,n,e[n]);if(ag)for(var n of ag(e))MR.call(e,n)&&M0(t,n,e[n]);return t},LR=(t,e)=>g8(t,x8(e)),XN=(t,e)=>WS(t,"name",{value:e,configurable:!0}),XR=(t,e)=>{var n={};for(var r in t)_R.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&ag)for(var r of ag(t))e.indexOf(r)<0&&MR.call(t,r)&&(n[r]=t[r]);return n},gu=t=>{var e;return[,,,m8((e=t==null?void 0:t[zR("metadata")])!=null?e:null)]},ZR=["class","method","getter","setter","accessor","field","value","get","set"],Dd=t=>t!==void 0&&typeof t!="function"?mu("Function expected"):t,b8=(t,e,n,r,i)=>({kind:ZR[t],name:e,metadata:r,addInitializer:s=>n._?mu("Already initialized"):i.push(Dd(s||null))}),po=(t,e)=>M0(e,zR("metadata"),t[3]),ze=(t,e,n,r)=>{for(var i=0,s=t[e>>1],l=s&&s.length;i<l;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},tt=(t,e,n,r,i,s)=>{var l,c,u,f,p,m=e&7,O=!!(e&8),x=!!(e&16),v=m>3?t.length+1:m?O?1:2:0,S=ZR[m+5],k=m>3&&(t[v-1]=[]),w=t[v]||(t[v]=[]),N=m&&(!x&&!O&&(i=i.prototype),m<5&&(m>3||!x)&&O8(m<4?i:{get[n](){return xn(this,s)},set[n](E){return Kr(this,s,E)}},n));m?x&&m<4&&XN(s,(m>2?"set ":m>1?"get ":"")+n):XN(i,n);for(var C=r.length-1;C>=0;C--)f=b8(m,n,u={},t[3],w),m&&(f.static=O,f.private=x,p=f.access={has:x?E=>v8(i,E):E=>n in E},m^3&&(p.get=x?E=>(m^1?xn:y8)(E,i,m^4?s:N.get):E=>E[n]),m>2&&(p.set=x?(E,M)=>Kr(E,i,M,m^4?s:N.set):(E,M)=>E[n]=M)),c=(0,r[C])(m?m<4?x?s:N[S]:m>4?void 0:{get:N.get,set:N.set}:i,f),u._=1,m^4||c===void 0?Dd(c)&&(m>4?k.unshift(c):m?x?s=c:N[S]=c:i=c):typeof c!="object"||c===null?mu("Object expected"):(Dd(l=c.get)&&(N.get=l),Dd(l=c.set)&&(N.set=l),Dd(l=c.init)&&k.unshift(l));return m||po(t,i),N&&WS(i,n,N),x?m^4?s:N:i},GS=(t,e,n)=>e.has(t)||mu("Cannot "+n),v8=(t,e)=>Object(e)!==e?mu('Cannot use the "in" operator on this value'):t.has(e),xn=(t,e,n)=>(GS(t,e,"read from private field"),n?n.call(t):e.get(t)),vt=(t,e,n)=>e.has(t)?mu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Kr=(t,e,n,r)=>(GS(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),y8=(t,e,n)=>(GS(t,e,"access private method"),n);function qR(t,e){return{plugin:t,options:e}}function FS(t){return e=>qR(t,e)}function HS(t){return typeof t=="function"?{plugin:t,options:void 0}:t}var IR,wh,KS,Nm;IR=[at];var xr=class{constructor(t,e){this.manager=t,this.options=e,vt(this,KS,ze(wh,8,this,!1)),ze(wh,11,this),vt(this,Nm,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return yt(()=>this.disabled)}configure(t){this.options=t}registerEffect(t){const e=ci(t.bind(this));return xn(this,Nm).add(e),e}destroy(){xn(this,Nm).forEach(t=>t())}static configure(t){return qR(this,t)}};wh=gu(null);KS=new WeakMap;Nm=new WeakMap;tt(wh,4,"disabled",IR,xr,KS);po(wh,xr);var uf=class extends xr{},Tm,ov=class{constructor(t){this.manager=t,this.instances=new Map,vt(this,Tm,[])}get values(){return Array.from(this.instances.values())}set values(t){const e=t.map(HS).reduceRight((r,i)=>r.some(({plugin:s})=>s===i.plugin)?r:[i,...r],[]),n=e.map(({plugin:r})=>r);for(const r of xn(this,Tm))if(!n.includes(r)){if(r.prototype instanceof uf)continue;this.unregister(r)}for(const{plugin:r,options:i}of e)this.register(r,i);Kr(this,Tm,n)}get(t){return this.instances.get(t)}register(t,e){const n=this.instances.get(t);if(n)return n.options!==e&&(n.options=e),n;const r=new t(this.manager,e);return this.instances.set(t,r),r}unregister(t){const e=this.instances.get(t);e&&(e.destroy(),this.instances.delete(t))}destroy(){for(const t of this.instances.values())t.destroy();this.instances.clear()}};Tm=new WeakMap;function S8(t,e){return t.priority===e.priority?t.type===e.type?e.value-t.value:e.type-t.type:e.priority-t.priority}var Hp=[],uc,dc,w8=class extends xr{constructor(t){super(t),vt(this,uc),vt(this,dc),this.computeCollisions=this.computeCollisions.bind(this),Kr(this,dc,af(Hp)),this.destroy=lf(()=>{const e=this.computeCollisions(),n=yt(()=>this.manager.dragOperation.position.current);if(e!==Hp){const r=xn(this,uc);if(Kr(this,uc,n),r&&n.x==r.x&&n.y==r.y)return}else Kr(this,uc,void 0);xn(this,dc).value=e},()=>{const{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()})}forceUpdate(t=!0){yt(()=>{t?xn(this,dc).value=this.computeCollisions():Kr(this,uc,void 0)})}computeCollisions(t,e){const{registry:n,dragOperation:r}=this.manager,{source:i,shape:s,status:l}=r;if(!l.initialized||!s)return Hp;const c=[],u=[];for(const f of t??n.droppables){if(f.disabled||i&&!f.accepts(i))continue;const p=e??f.collisionDetector;if(!p)continue;u.push(f),f.shape;const m=yt(()=>p({droppable:f,dragOperation:r}));m&&(f.collisionPriority!=null&&(m.priority=f.collisionPriority),c.push(m))}return u.length===0?Hp:(c.sort(S8),c)}get collisions(){return xn(this,dc).value}};uc=new WeakMap;dc=new WeakMap;var k8=class{constructor(){this.registry=new Map}addEventListener(t,e){const{registry:n}=this,r=new Set(n.get(t));return r.add(e),n.set(t,r),()=>this.removeEventListener(t,e)}removeEventListener(t,e){const{registry:n}=this,r=new Set(n.get(t));r.delete(e),n.set(t,r)}dispatch(t,...e){const{registry:n}=this,r=n.get(t);if(r)for(const i of r)i(...e)}},j8=class extends k8{constructor(t){super(),this.manager=t}dispatch(t,e){const n=[e,this.manager];super.dispatch(t,...n)}};function $m(t,e=!0){let n=!1;return LR(DR({},t),{cancelable:e,get defaultPrevented(){return n},preventDefault(){e&&(n=!0)}})}var Q8=class extends uf{constructor(t){super(t);const e=(r,i)=>r.map(({id:s})=>s).join("")===i.map(({id:s})=>s).join("");let n=[];this.destroy=lf(()=>{const{dragOperation:r,collisionObserver:i}=t;r.status.initializing&&(n=[],i.enable())},()=>{const{collisionObserver:r,monitor:i}=t,{collisions:s}=r;if(r.isDisabled())return;const l=$m({collisions:s});if(i.dispatch("collision",l),l.defaultPrevented||e(s,n))return;n=s;const[c]=s;yt(()=>{var u;(c==null?void 0:c.id)!==((u=t.dragOperation.target)==null?void 0:u.id)&&(r.disable(),t.actions.setDropTarget(c==null?void 0:c.id).then(()=>{r.enable()}))})})}},df=(t=>(t[t.Lowest=0]="Lowest",t[t.Low=1]="Low",t[t.Normal=2]="Normal",t[t.High=3]="High",t[t.Highest=4]="Highest",t))(df||{}),hf=(t=>(t[t.Collision=0]="Collision",t[t.ShapeIntersection=1]="ShapeIntersection",t[t.PointerIntersection=2]="PointerIntersection",t))(hf||{}),BR,YR,VR,UR,WR,GR,FR,ii,JS;FR=[at],GR=[en],WR=[en],UR=[en],VR=[en],YR=[en],BR=[en];var Ks=class{constructor(){ze(ii,5,this),vt(this,JS,ze(ii,8,this,"idle")),ze(ii,11,this)}get current(){return this.value}get idle(){return this.value==="idle"}get initializing(){return this.value==="initializing"}get initialized(){const{value:t}=this;return t!=="idle"&&t!=="initialization-pending"}get dragging(){return this.value==="dragging"}get dropped(){return this.value==="dropped"}set(t){this.value=t}};ii=gu(null);JS=new WeakMap;tt(ii,4,"value",FR,Ks,JS);tt(ii,2,"current",GR,Ks);tt(ii,2,"idle",WR,Ks);tt(ii,2,"initializing",UR,Ks);tt(ii,2,"initialized",VR,Ks);tt(ii,2,"dragging",YR,Ks);tt(ii,2,"dropped",BR,Ks);po(ii,Ks);var C8=class{constructor(t){this.manager=t}setDragSource(t){const{dragOperation:e}=this.manager;e.sourceIdentifier=typeof t=="string"||typeof t=="number"?t:t.id}setDropTarget(t){return yt(()=>{const{dragOperation:e}=this.manager,n=t??null;if(e.targetIdentifier===n)return Promise.resolve(!1);e.targetIdentifier=n;const r=$m({operation:e.snapshot()});return e.status.dragging&&this.manager.monitor.dispatch("dragover",r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(t){return yt(()=>{const{dragOperation:e}=this.manager;if(t.source!=null&&this.setDragSource(t.source),!e.source)throw new Error("Cannot start a drag operation without a drag source");if(!e.status.idle)throw new Error("Cannot start a drag operation while another is active");const r=new AbortController,{event:i,coordinates:s}=t;Jl(()=>{e.status.set("initialization-pending"),e.shape=null,e.canceled=!1,e.activatorEvent=i??null,e.position.reset(s)});const l=$m({operation:e.snapshot()});return this.manager.monitor.dispatch("beforedragstart",l),l.defaultPrevented?(e.reset(),r.abort(),r):(e.status.set("initializing"),e.controller=r,this.manager.renderer.rendering.then(()=>{if(r.signal.aborted)return;const{status:c}=e;c.current==="initializing"&&(e.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:i,operation:e.snapshot(),cancelable:!1}))}),r)})}move(t){return yt(()=>{var e,n;const{dragOperation:r}=this.manager,{status:i,controller:s}=r;if(!i.dragging||!s||s.signal.aborted)return;const l=$m({nativeEvent:t.event,operation:r.snapshot(),by:t.by,to:t.to},(e=t.cancelable)!=null?e:!0);((n=t.propagate)==null||n)&&this.manager.monitor.dispatch("dragmove",l),queueMicrotask(()=>{var c,u,f,p,m;if(l.defaultPrevented)return;const O=(m=t.to)!=null?m:{x:r.position.current.x+((u=(c=t.by)==null?void 0:c.x)!=null?u:0),y:r.position.current.y+((p=(f=t.by)==null?void 0:f.y)!=null?p:0)};r.position.current=O})})}stop(t={}){return yt(()=>{var e,n;const{dragOperation:r}=this.manager,{controller:i}=r;if(!i||i.signal.aborted)return;let s;const l=()=>{const u={resume:()=>{},abort:()=>{}};return s=new Promise((f,p)=>{u.resume=f,u.abort=p}),u};i.abort();const c=()=>{this.manager.renderer.rendering.then(()=>{r.status.set("dropped");const u=yt(()=>{var p;return((p=r.source)==null?void 0:p.status)==="dropping"}),f=()=>{r.controller===i&&(r.controller=void 0),r.reset()};if(u){const{source:p}=r,m=ci(()=>{(p==null?void 0:p.status)==="idle"&&(m(),f())})}else this.manager.renderer.rendering.then(f)})};r.canceled=(e=t.canceled)!=null?e:!1,this.manager.monitor.dispatch("dragend",{nativeEvent:t.event,operation:r.snapshot(),canceled:(n=t.canceled)!=null?n:!1,suspend:l}),s?s.then(c).catch(()=>r.reset()):c()})}},HR,KR,JR,e_,fr,ew,tw,nw,rw;e_=[at],JR=[at],KR=[at],HR=[at];var nl=class{constructor(t,e){vt(this,ew,ze(fr,8,this)),ze(fr,11,this),vt(this,tw,ze(fr,12,this)),ze(fr,15,this),vt(this,nw,ze(fr,16,this)),ze(fr,19,this),vt(this,rw,ze(fr,20,this)),ze(fr,23,this);const{effects:n,id:r,data:i={},disabled:s=!1,register:l=!0}=t;let c=r;this.manager=e,this.id=r,this.data=i,this.disabled=s,this.effects=()=>{var u;return[()=>{const{id:f,manager:p}=this;if(f!==c)return p==null||p.registry.register(this),()=>p==null?void 0:p.registry.unregister(this)},...(u=n==null?void 0:n())!=null?u:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),e&&l&&queueMicrotask(this.register)}register(){var t;return(t=this.manager)==null?void 0:t.registry.register(this)}unregister(){var t;(t=this.manager)==null||t.registry.unregister(this)}destroy(){var t;(t=this.manager)==null||t.registry.unregister(this)}};fr=gu(null);ew=new WeakMap;tw=new WeakMap;nw=new WeakMap;rw=new WeakMap;tt(fr,4,"manager",e_,nl,ew);tt(fr,4,"id",JR,nl,tw);tt(fr,4,"data",KR,nl,nw);tt(fr,4,"disabled",HR,nl,rw);po(fr,nl);var ZN=class{constructor(){this.map=af(new Map),this.cleanupFunctions=new WeakMap,this.register=(t,e)=>{const n=this.map.peek(),r=n.get(t),i=()=>this.unregister(t,e);if(r===e)return i;if(r){const c=this.cleanupFunctions.get(r);c==null||c(),this.cleanupFunctions.delete(r)}const s=new Map(n);s.set(t,e),this.map.value=s;const l=lf(...e.effects());return this.cleanupFunctions.set(e,l),i},this.unregister=(t,e)=>{const n=this.map.peek();if(n.get(t)!==e)return;const r=this.cleanupFunctions.get(e);r==null||r(),this.cleanupFunctions.delete(e);const i=new Map(n);i.delete(t),this.map.value=i}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(t){return this.map.value.has(t)}get(t){return this.map.value.get(t)}destroy(){for(const t of this){const e=this.cleanupFunctions.get(t);e==null||e(),t.destroy()}this.map.value=new Map}},t_,n_,r_,i_,s_,a_,z0,Vn,iw,sw,aw,ls=class extends(z0=nl,a_=[at],s_=[at],i_=[at],r_=[en],n_=[en],t_=[en],z0){constructor(e,n){var r=e,{modifiers:i,type:s,sensors:l}=r,c=XR(r,["modifiers","type","sensors"]);super(c,n),ze(Vn,5,this),vt(this,iw,ze(Vn,8,this)),ze(Vn,11,this),vt(this,sw,ze(Vn,12,this)),ze(Vn,15,this),vt(this,aw,ze(Vn,16,this,this.isDragSource?"dragging":"idle")),ze(Vn,19,this),this.type=s,this.sensors=l,this.modifiers=i,this.alignment=c.alignment}get isDropping(){return this.status==="dropping"&&this.isDragSource}get isDragging(){return this.status==="dragging"&&this.isDragSource}get isDragSource(){var e,n;return((n=(e=this.manager)==null?void 0:e.dragOperation.source)==null?void 0:n.id)===this.id}};Vn=gu(z0);iw=new WeakMap;sw=new WeakMap;aw=new WeakMap;tt(Vn,4,"type",a_,ls,iw);tt(Vn,4,"modifiers",s_,ls,sw);tt(Vn,4,"status",i_,ls,aw);tt(Vn,2,"isDropping",r_,ls);tt(Vn,2,"isDragging",n_,ls);tt(Vn,2,"isDragSource",t_,ls);po(Vn,ls);var l_,o_,c_,u_,d_,h_,D0,dn,lw,ow,cw,uw,dw,os=class extends(D0=nl,h_=[at],d_=[at],u_=[at],c_=[at],o_=[at],l_=[en],D0){constructor(e,n){var r=e,{accept:i,collisionDetector:s,collisionPriority:l,type:c}=r,u=XR(r,["accept","collisionDetector","collisionPriority","type"]);super(u,n),ze(dn,5,this),vt(this,lw,ze(dn,8,this)),ze(dn,11,this),vt(this,ow,ze(dn,12,this)),ze(dn,15,this),vt(this,cw,ze(dn,16,this)),ze(dn,19,this),vt(this,uw,ze(dn,20,this)),ze(dn,23,this),vt(this,dw,ze(dn,24,this)),ze(dn,27,this),this.accept=i,this.collisionDetector=s,this.collisionPriority=l,this.type=c}accepts(e){const{accept:n}=this;return n?typeof n=="function"?n(e):e.type?Array.isArray(n)?n.includes(e.type):e.type===n:!1:!0}get isDropTarget(){var e,n;return((n=(e=this.manager)==null?void 0:e.dragOperation.target)==null?void 0:n.id)===this.id}};dn=gu(D0);lw=new WeakMap;ow=new WeakMap;cw=new WeakMap;uw=new WeakMap;dw=new WeakMap;tt(dn,4,"accept",h_,os,lw);tt(dn,4,"type",d_,os,ow);tt(dn,4,"collisionDetector",u_,os,cw);tt(dn,4,"collisionPriority",c_,os,uw);tt(dn,4,"shape",o_,os,dw);tt(dn,2,"isDropTarget",l_,os);po(dn,os);var Vc=class extends xr{constructor(t,e){super(t,e),this.manager=t,this.options=e}},N8=class extends AbortController{constructor(t,e){super(),this.constraints=t,this.onActivate=e,this.activated=!1;for(const n of t??[])n.controller=this}onEvent(t){var e;if(!this.activated)if((e=this.constraints)!=null&&e.length)for(const n of this.constraints)n.onEvent(t);else this.activate(t)}activate(t){this.activated||(this.activated=!0,this.onActivate(t))}abort(t){this.activated=!1,super.abort(t)}},Em,f_=class{constructor(t){this.options=t,vt(this,Em)}set controller(t){Kr(this,Em,t),t.signal.addEventListener("abort",()=>this.abort())}activate(t){var e;(e=xn(this,Em))==null||e.activate(t)}};Em=new WeakMap;var qN=class extends xr{constructor(e,n){super(e,n),this.manager=e,this.options=n}apply(e){return e.transform}},T8=class{constructor(t){this.draggables=new ZN,this.droppables=new ZN,this.plugins=new ov(t),this.sensors=new ov(t),this.modifiers=new ov(t)}register(t,e){if(t instanceof ls)return this.draggables.register(t.id,t);if(t instanceof os)return this.droppables.register(t.id,t);if(t.prototype instanceof qN)return this.modifiers.register(t,e);if(t.prototype instanceof Vc)return this.sensors.register(t,e);if(t.prototype instanceof xr)return this.plugins.register(t,e);throw new Error("Invalid instance type")}unregister(t){if(t instanceof nl)return t instanceof ls?this.draggables.unregister(t.id,t):t instanceof os?this.droppables.unregister(t.id,t):()=>{};if(t.prototype instanceof qN)return this.modifiers.unregister(t);if(t.prototype instanceof Vc)return this.sensors.unregister(t);if(t.prototype instanceof xr)return this.plugins.unregister(t);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},p_,m_,g_,O_,x_,b_,v_,y_,S_,Ld,Pm,hc,Bt,hw,fw,pw,mw,gw,Xd;S_=[en],y_=[at],v_=[at],b_=[at],x_=[at],O_=[at],g_=[en],m_=[en],p_=[en];var Ni=class{constructor(t){ze(Bt,5,this),vt(this,Ld),vt(this,Pm),vt(this,hc,new fo(void 0,(e,n)=>e&&n?e.equals(n):e===n)),this.status=new Ks,vt(this,hw,ze(Bt,8,this,!1)),ze(Bt,11,this),vt(this,fw,ze(Bt,12,this,null)),ze(Bt,15,this),vt(this,pw,ze(Bt,16,this,null)),ze(Bt,19,this),vt(this,mw,ze(Bt,20,this,null)),ze(Bt,23,this),vt(this,gw,ze(Bt,24,this,[])),ze(Bt,27,this),this.position=new rO({x:0,y:0}),vt(this,Xd,{x:0,y:0}),Kr(this,Ld,t)}get shape(){const{current:t,initial:e,previous:n}=xn(this,hc);return!t||!e?null:{current:t,initial:e,previous:n}}set shape(t){t?xn(this,hc).current=t:xn(this,hc).reset()}get source(){var t;const e=this.sourceIdentifier;if(e==null)return null;const n=xn(this,Ld).registry.draggables.get(e);return n&&Kr(this,Pm,n),(t=n??xn(this,Pm))!=null?t:null}get target(){var t;const e=this.targetIdentifier;return e!=null&&(t=xn(this,Ld).registry.droppables.get(e))!=null?t:null}get transform(){const{x:t,y:e}=this.position.delta;let n={x:t,y:e};for(const r of this.modifiers)n=r.apply(LR(DR({},this.snapshot()),{transform:n}));return Kr(this,Xd,n),n}snapshot(){return yt(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:xn(this,Xd),shape:this.shape?lv(this.shape):null,position:lv(this.position),status:lv(this.status),canceled:this.canceled}))}reset(){Jl(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,xn(this,hc).reset(),this.position.reset({x:0,y:0}),Kr(this,Xd,{x:0,y:0}),this.modifiers=[]})}};Bt=gu(null);Ld=new WeakMap;Pm=new WeakMap;hc=new WeakMap;hw=new WeakMap;fw=new WeakMap;pw=new WeakMap;mw=new WeakMap;gw=new WeakMap;Xd=new WeakMap;tt(Bt,2,"shape",S_,Ni);tt(Bt,4,"canceled",y_,Ni,hw);tt(Bt,4,"activatorEvent",v_,Ni,fw);tt(Bt,4,"sourceIdentifier",b_,Ni,pw);tt(Bt,4,"targetIdentifier",x_,Ni,mw);tt(Bt,4,"modifiers",O_,Ni,gw);tt(Bt,2,"source",g_,Ni);tt(Bt,2,"target",m_,Ni);tt(Bt,2,"transform",p_,Ni);po(Bt,Ni);var $8={get rendering(){return Promise.resolve()}};function Zs(t,e){return typeof t=="function"?t(e):t??e}var E8=class{constructor(e){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(O=>O.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};var n;const r=e??{},i=Zs(r.plugins,[]),s=Zs(r.sensors,[]),l=Zs(r.modifiers,[]),c=(n=r.renderer)!=null?n:$8,u=new j8(this),f=new T8(this);this.registry=f,this.monitor=u,this.renderer=c,this.actions=new C8(this),this.dragOperation=new Ni(this),this.collisionObserver=new w8(this),this.plugins=[Q8,...i],this.modifiers=l,this.sensors=s;const{destroy:p}=this,m=lf(()=>{var O,x,v;const S=yt(()=>this.dragOperation.modifiers),k=this.modifiers;for(const w of S)k.includes(w)||w.destroy();this.dragOperation.modifiers=(v=(x=(O=this.dragOperation.source)==null?void 0:O.modifiers)==null?void 0:x.map(w=>{const{plugin:N,options:C}=HS(w);return new N(this,C)}))!=null?v:k});this.destroy=()=>{m(),p()}}get plugins(){return this.registry.plugins.values}set plugins(e){this.registry.plugins.values=e}get modifiers(){return this.registry.modifiers.values}set modifiers(e){this.registry.modifiers.values=e}get sensors(){return this.registry.sensors.values}set sensors(e){this.registry.sensors.values=e}},w_=t=>{throw TypeError(t)},Ow=(t,e,n)=>e.has(t)||w_("Cannot "+n),Ze=(t,e,n)=>(Ow(t,e,"read from private field"),e.get(t)),dr=(t,e,n)=>e.has(t)?w_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Pr=(t,e,n,r)=>(Ow(t,e,"write to private field"),e.set(t,n),n),k_=(t,e,n)=>(Ow(t,e,"access private method"),n);function iO(t){return t?t instanceof KeyframeEffect?!0:"getKeyframes"in t&&typeof t.getKeyframes=="function":!1}function P8(t,e){const n=t.getAnimations();if(n.length>0)for(const r of n){if(r.playState!=="running")continue;const{effect:i}=r,l=(iO(i)?i.getKeyframes():[]).filter(e);if(l.length>0)return[l[l.length-1],r]}return null}function sO(t){const{width:e,height:n,top:r,left:i,bottom:s,right:l}=t.getBoundingClientRect();return{width:e,height:n,top:r,left:i,bottom:s,right:l}}function xw(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function ff(t){return"nodeType"in t}function ui(t){var e,n,r;return t?xw(t)?t:ff(t)?"defaultView"in t?(e=t.defaultView)!=null?e:window:(r=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?r:window:window:window}function bw(t){const{Document:e}=ui(t);return t instanceof e||"nodeType"in t&&t.nodeType===Node.DOCUMENT_NODE}function eo(t){return!t||xw(t)?!1:t instanceof ui(t).HTMLElement||"namespaceURI"in t&&typeof t.namespaceURI=="string"&&t.namespaceURI.endsWith("html")}function j_(t){return t instanceof ui(t).SVGElement||"namespaceURI"in t&&typeof t.namespaceURI=="string"&&t.namespaceURI.endsWith("svg")}function mo(t){return t?xw(t)?t.document:ff(t)?bw(t)?t:eo(t)||j_(t)?t.ownerDocument:document:document:document}function A8(t){var e,n,r,i;const{documentElement:s}=mo(t),l=ui(t).visualViewport,c=(e=l==null?void 0:l.width)!=null?e:s.clientWidth,u=(n=l==null?void 0:l.height)!=null?n:s.clientHeight,f=(r=l==null?void 0:l.offsetTop)!=null?r:0,p=(i=l==null?void 0:l.offsetLeft)!=null?i:0;return{top:f,left:p,right:p+c,bottom:f+u,width:c,height:u}}function R8(t,e){if(_8(t)&&t.open===!1)return!1;const{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(t);return n==="visible"&&r==="visible"&&i==="visible"}function _8(t){return t.tagName==="DETAILS"}function lg(t,e=t.getBoundingClientRect(),n=0){var r,i,s,l,c;let u=e;const{ownerDocument:f}=t,p=(r=f.defaultView)!=null?r:window;let m=t.parentElement;for(;m&&m!==f.documentElement;){if(!R8(m)){const C=m.getBoundingClientRect(),E=n*(C.bottom-C.top),M=n*(C.right-C.left),R=n*(C.bottom-C.top),_=n*(C.right-C.left);u={top:Math.max(u.top,C.top-E),right:Math.min(u.right,C.right+M),bottom:Math.min(u.bottom,C.bottom+R),left:Math.max(u.left,C.left-_),width:0,height:0},u.width=u.right-u.left,u.height=u.bottom-u.top}m=m.parentElement}const O=p.visualViewport,x=(i=O==null?void 0:O.offsetTop)!=null?i:0,v=(s=O==null?void 0:O.offsetLeft)!=null?s:0,S=(l=O==null?void 0:O.width)!=null?l:p.innerWidth,k=(c=O==null?void 0:O.height)!=null?c:p.innerHeight,w=n*k,N=n*S;return u={top:Math.max(u.top,x-w),right:Math.min(u.right,v+S+N),bottom:Math.min(u.bottom,x+k+w),left:Math.max(u.left,v-N),width:0,height:0},u.width=u.right-u.left,u.height=u.bottom-u.top,u.width<0&&(u.width=0),u.height<0&&(u.height=0),u}function Uc(t){return{x:t.clientX,y:t.clientY}}var Q_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function L0(t=document,e=new Set){if(e.has(t))return[];e.add(t);const n=[t];for(const r of Array.from(t.querySelectorAll("iframe, frame")))try{const i=r.contentDocument;i&&!e.has(i)&&n.push(...L0(i,e))}catch{}try{const r=t.defaultView;if(r&&r!==window.top){const i=r.parent;i&&i.document&&i.document!==t&&n.push(...L0(i.document,e))}}catch{}return n}function vw(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function C_(){var t,e;const n=vw()?window.visualViewport:null;return{x:(t=n==null?void 0:n.offsetLeft)!=null?t:0,y:(e=n==null?void 0:n.offsetTop)!=null?e:0}}function yw(t){return!t||!ff(t)?!1:t instanceof ui(t).ShadowRoot}function og(t){if(t&&ff(t)){let e=t.getRootNode();if(yw(e))return e;if(e instanceof Document)return e}return mo(t)}function N_(t){return t.matchMedia("(prefers-reduced-motion: reduce)").matches}function M8(t){const e="input, textarea, select, canvas, [contenteditable]",n=t.cloneNode(!0),r=Array.from(t.querySelectorAll(e));return Array.from(n.querySelectorAll(e)).forEach((s,l)=>{const c=r[l];if(IN(s)&&IN(c)&&(s.type!=="file"&&(s.value=c.value),s.type==="radio"&&s.name&&(s.name=`Cloned__${s.name}`)),BN(s)&&BN(c)&&c.width>0&&c.height>0){const u=s.getContext("2d");u==null||u.drawImage(c,0,0)}}),n}function IN(t){return"value"in t}function BN(t){return t.tagName==="CANVAS"}function T_(t,{x:e,y:n}){const r=t.elementFromPoint(e,n);if(z8(r)){const{contentDocument:i}=r;if(i){const{left:s,top:l}=r.getBoundingClientRect();return T_(i,{x:e-s,y:n-l})}}return r}function z8(t){return(t==null?void 0:t.tagName)==="IFRAME"}var YN=new WeakMap;function D8(t){return!!t.closest(`
|
|
452
|
+
input:not([disabled]),
|
|
453
|
+
select:not([disabled]),
|
|
454
|
+
textarea:not([disabled]),
|
|
455
|
+
button:not([disabled]),
|
|
456
|
+
a[href],
|
|
457
|
+
[contenteditable]:not([contenteditable="false"])
|
|
458
|
+
`)}var $_=class{constructor(){this.entries=new Set,this.clear=()=>{for(const t of this.entries){const[e,{type:n,listener:r,options:i}]=t;e.removeEventListener(n,r,i)}this.entries.clear()}}bind(t,e){const n=Array.isArray(t)?t:[t],r=Array.isArray(e)?e:[e],i=[];for(const s of n)for(const l of r){const{type:c,listener:u,options:f}=l,p=[s,l];s.addEventListener(c,u,f),this.entries.add(p),i.push(p)}return function(){for(const[l,{type:c,listener:u,options:f}]of i)l.removeEventListener(c,u,f)}}};function Wc(t){const e=t==null?void 0:t.ownerDocument.defaultView;if(e&&e.self!==e.parent)return e.frameElement}function L8(t){const e=new Set;let n=Wc(t);for(;n;)e.add(n),n=Wc(n);return e}function X8(t,e){const n=setTimeout(t,e);return()=>clearTimeout(n)}function E_(t,e){const n=()=>performance.now();let r,i;return function(...s){const l=this;i?(r==null||r(),r=X8(()=>{t.apply(l,s),i=n()},e-(n()-i))):(t.apply(l,s),i=n())}}function Z8(t,e){return t===e?!0:!t||!e?!1:t.top==e.top&&t.left==e.left&&t.right==e.right&&t.bottom==e.bottom}function q8(t,e=t.getBoundingClientRect()){const{width:n,height:r}=lg(t,e);return n>0&&r>0}var I8=Q_?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},Am,B8=class extends I8{constructor(t){super(e=>{if(!Ze(this,Am)){Pr(this,Am,!0);return}t(e,this)}),dr(this,Am,!1)}};Am=new WeakMap;var VN=Array.from({length:100},(t,e)=>e/100),P_=75,Nl,cg,Ea,Tl,Zd,Qn,Kd,qd,ug,A_,R_,__=class{constructor(t,e,n={debug:!1,skipInitial:!1}){this.element=t,this.callback=e,dr(this,ug),this.disconnect=()=>{var s,l,c;Pr(this,Kd,!0),(s=Ze(this,Ea))==null||s.disconnect(),(l=Ze(this,Tl))==null||l.disconnect(),Ze(this,Zd).disconnect(),(c=Ze(this,Qn))==null||c.remove()},dr(this,Nl,!0),dr(this,cg),dr(this,Ea),dr(this,Tl),dr(this,Zd),dr(this,Qn),dr(this,Kd,!1),dr(this,qd,E_(()=>{var s,l,c;const{element:u}=this;if((s=Ze(this,Tl))==null||s.disconnect(),Ze(this,Kd)||!Ze(this,Nl)||!u.isConnected)return;const f=(l=u.ownerDocument)!=null?l:document,{innerHeight:p,innerWidth:m}=(c=f.defaultView)!=null?c:window,O=u.getBoundingClientRect(),x=lg(u,O),{top:v,left:S,bottom:k,right:w}=x,N=-Math.floor(v),C=-Math.floor(S),E=-Math.floor(m-w),M=-Math.floor(p-k),R=`${N}px ${E}px ${M}px ${C}px`;this.boundingClientRect=O,Pr(this,Tl,new IntersectionObserver(_=>{const[V]=_,{intersectionRect:G}=V;(V.intersectionRatio!==1?V.intersectionRatio:of.intersectionRatio(G,lg(u)))!==1&&Ze(this,qd).call(this)},{threshold:VN,rootMargin:R,root:f})),Ze(this,Tl).observe(u),k_(this,ug,A_).call(this)},P_)),this.boundingClientRect=t.getBoundingClientRect(),Pr(this,Nl,q8(t,this.boundingClientRect));let r=!0;this.callback=s=>{r&&(r=!1,n.skipInitial)||e(s)};const i=t.ownerDocument;n!=null&&n.debug&&(Pr(this,Qn,document.createElement("div")),Ze(this,Qn).style.background="rgba(0,0,0,0.15)",Ze(this,Qn).style.position="fixed",Ze(this,Qn).style.pointerEvents="none",i.body.appendChild(Ze(this,Qn))),Pr(this,Zd,new IntersectionObserver(s=>{var l,c;const u=s[s.length-1],{boundingClientRect:f,isIntersecting:p}=u,{width:m,height:O}=f,x=Ze(this,Nl);Pr(this,Nl,p),!(!m&&!O)&&(x&&!p?((l=Ze(this,Tl))==null||l.disconnect(),this.callback(null),(c=Ze(this,Ea))==null||c.disconnect(),Pr(this,Ea,void 0),Ze(this,Qn)&&(Ze(this,Qn).style.visibility="hidden")):Ze(this,qd).call(this),p&&!Ze(this,Ea)&&(Pr(this,Ea,new B8(Ze(this,qd))),Ze(this,Ea).observe(t)))},{threshold:VN,root:i})),Ze(this,Nl)&&!n.skipInitial&&this.callback(this.boundingClientRect),Ze(this,Zd).observe(t)}};Nl=new WeakMap;cg=new WeakMap;Ea=new WeakMap;Tl=new WeakMap;Zd=new WeakMap;Qn=new WeakMap;Kd=new WeakMap;qd=new WeakMap;ug=new WeakSet;A_=function(){Ze(this,Kd)||(k_(this,ug,R_).call(this),!Z8(this.boundingClientRect,Ze(this,cg))&&(this.callback(this.boundingClientRect),Pr(this,cg,this.boundingClientRect)))};R_=function(){if(Ze(this,Qn)){const{top:t,left:e,width:n,height:r}=lg(this.element);Ze(this,Qn).style.overflow="hidden",Ze(this,Qn).style.visibility="visible",Ze(this,Qn).style.top=`${Math.floor(t)}px`,Ze(this,Qn).style.left=`${Math.floor(e)}px`,Ze(this,Qn).style.width=`${Math.floor(n)}px`,Ze(this,Qn).style.height=`${Math.floor(r)}px`}};var Kp=new WeakMap,Jp=new WeakMap;function Y8(t,e){let n=Kp.get(t);return n||(n={disconnect:new __(t,i=>{const s=Kp.get(t);s&&s.callbacks.forEach(l=>l(i))},{skipInitial:!0}).disconnect,callbacks:new Set}),n.callbacks.add(e),Kp.set(t,n),()=>{n.callbacks.delete(e),n.callbacks.size===0&&(Kp.delete(t),n.disconnect())}}function V8(t,e){const n=new Set;for(const r of t){const i=Y8(r,e);n.add(i)}return()=>n.forEach(r=>r())}function U8(t,e){var n;const r=t.ownerDocument;if(!Jp.has(r)){const l=new AbortController,c=new Set;document.addEventListener("scroll",u=>c.forEach(f=>f(u)),{capture:!0,passive:!0,signal:l.signal}),Jp.set(r,{disconnect:()=>l.abort(),listeners:c})}const{listeners:i,disconnect:s}=(n=Jp.get(r))!=null?n:{};return!i||!s?()=>{}:(i.add(e),()=>{i.delete(e),i.size===0&&(s(),Jp.delete(r))})}var Id,Bd,Rm,X0,W8=class{constructor(t,e,n){this.callback=e,dr(this,Id),dr(this,Bd,!1),dr(this,Rm),dr(this,X0,E_(l=>{if(!Ze(this,Bd)&&l.target&&"contains"in l.target&&typeof l.target.contains=="function"){for(const c of Ze(this,Rm))if(l.target.contains(c)){this.callback(Ze(this,Id).boundingClientRect);break}}},P_));const r=L8(t),i=V8(r,e),s=U8(t,Ze(this,X0));Pr(this,Rm,r),Pr(this,Id,new __(t,e,n)),this.disconnect=()=>{Ze(this,Bd)||(Pr(this,Bd,!0),i(),s(),Ze(this,Id).disconnect())}}};Id=new WeakMap;Bd=new WeakMap;Rm=new WeakMap;X0=new WeakMap;function Z0(t){return"showPopover"in t&&"hidePopover"in t&&typeof t.showPopover=="function"&&typeof t.hidePopover=="function"}function kh(t){try{Z0(t)&&t.isConnected&&t.hasAttribute("popover")&&!t.matches(":popover-open")&&t.showPopover()}catch{}}function UN(t){return!Q_||!t?!1:t===mo(t).scrollingElement}function M_(t){var e,n;const r=ui(t),i=UN(t)?A8(t):sO(t),s=r.visualViewport,l=UN(t)?{height:(e=s==null?void 0:s.height)!=null?e:r.innerHeight,width:(n=s==null?void 0:s.width)!=null?n:r.innerWidth}:{height:t.clientHeight,width:t.clientWidth},c={current:{x:t.scrollLeft,y:t.scrollTop},max:{x:t.scrollWidth-l.width,y:t.scrollHeight-l.height}},u=c.current.y<=0,f=c.current.x<=0,p=c.current.y>=c.max.y,m=c.current.x>=c.max.x;return{rect:i,position:c,isTop:u,isLeft:f,isBottom:p,isRight:m}}function G8(t,e){const{isTop:n,isBottom:r,isLeft:i,isRight:s,position:l}=M_(t),{x:c,y:u}=e??{x:0,y:0},f=!n&&l.current.y+u>0,p=!r&&l.current.y+u<l.max.y,m=!i&&l.current.x+c>0,O=!s&&l.current.x+c<l.max.x;return{top:f,bottom:p,left:m,right:O,x:m||O,y:f||p}}var Sw=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:n,resolvers:r}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const i of n)i();for(const i of r)i()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(n=>this.resolvers.add(n))}},dg=new Sw(t=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()}),F8=new Sw(t=>setTimeout(t,50)),hg=new Map,H8=hg.clear.bind(hg);function Js(t,e=!1){if(!e)return WN(t);let n=hg.get(t);return n||(n=WN(t),hg.set(t,n),F8.schedule(H8),n)}function WN(t){return ui(t).getComputedStyle(t)}function K8(t,e=Js(t,!0)){return e.position==="fixed"||e.position==="sticky"}function J8(t,e=Js(t,!0)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=e[i];return typeof s=="string"?n.test(s):!1})}var e9={excludeElement:!0,escapeShadowDOM:!0};function q0(t,e=e9){const{limit:n,excludeElement:r,escapeShadowDOM:i}=e,s=new Set;function l(c){if(n!=null&&s.size>=n||!c)return s;if(bw(c)&&c.scrollingElement!=null&&!s.has(c.scrollingElement))return s.add(c.scrollingElement),s;if(i&&yw(c))return l(c.host);if(!eo(c))return j_(c)?l(c.parentElement):s;if(s.has(c))return s;const u=Js(c,!0);if(r&&c===t||J8(c,u)&&s.add(c),K8(c,u)){const{scrollingElement:f}=c.ownerDocument;return f&&s.add(f),s}return l(c.parentNode)}return t?l(t):s}function t9(t){const[e]=q0(t,{limit:1});return e??null}function Gc(t,e=window.frameElement){const n={x:0,y:0,scaleX:1,scaleY:1};if(!t)return n;let r=Wc(t);for(;r;){if(r===e)return n;const i=sO(r),{x:s,y:l}=n9(r,i);n.x=n.x+i.left,n.y=n.y+i.top,n.scaleX=n.scaleX*s,n.scaleY=n.scaleY*l,r=Wc(r)}return n}function n9(t,e=sO(t)){const n=Math.round(e.width),r=Math.round(e.height);if(eo(t))return{x:n/t.offsetWidth,y:r/t.offsetHeight};const i=Js(t,!0);return{x:(parseFloat(i.width)||n)/n,y:(parseFloat(i.height)||r)/r}}function r9(t){if(t==="none")return null;const e=t.split(" "),n=parseFloat(e[0]),r=parseFloat(e[1]);return isNaN(n)&&isNaN(r)?null:{x:isNaN(n)?r:n,y:isNaN(r)?n:r}}function ww(t){if(t==="none")return null;const[e,n,r="0"]=t.split(" "),i={x:parseFloat(e),y:parseFloat(n),z:parseInt(r,10)};return isNaN(i.x)&&isNaN(i.y)?null:{x:isNaN(i.x)?0:i.x,y:isNaN(i.y)?0:i.y,z:isNaN(i.z)?0:i.z}}function kw(t){var e,n,r,i,s,l,c,u,f;const{scale:p,transform:m,translate:O}=t,x=r9(p),v=ww(O),S=i9(m);if(!S&&!x&&!v)return null;const k={x:(e=x==null?void 0:x.x)!=null?e:1,y:(n=x==null?void 0:x.y)!=null?n:1},w={x:(r=v==null?void 0:v.x)!=null?r:0,y:(i=v==null?void 0:v.y)!=null?i:0},N={x:(s=S==null?void 0:S.x)!=null?s:0,y:(l=S==null?void 0:S.y)!=null?l:0,scaleX:(c=S==null?void 0:S.scaleX)!=null?c:1,scaleY:(u=S==null?void 0:S.scaleY)!=null?u:1};return{x:w.x+N.x,y:w.y+N.y,z:(f=v==null?void 0:v.z)!=null?f:0,scaleX:k.x*N.scaleX,scaleY:k.y*N.scaleY}}function i9(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}var Jr=(t=>(t[t.Idle=0]="Idle",t[t.Forward=1]="Forward",t[t.Reverse=-1]="Reverse",t))(Jr||{}),s9={x:.2,y:.2},a9={x:10,y:10};function l9(t,e,n,r=25,i=s9,s=a9){const{x:l,y:c}=e,{rect:u,isTop:f,isBottom:p,isLeft:m,isRight:O}=M_(t),x=Gc(t),v=Js(t,!0),S=kw(v),k=S!==null?(S==null?void 0:S.scaleX)<0:!1,w=S!==null?(S==null?void 0:S.scaleY)<0:!1,N=new of(u.left*x.scaleX+x.x,u.top*x.scaleY+x.y,u.width*x.scaleX,u.height*x.scaleY),C={x:0,y:0},E={x:0,y:0},M={height:N.height*i.y,width:N.width*i.x};return(!f||w&&!p)&&c<=N.top+M.height&&(n==null?void 0:n.y)!==1&&l>=N.left-s.x&&l<=N.right+s.x?(C.y=w?1:-1,E.y=r*Math.abs((N.top+M.height-c)/M.height)):(!p||w&&!f)&&c>=N.bottom-M.height&&(n==null?void 0:n.y)!==-1&&l>=N.left-s.x&&l<=N.right+s.x&&(C.y=w?-1:1,E.y=r*Math.abs((N.bottom-M.height-c)/M.height)),(!O||k&&!m)&&l>=N.right-M.width&&(n==null?void 0:n.x)!==-1&&c>=N.top-s.y&&c<=N.bottom+s.y?(C.x=k?-1:1,E.x=r*Math.abs((N.right-M.width-l)/M.width)):(!m||k&&!O)&&l<=N.left+M.width&&(n==null?void 0:n.x)!==1&&c>=N.top-s.y&&c<=N.bottom+s.y&&(C.x=k?1:-1,E.x=r*Math.abs((N.left+M.width-l)/M.width)),{direction:C,speed:E}}function o9(t){return"scrollIntoViewIfNeeded"in t&&typeof t.scrollIntoViewIfNeeded=="function"}function c9(t,e=!1){if(o9(t)){t.scrollIntoViewIfNeeded(e);return}if(!eo(t))return t.scrollIntoView();var n=t9(t);if(!eo(n))return;const r=Js(n,!0),i=parseInt(r.getPropertyValue("border-top-width")),s=parseInt(r.getPropertyValue("border-left-width")),l=t.offsetTop-n.offsetTop<n.scrollTop,c=t.offsetTop-n.offsetTop+t.clientHeight-i>n.scrollTop+n.clientHeight,u=t.offsetLeft-n.offsetLeft<n.scrollLeft,f=t.offsetLeft-n.offsetLeft+t.clientWidth-s>n.scrollLeft+n.clientWidth,p=l&&!c;(l||c)&&e&&(n.scrollTop=t.offsetTop-n.offsetTop-n.clientHeight/2-i+t.clientHeight/2),(u||f)&&e&&(n.scrollLeft=t.offsetLeft-n.offsetLeft-n.clientWidth/2-s+t.clientWidth/2),(l||c||u||f)&&!e&&t.scrollIntoView(p)}function u9(t,e,n){const{scaleX:r,scaleY:i,x:s,y:l}=e,c=t.left+s+(1-r)*parseFloat(n),u=t.top+l+(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=r?t.width*r:t.width,p=i?t.height*i:t.height;return{width:f,height:p,top:u,right:c+f,bottom:u+p,left:c}}function d9(t,e,n){const{scaleX:r,scaleY:i,x:s,y:l}=e,c=t.left-s-(1-r)*parseFloat(n),u=t.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=r?t.width/r:t.width,p=i?t.height/i:t.height;return{width:f,height:p,top:u,right:c+f,bottom:u+p,left:c}}function h9({element:t,keyframes:e,options:n}){return t.animate(e,n).finished}var f9=new Sw(t=>setTimeout(t,0)),Jd=new Map,p9=Jd.clear.bind(Jd);function m9(t){const e=t.ownerDocument;let n=Jd.get(e);if(n)return n;n=e.getAnimations(),Jd.set(e,n),f9.schedule(p9);const r=n.filter(i=>iO(i.effect)&&i.effect.target===t);return Jd.set(t,r),n}function g9(t,e){const n=m9(t).filter(r=>{var i,s;if(iO(r.effect)){const{target:l}=r.effect;if((s=l&&((i=e.isValidTarget)==null?void 0:i.call(e,l)))!=null?s:!0)return r.effect.getKeyframes().some(u=>{for(const f of e.properties)if(u[f])return!0})}}).map(r=>{const{effect:i,currentTime:s}=r,l=i==null?void 0:i.getComputedTiming().duration;if(!(r.pending||r.playState==="finished")&&typeof l=="number"&&typeof s=="number"&&s<l)return r.currentTime=l,()=>{r.currentTime=s}});if(n.length>0)return()=>n.forEach(r=>r==null?void 0:r())}var qs=class extends of{constructor(t,e={}){var n,r,i,s;const{frameTransform:l=Gc(t),ignoreTransforms:c,getBoundingClientRect:u=sO}=e,f=g9(t,{properties:["transform","translate","scale","width","height"],isValidTarget:M=>(M!==t||vw())&&M.contains(t)}),p=u(t);let{top:m,left:O,width:x,height:v}=p,S;const k=Js(t),w=kw(k),N={x:(n=w==null?void 0:w.scaleX)!=null?n:1,y:(r=w==null?void 0:w.scaleY)!=null?r:1},C=O9(t,k);f==null||f(),w&&(S=d9(p,w,k.transformOrigin),(c||C)&&(m=S.top,O=S.left,x=S.width,v=S.height));const E={width:(i=S==null?void 0:S.width)!=null?i:x,height:(s=S==null?void 0:S.height)!=null?s:v};if(C&&!c&&S){const M=u9(S,C,k.transformOrigin);m=M.top,O=M.left,x=M.width,v=M.height,N.x=C.scaleX,N.y=C.scaleY}l&&(c||(O*=l.scaleX,x*=l.scaleX,m*=l.scaleY,v*=l.scaleY),O+=l.x,m+=l.y),super(O,m,x,v),this.scale=N,this.intrinsicWidth=E.width,this.intrinsicHeight=E.height}};function O9(t,e){var n;const r=t.getAnimations();let i=null;if(!r.length)return null;for(const s of r){if(s.playState!=="running")continue;const l=iO(s.effect)?s.effect.getKeyframes():[],c=l[l.length-1];if(!c)continue;const{transform:u,translate:f,scale:p}=c;if(u||f||p){const m=kw({transform:typeof u=="string"&&u?u:e.transform,translate:typeof f=="string"&&f?f:e.translate,scale:typeof p=="string"&&p?p:e.scale});m&&(i=i?{x:i.x+m.x,y:i.y+m.y,z:(n=i.z)!=null?n:m.z,scaleX:i.scaleX*m.scaleX,scaleY:i.scaleY*m.scaleY}:m)}}return i}function eh(t){return"style"in t&&typeof t.style=="object"&&t.style!==null&&"setProperty"in t.style&&"removeProperty"in t.style&&typeof t.style.setProperty=="function"&&typeof t.style.removeProperty=="function"}var x9=class{constructor(t){this.element=t,this.initial=new Map}set(t,e=""){const{element:n}=this;if(eh(n))for(const[r,i]of Object.entries(t)){const s=`${e}${r}`;this.initial.has(s)||this.initial.set(s,n.style.getPropertyValue(s)),n.style.setProperty(s,typeof i=="string"?i:`${i}px`)}}remove(t,e=""){const{element:n}=this;if(eh(n))for(const r of t){const i=`${e}${r}`;n.style.removeProperty(i)}}reset(){const{element:t}=this;if(eh(t)){for(const[e,n]of this.initial)t.style.setProperty(e,n);t.getAttribute("style")===""&&t.removeAttribute("style")}}};function to(t){return t?t instanceof ui(t).Element||ff(t)&&t.nodeType===Node.ELEMENT_NODE:!1}function jw(t){if(!t)return!1;const{KeyboardEvent:e}=ui(t.target);return t instanceof e}function b9(t){if(!t)return!1;const{PointerEvent:e}=ui(t.target);return t instanceof e}function v9(t){if(!to(t))return!1;const{tagName:e}=t;return e==="INPUT"||e==="TEXTAREA"||y9(t)}function y9(t){return t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")!=="false"}var cv={};function I0(t){const e=cv[t]==null?0:cv[t]+1;return cv[t]=e,`${t}-${e}`}var S9=({dragOperation:t,droppable:e})=>{const n=t.position.current;if(!n)return null;const{id:r}=e;if(!e.shape)return null;if(e.shape.containsPoint(n)){const i=Gi.distance(e.shape.center,n);return{id:r,value:1/i,type:hf.PointerIntersection,priority:df.High}}return null},w9=({dragOperation:t,droppable:e})=>{const{shape:n}=t;if(!e.shape||!(n!=null&&n.current))return null;const r=n.current.intersectionArea(e.shape);if(r){const{position:i}=t,s=Gi.distance(e.shape.center,i.current),c=r/(n.current.area+e.shape.area-r)/s;return{id:e.id,value:c,type:hf.ShapeIntersection,priority:df.Normal}}return null},k9=t=>{var e;return(e=S9(t))!=null?e:w9(t)},j9=Object.create,Qw=Object.defineProperty,Q9=Object.defineProperties,C9=Object.getOwnPropertyDescriptor,N9=Object.getOwnPropertyDescriptors,fg=Object.getOwnPropertySymbols,z_=Object.prototype.hasOwnProperty,D_=Object.prototype.propertyIsEnumerable,L_=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Ou=t=>{throw TypeError(t)},B0=(t,e,n)=>e in t?Qw(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,jh=(t,e)=>{for(var n in e||(e={}))z_.call(e,n)&&B0(t,n,e[n]);if(fg)for(var n of fg(e))D_.call(e,n)&&B0(t,n,e[n]);return t},Cw=(t,e)=>Q9(t,N9(e)),GN=(t,e)=>Qw(t,"name",{value:e,configurable:!0}),X_=(t,e)=>{var n={};for(var r in t)z_.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&fg)for(var r of fg(t))e.indexOf(r)<0&&D_.call(t,r)&&(n[r]=t[r]);return n},xu=t=>{var e;return[,,,j9((e=t==null?void 0:t[L_("metadata")])!=null?e:null)]},Z_=["class","method","getter","setter","accessor","field","value","get","set"],Yd=t=>t!==void 0&&typeof t!="function"?Ou("Function expected"):t,T9=(t,e,n,r,i)=>({kind:Z_[t],name:e,metadata:r,addInitializer:s=>n._?Ou("Already initialized"):i.push(Yd(s||null))}),go=(t,e)=>B0(e,L_("metadata"),t[3]),tn=(t,e,n,r)=>{for(var i=0,s=t[e>>1],l=s&&s.length;i<l;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},zr=(t,e,n,r,i,s)=>{var l,c,u,f,p,m=e&7,O=!!(e&8),x=!!(e&16),v=m>3?t.length+1:m?O?1:2:0,S=Z_[m+5],k=m>3&&(t[v-1]=[]),w=t[v]||(t[v]=[]),N=m&&(!x&&!O&&(i=i.prototype),m<5&&(m>3||!x)&&C9(m<4?i:{get[n](){return Tt(this,s)},set[n](E){return Fn(this,s,E)}},n));m?x&&m<4&&GN(s,(m>2?"set ":m>1?"get ":"")+n):GN(i,n);for(var C=r.length-1;C>=0;C--)f=T9(m,n,u={},t[3],w),m&&(f.static=O,f.private=x,p=f.access={has:x?E=>$9(i,E):E=>n in E},m^3&&(p.get=x?E=>(m^1?Tt:no)(E,i,m^4?s:N.get):E=>E[n]),m>2&&(p.set=x?(E,M)=>Fn(E,i,M,m^4?s:N.set):(E,M)=>E[n]=M)),c=(0,r[C])(m?m<4?x?s:N[S]:m>4?void 0:{get:N.get,set:N.set}:i,f),u._=1,m^4||c===void 0?Yd(c)&&(m>4?k.unshift(c):m?x?s=c:N[S]=c:i=c):typeof c!="object"||c===null?Ou("Object expected"):(Yd(l=c.get)&&(N.get=l),Yd(l=c.set)&&(N.set=l),Yd(l=c.init)&&k.unshift(l));return m||go(t,i),N&&Qw(i,n,N),x?m^4?s:N:i},Nw=(t,e,n)=>e.has(t)||Ou("Cannot "+n),$9=(t,e)=>Object(e)!==e?Ou('Cannot use the "in" operator on this value'):t.has(e),Tt=(t,e,n)=>(Nw(t,e,"read from private field"),n?n.call(t):e.get(t)),Vt=(t,e,n)=>e.has(t)?Ou("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Fn=(t,e,n,r)=>(Nw(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),no=(t,e,n)=>(Nw(t,e,"access private method"),n),FN={role:"button",roleDescription:"draggable"},E9="dnd-kit-description",P9="dnd-kit-announcement",A9={draggable:"To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel."},R9={dragstart({operation:{source:t}}){if(t)return`Picked up draggable item ${t.id}.`},dragover({operation:{source:t,target:e}}){if(!(!t||t.id===(e==null?void 0:e.id)))return e?`Draggable item ${t.id} was moved over droppable target ${e.id}.`:`Draggable item ${t.id} is no longer over a droppable target.`},dragend({operation:{source:t,target:e},canceled:n}){if(t)return n?`Dragging was cancelled. Draggable item ${t.id} was dropped.`:e?`Draggable item ${t.id} was dropped over droppable target ${e.id}`:`Draggable item ${t.id} was dropped.`}};function _9(t){const e=t.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(e)}function M9(t,e){const n=document.createElement("div");return n.id=t,n.style.setProperty("display","none"),n.textContent=e,n}function z9(t){const e=document.createElement("div");return e.id=t,e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),e.style.setProperty("position","fixed"),e.style.setProperty("width","1px"),e.style.setProperty("height","1px"),e.style.setProperty("margin","-1px"),e.style.setProperty("border","0"),e.style.setProperty("padding","0"),e.style.setProperty("overflow","hidden"),e.style.setProperty("clip","rect(0 0 0 0)"),e.style.setProperty("clip-path","inset(100%)"),e.style.setProperty("white-space","nowrap"),e}var D9=["dragover","dragmove"],L9=class extends xr{constructor(t,e){super(t);const{id:n,idPrefix:{description:r=E9,announcement:i=P9}={},announcements:s=R9,screenReaderInstructions:l=A9,debounce:c=500}=e??{},u=n?`${r}-${n}`:I0(r),f=n?`${i}-${n}`:I0(i);let p,m,O,x;const v=(M=x)=>{!O||!M||(O==null?void 0:O.nodeValue)!==M&&(O.nodeValue=M)},S=()=>dg.schedule(v),k=X9(S,c),w=Object.entries(s).map(([M,R])=>this.manager.monitor.addEventListener(M,(_,V)=>{const G=O;if(!G)return;const D=R==null?void 0:R(_,V);D&&G.nodeValue!==D&&(x=D,D9.includes(M)?k():(S(),k.cancel()))})),N=()=>{let M=[];p!=null&&p.isConnected||(p=M9(u,l.draggable),M.push(p)),m!=null&&m.isConnected||(m=z9(f),O=document.createTextNode(""),m.appendChild(O),M.push(m)),M.length>0&&document.body.append(...M)},C=new Set;function E(){for(const M of C)M()}this.registerEffect(()=>{var M;C.clear();for(const R of this.manager.registry.draggables.value){const _=(M=R.handle)!=null?M:R.element;if(_){(!p||!m)&&C.add(N),(!_9(_)||vw())&&!_.hasAttribute("tabindex")&&C.add(()=>_.setAttribute("tabindex","0")),!_.hasAttribute("role")&&_.tagName.toLowerCase()!=="button"&&C.add(()=>_.setAttribute("role",FN.role)),_.hasAttribute("aria-roledescription")||C.add(()=>_.setAttribute("aria-roledescription",FN.roleDescription)),_.hasAttribute("aria-describedby")||C.add(()=>_.setAttribute("aria-describedby",u));for(const G of["aria-pressed","aria-grabbed"]){const D=String(R.isDragging);_.getAttribute(G)!==D&&C.add(()=>_.setAttribute(G,D))}const V=String(R.disabled);_.getAttribute("aria-disabled")!==V&&C.add(()=>_.setAttribute("aria-disabled",V))}}C.size>0&&dg.schedule(E)}),this.destroy=()=>{super.destroy(),p==null||p.remove(),m==null||m.remove(),w.forEach(M=>M())}}};function X9(t,e){let n;const r=()=>{clearTimeout(n),n=setTimeout(t,e)};return r.cancel=()=>clearTimeout(n),r}var Z9=class extends xr{constructor(t,e){super(t,e),this.manager=t;const n=sg(()=>{var r;return mo((r=this.manager.dragOperation.source)==null?void 0:r.element)});this.destroy=ci(()=>{var r;const{dragOperation:i}=this.manager,{cursor:s="grabbing",nonce:l}=(r=this.options)!=null?r:{};if(i.status.initialized){const c=n.value,u=c.createElement("style");return l&&u.setAttribute("nonce",l),u.textContent=`* { cursor: ${s} !important; }`,c.head.appendChild(u),()=>u.remove()}})}},pg=new Map,q_,I_,B_,Y_,Y0,th,Is,Tw,Fc,V_,U_,W_,G_,Oo=class extends(Y0=uf,Y_=[at],B_=[en],I_=[en],q_=[en],Y0){constructor(t){super(t),tn(Is,5,this),Vt(this,Fc),Vt(this,th,new Set),Vt(this,Tw,tn(Is,8,this,new Set)),tn(Is,11,this),this.registerEffect(no(this,Fc,V_))}register(t){return Tt(this,th).add(t),()=>{Tt(this,th).delete(t)}}addRoot(t){return yt(()=>{const e=new Set(this.additionalRoots);e.add(t),this.additionalRoots=e}),()=>{yt(()=>{const e=new Set(this.additionalRoots);e.delete(t),this.additionalRoots=e})}}get sourceRoot(){var t;const{source:e}=this.manager.dragOperation;return og((t=e==null?void 0:e.element)!=null?t:null)}get targetRoot(){var t;const{target:e}=this.manager.dragOperation;return og((t=e==null?void 0:e.element)!=null?t:null)}get roots(){const{status:t}=this.manager.dragOperation;if(t.initializing||t.initialized){const e=[this.sourceRoot,this.targetRoot].filter(n=>n!=null);return new Set([...e,...this.additionalRoots])}return new Set}};Is=xu(Y0);th=new WeakMap;Tw=new WeakMap;Fc=new WeakSet;V_=function(){const{roots:t}=this,e=[];for(const n of t)for(const r of Tt(this,th))e.push(no(this,Fc,U_).call(this,n,r));return()=>{for(const n of e)n()}};U_=function(t,e){let n=pg.get(t);n||(n=new Map,pg.set(t,n));let r=n.get(e);if(!r){const s=bw(t)?no(this,Fc,W_).call(this,t,n,e):no(this,Fc,G_).call(this,t,n,e);if(!s)return()=>{};r=s,n.set(e,r)}r.refCount++;let i=!1;return()=>{i||(i=!0,r.refCount--,r.refCount===0&&r.cleanup())}};W_=function(t,e,n){const r=t.createElement("style");r.textContent=n,t.head.prepend(r);const i=new MutationObserver(s=>{for(const l of s)for(const c of Array.from(l.removedNodes))if(c===r){t.head.prepend(r);return}});return i.observe(t.head,{childList:!0}),{refCount:0,cleanup:()=>{i.disconnect(),r.remove(),e.delete(n),e.size===0&&pg.delete(t)}}};G_=function(t,e,n){"adoptedStyleSheets"in t&&Array.isArray(t.adoptedStyleSheets);const r=t.ownerDocument.defaultView,{CSSStyleSheet:i}=r??{};if(!i)return null;const s=new i;return s.replaceSync(n),t.adoptedStyleSheets.push(s),{refCount:0,cleanup:()=>{var l;if(yw(t)&&((l=t.host)!=null&&l.isConnected)){const c=t.adoptedStyleSheets.indexOf(s);c!==-1&&t.adoptedStyleSheets.splice(c,1)}e.delete(n),e.size===0&&pg.delete(t)}}};zr(Is,4,"additionalRoots",Y_,Oo,Tw);zr(Is,2,"sourceRoot",B_,Oo);zr(Is,2,"targetRoot",I_,Oo);zr(Is,2,"roots",q_,Oo);go(Is,Oo);var pf="data-dnd-",V0=`${pf}dropping`,Rn="--dnd-",Bi=`${pf}dragging`,mg=`${pf}placeholder`,q9=[Bi,mg,"popover","aria-pressed","aria-grabbing"],I9=["view-transition-name"],B9=`
|
|
459
|
+
:is(:root,:host) [${Bi}] {
|
|
460
|
+
position: fixed !important;
|
|
461
|
+
pointer-events: none !important;
|
|
462
|
+
touch-action: none;
|
|
463
|
+
z-index: calc(infinity);
|
|
464
|
+
will-change: translate;
|
|
465
|
+
top: var(${Rn}top, 0px) !important;
|
|
466
|
+
left: var(${Rn}left, 0px) !important;
|
|
467
|
+
right: unset !important;
|
|
468
|
+
bottom: unset !important;
|
|
469
|
+
width: var(${Rn}width, auto);
|
|
470
|
+
max-width: var(${Rn}width, auto);
|
|
471
|
+
height: var(${Rn}height, auto);
|
|
472
|
+
max-height: var(${Rn}height, auto);
|
|
473
|
+
transition: var(${Rn}transition) !important;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
:is(:root,:host) [${mg}] {
|
|
477
|
+
transition: none;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
:is(:root,:host) [${mg}='hidden'] {
|
|
481
|
+
visibility: hidden;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
[${Bi}] * {
|
|
485
|
+
pointer-events: none !important;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
[${Bi}]:not([${V0}]) {
|
|
489
|
+
translate: var(${Rn}translate) !important;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
[${Bi}][style*='${Rn}scale'] {
|
|
493
|
+
scale: var(${Rn}scale) !important;
|
|
494
|
+
transform-origin: var(${Rn}transform-origin) !important;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
@layer dnd-kit {
|
|
498
|
+
:where([${Bi}][popover]) {
|
|
499
|
+
overflow: visible;
|
|
500
|
+
background: unset;
|
|
501
|
+
border: unset;
|
|
502
|
+
margin: unset;
|
|
503
|
+
padding: unset;
|
|
504
|
+
color: inherit;
|
|
505
|
+
|
|
506
|
+
&:is(input, button) {
|
|
507
|
+
border: revert;
|
|
508
|
+
background: revert;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
[${Bi}]::backdrop, [${pf}overlay]:not([${Bi}]) {
|
|
513
|
+
display: none;
|
|
514
|
+
visibility: hidden;
|
|
515
|
+
}
|
|
516
|
+
`.replace(/\n+/g," ").replace(/\s+/g," ").trim();function Y9(t,e="hidden"){return yt(()=>{const{element:n,manager:r}=t;if(!n||!r)return;const i=V9(n,r.registry.droppables),s=[],l=M8(n),{remove:c}=l;return U9(i,l,s),W9(l,e),l.remove=()=>{s.forEach(u=>u()),c.call(l)},l})}function V9(t,e){const n=new Map;for(const r of e)if(r.element&&(t===r.element||t.contains(r.element))){const i=`${pf}${I0("dom-id")}`;r.element.setAttribute(i,""),n.set(r,i)}return n}function U9(t,e,n){for(const[r,i]of t){if(!r.element)continue;const s=`[${i}]`,l=e.matches(s)?e:e.querySelector(s);if(r.element.removeAttribute(i),!l)continue;const c=r.element;r.proxy=l,l.removeAttribute(i),YN.set(c,l),n.push(()=>{YN.delete(c),r.proxy=void 0})}}function W9(t,e="hidden"){t.setAttribute("inert","true"),t.setAttribute("tab-index","-1"),t.setAttribute("aria-hidden","true"),t.setAttribute(mg,e)}function F_(t,e){return t===e?!0:Wc(t)===Wc(e)}function HN(t){const{target:e}=t;"newState"in t&&t.newState==="closed"&&to(e)&&e.hasAttribute("popover")&&requestAnimationFrame(()=>kh(e))}function U0(t){return t.tagName==="TR"}function G9(t,e,n){const r=new MutationObserver(i=>{let s=!1;for(const l of i){if(l.target!==t){s=!0;continue}if(l.type!=="attributes")continue;const c=l.attributeName;if(c.startsWith("aria-")||q9.includes(c))continue;const u=t.getAttribute(c);if(c==="style"){if(eh(t)&&eh(e)){const f=t.style;for(const p of Array.from(e.style))f.getPropertyValue(p)===""&&e.style.removeProperty(p);for(const p of Array.from(f)){if(I9.includes(p)||p.startsWith(Rn))continue;const m=f.getPropertyValue(p);e.style.setProperty(p,m)}}}else u!==null?e.setAttribute(c,u):e.removeAttribute(c)}s&&n&&(e.innerHTML=t.innerHTML)});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function F9(t,e,n){const r=new MutationObserver(i=>{for(const s of i)if(s.addedNodes.length!==0)for(const l of Array.from(s.addedNodes)){if(l.contains(t)&&t.nextElementSibling!==e){t.insertAdjacentElement("afterend",e),kh(n);return}if(l.contains(e)&&e.previousElementSibling!==t){e.insertAdjacentElement("beforebegin",t),kh(n);return}}});return r.observe(t.ownerDocument.body,{childList:!0,subtree:!0}),r}function H9(t){return new ResizeObserver(()=>{var e,n;const r=new qs(t.placeholder,{frameTransform:t.frameTransform,ignoreTransforms:!0}),i=(e=t.transformOrigin)!=null?e:{x:1,y:1},s=(t.width-r.width)*i.x+t.delta.x,l=(t.height-r.height)*i.y+t.delta.y,c=C_();if(t.styles.set({width:r.width-t.widthOffset,height:r.height-t.heightOffset,top:t.top+l+c.y,left:t.left+s+c.x},Rn),(n=t.getElementMutationObserver())==null||n.takeRecords(),U0(t.element)&&U0(t.placeholder)){const u=Array.from(t.element.cells),f=Array.from(t.placeholder.cells);t.getSavedCellWidths()||t.setSavedCellWidths(u.map(p=>p.style.width));for(const[p,m]of u.entries()){const O=f[p];m.style.width=`${O.getBoundingClientRect().width}px`}}t.dragOperation.shape=new qs(t.feedbackElement)})}var K9=250,J9="ease";function e7(t){var e,n,r,i;const{animation:s}=t;if(typeof s=="function"){const N=s({element:t.element,feedbackElement:t.feedbackElement,placeholder:t.placeholder,translate:t.translate,moved:t.moved});Promise.resolve(N).then(()=>{t.cleanup(),requestAnimationFrame(t.restoreFocus)});return}const{duration:l=K9,easing:c=J9}=s??{};kh(t.feedbackElement);const[,u]=(e=P8(t.feedbackElement,N=>"translate"in N))!=null?e:[];u==null||u.pause();const f=(n=t.placeholder)!=null?n:t.element,p={frameTransform:F_(t.feedbackElement,f)?null:void 0},m=new qs(t.feedbackElement,p),O=(r=ww(Js(t.feedbackElement).translate))!=null?r:t.translate,x=new qs(f,p),v=of.delta(m,x,t.alignment),S={x:O.x-v.x,y:O.y-v.y},k=Math.round(m.intrinsicHeight)!==Math.round(x.intrinsicHeight)?{minHeight:[`${m.intrinsicHeight}px`,`${x.intrinsicHeight}px`],maxHeight:[`${m.intrinsicHeight}px`,`${x.intrinsicHeight}px`]}:{},w=Math.round(m.intrinsicWidth)!==Math.round(x.intrinsicWidth)?{minWidth:[`${m.intrinsicWidth}px`,`${x.intrinsicWidth}px`],maxWidth:[`${m.intrinsicWidth}px`,`${x.intrinsicWidth}px`]}:{};t.styles.set({transition:t.transition},Rn),t.feedbackElement.setAttribute(V0,""),(i=t.getElementMutationObserver())==null||i.takeRecords(),h9({element:t.feedbackElement,keyframes:Cw(jh(jh({},k),w),{translate:[`${O.x}px ${O.y}px 0`,`${S.x}px ${S.y}px 0`]}),options:{duration:N_(ui(t.feedbackElement))?0:t.moved||t.feedbackElement!==t.element?l:0,easing:c}}).then(()=>{t.feedbackElement.removeAttribute(V0),u==null||u.finish(),t.cleanup(),requestAnimationFrame(t.restoreFocus)})}var H_,W0,Qh,$w,_m,K_,J_,Ch=class extends(W0=xr,H_=[at],W0){constructor(e,n){super(e,n),Vt(this,_m),Vt(this,$w,tn(Qh,8,this)),tn(Qh,11,this),this.state={initial:{},current:{}};const r=e.registry.plugins.get(Oo),i=r==null?void 0:r.register(B9);if(i){const s=this.destroy.bind(this);this.destroy=()=>{i(),s()}}this.registerEffect(no(this,_m,K_).bind(this,r)),this.registerEffect(no(this,_m,J_))}};Qh=xu(W0);$w=new WeakMap;_m=new WeakSet;K_=function(t){const{overlay:e}=this;if(!e||!t)return;const n=og(e);if(n)return t.addRoot(n)};J_=function(){var t,e,n;const{state:r,manager:i,options:s}=this,{dragOperation:l}=i,{position:c,source:u,status:f}=l;if(f.idle){r.current={},r.initial={};return}if(!u)return;const{element:p,feedback:m}=u;if(!p||m==="none"||!f.initialized||f.initializing)return;const{initial:O}=r,x=(t=this.overlay)!=null?t:p,v=Gc(x),S=Gc(p),k=!F_(p,x),w=new qs(p,{frameTransform:k?S:null,ignoreTransforms:!k}),N={x:S.scaleX/v.scaleX,y:S.scaleY/v.scaleY};let{width:C,height:E,top:M,left:R}=w;k&&(C=C/N.x,E=E/N.y);const _=new x9(x),{transition:V,translate:G,boxSizing:D,paddingBlockStart:L,paddingBlockEnd:Z,paddingInlineStart:te,paddingInlineEnd:I,borderInlineStartWidth:B,borderInlineEndWidth:X,borderBlockStartWidth:q,borderBlockEndWidth:K}=Js(p),ne=m==="clone",$=D==="content-box",P=$?parseInt(te)+parseInt(I)+parseInt(B)+parseInt(X):0,U=$?parseInt(L)+parseInt(Z)+parseInt(q)+parseInt(K):0,T=m!=="move"&&!this.overlay?Y9(u,ne?"clone":"hidden"):null,J=yt(()=>jw(i.dragOperation.activatorEvent));if(G!=="none"){const qe=ww(G);qe&&!O.translate&&(O.translate=qe)}if(!O.transformOrigin){const qe=yt(()=>c.current);O.transformOrigin={x:(qe.x-R*v.scaleX-v.x)/(C*v.scaleX),y:(qe.y-M*v.scaleY-v.y)/(E*v.scaleY)}}const{transformOrigin:W}=O,re=M*v.scaleY+v.y,oe=R*v.scaleX+v.x;if(!O.coordinates&&(O.coordinates={x:oe,y:re},N.x!==1||N.y!==1)){const{scaleX:qe,scaleY:ft}=S,{x:jt,y:Qt}=W;O.coordinates.x+=(C*qe-C)*jt,O.coordinates.y+=(E*ft-E)*Qt}O.dimensions||(O.dimensions={width:C,height:E}),O.frameTransform||(O.frameTransform=v);const ce={x:O.coordinates.x-oe,y:O.coordinates.y-re},me={width:(O.dimensions.width*O.frameTransform.scaleX-C*v.scaleX)*W.x,height:(O.dimensions.height*O.frameTransform.scaleY-E*v.scaleY)*W.y},ve={x:ce.x/v.scaleX+me.width,y:ce.y/v.scaleY+me.height},Ie={left:R+ve.x,top:M+ve.y};x.setAttribute(Bi,"true");const Dt=yt(()=>l.transform),Rt=(e=O.translate)!=null?e:{x:0,y:0},Lt=Dt.x*v.scaleX+Rt.x,er=Dt.y*v.scaleY+Rt.y,Dr=C_();_.set({width:C-P,height:E-U,top:Ie.top+Dr.y,left:Ie.left+Dr.x,translate:`${Lt}px ${er}px 0`,transition:V?`${V}, translate 0ms linear`:"",scale:k?`${N.x} ${N.y}`:"","transform-origin":`${W.x*100}% ${W.y*100}%`},Rn),T&&(p.insertAdjacentElement("afterend",T),s!=null&&s.rootElement&&(typeof s.rootElement=="function"?s.rootElement(u):s.rootElement).appendChild(p)),Z0(x)&&(x.hasAttribute("popover")||x.setAttribute("popover","manual"),kh(x),x.addEventListener("beforetoggle",HN));let Zn,yr,fi;const ps=H9({placeholder:T,element:p,feedbackElement:x,frameTransform:v,transformOrigin:W,width:C,height:E,top:M,left:R,widthOffset:P,heightOffset:U,delta:ve,styles:_,dragOperation:l,getElementMutationObserver:()=>Zn,getSavedCellWidths:()=>fi,setSavedCellWidths:qe=>{fi=qe}}),ra=new qs(x);yt(()=>l.shape=ra);const sl=ui(x),vo=qe=>{this.manager.actions.stop({event:qe})},bn=N_(sl);J&&sl.addEventListener("resize",vo),yt(()=>u.status)==="idle"&&requestAnimationFrame(()=>u.status="dragging"),T&&(ps.observe(T),Zn=G9(p,T,ne),yr=F9(p,T,x));const yo=(n=i.dragOperation.source)==null?void 0:n.id,de=()=>{var qe;if(!J||yo==null)return;const ft=i.registry.draggables.get(yo),jt=(qe=ft==null?void 0:ft.handle)!=null?qe:ft==null?void 0:ft.element;eo(jt)&&jt.focus()},xe=()=>{var qe;if(Zn==null||Zn.disconnect(),yr==null||yr.disconnect(),ps.disconnect(),sl.removeEventListener("resize",vo),Z0(x)&&(x.removeEventListener("beforetoggle",HN),x.removeAttribute("popover")),x.removeAttribute(Bi),_.reset(),fi&&U0(p)){const jt=Array.from(p.cells);for(const[Qt,Ft]of jt.entries())Ft.style.width=(qe=fi[Qt])!=null?qe:""}u.status="idle";const ft=r.current.translate!=null;T&&(ft||T.parentElement!==x.parentElement)&&x.isConnected&&T.replaceWith(x),T==null||T.remove()},Pe=s==null?void 0:s.dropAnimation,Xe=this,nt=lf(()=>{var qe;const{transform:ft,status:jt}=l;if(!(!ft.x&&!ft.y&&!r.current.translate)&&jt.dragging){const Qt=(qe=O.translate)!=null?qe:{x:0,y:0},Ft={x:ft.x/v.scaleX+Qt.x,y:ft.y/v.scaleY+Qt.y},ct=r.current.translate,Ai=yt(()=>l.modifiers),qn=yt(()=>{var Ri;return(Ri=l.shape)==null?void 0:Ri.current}),AO=J&&!bn?"250ms cubic-bezier(0.25, 1, 0.5, 1)":"0ms linear";if(_.set({transition:`${V}, translate ${AO}`,translate:`${Ft.x}px ${Ft.y}px 0`},Rn),Zn==null||Zn.takeRecords(),qn&&qn!==ra&&ct&&!Ai.length){const Ri=Gi.delta(Ft,ct);l.shape=of.from(qn.boundingRectangle).translate(Ri.x*v.scaleX,Ri.y*v.scaleY)}else l.shape=new qs(x);r.current.translate=Ft}},function(){if(l.status.dropped){this.dispose(),u.status="dropping";const qe=Xe.dropAnimation!==void 0?Xe.dropAnimation:Pe;let ft=r.current.translate;const jt=ft!=null;if(!ft&&p!==x&&(ft={x:0,y:0}),!ft||qe===null){xe();return}i.renderer.rendering.then(()=>{e7({element:p,feedbackElement:x,placeholder:T,translate:ft,moved:jt,transition:V,alignment:u.alignment,styles:_,animation:qe??void 0,getElementMutationObserver:()=>Zn,cleanup:xe,restoreFocus:de})})}});return()=>{xe(),nt()}};zr(Qh,4,"overlay",H_,Ch,$w);go(Qh,Ch);Ch.configure=FS(Ch);var t7=Ch,Sd=!0,n7=!1,e5,t5,n5,r5,Ya,Ew,Pw;r5=(n5=[at],Jr.Forward),t5=(e5=[at],Jr.Reverse);var Nh=class{constructor(){Vt(this,Ew,tn(Ya,8,this,Sd)),tn(Ya,11,this),Vt(this,Pw,tn(Ya,12,this,Sd)),tn(Ya,15,this)}isLocked(t){return t===Jr.Idle?!1:t==null?this[Jr.Forward]===Sd&&this[Jr.Reverse]===Sd:this[t]===Sd}unlock(t){t!==Jr.Idle&&(this[t]=n7)}};Ya=xu(null);Ew=new WeakMap;Pw=new WeakMap;zr(Ya,4,r5,n5,Nh,Ew);zr(Ya,4,t5,e5,Nh,Pw);go(Ya,Nh);var r7=[Jr.Forward,Jr.Reverse],KN=class{constructor(){this.x=new Nh,this.y=new Nh}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},i7=class extends xr{constructor(t){super(t);const e=af(new KN);let n=null;this.signal=e,ci(()=>{const{status:r}=t.dragOperation;if(!r.initialized){n=null,e.value=new KN;return}const{delta:i}=t.dragOperation.position;if(n){const s={x:JN(i.x,n.x),y:JN(i.y,n.y)},l=e.peek();Jl(()=>{for(const c of RR)for(const u of r7)s[c]===u&&l[c].unlock(u);e.value=l})}n=i})}get current(){return this.signal.peek()}};function JN(t,e){return Math.sign(t-e)}var i5,G0,Th,Aw,Pa,F0,aO=class extends(G0=uf,i5=[at],G0){constructor(t){super(t),Vt(this,Aw,tn(Th,8,this,!1)),tn(Th,11,this),Vt(this,Pa),Vt(this,F0,()=>{if(!Tt(this,Pa))return;const{element:s,by:l}=Tt(this,Pa);l.y&&(s.scrollTop+=l.y),l.x&&(s.scrollLeft+=l.x)}),this.scroll=s=>{var l;if(this.disabled)return!1;const c=this.getScrollableElements();if(!c)return Fn(this,Pa,void 0),!1;const{position:u}=this.manager.dragOperation,f=u==null?void 0:u.current;if(f){const{by:p}=s??{},m=p?{x:eT(p.x),y:eT(p.y)}:void 0,O=m?void 0:this.scrollIntentTracker.current;if(O!=null&&O.isLocked())return!1;for(const x of c){const v=G8(x,p);if(v.x||v.y){const{speed:S,direction:k}=l9(x,f,m);if(O)for(const w of RR)O[w].isLocked(k[w])&&(S[w]=0,k[w]=0);if(k.x||k.y){const{x:w,y:N}=p??k,C=w*S.x,E=N*S.y;if(C||E){const M=(l=Tt(this,Pa))==null?void 0:l.by;if(this.autoScrolling&&M&&(M.x&&!C||M.y&&!E))continue;return Fn(this,Pa,{element:x,by:{x:C,y:E}}),dg.schedule(Tt(this,F0)),!0}}}}}return Fn(this,Pa,void 0),!1};let e=null,n=null;const r=sg(()=>{const{position:s,source:l}=t.dragOperation;if(!s)return null;const c=T_(og(l==null?void 0:l.element),s.current);return c&&(e=c),c??e}),i=sg(()=>{const s=r.value,{documentElement:l}=mo(s);if(!s||s===l){const{target:c}=t.dragOperation,u=c==null?void 0:c.element;if(u){const f=q0(u,{excludeElement:!1});return n=f,f}}if(s){const c=q0(s,{excludeElement:!1});return this.autoScrolling&&n&&c.size<(n==null?void 0:n.size)?n:(n=c,c)}return n=null,null},Yc);this.getScrollableElements=()=>i.value,this.scrollIntentTracker=new i7(t),this.destroy=t.monitor.addEventListener("dragmove",s=>{this.disabled||s.defaultPrevented||!jw(t.dragOperation.activatorEvent)||!s.by||this.scroll({by:s.by})&&s.preventDefault()})}};Th=xu(G0);Aw=new WeakMap;Pa=new WeakMap;F0=new WeakMap;zr(Th,4,"autoScrolling",i5,aO,Aw);go(Th,aO);function eT(t){return t>0?Jr.Forward:t<0?Jr.Reverse:Jr.Idle}var s7=class{constructor(t){this.scheduler=t,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:e,resolvers:n}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const r of e)r();for(const r of n)r()}}schedule(t){return this.tasks.add(t),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(e=>this.resolvers.add(e))}},a7=new s7(t=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()}),l7=10,s5=class extends xr{constructor(t,e){super(t);const n=t.registry.plugins.get(aO);if(!n)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=ci(()=>{if(this.disabled)return;const{position:r,status:i}=t.dragOperation;if(i.dragging)if(n.scroll()){n.autoScrolling=!0;const l=setInterval(()=>a7.schedule(n.scroll),l7);return()=>{clearInterval(l)}}else n.autoScrolling=!1})}},tT={capture:!0,passive:!0},Vd,o7=class extends uf{constructor(t){super(t),Vt(this,Vd),this.handleScroll=()=>{Tt(this,Vd)==null&&Fn(this,Vd,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),Fn(this,Vd,void 0)},50))};const{dragOperation:e}=this.manager;this.destroy=ci(()=>{var n,r,i;if(e.status.dragging){const l=(i=(r=(n=e.source)==null?void 0:n.element)==null?void 0:r.ownerDocument)!=null?i:document;return l.addEventListener("scroll",this.handleScroll,tT),()=>{l.removeEventListener("scroll",this.handleScroll,tT)}}})}};Vd=new WeakMap;var c7=class extends xr{constructor(t,e){super(t,e),this.manager=t,this.destroy=ci(()=>{var n;const{dragOperation:r}=this.manager,{nonce:i}=(n=this.options)!=null?n:{};if(r.status.initialized){const s=document.createElement("style");return i&&s.setAttribute("nonce",i),s.textContent="* { user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(s),uv(),document.addEventListener("selectionchange",uv,{capture:!0}),()=>{document.removeEventListener("selectionchange",uv,{capture:!0}),s.remove()}}})}};function uv(){var t;(t=document.getSelection())==null||t.removeAllRanges()}var Ud=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},preventActivation(t,e){var n;const r=(n=e.handle)!=null?n:e.element;return t.target!==r}}),fc,gg=class extends Vc{constructor(e,n){super(e),this.manager=e,this.options=n,Vt(this,fc,[]),this.listeners=new $_,this.handleSourceKeyDown=(r,i,s)=>{if(this.disabled||r.defaultPrevented||!to(r.target)||i.disabled)return;const{keyboardCodes:l=Ud.keyboardCodes,preventActivation:c=Ud.preventActivation}=s??{};l.start.includes(r.code)&&this.manager.dragOperation.status.idle&&(c!=null&&c(r,i)||this.handleStart(r,i,s))}}bind(e,n=this.options){return ci(()=>{var i;const s=(i=e.handle)!=null?i:e.element,l=c=>{jw(c)&&this.handleSourceKeyDown(c,e,n)};if(s)return s.addEventListener("keydown",l),()=>{s.removeEventListener("keydown",l)}})}handleStart(e,n,r){const{element:i}=n;if(!i)throw new Error("Source draggable does not have an associated element");e.preventDefault(),e.stopImmediatePropagation(),c9(i);const{center:s}=new qs(i);if(this.manager.actions.start({event:e,coordinates:{x:s.x,y:s.y},source:n}).signal.aborted)return this.cleanup();this.sideEffects();const c=mo(i),u=[this.listeners.bind(c,[{type:"keydown",listener:f=>this.handleKeyDown(f,n,r),options:{capture:!0}}])];Tt(this,fc).push(...u)}handleKeyDown(e,n,r){const{keyboardCodes:i=Ud.keyboardCodes}=r??{};if(ac(e,[...i.end,...i.cancel])){e.preventDefault();const s=ac(e,i.cancel);this.handleEnd(e,s);return}ac(e,i.up)?this.handleMove("up",e):ac(e,i.down)&&this.handleMove("down",e),ac(e,i.left)?this.handleMove("left",e):ac(e,i.right)&&this.handleMove("right",e)}handleEnd(e,n){this.manager.actions.stop({event:e,canceled:n}),this.cleanup()}handleMove(e,n){var r,i;const{shape:s}=this.manager.dragOperation,l=n.shiftKey?5:1;let c={x:0,y:0},u=(i=(r=this.options)==null?void 0:r.offset)!=null?i:Ud.offset;if(typeof u=="number"&&(u={x:u,y:u}),!!s){switch(e){case"up":c={x:0,y:-u.y*l};break;case"down":c={x:0,y:u.y*l};break;case"left":c={x:-u.x*l,y:0};break;case"right":c={x:u.x*l,y:0};break}(c.x||c.y)&&(n.preventDefault(),this.manager.actions.move({event:n,by:c}))}}sideEffects(){const e=this.manager.registry.plugins.get(s5);(e==null?void 0:e.disabled)===!1&&(e.disable(),Tt(this,fc).push(()=>{e.enable()}))}cleanup(){Tt(this,fc).forEach(e=>e()),Fn(this,fc,[])}destroy(){this.cleanup(),this.listeners.clear()}};fc=new WeakMap;gg.configure=FS(gg);gg.defaults=Ud;var u7=gg;function ac(t,e){return e.includes(t.code)}var $l,d7=class extends f_{constructor(){super(...arguments),Vt(this,$l)}onEvent(t){switch(t.type){case"pointerdown":Fn(this,$l,Uc(t));break;case"pointermove":if(!Tt(this,$l))return;const{x:e,y:n}=Uc(t),r={x:e-Tt(this,$l).x,y:n-Tt(this,$l).y},{tolerance:i}=this.options;if(i&&_0(r,i)){this.abort();return}_0(r,this.options.value)&&this.activate(t);break;case"pointerup":this.abort();break}}abort(){Fn(this,$l,void 0)}};$l=new WeakMap;var pc,El,h7=class extends f_{constructor(){super(...arguments),Vt(this,pc),Vt(this,El)}onEvent(t){switch(t.type){case"pointerdown":Fn(this,El,Uc(t)),Fn(this,pc,setTimeout(()=>this.activate(t),this.options.value));break;case"pointermove":if(!Tt(this,El))return;const{x:e,y:n}=Uc(t),r={x:e-Tt(this,El).x,y:n-Tt(this,El).y};_0(r,this.options.tolerance)&&this.abort();break;case"pointerup":this.abort();break}}abort(){Tt(this,pc)&&(clearTimeout(Tt(this,pc)),Fn(this,El,void 0),Fn(this,pc,void 0))}};pc=new WeakMap;El=new WeakMap;var bc=class{};bc.Delay=h7;bc.Distance=d7;var H0=Object.freeze({activationConstraints(t,e){var n;const{pointerType:r,target:i}=t;if(!(r==="mouse"&&to(i)&&(e.handle===i||(n=e.handle)!=null&&n.contains(i))))return r==="touch"?[new bc.Delay({value:250,tolerance:5})]:v9(i)&&!t.defaultPrevented?[new bc.Delay({value:200,tolerance:0})]:[new bc.Delay({value:200,tolerance:10}),new bc.Distance({value:5})]},preventActivation(t,e){var n;const{target:r}=t;return r===e.element||r===e.handle||!to(r)||(n=e.handle)!=null&&n.contains(r)?!1:D8(r)}}),mc,Og=class extends Vc{constructor(e,n){super(e),this.manager=e,this.options=n,Vt(this,mc,new Set),this.listeners=new $_,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{const{event:r,coordinates:i}=this.latest;!r||!i||this.manager.actions.move({event:r,to:i})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(e,n,r=this.options){const{activationConstraints:i=H0.activationConstraints}=r??{};return typeof i=="function"?i(e,n):i}bind(e,n=this.options){return ci(()=>{var i;const s=new AbortController,{signal:l}=s,c=f=>{b9(f)&&this.handlePointerDown(f,e,n)};let u=[(i=e.handle)!=null?i:e.element];n!=null&&n.activatorElements&&(Array.isArray(n.activatorElements)?u=n.activatorElements:u=n.activatorElements(e));for(const f of u)f&&(g7(f.ownerDocument.defaultView),f.addEventListener("pointerdown",c,{signal:l}));return()=>s.abort()})}handlePointerDown(e,n,r){if(this.disabled||!e.isPrimary||e.button!==0||!to(e.target)||n.disabled||p7(e)||!this.manager.dragOperation.status.idle)return;const{preventActivation:i=H0.preventActivation}=r??{};if(i!=null&&i(e,n))return;const{target:s}=e,l=eo(s)&&s.draggable&&s.getAttribute("draggable")==="true",c=Gc(n.element),{x:u,y:f}=Uc(e);this.initialCoordinates={x:u*c.scaleX+c.x,y:f*c.scaleY+c.y};const p=this.activationConstraints(e,n,r);e.sensor=this;const m=new N8(p,S=>this.handleStart(n,S));m.signal.onabort=()=>this.handleCancel(e),m.onEvent(e),this.controller=m;const O=L0(),x=this.listeners.bind(O,[{type:"pointermove",listener:S=>this.handlePointerMove(S,n)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"pointercancel",listener:this.handleCancel},{type:"dragstart",listener:l?this.handleCancel:em,options:{capture:!0}}]),v=()=>{x(),this.initialCoordinates=void 0};Tt(this,mc).add(v)}handlePointerMove(e,n){var r,i;if(((r=this.controller)==null?void 0:r.activated)===!1){(i=this.controller)==null||i.onEvent(e);return}if(this.manager.dragOperation.status.dragging){const s=Uc(e),l=Gc(n.element);s.x=s.x*l.scaleX+l.x,s.y=s.y*l.scaleY+l.y,e.preventDefault(),e.stopPropagation(),this.latest.event=e,this.latest.coordinates=s,dg.schedule(this.handleMove)}}handlePointerUp(e){const{status:n}=this.manager.dragOperation;if(!n.idle){e.preventDefault(),e.stopPropagation();const r=!n.initialized;this.manager.actions.stop({event:e,canceled:r})}this.cleanup()}handleKeyDown(e){e.key==="Escape"&&(e.preventDefault(),this.handleCancel(e))}handleStart(e,n){const{manager:r,initialCoordinates:i}=this;if(!i||!r.dragOperation.status.idle||n.defaultPrevented)return;if(r.actions.start({coordinates:i,event:n,source:e}).signal.aborted)return this.cleanup();n.preventDefault();const c=mo(n.target).body;c.setPointerCapture(n.pointerId);const u=to(n.target)?[n.target,c]:c,f=this.listeners.bind(u,[{type:"touchmove",listener:em,options:{passive:!1}},{type:"click",listener:em},{type:"contextmenu",listener:em},{type:"keydown",listener:this.handleKeyDown}]);Tt(this,mc).add(f)}handleCancel(e){const{dragOperation:n}=this.manager;n.status.initialized&&this.manager.actions.stop({event:e,canceled:!0}),this.cleanup()}cleanup(){this.latest={event:void 0,coordinates:void 0},Tt(this,mc).forEach(e=>e()),Tt(this,mc).clear()}destroy(){this.cleanup(),this.listeners.clear()}};mc=new WeakMap;Og.configure=FS(Og);Og.defaults=H0;var f7=Og;function p7(t){return"sensor"in t}function em(t){t.preventDefault()}function m7(){}var nT=new WeakSet;function g7(t){!t||nT.has(t)||(t.addEventListener("touchmove",m7,{capture:!1,passive:!1}),nT.add(t))}var wc={modifiers:[],plugins:[L9,s5,Z9,t7,c7],sensors:[f7,u7]},a5=class extends E8{constructor(t={}){const e=Zs(t.plugins,wc.plugins),n=Zs(t.sensors,wc.sensors),r=Zs(t.modifiers,wc.modifiers);super(Cw(jh({},t),{plugins:[o7,aO,Oo,...e],sensors:n,modifiers:r}))}},l5,o5,c5,K0,xi,Rw,_w,Mw,mf=class extends(K0=ls,c5=[at],o5=[at],l5=[at],K0){constructor(t,e){var n=t,{element:r,effects:i=()=>[],handle:s,feedback:l="default"}=n,c=X_(n,["element","effects","handle","feedback"]);super(jh({effects:()=>[...i(),()=>{var u,f;const{manager:p}=this;if(!p)return;const O=((f=(u=this.sensors)==null?void 0:u.map(HS))!=null?f:[...p.sensors]).map(x=>{const v=x instanceof Vc?x:p.registry.register(x.plugin),S=x instanceof Vc?void 0:x.options;return v.bind(this,S)});return function(){O.forEach(v=>v())}}]},c),e),Vt(this,Rw,tn(xi,8,this)),tn(xi,11,this),Vt(this,_w,tn(xi,12,this)),tn(xi,15,this),Vt(this,Mw,tn(xi,16,this)),tn(xi,19,this),this.element=r,this.handle=s,this.feedback=l}};xi=xu(K0);Rw=new WeakMap;_w=new WeakMap;Mw=new WeakMap;zr(xi,4,"handle",c5,mf,Rw);zr(xi,4,"element",o5,mf,_w);zr(xi,4,"feedback",l5,mf,Mw);go(xi,mf);var u5,d5,J0,Va,zw,dv,h5,f5,nh,Dw,Lw=class extends(J0=os,d5=[at],u5=[at],J0){constructor(t,e){var n=t,{element:r,effects:i=()=>[]}=n,s=X_(n,["element","effects"]);const{collisionDetector:l=k9}=s,c=f=>{const{manager:p,element:m}=this;if(!m||f===null){this.shape=void 0;return}if(!p)return;const O=new qs(m),x=yt(()=>this.shape);return O&&(x!=null&&x.equals(O))?x:(this.shape=O,O)},u=af(!1);super(Cw(jh({},s),{collisionDetector:l,effects:()=>[...i(),()=>{const{element:f,manager:p}=this;if(!p)return;const{dragOperation:m}=p,{source:O}=m;u.value=!!(O&&m.status.initialized&&f&&!this.disabled&&this.accepts(O))},()=>{const{element:f}=this;if(u.value&&f){const p=new W8(f,c);return()=>{p.disconnect(),this.shape=void 0}}},()=>{var f;if((f=this.manager)!=null&&f.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),e),Vt(this,nh),Vt(this,zw,tn(Va,8,this)),tn(Va,11,this),Vt(this,Dw,tn(Va,12,this)),tn(Va,15,this),this.element=r,this.refreshShape=()=>c()}set element(t){Fn(this,nh,t,f5)}get element(){var t;return(t=this.proxy)!=null?t:Tt(this,nh,h5)}};Va=xu(J0);zw=new WeakMap;nh=new WeakSet;Dw=new WeakMap;dv=zr(Va,20,"#element",d5,nh,zw),h5=dv.get,f5=dv.set;zr(Va,4,"proxy",u5,Lw,Dw);go(Va,Lw);function O7(t){return t!=null&&typeof t=="object"&&"current"in t}function $h(t){var e;if(t!=null)return O7(t)?(e=t.current)!=null?e:void 0:t}var x7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gf=x7?j.useLayoutEffect:j.useEffect;function b7(){const t=j.useState(0)[1];return j.useCallback(()=>{t(e=>e+1)},[t])}function p5(t,e){const n=j.useRef(new Map),r=b7();return gf(()=>{if(!t){n.current.clear();return}return ci(()=>{var i;let s=!1,l=!1;for(const c of n.current){const[u]=c,f=yt(()=>c[1]),p=t[u];f!==p&&(s=!0,n.current.set(u,p),l=(i=e==null?void 0:e(u,f,p))!=null?i:!1)}s&&(l?x6.flushSync(r):r())})},[t]),j.useMemo(()=>t&&new Proxy(t,{get(i,s){const l=i[s];return n.current.set(s,l),l}}),[t])}function lc(t){const e=j.useRef(t);return gf(()=>{e.current=t},[t]),e}function _n(t,e,n=j.useEffect,r=Object.is){const i=j.useRef(t);n(()=>{const s=i.current;r(t,s)||(i.current=t,e(t,s))},[e,t])}function e1(t,e){const n=j.useRef($h(t));gf(()=>{const r=$h(t);r!==n.current&&(n.current=r,e(r))})}var v7=Object.defineProperty,y7=Object.defineProperties,S7=Object.getOwnPropertyDescriptors,xg=Object.getOwnPropertySymbols,m5=Object.prototype.hasOwnProperty,g5=Object.prototype.propertyIsEnumerable,rT=(t,e,n)=>e in t?v7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,O5=(t,e)=>{for(var n in e||(e={}))m5.call(e,n)&&rT(t,n,e[n]);if(xg)for(var n of xg(e))g5.call(e,n)&&rT(t,n,e[n]);return t},x5=(t,e)=>y7(t,S7(e)),w7=(t,e)=>{var n={};for(var r in t)m5.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&xg)for(var r of xg(t))e.indexOf(r)<0&&g5.call(t,r)&&(n[r]=t[r]);return n},k7=new a5,b5=j.createContext(k7),j7=j.memo(j.forwardRef(({children:t},e)=>{const[n,r]=j.useState(0),i=j.useRef(null),s=j.useRef(null),l=j.useMemo(()=>({renderer:{get rendering(){var c;return(c=i.current)!=null?c:Promise.resolve()}},trackRendering(c){i.current||(i.current=new Promise(u=>{s.current=u})),j.startTransition(()=>{c(),r(u=>u+1)})}}),[]);return gf(()=>{var c;(c=s.current)==null||c.call(s),i.current=null},[t,n]),j.useImperativeHandle(e,()=>l),null})),hv=[void 0,Yc];function Q7(t){var e=t,{children:n,onCollision:r,onBeforeDragStart:i,onDragStart:s,onDragMove:l,onDragOver:c,onDragEnd:u}=e,f=w7(e,["children","onCollision","onBeforeDragStart","onDragStart","onDragMove","onDragOver","onDragEnd"]);const p=j.useRef(null),{plugins:m,modifiers:O,sensors:x}=f,v=Zs(m,wc.plugins),S=Zs(x,wc.sensors),k=Zs(O,wc.modifiers),w=lc(i),N=lc(s),C=lc(c),E=lc(l),M=lc(u),R=lc(r),_=C7(()=>{var V;return(V=f.manager)!=null?V:new a5(f)});return j.useEffect(()=>{if(!p.current)throw new Error("Renderer not found");const{renderer:V,trackRendering:G}=p.current,{monitor:D}=_;_.renderer=V;const L=[D.addEventListener("beforedragstart",Z=>{const te=w.current;te&&G(()=>te(Z,_))}),D.addEventListener("dragstart",Z=>{var te;return(te=N.current)==null?void 0:te.call(N,Z,_)}),D.addEventListener("dragover",Z=>{const te=C.current;te&&G(()=>te(Z,_))}),D.addEventListener("dragmove",Z=>{const te=E.current;te&&G(()=>te(Z,_))}),D.addEventListener("dragend",Z=>{const te=M.current;te&&G(()=>te(Z,_))}),D.addEventListener("collision",Z=>{var te;return(te=R.current)==null?void 0:te.call(R,Z,_)})];return()=>L.forEach(Z=>Z())},[_]),_n(v,()=>_&&(_.plugins=v),...hv),_n(S,()=>_&&(_.sensors=S),...hv),_n(k,()=>_&&(_.modifiers=k),...hv),d.jsxs(b5.Provider,{value:_,children:[d.jsx(j7,{ref:p,children:n}),n]})}function C7(t){const e=j.useRef(null);return e.current||(e.current=t()),j.useInsertionEffect(()=>()=>{var n;return(n=e.current)==null?void 0:n.destroy()},[]),e.current}function N7(){return j.useContext(b5)}function v5(t){var e;const n=(e=N7())!=null?e:void 0,[r]=j.useState(()=>t(n));return r.manager!==n&&(r.manager=n),gf(r.register,[n,r]),r}function T7(t){const{disabled:e,data:n,element:r,handle:i,id:s,modifiers:l,sensors:c}=t,u=v5(p=>new mf(x5(O5({},t),{register:!1,handle:$h(i),element:$h(r)}),p)),f=p5(u,$7);return _n(s,()=>u.id=s),e1(i,p=>u.handle=p),e1(r,p=>u.element=p),_n(n,()=>n&&(u.data=n)),_n(e,()=>u.disabled=e===!0),_n(c,()=>u.sensors=c),_n(l,()=>u.modifiers=l,void 0,Yc),_n(t.feedback,()=>{var p;return u.feedback=(p=t.feedback)!=null?p:"default"}),_n(t.alignment,()=>u.alignment=t.alignment),{draggable:f,get isDragging(){return f.isDragging},get isDropping(){return f.isDropping},get isDragSource(){return f.isDragSource},handleRef:j.useCallback(p=>{u.handle=p??void 0},[u]),ref:j.useCallback(p=>{var m,O;!p&&((m=u.element)!=null&&m.isConnected)&&!((O=u.manager)!=null&&O.dragOperation.status.idle)||(u.element=p??void 0)},[u])}}function $7(t,e,n){return!!(t==="isDragSource"&&!n&&e)}var E7=Object.create,y5=Object.defineProperty,P7=Object.getOwnPropertyDescriptor,S5=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),lO=t=>{throw TypeError(t)},A7=(t,e,n)=>e in t?y5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,R7=t=>{var e;return[,,,E7((e=t==null?void 0:t[S5("metadata")])!=null?e:null)]},w5=["class","method","getter","setter","accessor","field","value","get","set"],k5=t=>t!==void 0&&typeof t!="function"?lO("Function expected"):t,_7=(t,e,n,r,i)=>({kind:w5[t],name:e,metadata:r,addInitializer:s=>n._?lO("Already initialized"):i.push(k5(s||null))}),M7=(t,e)=>A7(e,S5("metadata"),t[3]),z7=(t,e,n,r)=>{for(var i=0,s=t[e>>1],l=s&&s.length;i<l;i++)s[i].call(n);return r},j5=(t,e,n,r,i,s)=>{for(var l,c,u,f,p=e&7,m=!1,O=!1,x=2,v=w5[p+5],S=t[x]||(t[x]=[]),k=(i=i.prototype,P7(i,n)),w=r.length-1;w>=0;w--)u=_7(p,n,c={},t[3],S),u.static=m,u.private=O,f=u.access={has:N=>n in N},f.get=N=>N[n],l=(0,r[w])(k[v],u),c._=1,k5(l)&&(k[v]=l);return k&&y5(i,n,k),i},Q5=(t,e,n)=>e.has(t)||lO("Cannot "+n),D7=(t,e,n)=>(Q5(t,e,"read from private field"),e.get(t)),L7=(t,e,n)=>e.has(t)?lO("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),X7=(t,e,n,r)=>(Q5(t,e,"write to private field"),e.set(t,n),n),Rl=class t1{constructor(e,n){this.x=e,this.y=n}static delta(e,n){return new t1(e.x-n.x,e.y-n.y)}static distance(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}static equals(e,n){return e.x===n.x&&e.y===n.y}static from({x:e,y:n}){return new t1(e,n)}},C5,N5,n1,Mm,Of,Xw=class extends(n1=fo,N5=[en],C5=[en],n1){constructor(t){const e=Rl.from(t);super(e,(n,r)=>Rl.equals(n,r)),z7(Of,5,this),L7(this,Mm,0),this.velocity={x:0,y:0}}get delta(){return Rl.delta(this.current,this.initial)}get direction(){const{current:t,previous:e}=this;if(!e)return null;const n={x:t.x-e.x,y:t.y-e.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up"}get current(){return super.current}set current(t){const{current:e}=this,n=Rl.from(t),r={x:n.x-e.x,y:n.y-e.y},i=Date.now(),s=i-D7(this,Mm),l=c=>Math.round(c/s*100);Jl(()=>{X7(this,Mm,i),this.velocity={x:l(r.x),y:l(r.y)},super.current=n})}reset(t=this.defaultValue){super.reset(Rl.from(t)),this.velocity={x:0,y:0}}};Of=R7(n1);Mm=new WeakMap;j5(Of,2,"delta",N5,Xw);j5(Of,2,"direction",C5,Xw);M7(Of,Xw);var T5=(t=>(t.Horizontal="x",t.Vertical="y",t))(T5||{});Object.values(T5);var Z7=({dragOperation:t,droppable:e})=>{const n=t.position.current;if(!n)return null;const{id:r}=e;if(!e.shape)return null;if(e.shape.containsPoint(n)){const i=Rl.distance(e.shape.center,n);return{id:r,value:1/i,type:hf.PointerIntersection,priority:df.High}}return null},q7=({dragOperation:t,droppable:e})=>{const{shape:n}=t;if(!e.shape||!(n!=null&&n.current))return null;const r=n.current.intersectionArea(e.shape);if(r){const{position:i}=t,s=Rl.distance(e.shape.center,i.current),c=r/(n.current.area+e.shape.area-r)/s;return{id:e.id,value:c,type:hf.ShapeIntersection,priority:df.Normal}}return null},I7=t=>{var e;return(e=Z7(t))!=null?e:q7(t)};function B7(t){const{collisionDetector:e,data:n,disabled:r,element:i,id:s,accept:l,type:c}=t,u=v5(p=>new Lw(x5(O5({},t),{register:!1,element:$h(i)}),p)),f=p5(u);return _n(s,()=>u.id=s),e1(i,p=>u.element=p),_n(l,()=>u.accept=l,void 0,Yc),_n(e,()=>u.collisionDetector=e??I7),_n(n,()=>n&&(u.data=n)),_n(r,()=>u.disabled=r===!0),_n(c,()=>u.type=c),{droppable:f,get isDropTarget(){return f.isDropTarget},ref:j.useCallback(p=>{var m,O;!p&&((m=u.element)!=null&&m.isConnected)&&!((O=u.manager)!=null&&O.dragOperation.status.idle)||(u.element=p??void 0)},[u])}}function Zw(){return Hs({queryKey:["skills"],queryFn:async()=>{const t=await fetch("/api/skills");if(!t.ok)throw new Error("Failed to fetch skills");return t.json()},staleTime:3e4})}function Y7(t){return Hs({queryKey:["skills",{id:t}],queryFn:async()=>{const e=await fetch(`/api/skills/${t}`);if(!e.ok)throw new Error(`Failed to fetch skill ${t}`);return e.json()},enabled:!!t})}function V7(t,e){const n=t.split(`
|
|
517
|
+
`),r=e.split(`
|
|
518
|
+
`),i=[],s=Math.max(n.length,r.length);for(let l=0;l<s;l++){const c=n[l],u=r[l];c===u?i.push({type:"unchanged",content:c??"",lineNumber:l+1}):(c!==void 0&&i.push({type:"removed",content:c,lineNumber:l+1}),u!==void 0&&i.push({type:"added",content:u,lineNumber:l+1}))}return i}function $5({original:t,modified:e,onConfirm:n,onCancel:r}){if(t===e)return d.jsx("div",{className:"p-8 text-center text-[var(--color-muted)]",children:d.jsx("p",{className:"text-sm",children:"No changes to save"})});const i=V7(t,e);return d.jsxs("div",{className:"flex flex-col h-full",children:[d.jsx("div",{className:"flex-1 overflow-auto font-[var(--font-mono)] text-sm",children:i.map((s,l)=>d.jsxs("div",{className:`px-4 py-0.5 ${s.type==="added"?"bg-green-950/30 text-green-400":s.type==="removed"?"bg-red-950/30 text-red-400":"text-[var(--color-text)]"}`,children:[d.jsx("span",{className:"inline-block w-6 text-right mr-3 text-[var(--color-muted)] select-none",children:s.type==="added"?"+":s.type==="removed"?"-":" "}),s.content]},l))}),(n||r)&&d.jsxs("div",{className:"flex justify-end gap-3 px-4 py-3 border-t border-[var(--color-border-subtle)]",children:[r&&d.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] text-[var(--color-text)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),n&&d.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-md bg-[var(--color-accent)] text-white font-bold hover:bg-[var(--color-accent-hover)] transition-colors",children:"Confirm Save"})]})]})}function U7({skill:t,onAdd:e}){const{ref:n,isDragging:r}=T7({id:`available-${t.id}`,data:{skillName:t.name,skillId:t.id}});return d.jsxs("div",{ref:n,className:`w-full flex items-center gap-2 px-3 py-2 text-left rounded-md hover:bg-[var(--color-surface-raised)] transition-colors group cursor-grab active:cursor-grabbing ${r?"opacity-40":""}`,children:[d.jsx(aI,{size:14,className:"text-[var(--color-muted)] shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("p",{className:"text-sm font-bold truncate",children:t.name}),t.module&&d.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)] shrink-0",children:t.module})]}),t.description&&d.jsx("p",{className:"text-xs text-[var(--color-muted)] truncate",children:t.description})]}),d.jsx("button",{onClick:i=>{i.stopPropagation(),e()},className:"text-[var(--color-success)] shrink-0 opacity-0 group-hover:opacity-100 transition-opacity hover:scale-110",title:"Add skill",children:d.jsx(Yt,{size:14})})]})}function W7({children:t,isEmpty:e}){const{ref:n,isDropTarget:r}=B7({id:"assigned-skills-zone"});return d.jsxs("div",{ref:n,className:`flex-1 overflow-y-auto p-2 transition-colors ${r?"bg-[var(--color-accent)]/5 ring-2 ring-inset ring-[var(--color-accent)]/30 rounded-lg":""}`,children:[t,e&&!r&&d.jsx("p",{className:"text-sm text-[var(--color-muted)] text-center py-4",children:"No skills assigned"}),d.jsx("div",{className:`mt-2 py-3 border-2 border-dashed rounded-lg text-center transition-all ${r?"border-[var(--color-accent)] text-[var(--color-accent)]":"border-[var(--color-border-subtle)] text-[var(--color-muted)]"}`,children:d.jsx("p",{className:"text-xs",children:"Drop skills here to assign"})})]})}function G7({agentName:t,currentSkills:e,onSave:n,onClose:r}){const{data:i}=Zw(),[s,l]=j.useState(e),[c,u]=j.useState(""),[f,p]=j.useState(!1),m=j.useMemo(()=>{if(!i)return[];const k=new Set(s);let w=i.filter(N=>!k.has(N.id)&&!k.has(N.name));if(c){const N=c.toLowerCase();w=w.filter(C=>C.name.toLowerCase().includes(N)||C.description.toLowerCase().includes(N))}return w},[i,s,c]),O=j.useCallback(k=>{l(w=>w.includes(k)?w:[...w,k])},[]),x=j.useCallback(k=>{l(w=>w.filter(N=>N!==k))},[]),v=j.useCallback(k=>{var C;const{source:w,target:N}=k.operation;(C=w==null?void 0:w.data)!=null&&C.skillName&&(N==null?void 0:N.id)==="assigned-skills-zone"&&O(w.data.skillName)},[O]),S=JSON.stringify(s)!==JSON.stringify(e);if(f){const k=e.join(`
|
|
519
|
+
`),w=s.join(`
|
|
520
|
+
`);return d.jsxs("div",{className:"h-full flex flex-col",children:[d.jsx("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)]",children:d.jsxs("h2",{className:"text-lg font-bold",children:["Review Skill Changes: ",t]})}),d.jsx("div",{className:"flex-1 overflow-hidden",children:d.jsx($5,{original:k,modified:w,onConfirm:()=>n(s),onCancel:()=>p(!1)})})]})}return d.jsx(Q7,{onDragEnd:v,children:d.jsxs("div",{className:"h-full flex flex-col",children:[d.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between",children:[d.jsxs("h2",{className:"text-lg font-bold",children:["Assign Skills: ",t]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>p(!0),disabled:!S,className:"px-3 py-1.5 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Review Changes"}),d.jsx("button",{onClick:r,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]})]}),d.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[d.jsxs("div",{className:"w-1/2 border-r border-[var(--color-border-subtle)] flex flex-col",children:[d.jsxs("div",{className:"p-4 border-b border-[var(--color-border-subtle)]",children:[d.jsx("h3",{className:"text-sm font-bold mb-2",children:"Available Skills"}),d.jsxs("div",{className:"relative",children:[d.jsx(hs,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),d.jsx("input",{type:"text",placeholder:"Search skills...",value:c,onChange:k=>u(k.target.value),className:"w-full pl-8 pr-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-text)] placeholder:text-[var(--color-muted)] outline-none focus:border-[var(--color-accent)]"})]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[m.map(k=>d.jsx(U7,{skill:k,onAdd:()=>O(k.name)},k.id)),m.length===0&&d.jsx("p",{className:"text-sm text-[var(--color-muted)] text-center py-4",children:c?"No matching skills":"All skills assigned"})]})]}),d.jsxs("div",{className:"w-1/2 flex flex-col",children:[d.jsx("div",{className:"p-4 border-b border-[var(--color-border-subtle)]",children:d.jsxs("h3",{className:"text-sm font-bold",children:["Assigned Skills (",s.length,")"]})}),d.jsx(W7,{isEmpty:s.length===0,children:s.map(k=>d.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-md hover:bg-[var(--color-surface-raised)] transition-colors group",children:[d.jsx("span",{className:"text-sm",children:k}),d.jsx("button",{onClick:()=>x(k),className:"text-[var(--color-error)] opacity-0 group-hover:opacity-100 transition-opacity",title:"Remove skill",children:d.jsx(yI,{size:14})})]},k))})]})]})]})})}function F7({agent:t,onClose:e,onSaved:n}){const r=tl(),i=t.module==="bmm"||t.module==="core",[s,l]=j.useState(t.title||""),[c,u]=j.useState(t.role||""),[f,p]=j.useState(t.icon||""),[m,O]=j.useState(t.discussion),[x,v]=j.useState(new Set(t.skills)),[S,k]=j.useState([]),[w,N]=j.useState(""),[C,E]=j.useState(null),[M,R]=j.useState(!1);j.useEffect(()=>{fetch("/api/skills").then(D=>D.json()).then(D=>k(D)).catch(()=>{})},[]);const _=S.filter(D=>{if(!w)return!0;const L=w.toLowerCase();return D.name.toLowerCase().includes(L)||D.description.toLowerCase().includes(L)}),V=D=>{v(L=>{const Z=new Set(L);return Z.has(D)?Z.delete(D):Z.add(D),Z})},G=async()=>{var D,L;R(!0),E(null);try{const Z=Array.from(x);if(Z.length!==t.skills.length||Z.some(q=>!t.skills.includes(q))){const q=await fetch(`/api/agents/${encodeURIComponent(t.id)}/skills`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({skills:Z})});if(!q.ok){const K=await q.json();throw new Error(((D=K.error)==null?void 0:D.message)??"Failed to update skills")}}const I=q=>q.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),B=[`title: "${I(s)}"`,`role: "${I(c)}"`,f?`icon: "${I(f)}"`:null,`discussion: ${m}`].filter(q=>q!==null).join(`
|
|
521
|
+
`)+`
|
|
522
|
+
`,X=await fetch(`/api/agents/${encodeURIComponent(t.id)}/override`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:B})});if(!X.ok){const q=await X.json();throw new Error(((L=q.error)==null?void 0:L.message)??"Failed to save override")}await r.invalidateQueries({queryKey:["agents"]}),await r.invalidateQueries({queryKey:["agent",t.id]}),n()}catch(Z){E(Z instanceof Error?Z.message:"Failed to save agent")}finally{R(!1)}};return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),d.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-2xl p-6 max-h-[85vh] flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-bold",children:"Edit Agent"}),i&&d.jsx("p",{className:"text-xs text-[var(--color-warning)] mt-1",children:"Override mode — base file will not be modified"})]}),d.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]}),d.jsxs("div",{className:"space-y-4 overflow-y-auto flex-1 pr-1",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Title"}),d.jsx("input",{type:"text",value:s,onChange:D=>l(D.target.value),placeholder:"e.g. Project Manager",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Role"}),d.jsx("textarea",{value:c,onChange:D=>u(D.target.value),rows:2,placeholder:"Describe the agent's role...",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Icon"}),d.jsx("input",{type:"text",value:f,onChange:D=>p(D.target.value),placeholder:"e.g. a single emoji",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("label",{className:"text-sm font-bold",children:"Discussion mode"}),d.jsx("button",{onClick:()=>O(!m),className:`relative w-10 h-5 rounded-full transition-colors ${m?"bg-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]"}`,children:d.jsx("span",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform ${m?"translate-x-5":"translate-x-0.5"}`})})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-bold mb-1",children:["Skills (",x.size," assigned)"]}),d.jsxs("div",{className:"relative mb-2",children:[d.jsx(hs,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),d.jsx("input",{type:"text",value:w,onChange:D=>N(D.target.value),placeholder:"Search skills...",className:"w-full pl-9 pr-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),d.jsx("div",{className:"max-h-48 overflow-y-auto border border-[var(--color-border-subtle)] rounded-md",children:_.length===0?d.jsx("p",{className:"text-xs text-[var(--color-muted)] p-3 text-center",children:"No skills found"}):_.map(D=>d.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-[var(--color-surface-raised)] cursor-pointer text-sm",children:[d.jsx("input",{type:"checkbox",checked:x.has(D.id),onChange:()=>V(D.id),className:"accent-[var(--color-accent)]"}),d.jsx("span",{className:"truncate font-bold",children:D.name}),d.jsx("span",{className:"text-xs text-[var(--color-muted)] truncate ml-auto",children:D.description})]},D.id))})]}),d.jsxs("div",{className:"text-xs text-[var(--color-muted)] space-y-1 pt-2 border-t border-[var(--color-border-subtle)]",children:[d.jsxs("p",{children:["ID: ",d.jsx("code",{className:"font-[var(--font-mono)]",children:t.id})]}),d.jsxs("p",{children:["Module: ",d.jsx("code",{className:"font-[var(--font-mono)]",children:t.module??"custom"})]}),d.jsxs("p",{children:["File: ",d.jsx("code",{className:"font-[var(--font-mono)] break-all",children:t.filePath})]})]}),C&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:C})]}),d.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[d.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsxs("button",{onClick:G,disabled:M,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[d.jsx(Bc,{size:14}),M?"Saving...":"Save Changes"]})]})]})]})}function H7(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const K7=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J7=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eY={};function iT(t,e){return(eY.jsx?J7:K7).test(t)}const tY=/[ \t\n\f\r]/g;function nY(t){return typeof t=="object"?t.type==="text"?sT(t.value):!1:sT(t)}function sT(t){return t.replace(tY,"")===""}let xf=class{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}};xf.prototype.normal={};xf.prototype.property={};xf.prototype.space=void 0;function E5(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new xf(n,r,e)}function r1(t){return t.toLowerCase()}class vr{constructor(e,n){this.attribute=n,this.property=e}}vr.prototype.attribute="";vr.prototype.booleanish=!1;vr.prototype.boolean=!1;vr.prototype.commaOrSpaceSeparated=!1;vr.prototype.commaSeparated=!1;vr.prototype.defined=!1;vr.prototype.mustUseProperty=!1;vr.prototype.number=!1;vr.prototype.overloadedBoolean=!1;vr.prototype.property="";vr.prototype.spaceSeparated=!1;vr.prototype.space=void 0;let rY=0;const Le=xo(),ln=xo(),i1=xo(),ge=xo(),Ct=xo(),kc=xo(),Er=xo();function xo(){return 2**++rY}const s1=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:ln,commaOrSpaceSeparated:Er,commaSeparated:kc,number:ge,overloadedBoolean:i1,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),fv=Object.keys(s1);class qw extends vr{constructor(e,n,r,i){let s=-1;if(super(e,n),aT(this,"space",i),typeof r=="number")for(;++s<fv.length;){const l=fv[s];aT(this,fv[s],(r&s1[l])===s1[l])}}}qw.prototype.defined=!0;function aT(t,e,n){n&&(t[e]=n)}function bu(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new qw(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[r1(r)]=r,n[r1(s.attribute)]=r}return new xf(e,n,t.space)}const P5=bu({properties:{ariaActiveDescendant:null,ariaAtomic:ln,ariaAutoComplete:null,ariaBusy:ln,ariaChecked:ln,ariaColCount:ge,ariaColIndex:ge,ariaColSpan:ge,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:ln,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:ln,ariaFlowTo:Ct,ariaGrabbed:ln,ariaHasPopup:null,ariaHidden:ln,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:ge,ariaLive:null,ariaModal:ln,ariaMultiLine:ln,ariaMultiSelectable:ln,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:ge,ariaPressed:ln,ariaReadOnly:ln,ariaRelevant:null,ariaRequired:ln,ariaRoleDescription:Ct,ariaRowCount:ge,ariaRowIndex:ge,ariaRowSpan:ge,ariaSelected:ln,ariaSetSize:ge,ariaSort:null,ariaValueMax:ge,ariaValueMin:ge,ariaValueNow:ge,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function A5(t,e){return e in t?t[e]:e}function R5(t,e){return A5(t,e.toLowerCase())}const iY=bu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:kc,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:Ct,autoFocus:Le,autoPlay:Le,blocking:Ct,capture:null,charSet:null,checked:Le,cite:null,className:Ct,cols:ge,colSpan:null,content:null,contentEditable:ln,controls:Le,controlsList:Ct,coords:ge|kc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:i1,draggable:ln,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:Ct,height:ge,hidden:i1,high:ge,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:Le,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:ge,manifest:null,max:null,maxLength:ge,media:null,method:null,min:null,minLength:ge,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Le,optimum:ge,pattern:null,ping:Ct,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:Ct,required:Le,reversed:Le,rows:ge,rowSpan:ge,sandbox:Ct,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shape:null,size:ge,sizes:null,slot:null,span:ge,spellCheck:ln,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ge,step:null,style:null,tabIndex:ge,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:ln,width:ge,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:ge,borderColor:null,bottomMargin:ge,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:ge,leftMargin:ge,link:null,longDesc:null,lowSrc:null,marginHeight:ge,marginWidth:ge,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:ge,rules:null,scheme:null,scrolling:ln,standby:null,summary:null,text:null,topMargin:ge,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ge,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Le,disableRemotePlayback:Le,prefix:null,property:null,results:ge,security:null,unselectable:null},space:"html",transform:R5}),sY=bu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Er,accentHeight:ge,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ge,amplitude:ge,arabicForm:null,ascent:ge,attributeName:null,attributeType:null,azimuth:ge,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ge,by:null,calcMode:null,capHeight:ge,className:Ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ge,diffuseConstant:ge,direction:null,display:null,dur:null,divisor:ge,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:ge,enableBackground:null,end:null,event:null,exponent:ge,externalResourcesRequired:null,fill:null,fillOpacity:ge,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:kc,g2:kc,glyphName:kc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ge,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ge,horizOriginX:ge,horizOriginY:ge,id:null,ideographic:ge,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ge,k:ge,k1:ge,k2:ge,k3:ge,k4:ge,kernelMatrix:Er,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ge,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ge,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ge,overlineThickness:ge,paintOrder:null,panose1:null,path:null,pathLength:ge,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ge,pointsAtY:ge,pointsAtZ:ge,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Er,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Er,rev:Er,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Er,requiredFeatures:Er,requiredFonts:Er,requiredFormats:Er,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ge,specularExponent:ge,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ge,strikethroughThickness:ge,string:null,stroke:null,strokeDashArray:Er,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ge,strokeOpacity:ge,strokeWidth:null,style:null,surfaceScale:ge,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Er,tabIndex:ge,tableValues:null,target:null,targetX:ge,targetY:ge,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Er,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ge,underlineThickness:ge,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ge,values:null,vAlphabetic:ge,vMathematical:ge,vectorEffect:null,vHanging:ge,vIdeographic:ge,version:null,vertAdvY:ge,vertOriginX:ge,vertOriginY:ge,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ge,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:A5}),_5=bu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),M5=bu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:R5}),z5=bu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),aY={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},lY=/[A-Z]/g,lT=/-[a-z]/g,oY=/^data[-\w.:]+$/i;function cY(t,e){const n=r1(e);let r=e,i=vr;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&oY.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(lT,dY);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!lT.test(s)){let l=s.replace(lY,uY);l.charAt(0)!=="-"&&(l="-"+l),e="data"+l}}i=qw}return new i(r,e)}function uY(t){return"-"+t.toLowerCase()}function dY(t){return t.charAt(1).toUpperCase()}const hY=E5([P5,iY,_5,M5,z5],"html"),Iw=E5([P5,sY,_5,M5,z5],"svg");function fY(t){return t.join(" ").trim()}var oc={},pv,oT;function pY(){if(oT)return pv;oT=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,u=`
|
|
523
|
+
`,f="/",p="*",m="",O="comment",x="declaration";function v(k,w){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];w=w||{};var N=1,C=1;function E(I){var B=I.match(e);B&&(N+=B.length);var X=I.lastIndexOf(u);C=~X?I.length-X:C+I.length}function M(){var I={line:N,column:C};return function(B){return B.position=new R(I),G(),B}}function R(I){this.start=I,this.end={line:N,column:C},this.source=w.source}R.prototype.content=k;function _(I){var B=new Error(w.source+":"+N+":"+C+": "+I);if(B.reason=I,B.filename=w.source,B.line=N,B.column=C,B.source=k,!w.silent)throw B}function V(I){var B=I.exec(k);if(B){var X=B[0];return E(X),k=k.slice(X.length),B}}function G(){V(n)}function D(I){var B;for(I=I||[];B=L();)B!==!1&&I.push(B);return I}function L(){var I=M();if(!(f!=k.charAt(0)||p!=k.charAt(1))){for(var B=2;m!=k.charAt(B)&&(p!=k.charAt(B)||f!=k.charAt(B+1));)++B;if(B+=2,m===k.charAt(B-1))return _("End of comment missing");var X=k.slice(2,B-2);return C+=2,E(X),k=k.slice(B),C+=2,I({type:O,comment:X})}}function Z(){var I=M(),B=V(r);if(B){if(L(),!V(i))return _("property missing ':'");var X=V(s),q=I({type:x,property:S(B[0].replace(t,m)),value:X?S(X[0].replace(t,m)):m});return V(l),q}}function te(){var I=[];D(I);for(var B;B=Z();)B!==!1&&(I.push(B),D(I));return I}return G(),te()}function S(k){return k?k.replace(c,m):m}return pv=v,pv}var cT;function mY(){if(cT)return oc;cT=1;var t=oc&&oc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oc,"__esModule",{value:!0}),oc.default=n;const e=t(pY());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const l=(0,e.default)(r),c=typeof i=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:f,value:p}=u;c?i(f,p,u):p&&(s=s||{},s[f]=p)}),s}return oc}var wd={},uT;function gY(){if(uT)return wd;uT=1,Object.defineProperty(wd,"__esModule",{value:!0}),wd.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(f){return!f||n.test(f)||t.test(f)},l=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},u=function(f,p){return p===void 0&&(p={}),s(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(i,c):f=f.replace(r,c),f.replace(e,l))};return wd.camelCase=u,wd}var kd,dT;function OY(){if(dT)return kd;dT=1;var t=kd&&kd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(mY()),n=gY();function r(i,s){var l={};return!i||typeof i!="string"||(0,e.default)(i,function(c,u){c&&u&&(l[(0,n.camelCase)(c,s)]=u)}),l}return r.default=r,kd=r,kd}var xY=OY();const bY=Gg(xY),D5=L5("end"),Bw=L5("start");function L5(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function vY(t){const e=Bw(t),n=D5(t);if(e&&n)return{start:e,end:n}}function rh(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?hT(t.position):"start"in t||"end"in t?hT(t):"line"in t||"column"in t?a1(t):""}function a1(t){return fT(t&&t.line)+":"+fT(t&&t.column)}function hT(t){return a1(t&&t.start)+"-"+a1(t&&t.end)}function fT(t){return t&&typeof t=="number"?t:1}class Ln extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},l=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(l=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=rh(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ln.prototype.file="";Ln.prototype.name="";Ln.prototype.reason="";Ln.prototype.message="";Ln.prototype.stack="";Ln.prototype.column=void 0;Ln.prototype.line=void 0;Ln.prototype.ancestors=void 0;Ln.prototype.cause=void 0;Ln.prototype.fatal=void 0;Ln.prototype.place=void 0;Ln.prototype.ruleId=void 0;Ln.prototype.source=void 0;const Yw={}.hasOwnProperty,yY=new Map,SY=/[A-Z]/g,wY=new Set(["table","tbody","thead","tfoot","tr"]),kY=new Set(["td","th"]),X5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function jY(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=AY(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=PY(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Iw:hY,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=Z5(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function Z5(t,e,n){if(e.type==="element")return QY(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return CY(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return TY(t,e,n);if(e.type==="mdxjsEsm")return NY(t,e);if(e.type==="root")return $Y(t,e,n);if(e.type==="text")return EY(t,e)}function QY(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Iw,t.schema=i),t.ancestors.push(e);const s=I5(t,e.tagName,!1),l=RY(t,e);let c=Uw(t,e);return wY.has(e.tagName)&&(c=c.filter(function(u){return typeof u=="string"?!nY(u):!0})),q5(t,l,s,e),Vw(l,c),t.ancestors.pop(),t.schema=r,t.create(e,s,l,n)}function CY(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}Eh(t,e.position)}function NY(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Eh(t,e.position)}function TY(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Iw,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:I5(t,e.name,!0),l=_Y(t,e),c=Uw(t,e);return q5(t,l,s,e),Vw(l,c),t.ancestors.pop(),t.schema=r,t.create(e,s,l,n)}function $Y(t,e,n){const r={};return Vw(r,Uw(t,e)),t.create(e,t.Fragment,r,n)}function EY(t,e){return e.value}function q5(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Vw(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function PY(t,e,n){return r;function r(i,s,l,c){const f=Array.isArray(l.children)?n:e;return c?f(s,l,c):f(s,l)}}function AY(t,e){return n;function n(r,i,s,l){const c=Array.isArray(s.children),u=Bw(r);return e(i,s,l,c,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function RY(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&Yw.call(e.properties,i)){const s=MY(t,i,e.properties[i]);if(s){const[l,c]=s;t.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&kY.has(e.tagName)?r=c:n[l]=c}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function _Y(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const l=s.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,t.evaluater.evaluateExpression(c.argument))}else Eh(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const c=r.value.data.estree.body[0];c.type,s=t.evaluater.evaluateExpression(c.expression)}else Eh(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Uw(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:yY;for(;++r<e.children.length;){const s=e.children[r];let l;if(t.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const f=i.get(u)||0;l=u+"-"+f,i.set(u,f+1)}}const c=Z5(t,s,l);c!==void 0&&n.push(c)}return n}function MY(t,e,n){const r=cY(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?H7(n):fY(n)),r.property==="style"){let i=typeof n=="object"?n:zY(t,String(n));return t.stylePropertyNameCase==="css"&&(i=DY(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?aY[r.property]||r.property:r.attribute,n]}}function zY(t,e){try{return bY(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new Ln("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=X5+"#cannot-parse-style-attribute",i}}function I5(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,l;for(;++s<i.length;){const c=iT(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}r=l}else r=iT(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return Yw.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);Eh(t)}function Eh(t,e){const n=new Ln("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=X5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function DY(t){const e={};let n;for(n in t)Yw.call(t,n)&&(e[LY(n)]=t[n]);return e}function LY(t){let e=t.replace(SY,XY);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function XY(t){return"-"+t.toLowerCase()}const mv={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},ZY={};function Ww(t,e){const n=ZY,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return B5(t,r,i)}function B5(t,e,n){if(qY(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return pT(t.children,e,n)}return Array.isArray(t)?pT(t,e,n):""}function pT(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=B5(t[i],e,n);return r.join("")}function qY(t){return!!(t&&typeof t=="object")}const mT=document.createElement("i");function Gw(t){const e="&"+t+";";mT.innerHTML=e;const n=mT.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Mr(t,e,n,r){const i=t.length;let s=0,l;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(e,n),t.splice(...l);else for(n&&t.splice(e,n);s<r.length;)l=r.slice(s,s+1e4),l.unshift(e,0),t.splice(...l),s+=1e4,e+=1e4}function Hr(t,e){return t.length>0?(Mr(t,t.length,0,e),t):e}const gT={}.hasOwnProperty;function Y5(t){const e={};let n=-1;for(;++n<t.length;)IY(e,t[n]);return e}function IY(t,e){let n;for(n in e){const i=(gT.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let l;if(s)for(l in s){gT.call(i,l)||(i[l]=[]);const c=s[l];BY(i[l],Array.isArray(c)?c:c?[c]:[])}}}function BY(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);Mr(t,0,0,r)}function V5(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function wi(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Wn=rl(/[A-Za-z]/),zn=rl(/[\dA-Za-z]/),YY=rl(/[#-'*+\--9=?A-Z^-~]/);function bg(t){return t!==null&&(t<32||t===127)}const l1=rl(/\d/),VY=rl(/[\dA-Fa-f]/),UY=rl(/[!-/:-@[-`{-~]/);function Ne(t){return t!==null&&t<-2}function kt(t){return t!==null&&(t<0||t===32)}function Ve(t){return t===-2||t===-1||t===32}const oO=rl(new RegExp("\\p{P}|\\p{S}","u")),ro=rl(/\s/);function rl(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function vu(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const s=t.charCodeAt(n);let l="";if(s===37&&zn(t.charCodeAt(n+1))&&zn(t.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const c=t.charCodeAt(n+1);s<56320&&c>56319&&c<57344?(l=String.fromCharCode(s,c),i=1):l="�"}else l=String.fromCharCode(s);l&&(e.push(t.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function et(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(u){return Ve(u)?(t.enter(n),c(u)):e(u)}function c(u){return Ve(u)&&s++<i?(t.consume(u),c):(t.exit(n),e(u))}}const WY={tokenize:GY};function GY(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(c){if(c===null){t.consume(c);return}return t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),et(t,e,"linePrefix")}function i(c){return t.enter("paragraph"),s(c)}function s(c){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,l(c)}function l(c){if(c===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(c);return}return Ne(c)?(t.consume(c),t.exit("chunkText"),s):(t.consume(c),l)}}const FY={tokenize:HY},OT={tokenize:KY};function HY(t){const e=this,n=[];let r=0,i,s,l;return c;function c(C){if(r<n.length){const E=n[r];return e.containerState=E[1],t.attempt(E[0].continuation,u,f)(C)}return f(C)}function u(C){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&N();const E=e.events.length;let M=E,R;for(;M--;)if(e.events[M][0]==="exit"&&e.events[M][1].type==="chunkFlow"){R=e.events[M][1].end;break}w(r);let _=E;for(;_<e.events.length;)e.events[_][1].end={...R},_++;return Mr(e.events,M+1,0,e.events.slice(E)),e.events.length=_,f(C)}return c(C)}function f(C){if(r===n.length){if(!i)return O(C);if(i.currentConstruct&&i.currentConstruct.concrete)return v(C);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(OT,p,m)(C)}function p(C){return i&&N(),w(r),O(C)}function m(C){return e.parser.lazy[e.now().line]=r!==n.length,l=e.now().offset,v(C)}function O(C){return e.containerState={},t.attempt(OT,x,v)(C)}function x(C){return r++,n.push([e.currentConstruct,e.containerState]),O(C)}function v(C){if(C===null){i&&N(),w(0),t.consume(C);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),S(C)}function S(C){if(C===null){k(t.exit("chunkFlow"),!0),w(0),t.consume(C);return}return Ne(C)?(t.consume(C),k(t.exit("chunkFlow")),r=0,e.interrupt=void 0,c):(t.consume(C),S)}function k(C,E){const M=e.sliceStream(C);if(E&&M.push(null),C.previous=s,s&&(s.next=C),s=C,i.defineSkip(C.start),i.write(M),e.parser.lazy[C.start.line]){let R=i.events.length;for(;R--;)if(i.events[R][1].start.offset<l&&(!i.events[R][1].end||i.events[R][1].end.offset>l))return;const _=e.events.length;let V=_,G,D;for(;V--;)if(e.events[V][0]==="exit"&&e.events[V][1].type==="chunkFlow"){if(G){D=e.events[V][1].end;break}G=!0}for(w(r),R=_;R<e.events.length;)e.events[R][1].end={...D},R++;Mr(e.events,V+1,0,e.events.slice(_)),e.events.length=R}}function w(C){let E=n.length;for(;E-- >C;){const M=n[E];e.containerState=M[1],M[0].exit.call(e,t)}n.length=C}function N(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function KY(t,e,n){return et(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Hc(t){if(t===null||kt(t)||ro(t))return 1;if(oO(t))return 2}function cO(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!r.includes(s)&&(e=s(e,n),r.push(s))}return e}const o1={name:"attention",resolveAll:JY,tokenize:eV};function JY(t,e){let n=-1,r,i,s,l,c,u,f,p;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const m={...t[r][1].end},O={...t[n][1].start};xT(m,-u),xT(O,u),l={type:u>1?"strongSequence":"emphasisSequence",start:m,end:{...t[r][1].end}},c={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:O},s={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},t[r][1].end={...l.start},t[n][1].start={...c.end},f=[],t[r][1].end.offset-t[r][1].start.offset&&(f=Hr(f,[["enter",t[r][1],e],["exit",t[r][1],e]])),f=Hr(f,[["enter",i,e],["enter",l,e],["exit",l,e],["enter",s,e]]),f=Hr(f,cO(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),f=Hr(f,[["exit",s,e],["enter",c,e],["exit",c,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(p=2,f=Hr(f,[["enter",t[n][1],e],["exit",t[n][1],e]])):p=0,Mr(t,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function eV(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Hc(r);let s;return l;function l(u){return s=u,t.enter("attentionSequence"),c(u)}function c(u){if(u===s)return t.consume(u),c;const f=t.exit("attentionSequence"),p=Hc(u),m=!p||p===2&&i||n.includes(u),O=!i||i===2&&p||n.includes(r);return f._open=!!(s===42?m:m&&(i||!O)),f._close=!!(s===42?O:O&&(p||!m)),e(u)}}function xT(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const tV={name:"autolink",tokenize:nV};function nV(t,e,n){let r=0;return i;function i(x){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(x){return Wn(x)?(t.consume(x),l):x===64?n(x):f(x)}function l(x){return x===43||x===45||x===46||zn(x)?(r=1,c(x)):f(x)}function c(x){return x===58?(t.consume(x),r=0,u):(x===43||x===45||x===46||zn(x))&&r++<32?(t.consume(x),c):(r=0,f(x))}function u(x){return x===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):x===null||x===32||x===60||bg(x)?n(x):(t.consume(x),u)}function f(x){return x===64?(t.consume(x),p):YY(x)?(t.consume(x),f):n(x)}function p(x){return zn(x)?m(x):n(x)}function m(x){return x===46?(t.consume(x),r=0,p):x===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):O(x)}function O(x){if((x===45||zn(x))&&r++<63){const v=x===45?O:m;return t.consume(x),v}return n(x)}}const bf={partial:!0,tokenize:rV};function rV(t,e,n){return r;function r(s){return Ve(s)?et(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||Ne(s)?e(s):n(s)}}const U5={continuation:{tokenize:sV},exit:aV,name:"blockQuote",tokenize:iV};function iV(t,e,n){const r=this;return i;function i(l){if(l===62){const c=r.containerState;return c.open||(t.enter("blockQuote",{_container:!0}),c.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(l),t.exit("blockQuoteMarker"),s}return n(l)}function s(l){return Ve(l)?(t.enter("blockQuotePrefixWhitespace"),t.consume(l),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(l))}}function sV(t,e,n){const r=this;return i;function i(l){return Ve(l)?et(t,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return t.attempt(U5,e,n)(l)}}function aV(t){t.exit("blockQuote")}const W5={name:"characterEscape",tokenize:lV};function lV(t,e,n){return r;function r(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return UY(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const G5={name:"characterReference",tokenize:oV};function oV(t,e,n){const r=this;let i=0,s,l;return c;function c(m){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),u}function u(m){return m===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(m),t.exit("characterReferenceMarkerNumeric"),f):(t.enter("characterReferenceValue"),s=31,l=zn,p(m))}function f(m){return m===88||m===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(m),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,l=VY,p):(t.enter("characterReferenceValue"),s=7,l=l1,p(m))}function p(m){if(m===59&&i){const O=t.exit("characterReferenceValue");return l===zn&&!Gw(r.sliceSerialize(O))?n(m):(t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return l(m)&&i++<s?(t.consume(m),p):n(m)}}const bT={partial:!0,tokenize:uV},vT={concrete:!0,name:"codeFenced",tokenize:cV};function cV(t,e,n){const r=this,i={partial:!0,tokenize:M};let s=0,l=0,c;return u;function u(R){return f(R)}function f(R){const _=r.events[r.events.length-1];return s=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,c=R,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),p(R)}function p(R){return R===c?(l++,t.consume(R),p):l<3?n(R):(t.exit("codeFencedFenceSequence"),Ve(R)?et(t,m,"whitespace")(R):m(R))}function m(R){return R===null||Ne(R)?(t.exit("codeFencedFence"),r.interrupt?e(R):t.check(bT,S,E)(R)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),O(R))}function O(R){return R===null||Ne(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),m(R)):Ve(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),et(t,x,"whitespace")(R)):R===96&&R===c?n(R):(t.consume(R),O)}function x(R){return R===null||Ne(R)?m(R):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),v(R))}function v(R){return R===null||Ne(R)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),m(R)):R===96&&R===c?n(R):(t.consume(R),v)}function S(R){return t.attempt(i,E,k)(R)}function k(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),w}function w(R){return s>0&&Ve(R)?et(t,N,"linePrefix",s+1)(R):N(R)}function N(R){return R===null||Ne(R)?t.check(bT,S,E)(R):(t.enter("codeFlowValue"),C(R))}function C(R){return R===null||Ne(R)?(t.exit("codeFlowValue"),N(R)):(t.consume(R),C)}function E(R){return t.exit("codeFenced"),e(R)}function M(R,_,V){let G=0;return D;function D(B){return R.enter("lineEnding"),R.consume(B),R.exit("lineEnding"),L}function L(B){return R.enter("codeFencedFence"),Ve(B)?et(R,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):Z(B)}function Z(B){return B===c?(R.enter("codeFencedFenceSequence"),te(B)):V(B)}function te(B){return B===c?(G++,R.consume(B),te):G>=l?(R.exit("codeFencedFenceSequence"),Ve(B)?et(R,I,"whitespace")(B):I(B)):V(B)}function I(B){return B===null||Ne(B)?(R.exit("codeFencedFence"),_(B)):V(B)}}}function uV(t,e,n){const r=this;return i;function i(l){return l===null?n(l):(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),s)}function s(l){return r.parser.lazy[r.now().line]?n(l):e(l)}}const gv={name:"codeIndented",tokenize:hV},dV={partial:!0,tokenize:fV};function hV(t,e,n){const r=this;return i;function i(f){return t.enter("codeIndented"),et(t,s,"linePrefix",5)(f)}function s(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?u(f):Ne(f)?t.attempt(dV,l,u)(f):(t.enter("codeFlowValue"),c(f))}function c(f){return f===null||Ne(f)?(t.exit("codeFlowValue"),l(f)):(t.consume(f),c)}function u(f){return t.exit("codeIndented"),e(f)}}function fV(t,e,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):Ne(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),i):et(t,s,"linePrefix",5)(l)}function s(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(l):Ne(l)?i(l):n(l)}}const pV={name:"codeText",previous:gV,resolve:mV,tokenize:OV};function mV(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function gV(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function OV(t,e,n){let r=0,i,s;return l;function l(m){return t.enter("codeText"),t.enter("codeTextSequence"),c(m)}function c(m){return m===96?(t.consume(m),r++,c):(t.exit("codeTextSequence"),u(m))}function u(m){return m===null?n(m):m===32?(t.enter("space"),t.consume(m),t.exit("space"),u):m===96?(s=t.enter("codeTextSequence"),i=0,p(m)):Ne(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),u):(t.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||Ne(m)?(t.exit("codeTextData"),u(m)):(t.consume(m),f)}function p(m){return m===96?(t.consume(m),i++,p):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(m)):(s.type="codeTextData",f(m))}}class xV{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&jd(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),jd(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),jd(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);jd(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);jd(this.left,n.reverse())}}}function jd(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function F5(t){const e={};let n=-1,r,i,s,l,c,u,f;const p=new xV(t);for(;++n<p.length;){for(;n in e;)n=e[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,bV(p,n)),n=e[n],f=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(l=p.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},c=p.slice(i,n),c.unshift(r),p.splice(i,n-i+1,c))}}return Mr(t,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function bV(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const s=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,u=[],f={};let p,m,O=-1,x=n,v=0,S=0;const k=[S];for(;x;){for(;t.get(++i)[1]!==x;);s.push(i),x._tokenizer||(p=r.sliceStream(x),x.next||p.push(null),m&&l.defineSkip(x.start),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=x,x=x.next}for(x=n;++O<c.length;)c[O][0]==="exit"&&c[O-1][0]==="enter"&&c[O][1].type===c[O-1][1].type&&c[O][1].start.line!==c[O][1].end.line&&(S=O+1,k.push(S),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(l.events=[],x?(x._tokenizer=void 0,x.previous=void 0):k.pop(),O=k.length;O--;){const w=c.slice(k[O],k[O+1]),N=s.pop();u.push([N,N+w.length-1]),t.splice(N,2,w)}for(u.reverse(),O=-1;++O<u.length;)f[v+u[O][0]]=v+u[O][1],v+=u[O][1]-u[O][0]-1;return f}const vV={resolve:SV,tokenize:wV},yV={partial:!0,tokenize:kV};function SV(t){return F5(t),t}function wV(t,e){let n;return r;function r(c){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?s(c):Ne(c)?t.check(yV,l,s)(c):(t.consume(c),i)}function s(c){return t.exit("chunkContent"),t.exit("content"),e(c)}function l(c){return t.consume(c),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function kV(t,e,n){const r=this;return i;function i(l){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),et(t,s,"linePrefix")}function s(l){if(l===null||Ne(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(l):t.interrupt(r.parser.constructs.flow,n,e)(l)}}function H5(t,e,n,r,i,s,l,c,u){const f=u||Number.POSITIVE_INFINITY;let p=0;return m;function m(w){return w===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(w),t.exit(s),O):w===null||w===32||w===41||bg(w)?n(w):(t.enter(r),t.enter(l),t.enter(c),t.enter("chunkString",{contentType:"string"}),S(w))}function O(w){return w===62?(t.enter(s),t.consume(w),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(c),t.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===62?(t.exit("chunkString"),t.exit(c),O(w)):w===null||w===60||Ne(w)?n(w):(t.consume(w),w===92?v:x)}function v(w){return w===60||w===62||w===92?(t.consume(w),x):x(w)}function S(w){return!p&&(w===null||w===41||kt(w))?(t.exit("chunkString"),t.exit(c),t.exit(l),t.exit(r),e(w)):p<f&&w===40?(t.consume(w),p++,S):w===41?(t.consume(w),p--,S):w===null||w===32||w===40||bg(w)?n(w):(t.consume(w),w===92?k:S)}function k(w){return w===40||w===41||w===92?(t.consume(w),S):S(w)}}function K5(t,e,n,r,i,s){const l=this;let c=0,u;return f;function f(x){return t.enter(r),t.enter(i),t.consume(x),t.exit(i),t.enter(s),p}function p(x){return c>999||x===null||x===91||x===93&&!u||x===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(x):x===93?(t.exit(s),t.enter(i),t.consume(x),t.exit(i),t.exit(r),e):Ne(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),p):(t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||Ne(x)||c++>999?(t.exit("chunkString"),p(x)):(t.consume(x),u||(u=!Ve(x)),x===92?O:m)}function O(x){return x===91||x===92||x===93?(t.consume(x),c++,m):m(x)}}function J5(t,e,n,r,i,s){let l;return c;function c(O){return O===34||O===39||O===40?(t.enter(r),t.enter(i),t.consume(O),t.exit(i),l=O===40?41:O,u):n(O)}function u(O){return O===l?(t.enter(i),t.consume(O),t.exit(i),t.exit(r),e):(t.enter(s),f(O))}function f(O){return O===l?(t.exit(s),u(l)):O===null?n(O):Ne(O)?(t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),et(t,f,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),p(O))}function p(O){return O===l||O===null||Ne(O)?(t.exit("chunkString"),f(O)):(t.consume(O),O===92?m:p)}function m(O){return O===l||O===92?(t.consume(O),p):p(O)}}function ih(t,e){let n;return r;function r(i){return Ne(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Ve(i)?et(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const jV={name:"definition",tokenize:CV},QV={partial:!0,tokenize:NV};function CV(t,e,n){const r=this;let i;return s;function s(x){return t.enter("definition"),l(x)}function l(x){return K5.call(r,t,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function c(x){return i=wi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),u):n(x)}function u(x){return kt(x)?ih(t,f)(x):f(x)}function f(x){return H5(t,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function p(x){return t.attempt(QV,m,m)(x)}function m(x){return Ve(x)?et(t,O,"whitespace")(x):O(x)}function O(x){return x===null||Ne(x)?(t.exit("definition"),r.parser.defined.push(i),e(x)):n(x)}}function NV(t,e,n){return r;function r(c){return kt(c)?ih(t,i)(c):n(c)}function i(c){return J5(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return Ve(c)?et(t,l,"whitespace")(c):l(c)}function l(c){return c===null||Ne(c)?e(c):n(c)}}const TV={name:"hardBreakEscape",tokenize:$V};function $V(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return Ne(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const EV={name:"headingAtx",resolve:PV,tokenize:AV};function PV(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Mr(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function AV(t,e,n){let r=0;return i;function i(p){return t.enter("atxHeading"),s(p)}function s(p){return t.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(t.consume(p),l):p===null||kt(p)?(t.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(t.enter("atxHeadingSequence"),u(p)):p===null||Ne(p)?(t.exit("atxHeading"),e(p)):Ve(p)?et(t,c,"whitespace")(p):(t.enter("atxHeadingText"),f(p))}function u(p){return p===35?(t.consume(p),u):(t.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||kt(p)?(t.exit("atxHeadingText"),c(p)):(t.consume(p),f)}}const RV=["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","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],yT=["pre","script","style","textarea"],_V={concrete:!0,name:"htmlFlow",resolveTo:DV,tokenize:LV},MV={partial:!0,tokenize:ZV},zV={partial:!0,tokenize:XV};function DV(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function LV(t,e,n){const r=this;let i,s,l,c,u;return f;function f(T){return p(T)}function p(T){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(T),m}function m(T){return T===33?(t.consume(T),O):T===47?(t.consume(T),s=!0,S):T===63?(t.consume(T),i=3,r.interrupt?e:$):Wn(T)?(t.consume(T),l=String.fromCharCode(T),k):n(T)}function O(T){return T===45?(t.consume(T),i=2,x):T===91?(t.consume(T),i=5,c=0,v):Wn(T)?(t.consume(T),i=4,r.interrupt?e:$):n(T)}function x(T){return T===45?(t.consume(T),r.interrupt?e:$):n(T)}function v(T){const J="CDATA[";return T===J.charCodeAt(c++)?(t.consume(T),c===J.length?r.interrupt?e:Z:v):n(T)}function S(T){return Wn(T)?(t.consume(T),l=String.fromCharCode(T),k):n(T)}function k(T){if(T===null||T===47||T===62||kt(T)){const J=T===47,W=l.toLowerCase();return!J&&!s&&yT.includes(W)?(i=1,r.interrupt?e(T):Z(T)):RV.includes(l.toLowerCase())?(i=6,J?(t.consume(T),w):r.interrupt?e(T):Z(T)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):s?N(T):C(T))}return T===45||zn(T)?(t.consume(T),l+=String.fromCharCode(T),k):n(T)}function w(T){return T===62?(t.consume(T),r.interrupt?e:Z):n(T)}function N(T){return Ve(T)?(t.consume(T),N):D(T)}function C(T){return T===47?(t.consume(T),D):T===58||T===95||Wn(T)?(t.consume(T),E):Ve(T)?(t.consume(T),C):D(T)}function E(T){return T===45||T===46||T===58||T===95||zn(T)?(t.consume(T),E):M(T)}function M(T){return T===61?(t.consume(T),R):Ve(T)?(t.consume(T),M):C(T)}function R(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(t.consume(T),u=T,_):Ve(T)?(t.consume(T),R):V(T)}function _(T){return T===u?(t.consume(T),u=null,G):T===null||Ne(T)?n(T):(t.consume(T),_)}function V(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||kt(T)?M(T):(t.consume(T),V)}function G(T){return T===47||T===62||Ve(T)?C(T):n(T)}function D(T){return T===62?(t.consume(T),L):n(T)}function L(T){return T===null||Ne(T)?Z(T):Ve(T)?(t.consume(T),L):n(T)}function Z(T){return T===45&&i===2?(t.consume(T),X):T===60&&i===1?(t.consume(T),q):T===62&&i===4?(t.consume(T),P):T===63&&i===3?(t.consume(T),$):T===93&&i===5?(t.consume(T),ne):Ne(T)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(MV,U,te)(T)):T===null||Ne(T)?(t.exit("htmlFlowData"),te(T)):(t.consume(T),Z)}function te(T){return t.check(zV,I,U)(T)}function I(T){return t.enter("lineEnding"),t.consume(T),t.exit("lineEnding"),B}function B(T){return T===null||Ne(T)?te(T):(t.enter("htmlFlowData"),Z(T))}function X(T){return T===45?(t.consume(T),$):Z(T)}function q(T){return T===47?(t.consume(T),l="",K):Z(T)}function K(T){if(T===62){const J=l.toLowerCase();return yT.includes(J)?(t.consume(T),P):Z(T)}return Wn(T)&&l.length<8?(t.consume(T),l+=String.fromCharCode(T),K):Z(T)}function ne(T){return T===93?(t.consume(T),$):Z(T)}function $(T){return T===62?(t.consume(T),P):T===45&&i===2?(t.consume(T),$):Z(T)}function P(T){return T===null||Ne(T)?(t.exit("htmlFlowData"),U(T)):(t.consume(T),P)}function U(T){return t.exit("htmlFlow"),e(T)}}function XV(t,e,n){const r=this;return i;function i(l){return Ne(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),s):n(l)}function s(l){return r.parser.lazy[r.now().line]?n(l):e(l)}}function ZV(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(bf,e,n)}}const qV={name:"htmlText",tokenize:IV};function IV(t,e,n){const r=this;let i,s,l;return c;function c($){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume($),u}function u($){return $===33?(t.consume($),f):$===47?(t.consume($),M):$===63?(t.consume($),C):Wn($)?(t.consume($),V):n($)}function f($){return $===45?(t.consume($),p):$===91?(t.consume($),s=0,v):Wn($)?(t.consume($),N):n($)}function p($){return $===45?(t.consume($),x):n($)}function m($){return $===null?n($):$===45?(t.consume($),O):Ne($)?(l=m,q($)):(t.consume($),m)}function O($){return $===45?(t.consume($),x):m($)}function x($){return $===62?X($):$===45?O($):m($)}function v($){const P="CDATA[";return $===P.charCodeAt(s++)?(t.consume($),s===P.length?S:v):n($)}function S($){return $===null?n($):$===93?(t.consume($),k):Ne($)?(l=S,q($)):(t.consume($),S)}function k($){return $===93?(t.consume($),w):S($)}function w($){return $===62?X($):$===93?(t.consume($),w):S($)}function N($){return $===null||$===62?X($):Ne($)?(l=N,q($)):(t.consume($),N)}function C($){return $===null?n($):$===63?(t.consume($),E):Ne($)?(l=C,q($)):(t.consume($),C)}function E($){return $===62?X($):C($)}function M($){return Wn($)?(t.consume($),R):n($)}function R($){return $===45||zn($)?(t.consume($),R):_($)}function _($){return Ne($)?(l=_,q($)):Ve($)?(t.consume($),_):X($)}function V($){return $===45||zn($)?(t.consume($),V):$===47||$===62||kt($)?G($):n($)}function G($){return $===47?(t.consume($),X):$===58||$===95||Wn($)?(t.consume($),D):Ne($)?(l=G,q($)):Ve($)?(t.consume($),G):X($)}function D($){return $===45||$===46||$===58||$===95||zn($)?(t.consume($),D):L($)}function L($){return $===61?(t.consume($),Z):Ne($)?(l=L,q($)):Ve($)?(t.consume($),L):G($)}function Z($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(t.consume($),i=$,te):Ne($)?(l=Z,q($)):Ve($)?(t.consume($),Z):(t.consume($),I)}function te($){return $===i?(t.consume($),i=void 0,B):$===null?n($):Ne($)?(l=te,q($)):(t.consume($),te)}function I($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||kt($)?G($):(t.consume($),I)}function B($){return $===47||$===62||kt($)?G($):n($)}function X($){return $===62?(t.consume($),t.exit("htmlTextData"),t.exit("htmlText"),e):n($)}function q($){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume($),t.exit("lineEnding"),K}function K($){return Ve($)?et(t,ne,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):ne($)}function ne($){return t.enter("htmlTextData"),l($)}}const Fw={name:"labelEnd",resolveAll:UV,resolveTo:WV,tokenize:GV},BV={tokenize:FV},YV={tokenize:HV},VV={tokenize:KV};function UV(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&Mr(t,0,t.length,n),t}function WV(t,e){let n=t.length,r=0,i,s,l,c;for(;n--;)if(i=t[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const u={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},f={type:"label",start:{...t[s][1].start},end:{...t[l][1].end}},p={type:"labelText",start:{...t[s+r+2][1].end},end:{...t[l-2][1].start}};return c=[["enter",u,e],["enter",f,e]],c=Hr(c,t.slice(s+1,s+r+3)),c=Hr(c,[["enter",p,e]]),c=Hr(c,cO(e.parser.constructs.insideSpan.null,t.slice(s+r+4,l-3),e)),c=Hr(c,[["exit",p,e],t[l-2],t[l-1],["exit",f,e]]),c=Hr(c,t.slice(l+1)),c=Hr(c,[["exit",u,e]]),Mr(t,s,t.length,c),t}function GV(t,e,n){const r=this;let i=r.events.length,s,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return c;function c(O){return s?s._inactive?m(O):(l=r.parser.defined.includes(wi(r.sliceSerialize({start:s.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(O),t.exit("labelMarker"),t.exit("labelEnd"),u):n(O)}function u(O){return O===40?t.attempt(BV,p,l?p:m)(O):O===91?t.attempt(YV,p,l?f:m)(O):l?p(O):m(O)}function f(O){return t.attempt(VV,p,m)(O)}function p(O){return e(O)}function m(O){return s._balanced=!0,n(O)}}function FV(t,e,n){return r;function r(m){return t.enter("resource"),t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),i}function i(m){return kt(m)?ih(t,s)(m):s(m)}function s(m){return m===41?p(m):H5(t,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return kt(m)?ih(t,u)(m):p(m)}function c(m){return n(m)}function u(m){return m===34||m===39||m===40?J5(t,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return kt(m)?ih(t,p)(m):p(m)}function p(m){return m===41?(t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),t.exit("resource"),e):n(m)}}function HV(t,e,n){const r=this;return i;function i(c){return K5.call(r,t,s,l,"reference","referenceMarker","referenceString")(c)}function s(c){return r.parser.defined.includes(wi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(c):n(c)}function l(c){return n(c)}}function KV(t,e,n){return r;function r(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const JV={name:"labelStartImage",resolveAll:Fw.resolveAll,tokenize:eU};function eU(t,e,n){const r=this;return i;function i(c){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(c),t.exit("labelImageMarker"),s}function s(c){return c===91?(t.enter("labelMarker"),t.consume(c),t.exit("labelMarker"),t.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):e(c)}}const tU={name:"labelStartLink",resolveAll:Fw.resolveAll,tokenize:nU};function nU(t,e,n){const r=this;return i;function i(l){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):e(l)}}const Ov={name:"lineEnding",tokenize:rU};function rU(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),et(t,e,"linePrefix")}}const zm={name:"thematicBreak",tokenize:iU};function iU(t,e,n){let r=0,i;return s;function s(f){return t.enter("thematicBreak"),l(f)}function l(f){return i=f,c(f)}function c(f){return f===i?(t.enter("thematicBreakSequence"),u(f)):r>=3&&(f===null||Ne(f))?(t.exit("thematicBreak"),e(f)):n(f)}function u(f){return f===i?(t.consume(f),r++,u):(t.exit("thematicBreakSequence"),Ve(f)?et(t,c,"whitespace")(f):c(f))}}const or={continuation:{tokenize:oU},exit:uU,name:"list",tokenize:lU},sU={partial:!0,tokenize:dU},aU={partial:!0,tokenize:cU};function lU(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return c;function c(x){const v=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:l1(x)){if(r.containerState.type||(r.containerState.type=v,t.enter(v,{_container:!0})),v==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(zm,n,f)(x):f(x);if(!r.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(x)}return n(x)}function u(x){return l1(x)&&++l<10?(t.consume(x),u):(!r.interrupt||l<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),f(x)):n(x)}function f(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,t.check(bf,r.interrupt?n:p,t.attempt(sU,O,m))}function p(x){return r.containerState.initialBlankLine=!0,s++,O(x)}function m(x){return Ve(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),O):n(x)}function O(x){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(x)}}function oU(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(bf,i,s);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,et(t,e,"listItemIndent",r.containerState.size+1)(c)}function s(c){return r.containerState.furtherBlankLines||!Ve(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(aU,e,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,et(t,t.attempt(or,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function cU(t,e,n){const r=this;return et(t,i,"listItemIndent",r.containerState.size+1);function i(s){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?e(s):n(s)}}function uU(t){t.exit(this.containerState.type)}function dU(t,e,n){const r=this;return et(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const l=r.events[r.events.length-1];return!Ve(s)&&l&&l[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const ST={name:"setextUnderline",resolveTo:hU,tokenize:fU};function hU(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const l={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",l,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=l,t.push(["exit",l,e]),t}function fU(t,e,n){const r=this;let i;return s;function s(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(t.enter("setextHeadingLine"),i=f,l(f)):n(f)}function l(f){return t.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===i?(t.consume(f),c):(t.exit("setextHeadingLineSequence"),Ve(f)?et(t,u,"lineSuffix")(f):u(f))}function u(f){return f===null||Ne(f)?(t.exit("setextHeadingLine"),e(f)):n(f)}}const pU={tokenize:mU};function mU(t){const e=this,n=t.attempt(bf,r,t.attempt(this.parser.constructs.flowInitial,i,et(t,t.attempt(this.parser.constructs.flow,i,t.attempt(vV,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const gU={resolveAll:t3()},OU=e3("string"),xU=e3("text");function e3(t){return{resolveAll:t3(t==="text"?bU:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,l,c);return l;function l(p){return f(p)?s(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),u}function u(p){return f(p)?(n.exit("data"),s(p)):(n.consume(p),u)}function f(p){if(p===null)return!0;const m=i[p];let O=-1;if(m)for(;++O<m.length;){const x=m[O];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function t3(t){return e;function e(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(n,r):n}}function bU(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let s=i.length,l=-1,c=0,u;for(;s--;){const f=i[s];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(f===-2)u=!0,c++;else if(f!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(c=0),c){const f={type:n===t.length||u||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:r.start._bufferIndex+l,_index:r.start._index+s,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(t.splice(n,0,["enter",f,e],["exit",f,e]),n+=2)}n++}return t}const vU={42:or,43:or,45:or,48:or,49:or,50:or,51:or,52:or,53:or,54:or,55:or,56:or,57:or,62:U5},yU={91:jV},SU={[-2]:gv,[-1]:gv,32:gv},wU={35:EV,42:zm,45:[ST,zm],60:_V,61:ST,95:zm,96:vT,126:vT},kU={38:G5,92:W5},jU={[-5]:Ov,[-4]:Ov,[-3]:Ov,33:JV,38:G5,42:o1,60:[tV,qV],91:tU,92:[TV,W5],93:Fw,95:o1,96:pV},QU={null:[o1,gU]},CU={null:[42,95]},NU={null:[]},TU=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:CU,contentInitial:yU,disable:NU,document:vU,flow:wU,flowInitial:SU,insideSpan:QU,string:kU,text:jU},Symbol.toStringTag,{value:"Module"}));function $U(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let l=[],c=[];const u={attempt:_(M),check:_(R),consume:N,enter:C,exit:E,interrupt:_(R,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:v,parser:t,previous:null,sliceSerialize:O,sliceStream:x,write:m};let p=e.tokenize.call(f,u);return e.resolveAll&&s.push(e),f;function m(L){return l=Hr(l,L),k(),l[l.length-1]!==null?[]:(V(e,0),f.events=cO(s,f.events,f),f.events)}function O(L,Z){return PU(x(L),Z)}function x(L){return EU(l,L)}function v(){const{_bufferIndex:L,_index:Z,line:te,column:I,offset:B}=r;return{_bufferIndex:L,_index:Z,line:te,column:I,offset:B}}function S(L){i[L.line]=L.column,D()}function k(){let L;for(;r._index<l.length;){const Z=l[r._index];if(typeof Z=="string")for(L=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<Z.length;)w(Z.charCodeAt(r._bufferIndex));else w(Z)}}function w(L){p=p(L)}function N(L){Ne(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,D()):L!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=L}function C(L,Z){const te=Z||{};return te.type=L,te.start=v(),f.events.push(["enter",te,f]),c.push(te),te}function E(L){const Z=c.pop();return Z.end=v(),f.events.push(["exit",Z,f]),Z}function M(L,Z){V(L,Z.from)}function R(L,Z){Z.restore()}function _(L,Z){return te;function te(I,B,X){let q,K,ne,$;return Array.isArray(I)?U(I):"tokenize"in I?U([I]):P(I);function P(re){return oe;function oe(ce){const me=ce!==null&&re[ce],ve=ce!==null&&re.null,Ie=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(ve)?ve:ve?[ve]:[]];return U(Ie)(ce)}}function U(re){return q=re,K=0,re.length===0?X:T(re[K])}function T(re){return oe;function oe(ce){return $=G(),ne=re,re.partial||(f.currentConstruct=re),re.name&&f.parser.constructs.disable.null.includes(re.name)?W():re.tokenize.call(Z?Object.assign(Object.create(f),Z):f,u,J,W)(ce)}}function J(re){return L(ne,$),B}function W(re){return $.restore(),++K<q.length?T(q[K]):X}}}function V(L,Z){L.resolveAll&&!s.includes(L)&&s.push(L),L.resolve&&Mr(f.events,Z,f.events.length-Z,L.resolve(f.events.slice(Z),f)),L.resolveTo&&(f.events=L.resolveTo(f.events,f))}function G(){const L=v(),Z=f.previous,te=f.currentConstruct,I=f.events.length,B=Array.from(c);return{from:I,restore:X};function X(){r=L,f.previous=Z,f.currentConstruct=te,f.events.length=I,c=B,D()}}function D(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function EU(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let l;if(n===i)l=[t[n].slice(r,s)];else{if(l=t.slice(n,i),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}s>0&&l.push(t[i].slice(0,s))}return l}function PU(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const s=t[n];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
|
|
524
|
+
`;break}case-3:{l=`\r
|
|
525
|
+
`;break}case-2:{l=e?" ":" ";break}case-1:{if(!e&&i)continue;l=" ";break}default:l=String.fromCharCode(s)}i=s===-2,r.push(l)}return r.join("")}function AU(t){const r={constructs:Y5([TU,...(t||{}).extensions||[]]),content:i(WY),defined:[],document:i(FY),flow:i(pU),lazy:{},string:i(OU),text:i(xU)};return r;function i(s){return l;function l(c){return $U(r,s,c)}}}function RU(t){for(;!F5(t););return t}const wT=/[\0\t\n\r]/g;function _U(){let t=1,e="",n=!0,r;return i;function i(s,l,c){const u=[];let f,p,m,O,x;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s)),m=0,e="",n&&(s.charCodeAt(0)===65279&&m++,n=void 0);m<s.length;){if(wT.lastIndex=m,f=wT.exec(s),O=f&&f.index!==void 0?f.index:s.length,x=s.charCodeAt(O),!f){e=s.slice(m);break}if(x===10&&m===O&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),m<O&&(u.push(s.slice(m,O)),t+=O-m),x){case 0:{u.push(65533),t++;break}case 9:{for(p=Math.ceil(t/4)*4,u.push(-2);t++<p;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:r=!0,t=1}m=O+1}return c&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const MU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function zU(t){return t.replace(MU,DU)}function DU(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return V5(n.slice(s?2:1),s?16:10)}return Gw(n)||t}const n3={}.hasOwnProperty;function LU(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),XU(n)(RU(AU(n).document().write(_U()(t,e,!0))))}function XU(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(fi),autolinkProtocol:G,autolinkEmail:G,atxHeading:s(er),blockQuote:s(ve),characterEscape:G,characterReference:G,codeFenced:s(Ie),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(Ie,l),codeText:s(Dt,l),codeTextData:G,data:G,codeFlowValue:G,definition:s(Rt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(Lt),hardBreakEscape:s(Dr),hardBreakTrailing:s(Dr),htmlFlow:s(Zn,l),htmlFlowData:G,htmlText:s(Zn,l),htmlTextData:G,image:s(yr),label:l,link:s(fi),listItem:s(ra),listItemValue:O,listOrdered:s(ps,m),listUnordered:s(ps),paragraph:s(sl),reference:T,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(er),strong:s(vo),thematicBreak:s(yo)},exit:{atxHeading:u(),atxHeadingSequence:M,autolink:u(),autolinkEmail:me,autolinkProtocol:ce,blockQuote:u(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:W,characterReferenceMarkerNumeric:W,characterReferenceValue:re,characterReference:oe,codeFenced:u(k),codeFencedFence:S,codeFencedFenceInfo:x,codeFencedFenceMeta:v,codeFlowValue:D,codeIndented:u(w),codeText:u(B),codeTextData:D,data:D,definition:u(),definitionDestinationString:E,definitionLabelString:N,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(Z),hardBreakTrailing:u(Z),htmlFlow:u(te),htmlFlowData:D,htmlText:u(I),htmlTextData:D,image:u(q),label:ne,labelText:K,lineEnding:L,link:u(X),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:J,resourceDestinationString:$,resourceTitleString:P,resource:U,setextHeading:u(V),setextHeadingLineSequence:_,setextHeadingText:R,strong:u(),thematicBreak:u()}};r3(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(de){let xe={type:"root",children:[]};const Pe={stack:[xe],tokenStack:[],config:e,enter:c,exit:f,buffer:l,resume:p,data:n},Xe=[];let nt=-1;for(;++nt<de.length;)if(de[nt][1].type==="listOrdered"||de[nt][1].type==="listUnordered")if(de[nt][0]==="enter")Xe.push(nt);else{const qe=Xe.pop();nt=i(de,qe,nt)}for(nt=-1;++nt<de.length;){const qe=e[de[nt][0]];n3.call(qe,de[nt][1].type)&&qe[de[nt][1].type].call(Object.assign({sliceSerialize:de[nt][2].sliceSerialize},Pe),de[nt][1])}if(Pe.tokenStack.length>0){const qe=Pe.tokenStack[Pe.tokenStack.length-1];(qe[1]||kT).call(Pe,void 0,qe[0])}for(xe.position={start:Na(de.length>0?de[0][1].start:{line:1,column:1,offset:0}),end:Na(de.length>0?de[de.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<e.transforms.length;)xe=e.transforms[nt](xe)||xe;return xe}function i(de,xe,Pe){let Xe=xe-1,nt=-1,qe=!1,ft,jt,Qt,Ft;for(;++Xe<=Pe;){const ct=de[Xe];switch(ct[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ct[0]==="enter"?nt++:nt--,Ft=void 0;break}case"lineEndingBlank":{ct[0]==="enter"&&(ft&&!Ft&&!nt&&!Qt&&(Qt=Xe),Ft=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ft=void 0}if(!nt&&ct[0]==="enter"&&ct[1].type==="listItemPrefix"||nt===-1&&ct[0]==="exit"&&(ct[1].type==="listUnordered"||ct[1].type==="listOrdered")){if(ft){let Ai=Xe;for(jt=void 0;Ai--;){const qn=de[Ai];if(qn[1].type==="lineEnding"||qn[1].type==="lineEndingBlank"){if(qn[0]==="exit")continue;jt&&(de[jt][1].type="lineEndingBlank",qe=!0),qn[1].type="lineEnding",jt=Ai}else if(!(qn[1].type==="linePrefix"||qn[1].type==="blockQuotePrefix"||qn[1].type==="blockQuotePrefixWhitespace"||qn[1].type==="blockQuoteMarker"||qn[1].type==="listItemIndent"))break}Qt&&(!jt||Qt<jt)&&(ft._spread=!0),ft.end=Object.assign({},jt?de[jt][1].start:ct[1].end),de.splice(jt||Xe,0,["exit",ft,ct[2]]),Xe++,Pe++}if(ct[1].type==="listItemPrefix"){const Ai={type:"listItem",_spread:!1,start:Object.assign({},ct[1].start),end:void 0};ft=Ai,de.splice(Xe,0,["enter",Ai,ct[2]]),Xe++,Pe++,Qt=void 0,Ft=!0}}}return de[xe][1]._spread=qe,Pe}function s(de,xe){return Pe;function Pe(Xe){c.call(this,de(Xe),Xe),xe&&xe.call(this,Xe)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(de,xe,Pe){this.stack[this.stack.length-1].children.push(de),this.stack.push(de),this.tokenStack.push([xe,Pe||void 0]),de.position={start:Na(xe.start),end:void 0}}function u(de){return xe;function xe(Pe){de&&de.call(this,Pe),f.call(this,Pe)}}function f(de,xe){const Pe=this.stack.pop(),Xe=this.tokenStack.pop();if(Xe)Xe[0].type!==de.type&&(xe?xe.call(this,de,Xe[0]):(Xe[1]||kT).call(this,de,Xe[0]));else throw new Error("Cannot close `"+de.type+"` ("+rh({start:de.start,end:de.end})+"): it’s not open");Pe.position.end=Na(de.end)}function p(){return Ww(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function O(de){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(de),10),this.data.expectingFirstListItemValue=void 0}}function x(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=de}function v(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=de}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de.replace(/(\r?\n|\r)$/g,"")}function N(de){const xe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=xe,Pe.identifier=wi(this.sliceSerialize(de)).toLowerCase()}function C(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.title=de}function E(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.url=de}function M(de){const xe=this.stack[this.stack.length-1];if(!xe.depth){const Pe=this.sliceSerialize(de).length;xe.depth=Pe}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function _(de){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(de).codePointAt(0)===61?1:2}function V(){this.data.setextHeadingSlurpLineEnding=void 0}function G(de){const Pe=this.stack[this.stack.length-1].children;let Xe=Pe[Pe.length-1];(!Xe||Xe.type!=="text")&&(Xe=bn(),Xe.position={start:Na(de.start),end:void 0},Pe.push(Xe)),this.stack.push(Xe)}function D(de){const xe=this.stack.pop();xe.value+=this.sliceSerialize(de),xe.position.end=Na(de.end)}function L(de){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=xe.children[xe.children.length-1];Pe.position.end=Na(de.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(xe.type)&&(G.call(this,de),D.call(this,de))}function Z(){this.data.atHardBreak=!0}function te(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de}function I(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de}function B(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de}function X(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=xe,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function q(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=xe,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function K(de){const xe=this.sliceSerialize(de),Pe=this.stack[this.stack.length-2];Pe.label=zU(xe),Pe.identifier=wi(xe).toLowerCase()}function ne(){const de=this.stack[this.stack.length-1],xe=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const Xe=de.children;Pe.children=Xe}else Pe.alt=xe}function $(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.url=de}function P(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.title=de}function U(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function J(de){const xe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=xe,Pe.identifier=wi(this.sliceSerialize(de)).toLowerCase(),this.data.referenceType="full"}function W(de){this.data.characterReferenceType=de.type}function re(de){const xe=this.sliceSerialize(de),Pe=this.data.characterReferenceType;let Xe;Pe?(Xe=V5(xe,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Xe=Gw(xe);const nt=this.stack[this.stack.length-1];nt.value+=Xe}function oe(de){const xe=this.stack.pop();xe.position.end=Na(de.end)}function ce(de){D.call(this,de);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(de)}function me(de){D.call(this,de);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(de)}function ve(){return{type:"blockquote",children:[]}}function Ie(){return{type:"code",lang:null,meta:null,value:""}}function Dt(){return{type:"inlineCode",value:""}}function Rt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Lt(){return{type:"emphasis",children:[]}}function er(){return{type:"heading",depth:0,children:[]}}function Dr(){return{type:"break"}}function Zn(){return{type:"html",value:""}}function yr(){return{type:"image",title:null,url:"",alt:null}}function fi(){return{type:"link",title:null,url:"",children:[]}}function ps(de){return{type:"list",ordered:de.type==="listOrdered",start:null,spread:de._spread,children:[]}}function ra(de){return{type:"listItem",spread:de._spread,checked:null,children:[]}}function sl(){return{type:"paragraph",children:[]}}function vo(){return{type:"strong",children:[]}}function bn(){return{type:"text",value:""}}function yo(){return{type:"thematicBreak"}}}function Na(t){return{line:t.line,column:t.column,offset:t.offset}}function r3(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?r3(t,r):ZU(t,r)}}function ZU(t,e){let n;for(n in e)if(n3.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function kT(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+rh({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+rh({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+rh({start:e.start,end:e.end})+") is still open")}function qU(t){const e=this;e.parser=n;function n(r){return LU(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function IU(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function BU(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
526
|
+
`}]}function YU(t,e){const n=e.value?e.value+`
|
|
527
|
+
`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function VU(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function UU(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function WU(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=vu(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let l,c=t.footnoteCounts.get(r);c===void 0?(c=0,t.footnoteOrder.push(r),l=t.footnoteOrder.length):l=s+1,c+=1,t.footnoteCounts.set(r,c);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};t.patch(e,u);const f={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,f),t.applyData(e,f)}function GU(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function FU(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function i3(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function HU(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return i3(t,e);const i={src:vu(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function KU(t,e){const n={src:vu(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function JU(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function eW(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return i3(t,e);const i={href:vu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function tW(t,e){const n={href:vu(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function nW(t,e,n){const r=t.all(e),i=n?rW(n):s3(e),s={},l=[];if(typeof e.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(i||c!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
|
|
528
|
+
`}),p.type==="element"&&p.tagName==="p"&&!i?l.push(...p.children):l.push(p)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&l.push({type:"text",value:`
|
|
529
|
+
`});const f={type:"element",tagName:"li",properties:s,children:l};return t.patch(e,f),t.applyData(e,f)}function rW(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=s3(n[r])}return e}function s3(t){const e=t.spread;return e??t.children.length>1}function iW(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function sW(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function aW(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function lW(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function oW(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},c=Bw(e.children[1]),u=D5(e.children[e.children.length-1]);c&&u&&(l.position={start:c,end:u}),i.push(l)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function cW(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:e.children.length;let u=-1;const f=[];for(;++u<c;){const m=e.children[u],O={},x=l?l[u]:void 0;x&&(O.align=x);let v={type:"element",tagName:s,properties:O,children:[]};m&&(v.children=t.all(m),t.patch(m,v),v=t.applyData(m,v)),f.push(v)}const p={type:"element",tagName:"tr",properties:{},children:t.wrap(f,!0)};return t.patch(e,p),t.applyData(e,p)}function uW(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const jT=9,QT=32;function dW(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const s=[];for(;r;)s.push(CT(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(CT(e.slice(i),i>0,!1)),s.join("")}function CT(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===jT||s===QT;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===jT||s===QT;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function hW(t,e){const n={type:"text",value:dW(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function fW(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const pW={blockquote:IU,break:BU,code:YU,delete:VU,emphasis:UU,footnoteReference:WU,heading:GU,html:FU,imageReference:HU,image:KU,inlineCode:JU,linkReference:eW,link:tW,listItem:nW,list:iW,paragraph:sW,root:aW,strong:lW,table:oW,tableCell:uW,tableRow:cW,text:hW,thematicBreak:fW,toml:tm,yaml:tm,definition:tm,footnoteDefinition:tm};function tm(){}const a3=-1,uO=0,sh=1,vg=2,Hw=3,Kw=4,Jw=5,ek=6,l3=7,o3=8,NT=typeof self=="object"?self:globalThis,mW=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,l]=e[i];switch(s){case uO:case a3:return n(l,i);case sh:{const c=n([],i);for(const u of l)c.push(r(u));return c}case vg:{const c=n({},i);for(const[u,f]of l)c[r(u)]=r(f);return c}case Hw:return n(new Date(l),i);case Kw:{const{source:c,flags:u}=l;return n(new RegExp(c,u),i)}case Jw:{const c=n(new Map,i);for(const[u,f]of l)c.set(r(u),r(f));return c}case ek:{const c=n(new Set,i);for(const u of l)c.add(r(u));return c}case l3:{const{name:c,message:u}=l;return n(new NT[c](u),i)}case o3:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new NT[s](l),i)};return r},TT=t=>mW(new Map,t)(0),cc="",{toString:gW}={},{keys:OW}=Object,Qd=t=>{const e=typeof t;if(e!=="object"||!t)return[uO,e];const n=gW.call(t).slice(8,-1);switch(n){case"Array":return[sh,cc];case"Object":return[vg,cc];case"Date":return[Hw,cc];case"RegExp":return[Kw,cc];case"Map":return[Jw,cc];case"Set":return[ek,cc];case"DataView":return[sh,n]}return n.includes("Array")?[sh,n]:n.includes("Error")?[l3,n]:[vg,n]},nm=([t,e])=>t===uO&&(e==="function"||e==="symbol"),xW=(t,e,n,r)=>{const i=(l,c)=>{const u=r.push(l)-1;return n.set(c,u),u},s=l=>{if(n.has(l))return n.get(l);let[c,u]=Qd(l);switch(c){case uO:{let p=l;switch(u){case"bigint":c=o3,p=l.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);p=null;break;case"undefined":return i([a3],l)}return i([c,p],l)}case sh:{if(u){let O=l;return u==="DataView"?O=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(O=new Uint8Array(l)),i([u,[...O]],l)}const p=[],m=i([c,p],l);for(const O of l)p.push(s(O));return m}case vg:{if(u)switch(u){case"BigInt":return i([u,l.toString()],l);case"Boolean":case"Number":case"String":return i([u,l.valueOf()],l)}if(e&&"toJSON"in l)return s(l.toJSON());const p=[],m=i([c,p],l);for(const O of OW(l))(t||!nm(Qd(l[O])))&&p.push([s(O),s(l[O])]);return m}case Hw:return i([c,l.toISOString()],l);case Kw:{const{source:p,flags:m}=l;return i([c,{source:p,flags:m}],l)}case Jw:{const p=[],m=i([c,p],l);for(const[O,x]of l)(t||!(nm(Qd(O))||nm(Qd(x))))&&p.push([s(O),s(x)]);return m}case ek:{const p=[],m=i([c,p],l);for(const O of l)(t||!nm(Qd(O)))&&p.push(s(O));return m}}const{message:f}=l;return i([c,{name:u,message:f}],l)};return s},$T=(t,{json:e,lossy:n}={})=>{const r=[];return xW(!(e||n),!!e,new Map,r)(t),r},yg=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?TT($T(t,e)):structuredClone(t):(t,e)=>TT($T(t,e));function bW(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function vW(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function yW(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||bW,r=t.options.footnoteBackLabel||vW,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",l=t.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let u=-1;for(;++u<t.footnoteOrder.length;){const f=t.footnoteById.get(t.footnoteOrder[u]);if(!f)continue;const p=t.all(f),m=String(f.identifier).toUpperCase(),O=vu(m.toLowerCase());let x=0;const v=[],S=t.footnoteCounts.get(m);for(;S!==void 0&&++x<=S;){v.length>0&&v.push({type:"text",value:" "});let N=typeof n=="string"?n:n(u,x);typeof N=="string"&&(N={type:"text",value:N}),v.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+O+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,x),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const k=p[p.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const N=k.children[k.children.length-1];N&&N.type==="text"?N.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...v)}else p.push(...v);const w={type:"element",tagName:"li",properties:{id:e+"fn-"+O},children:t.wrap(p,!0)};t.patch(f,w),c.push(w)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...yg(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
530
|
+
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(c,!0)},{type:"text",value:`
|
|
531
|
+
`}]}}const dO=(function(t){if(t==null)return jW;if(typeof t=="function")return hO(t);if(typeof t=="object")return Array.isArray(t)?SW(t):wW(t);if(typeof t=="string")return kW(t);throw new Error("Expected function, string, or object as test")});function SW(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=dO(t[n]);return hO(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function wW(t){const e=t;return hO(n);function n(r){const i=r;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function kW(t){return hO(e);function e(n){return n&&n.type===t}}function hO(t){return e;function e(n,r,i){return!!(QW(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function jW(){return!0}function QW(t){return t!==null&&typeof t=="object"&&"type"in t}const c3=[],CW=!0,c1=!1,NW="skip";function u3(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const s=dO(i),l=r?-1:1;c(t,void 0,[])();function c(u,f,p){const m=u&&typeof u=="object"?u:{};if(typeof m.type=="string"){const x=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(O,"name",{value:"node ("+(u.type+(x?"<"+x+">":""))+")"})}return O;function O(){let x=c3,v,S,k;if((!e||s(u,f,p[p.length-1]||void 0))&&(x=TW(n(u,p)),x[0]===c1))return x;if("children"in u&&u.children){const w=u;if(w.children&&x[0]!==NW)for(S=(r?w.children.length:-1)+l,k=p.concat(w);S>-1&&S<w.children.length;){const N=w.children[S];if(v=c(N,S,k)(),v[0]===c1)return v;S=typeof v[1]=="number"?v[1]:S+l}}return x}}}function TW(t){return Array.isArray(t)?t:typeof t=="number"?[CW,t]:t==null?c3:[t]}function tk(t,e,n,r){let i,s,l;typeof e=="function"&&typeof n!="function"?(s=void 0,l=e,i=n):(s=e,l=n,i=r),u3(t,s,c,i);function c(u,f){const p=f[f.length-1],m=p?p.children.indexOf(u):void 0;return l(u,m,p)}}const u1={}.hasOwnProperty,$W={};function EW(t,e){const n=e||$W,r=new Map,i=new Map,s=new Map,l={...pW,...n.handlers},c={all:f,applyData:AW,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:l,one:u,options:n,patch:PW,wrap:_W};return tk(t,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,O=String(p.identifier).toUpperCase();m.has(O)||m.set(O,p)}}),c;function u(p,m){const O=p.type,x=c.handlers[O];if(u1.call(c.handlers,O)&&x)return x(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(O)){if("children"in p){const{children:S,...k}=p,w=yg(k);return w.children=c.all(p),w}return yg(p)}return(c.options.unknownHandler||RW)(c,p,m)}function f(p){const m=[];if("children"in p){const O=p.children;let x=-1;for(;++x<O.length;){const v=c.one(O[x],p);if(v){if(x&&O[x-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=ET(v.value)),!Array.isArray(v)&&v.type==="element")){const S=v.children[0];S&&S.type==="text"&&(S.value=ET(S.value))}Array.isArray(v)?m.push(...v):m.push(v)}}}return m}}function PW(t,e){t.position&&(e.position=vY(t))}function AW(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,s=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&s&&Object.assign(n.properties,yg(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function RW(t,e){const n=e.data||{},r="value"in e&&!(u1.call(n,"hProperties")||u1.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function _W(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
|
532
|
+
`});++r<t.length;)r&&n.push({type:"text",value:`
|
|
533
|
+
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
534
|
+
`}),n}function ET(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function PT(t,e){const n=EW(t,e),r=n.one(t,void 0),i=yW(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
535
|
+
`},i),s}function MW(t,e){return t&&"run"in t?async function(n,r){const i=PT(n,{file:r,...e});await t.run(i,r)}:function(n,r){return PT(n,{file:r,...t||e})}}function AT(t){if(t)throw t}var xv,RT;function zW(){if(RT)return xv;RT=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):e.call(f)==="[object Array]"},s=function(f){if(!f||e.call(f)!=="[object Object]")return!1;var p=t.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&t.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var O;for(O in f);return typeof O>"u"||t.call(f,O)},l=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(t.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return xv=function u(){var f,p,m,O,x,v,S=arguments[0],k=1,w=arguments.length,N=!1;for(typeof S=="boolean"&&(N=S,S=arguments[1]||{},k=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});k<w;++k)if(f=arguments[k],f!=null)for(p in f)m=c(S,p),O=c(f,p),S!==O&&(N&&O&&(s(O)||(x=i(O)))?(x?(x=!1,v=m&&i(m)?m:[]):v=m&&s(m)?m:{},l(S,{name:p,newValue:u(N,v,O)})):typeof O<"u"&&l(S,{name:p,newValue:O}));return S},xv}var DW=zW();const bv=Gg(DW);function d1(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function LW(){const t=[],e={run:n,use:r};return e;function n(...i){let s=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...i);function c(u,...f){const p=t[++s];let m=-1;if(u){l(u);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,p?XW(p,c)(...f):l(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function XW(t,e){let n;return r;function r(...l){const c=t.length>l.length;let u;c&&l.push(i);try{u=t.apply(this,l)}catch(f){const p=f;if(c&&n)throw p;return i(p)}c||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(l,...c){n||(n=!0,e(l,...c))}function s(l){i(null,l)}}const Ii={basename:ZW,dirname:qW,extname:IW,join:BW,sep:"/"};function ZW(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');vf(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let l=-1,c=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else l<0&&(s=!0,l=i+1),c>-1&&(t.codePointAt(i)===e.codePointAt(c--)?c<0&&(r=i):(c=-1,r=l));return n===r?r=l:r<0&&(r=t.length),t.slice(n,r)}function qW(t){if(vf(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function IW(t){vf(t);let e=t.length,n=-1,r=0,i=-1,s=0,l;for(;e--;){const c=t.codePointAt(e);if(c===47){if(l){r=e+1;break}continue}n<0&&(l=!0,n=e+1),c===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function BW(...t){let e=-1,n;for(;++e<t.length;)vf(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":YW(n)}function YW(t){vf(t);const e=t.codePointAt(0)===47;let n=VW(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function VW(t,e){let n="",r=0,i=-1,s=0,l=-1,c,u;for(;++l<=t.length;){if(l<t.length)c=t.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(i===l-1||s===1))if(i!==l-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=l,s=0;continue}}else if(n.length>0){n="",r=0,i=l,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,l):n=t.slice(i+1,l),r=l-i-1;i=l,s=0}else c===46&&s>-1?s++:s=-1}return n}function vf(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const UW={cwd:WW};function WW(){return"/"}function h1(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function GW(t){if(typeof t=="string")t=new URL(t);else if(!h1(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return FW(t)}function FW(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const vv=["history","path","basename","stem","extname","dirname"];class d3{constructor(e){let n;e?h1(e)?n={path:e}:typeof e=="string"||HW(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":UW.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<vv.length;){const s=vv[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)vv.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ii.basename(this.path):void 0}set basename(e){Sv(e,"basename"),yv(e,"basename"),this.path=Ii.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Ii.dirname(this.path):void 0}set dirname(e){_T(this.basename,"dirname"),this.path=Ii.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Ii.extname(this.path):void 0}set extname(e){if(yv(e,"extname"),_T(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ii.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){h1(e)&&(e=GW(e)),Sv(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Ii.basename(this.path,this.extname):void 0}set stem(e){Sv(e,"stem"),yv(e,"stem"),this.path=Ii.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new Ln(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function yv(t,e){if(t&&t.includes(Ii.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Ii.sep+"`")}function Sv(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function _T(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function HW(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const KW=(function(t){const r=this.constructor.prototype,i=r[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),JW={}.hasOwnProperty;class nk extends KW{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=LW()}copy(){const e=new nk;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(bv(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(jv("data",this.frozen),this.namespace[e]=n,this):JW.call(this.namespace,e)&&this.namespace[e]||void 0:e?(jv("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=rm(e),r=this.parser||this.Parser;return wv("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),wv("process",this.parser||this.Parser),kv("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,l){const c=rm(e),u=r.parse(c);r.run(u,c,function(p,m,O){if(p||!m||!O)return f(p);const x=m,v=r.stringify(x,O);nG(v)?O.value=v:O.result=v,f(p,O)});function f(p,m){p||!m?l(p):s?s(m):n(void 0,m)}}}processSync(e){let n=!1,r;return this.freeze(),wv("processSync",this.parser||this.Parser),kv("processSync",this.compiler||this.Compiler),this.process(e,i),zT("processSync","process",n),r;function i(s,l){n=!0,AT(s),r=l}}run(e,n,r){MT(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(l,c){const u=rm(n);i.run(e,u,f);function f(p,m,O){const x=m||e;p?c(p):l?l(x):r(void 0,x,O)}}}runSync(e,n){let r=!1,i;return this.run(e,n,s),zT("runSync","run",r),i;function s(l,c){AT(l),i=c,r=!0}}stringify(e,n){this.freeze();const r=rm(n),i=this.compiler||this.Compiler;return kv("stringify",i),MT(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(jv("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?c(e):l(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(f){if(typeof f=="function")u(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;u(p,m)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(i.settings=bv(!0,i.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];s(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function u(f,p){let m=-1,O=-1;for(;++m<r.length;)if(r[m][0]===f){O=m;break}if(O===-1)r.push([f,...p]);else if(p.length>0){let[x,...v]=p;const S=r[O][1];d1(S)&&d1(x)&&(x=bv(!0,S,x)),r[O]=[f,x,...v]}}}}const eG=new nk().freeze();function wv(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function kv(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function jv(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function MT(t){if(!d1(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function zT(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function rm(t){return tG(t)?t:new d3(t)}function tG(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function nG(t){return typeof t=="string"||rG(t)}function rG(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const iG="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",DT=[],LT={allowDangerousHtml:!0},sG=/^(https?|ircs?|mailto|xmpp)$/i,aG=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function h3(t){const e=lG(t),n=oG(t);return cG(e.runSync(e.parse(n),n),t)}function lG(t){const e=t.rehypePlugins||DT,n=t.remarkPlugins||DT,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...LT}:LT;return eG().use(qU).use(n).use(MW,r).use(e)}function oG(t){const e=t.children||"",n=new d3;return typeof e=="string"&&(n.value=e),n}function cG(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,l=e.skipHtml,c=e.unwrapDisallowed,u=e.urlTransform||uG;for(const p of aG)Object.hasOwn(e,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+iG+p.id,void 0);return tk(t,f),jY(t,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function f(p,m,O){if(p.type==="raw"&&O&&typeof m=="number")return l?O.children.splice(m,1):O.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let x;for(x in mv)if(Object.hasOwn(mv,x)&&Object.hasOwn(p.properties,x)){const v=p.properties[x],S=mv[x];(S===null||S.includes(p.tagName))&&(p.properties[x]=u(String(v||""),x,p))}}if(p.type==="element"){let x=n?!n.includes(p.tagName):s?s.includes(p.tagName):!1;if(!x&&r&&typeof m=="number"&&(x=!r(p,m,O)),x&&O&&typeof m=="number")return c&&p.children?O.children.splice(m,1,...p.children):O.children.splice(m,1),m}}}function uG(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||sG.test(t.slice(0,e))?t:""}function XT(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function dG(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function hG(t,e,n){const i=dO((n||{}).ignore||[]),s=fG(e);let l=-1;for(;++l<s.length;)u3(t,"text",c);function c(f,p){let m=-1,O;for(;++m<p.length;){const x=p[m],v=O?O.children:void 0;if(i(x,v?v.indexOf(x):void 0,O))return;O=x}if(O)return u(f,p)}function u(f,p){const m=p[p.length-1],O=s[l][0],x=s[l][1];let v=0;const k=m.children.indexOf(f);let w=!1,N=[];O.lastIndex=0;let C=O.exec(f.value);for(;C;){const E=C.index,M={index:C.index,input:C.input,stack:[...p,f]};let R=x(...C,M);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?O.lastIndex=E+1:(v!==E&&N.push({type:"text",value:f.value.slice(v,E)}),Array.isArray(R)?N.push(...R):R&&N.push(R),v=E+C[0].length,w=!0),!O.global)break;C=O.exec(f.value)}return w?(v<f.value.length&&N.push({type:"text",value:f.value.slice(v)}),m.children.splice(k,1,...N)):N=[f],k+N.length}}function fG(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([pG(i[0]),mG(i[1])])}return e}function pG(t){return typeof t=="string"?new RegExp(dG(t),"g"):t}function mG(t){return typeof t=="function"?t:function(){return t}}const Qv="phrasing",Cv=["autolink","link","image","label"];function gG(){return{transforms:[wG],enter:{literalAutolink:xG,literalAutolinkEmail:Nv,literalAutolinkHttp:Nv,literalAutolinkWww:Nv},exit:{literalAutolink:SG,literalAutolinkEmail:yG,literalAutolinkHttp:bG,literalAutolinkWww:vG}}}function OG(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Qv,notInConstruct:Cv},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Qv,notInConstruct:Cv},{character:":",before:"[ps]",after:"\\/",inConstruct:Qv,notInConstruct:Cv}]}}function xG(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Nv(t){this.config.enter.autolinkProtocol.call(this,t)}function bG(t){this.config.exit.autolinkProtocol.call(this,t)}function vG(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function yG(t){this.config.exit.autolinkEmail.call(this,t)}function SG(t){this.exit(t)}function wG(t){hG(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,kG],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),jG]],{ignore:["link","linkReference"]})}function kG(t,e,n,r,i){let s="";if(!f3(i)||(/^w/i.test(e)&&(n=e+n,e="",s="http://"),!QG(n)))return!1;const l=CG(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:s+e+l[0],children:[{type:"text",value:e+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function jG(t,e,n,r){return!f3(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function QG(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function CG(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=XT(t,"(");let s=XT(t,")");for(;r!==-1&&i>s;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[t,n]}function f3(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||ro(n)||oO(n))&&(!e||n!==47)}p3.peek=MG;function NG(){this.buffer()}function TG(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function $G(){this.buffer()}function EG(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function PG(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=wi(this.sliceSerialize(t)).toLowerCase(),n.label=e}function AG(t){this.exit(t)}function RG(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=wi(this.sliceSerialize(t)).toLowerCase(),n.label=e}function _G(t){this.exit(t)}function MG(){return"["}function p3(t,e,n,r){const i=n.createTracker(r);let s=i.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return s+=i.move(n.safe(n.associationId(t),{after:"]",before:s})),c(),l(),s+=i.move("]"),s}function zG(){return{enter:{gfmFootnoteCallString:NG,gfmFootnoteCall:TG,gfmFootnoteDefinitionLabelString:$G,gfmFootnoteDefinition:EG},exit:{gfmFootnoteCallString:PG,gfmFootnoteCall:AG,gfmFootnoteDefinitionLabelString:RG,gfmFootnoteDefinition:_G}}}function DG(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:p3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,l){const c=s.createTracker(l);let u=c.move("[^");const f=s.enter("footnoteDefinition"),p=s.enter("label");return u+=c.move(s.safe(s.associationId(r),{before:u,after:"]"})),p(),u+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),u+=c.move((e?`
|
|
536
|
+
`:" ")+s.indentLines(s.containerFlow(r,c.current()),e?m3:LG))),f(),u}}function LG(t,e,n){return e===0?t:m3(t,e,n)}function m3(t,e,n){return(n?"":" ")+t}const XG=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];g3.peek=YG;function ZG(){return{canContainEols:["delete"],enter:{strikethrough:IG},exit:{strikethrough:BG}}}function qG(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:XG}],handlers:{delete:g3}}}function IG(t){this.enter({type:"delete",children:[]},t)}function BG(t){this.exit(t)}function g3(t,e,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(t,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),s(),l}function YG(){return"~"}function VG(t){return t.length}function UG(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||VG,s=[],l=[],c=[],u=[];let f=0,p=-1;for(;++p<t.length;){const S=[],k=[];let w=-1;for(t[p].length>f&&(f=t[p].length);++w<t[p].length;){const N=WG(t[p][w]);if(n.alignDelimiters!==!1){const C=i(N);k[w]=C,(u[w]===void 0||C>u[w])&&(u[w]=C)}S.push(N)}l[p]=S,c[p]=k}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<f;)s[m]=ZT(r[m]);else{const S=ZT(r);for(;++m<f;)s[m]=S}m=-1;const O=[],x=[];for(;++m<f;){const S=s[m];let k="",w="";S===99?(k=":",w=":"):S===108?k=":":S===114&&(w=":");let N=n.alignDelimiters===!1?1:Math.max(1,u[m]-k.length-w.length);const C=k+"-".repeat(N)+w;n.alignDelimiters!==!1&&(N=k.length+N+w.length,N>u[m]&&(u[m]=N),x[m]=N),O[m]=C}l.splice(1,0,O),c.splice(1,0,x),p=-1;const v=[];for(;++p<l.length;){const S=l[p],k=c[p];m=-1;const w=[];for(;++m<f;){const N=S[m]||"";let C="",E="";if(n.alignDelimiters!==!1){const M=u[m]-(k[m]||0),R=s[m];R===114?C=" ".repeat(M):R===99?M%2?(C=" ".repeat(M/2+.5),E=" ".repeat(M/2-.5)):(C=" ".repeat(M/2),E=C):E=" ".repeat(M)}n.delimiterStart!==!1&&!m&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||m)&&w.push(" "),n.alignDelimiters!==!1&&w.push(C),w.push(N),n.alignDelimiters!==!1&&w.push(E),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||m!==f-1)&&w.push("|")}v.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return v.join(`
|
|
537
|
+
`)}function WG(t){return t==null?"":String(t)}function ZT(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function GG(t,e,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const l=n.indentLines(n.containerFlow(t,s.current()),FG);return i(),l}function FG(t,e,n){return">"+(n?"":" ")+t}function HG(t,e){return qT(t,e.inConstruct,!0)&&!qT(t,e.notInConstruct,!1)}function qT(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function IT(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
538
|
+
`&&HG(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
539
|
+
`}function KG(t,e){const n=String(t);let r=n.indexOf(e),i=r,s=0,l=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>l&&(l=s):s=1,i=r+e.length,r=n.indexOf(e,i);return l}function JG(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function eF(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function tF(t,e,n,r){const i=eF(n),s=t.value||"",l=i==="`"?"GraveAccent":"Tilde";if(JG(t,n)){const m=n.enter("codeIndented"),O=n.indentLines(s,nF);return m(),O}const c=n.createTracker(r),u=i.repeat(Math.max(KG(s,i)+1,3)),f=n.enter("codeFenced");let p=c.move(u);if(t.lang){const m=n.enter(`codeFencedLang${l}`);p+=c.move(n.safe(t.lang,{before:p,after:" ",encode:["`"],...c.current()})),m()}if(t.lang&&t.meta){const m=n.enter(`codeFencedMeta${l}`);p+=c.move(" "),p+=c.move(n.safe(t.meta,{before:p,after:`
|
|
540
|
+
`,encode:["`"],...c.current()})),m()}return p+=c.move(`
|
|
541
|
+
`),s&&(p+=c.move(s+`
|
|
542
|
+
`)),p+=c.move(u),f(),p}function nF(t,e,n){return(n?"":" ")+t}function rk(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function rF(t,e,n,r){const i=rk(n),s=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const u=n.createTracker(r);let f=u.move("[");return f+=u.move(n.safe(n.associationId(t),{before:f,after:"]",...u.current()})),f+=u.move("]: "),c(),!t.url||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(t.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(c=n.enter("destinationRaw"),f+=u.move(n.safe(t.url,{before:f,after:t.title?" ":`
|
|
543
|
+
`,...u.current()}))),c(),t.title&&(c=n.enter(`title${s}`),f+=u.move(" "+i),f+=u.move(n.safe(t.title,{before:f,after:i,...u.current()})),f+=u.move(i),c()),l(),f}function iF(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Ph(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Sg(t,e,n){const r=Hc(t),i=Hc(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}O3.peek=sF;function O3(t,e,n,r){const i=iF(n),s=n.enter("emphasis"),l=n.createTracker(r),c=l.move(i);let u=l.move(n.containerPhrasing(t,{after:i,before:c,...l.current()}));const f=u.charCodeAt(0),p=Sg(r.before.charCodeAt(r.before.length-1),f,i);p.inside&&(u=Ph(f)+u.slice(1));const m=u.charCodeAt(u.length-1),O=Sg(r.after.charCodeAt(0),m,i);O.inside&&(u=u.slice(0,-1)+Ph(m));const x=l.move(i);return s(),n.attentionEncodeSurroundingInfo={after:O.outside,before:p.outside},c+u+x}function sF(t,e,n){return n.options.emphasis||"*"}function aF(t,e){let n=!1;return tk(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,c1}),!!((!t.depth||t.depth<3)&&Ww(t)&&(e.options.setext||n))}function lF(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(r);if(aF(t,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),O=n.containerPhrasing(t,{...s.current(),before:`
|
|
544
|
+
`,after:`
|
|
545
|
+
`});return m(),p(),O+`
|
|
546
|
+
`+(i===1?"=":"-").repeat(O.length-(Math.max(O.lastIndexOf("\r"),O.lastIndexOf(`
|
|
547
|
+
`))+1))}const l="#".repeat(i),c=n.enter("headingAtx"),u=n.enter("phrasing");s.move(l+" ");let f=n.containerPhrasing(t,{before:"# ",after:`
|
|
548
|
+
`,...s.current()});return/^[\t ]/.test(f)&&(f=Ph(f.charCodeAt(0))+f.slice(1)),f=f?l+" "+f:l,n.options.closeAtx&&(f+=" "+l),u(),c(),f}x3.peek=oF;function x3(t){return t.value||""}function oF(){return"<"}b3.peek=cF;function b3(t,e,n,r){const i=rk(n),s=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const u=n.createTracker(r);let f=u.move("![");return f+=u.move(n.safe(t.alt,{before:f,after:"]",...u.current()})),f+=u.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(t.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(c=n.enter("destinationRaw"),f+=u.move(n.safe(t.url,{before:f,after:t.title?" ":")",...u.current()}))),c(),t.title&&(c=n.enter(`title${s}`),f+=u.move(" "+i),f+=u.move(n.safe(t.title,{before:f,after:i,...u.current()})),f+=u.move(i),c()),f+=u.move(")"),l(),f}function cF(){return"!"}v3.peek=uF;function v3(t,e,n,r){const i=t.referenceType,s=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let u=c.move("![");const f=n.safe(t.alt,{before:u,after:"]",...c.current()});u+=c.move(f+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(t),{before:u,after:"]",...c.current()});return l(),n.stack=p,s(),i==="full"||!f||f!==m?u+=c.move(m+"]"):i==="shortcut"?u=u.slice(0,-1):u+=c.move("]"),u}function uF(){return"!"}y3.peek=dF;function y3(t,e,n){let r=t.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const l=n.unsafe[s],c=n.compilePattern(l);let u;if(l.atBreak)for(;u=c.exec(r);){let f=u.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(u.index+1)}}return i+r+i}function dF(){return"`"}function S3(t,e){const n=Ww(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}w3.peek=hF;function w3(t,e,n,r){const i=rk(n),s=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,u;if(S3(t,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(t,{before:m,after:">",...l.current()})),m+=l.move(">"),c(),n.stack=p,m}c=n.enter("link"),u=n.enter("label");let f=l.move("[");return f+=l.move(n.containerPhrasing(t,{before:f,after:"](",...l.current()})),f+=l.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),f+=l.move("<"),f+=l.move(n.safe(t.url,{before:f,after:">",...l.current()})),f+=l.move(">")):(u=n.enter("destinationRaw"),f+=l.move(n.safe(t.url,{before:f,after:t.title?" ":")",...l.current()}))),u(),t.title&&(u=n.enter(`title${s}`),f+=l.move(" "+i),f+=l.move(n.safe(t.title,{before:f,after:i,...l.current()})),f+=l.move(i),u()),f+=l.move(")"),c(),f}function hF(t,e,n){return S3(t,n)?"<":"["}k3.peek=fF;function k3(t,e,n,r){const i=t.referenceType,s=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let u=c.move("[");const f=n.containerPhrasing(t,{before:u,after:"]",...c.current()});u+=c.move(f+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(t),{before:u,after:"]",...c.current()});return l(),n.stack=p,s(),i==="full"||!f||f!==m?u+=c.move(m+"]"):i==="shortcut"?u=u.slice(0,-1):u+=c.move("]"),u}function fF(){return"["}function ik(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function pF(t){const e=ik(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function mF(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function j3(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function gF(t,e,n,r){const i=n.enter("list"),s=n.bulletCurrent;let l=t.ordered?mF(n):ik(n);const c=t.ordered?l==="."?")":".":pF(n);let u=e&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!t.ordered){const p=t.children?t.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),j3(n)===l&&p){let m=-1;for(;++m<t.children.length;){const O=t.children[m];if(O&&O.type==="listItem"&&O.children&&O.children[0]&&O.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(l=c),n.bulletCurrent=l;const f=n.containerFlow(t,r);return n.bulletLastUsed=l,n.bulletCurrent=s,i(),f}function OF(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function xF(t,e,n,r){const i=OF(n);let s=n.bulletCurrent||ik(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let l=s.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(s+" ".repeat(l-s.length)),c.shift(l);const u=n.enter("listItem"),f=n.indentLines(n.containerFlow(t,c.current()),p);return u(),f;function p(m,O,x){return O?(x?"":" ".repeat(l))+m:(x?s:s+" ".repeat(l-s.length))+m}}function bF(t,e,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(t,r);return s(),i(),l}const vF=dO(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function yF(t,e,n,r){return(t.children.some(function(l){return vF(l)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function SF(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Q3.peek=wF;function Q3(t,e,n,r){const i=SF(n),s=n.enter("strong"),l=n.createTracker(r),c=l.move(i+i);let u=l.move(n.containerPhrasing(t,{after:i,before:c,...l.current()}));const f=u.charCodeAt(0),p=Sg(r.before.charCodeAt(r.before.length-1),f,i);p.inside&&(u=Ph(f)+u.slice(1));const m=u.charCodeAt(u.length-1),O=Sg(r.after.charCodeAt(0),m,i);O.inside&&(u=u.slice(0,-1)+Ph(m));const x=l.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:O.outside,before:p.outside},c+u+x}function wF(t,e,n){return n.options.strong||"*"}function kF(t,e,n,r){return n.safe(t.value,r)}function jF(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function QF(t,e,n){const r=(j3(n)+(n.options.ruleSpaces?" ":"")).repeat(jF(n));return n.options.ruleSpaces?r.slice(0,-1):r}const C3={blockquote:GG,break:IT,code:tF,definition:rF,emphasis:O3,hardBreak:IT,heading:lF,html:x3,image:b3,imageReference:v3,inlineCode:y3,link:w3,linkReference:k3,list:gF,listItem:xF,paragraph:bF,root:yF,strong:Q3,text:kF,thematicBreak:QF};function CF(){return{enter:{table:NF,tableData:BT,tableHeader:BT,tableRow:$F},exit:{codeText:EF,table:TF,tableData:Tv,tableHeader:Tv,tableRow:Tv}}}function NF(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function TF(t){this.exit(t),this.data.inTable=void 0}function $F(t){this.enter({type:"tableRow",children:[]},t)}function Tv(t){this.exit(t)}function BT(t){this.enter({type:"tableCell",children:[]},t)}function EF(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,PF));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function PF(t,e){return e==="|"?e:t}function AF(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
549
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:O,table:l,tableCell:u,tableRow:c}};function l(x,v,S,k){return f(p(x,S,k),x.align)}function c(x,v,S,k){const w=m(x,S,k),N=f([w]);return N.slice(0,N.indexOf(`
|
|
550
|
+
`))}function u(x,v,S,k){const w=S.enter("tableCell"),N=S.enter("phrasing"),C=S.containerPhrasing(x,{...k,before:s,after:s});return N(),w(),C}function f(x,v){return UG(x,{align:v,alignDelimiters:r,padding:n,stringLength:i})}function p(x,v,S){const k=x.children;let w=-1;const N=[],C=v.enter("table");for(;++w<k.length;)N[w]=m(k[w],v,S);return C(),N}function m(x,v,S){const k=x.children;let w=-1;const N=[],C=v.enter("tableRow");for(;++w<k.length;)N[w]=u(k[w],x,v,S);return C(),N}function O(x,v,S){let k=C3.inlineCode(x,v,S);return S.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function RF(){return{exit:{taskListCheckValueChecked:YT,taskListCheckValueUnchecked:YT,paragraph:MF}}}function _F(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:zF}}}function YT(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function MF(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,l;for(;++s<i.length;){const c=i[s];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function zF(t,e,n,r){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",l="["+(t.checked?"x":" ")+"] ",c=n.createTracker(r);s&&c.move(l);let u=C3.listItem(t,e,n,{...r,...c.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),u;function f(p){return p+l}}function DF(){return[gG(),zG(),ZG(),CF(),RF()]}function LF(t){return{extensions:[OG(),DG(t),qG(),AF(t),_F()]}}const XF={tokenize:VF,partial:!0},N3={tokenize:UF,partial:!0},T3={tokenize:WF,partial:!0},$3={tokenize:GF,partial:!0},ZF={tokenize:FF,partial:!0},E3={name:"wwwAutolink",tokenize:BF,previous:A3},P3={name:"protocolAutolink",tokenize:YF,previous:R3},ea={name:"emailAutolink",tokenize:IF,previous:_3},fs={};function qF(){return{text:fs}}let jl=48;for(;jl<123;)fs[jl]=ea,jl++,jl===58?jl=65:jl===91&&(jl=97);fs[43]=ea;fs[45]=ea;fs[46]=ea;fs[95]=ea;fs[72]=[ea,P3];fs[104]=[ea,P3];fs[87]=[ea,E3];fs[119]=[ea,E3];function IF(t,e,n){const r=this;let i,s;return l;function l(m){return!f1(m)||!_3.call(r,r.previous)||sk(r.events)?n(m):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),c(m))}function c(m){return f1(m)?(t.consume(m),c):m===64?(t.consume(m),u):n(m)}function u(m){return m===46?t.check(ZF,p,f)(m):m===45||m===95||zn(m)?(s=!0,t.consume(m),u):p(m)}function f(m){return t.consume(m),i=!0,u}function p(m){return s&&i&&Wn(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(m)):n(m)}}function BF(t,e,n){const r=this;return i;function i(l){return l!==87&&l!==119||!A3.call(r,r.previous)||sk(r.events)?n(l):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(XF,t.attempt(N3,t.attempt(T3,s),n),n)(l))}function s(l){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(l)}}function YF(t,e,n){const r=this;let i="",s=!1;return l;function l(m){return(m===72||m===104)&&R3.call(r,r.previous)&&!sk(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(m),t.consume(m),c):n(m)}function c(m){if(Wn(m)&&i.length<5)return i+=String.fromCodePoint(m),t.consume(m),c;if(m===58){const O=i.toLowerCase();if(O==="http"||O==="https")return t.consume(m),u}return n(m)}function u(m){return m===47?(t.consume(m),s?f:(s=!0,u)):n(m)}function f(m){return m===null||bg(m)||kt(m)||ro(m)||oO(m)?n(m):t.attempt(N3,t.attempt(T3,p),n)(m)}function p(m){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(m)}}function VF(t,e,n){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,t.consume(l),i):l===46&&r===3?(t.consume(l),s):n(l)}function s(l){return l===null?n(l):e(l)}}function UF(t,e,n){let r,i,s;return l;function l(f){return f===46||f===95?t.check($3,u,c)(f):f===null||kt(f)||ro(f)||f!==45&&oO(f)?u(f):(s=!0,t.consume(f),l)}function c(f){return f===95?r=!0:(i=r,r=void 0),t.consume(f),l}function u(f){return i||r||!s?n(f):e(f)}}function WF(t,e){let n=0,r=0;return i;function i(l){return l===40?(n++,t.consume(l),i):l===41&&r<n?s(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?t.check($3,e,s)(l):l===null||kt(l)||ro(l)?e(l):(t.consume(l),i)}function s(l){return l===41&&r++,t.consume(l),i}}function GF(t,e,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(t.consume(c),r):c===38?(t.consume(c),s):c===93?(t.consume(c),i):c===60||c===null||kt(c)||ro(c)?e(c):n(c)}function i(c){return c===null||c===40||c===91||kt(c)||ro(c)?e(c):r(c)}function s(c){return Wn(c)?l(c):n(c)}function l(c){return c===59?(t.consume(c),r):Wn(c)?(t.consume(c),l):n(c)}}function FF(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return zn(s)?n(s):e(s)}}function A3(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||kt(t)}function R3(t){return!Wn(t)}function _3(t){return!(t===47||f1(t))}function f1(t){return t===43||t===45||t===46||t===95||zn(t)}function sk(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const HF={tokenize:sH,partial:!0};function KF(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:nH,continuation:{tokenize:rH},exit:iH}},text:{91:{name:"gfmFootnoteCall",tokenize:tH},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:JF,resolveTo:eH}}}}function JF(t,e,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return c;function c(u){if(!l||!l._balanced)return n(u);const f=wi(r.sliceSerialize({start:l.end,end:r.now()}));return f.codePointAt(0)!==94||!s.includes(f.slice(1))?n(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function eH(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},c=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",l,e],["exit",l,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...c),t}function tH(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,l;return c;function c(m){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),u}function u(m){return m!==94?n(m):(t.enter("gfmFootnoteCallMarker"),t.consume(m),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",f)}function f(m){if(s>999||m===93&&!l||m===null||m===91||kt(m))return n(m);if(m===93){t.exit("chunkString");const O=t.exit("gfmFootnoteCallString");return i.includes(wi(r.sliceSerialize(O)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(m)}return kt(m)||(l=!0),s++,t.consume(m),m===92?p:f}function p(m){return m===91||m===92||m===93?(t.consume(m),s++,f):f(m)}}function nH(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,l=0,c;return u;function u(v){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(v),t.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(v){return v===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(v),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",p):n(v)}function p(v){if(l>999||v===93&&!c||v===null||v===91||kt(v))return n(v);if(v===93){t.exit("chunkString");const S=t.exit("gfmFootnoteDefinitionLabelString");return s=wi(r.sliceSerialize(S)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(v),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),O}return kt(v)||(c=!0),l++,t.consume(v),v===92?m:p}function m(v){return v===91||v===92||v===93?(t.consume(v),l++,p):p(v)}function O(v){return v===58?(t.enter("definitionMarker"),t.consume(v),t.exit("definitionMarker"),i.includes(s)||i.push(s),et(t,x,"gfmFootnoteDefinitionWhitespace")):n(v)}function x(v){return e(v)}}function rH(t,e,n){return t.check(bf,e,t.attempt(HF,e,n))}function iH(t){t.exit("gfmFootnoteDefinition")}function sH(t,e,n){const r=this;return et(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?e(s):n(s)}}function aH(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,c){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let f=u;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[u][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[u][1].end)},m={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[u][1].start)},O=[["enter",p,c],["enter",l[f][1],c],["exit",l[f][1],c],["enter",m,c]],x=c.parser.constructs.insideSpan.null;x&&Mr(O,O.length,0,cO(x,l.slice(f+1,u),c)),Mr(O,O.length,0,[["exit",m,c],["enter",l[u][1],c],["exit",l[u][1],c],["exit",p,c]]),Mr(l,f-1,u-f+3,O),u=f+O.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function s(l,c,u){const f=this.previous,p=this.events;let m=0;return O;function O(v){return f===126&&p[p.length-1][1].type!=="characterEscape"?u(v):(l.enter("strikethroughSequenceTemporary"),x(v))}function x(v){const S=Hc(f);if(v===126)return m>1?u(v):(l.consume(v),m++,x);if(m<2&&!n)return u(v);const k=l.exit("strikethroughSequenceTemporary"),w=Hc(v);return k._open=!w||w===2&&!!S,k._close=!S||S===2&&!!w,c(v)}}}class lH{constructor(){this.map=[]}add(e,n,r){oH(this,e,n,r)}consume(e){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function oH(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function cH(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function uH(){return{flow:{null:{name:"table",tokenize:dH,resolveAll:hH}}}}function dH(t,e,n){const r=this;let i=0,s=0,l;return c;function c(D){let L=r.events.length-1;for(;L>-1;){const I=r.events[L][1].type;if(I==="lineEnding"||I==="linePrefix")L--;else break}const Z=L>-1?r.events[L][1].type:null,te=Z==="tableHead"||Z==="tableRow"?R:u;return te===R&&r.parser.lazy[r.now().line]?n(D):te(D)}function u(D){return t.enter("tableHead"),t.enter("tableRow"),f(D)}function f(D){return D===124||(l=!0,s+=1),p(D)}function p(D){return D===null?n(D):Ne(D)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(D),t.exit("lineEnding"),x):n(D):Ve(D)?et(t,p,"whitespace")(D):(s+=1,l&&(l=!1,i+=1),D===124?(t.enter("tableCellDivider"),t.consume(D),t.exit("tableCellDivider"),l=!0,p):(t.enter("data"),m(D)))}function m(D){return D===null||D===124||kt(D)?(t.exit("data"),p(D)):(t.consume(D),D===92?O:m)}function O(D){return D===92||D===124?(t.consume(D),m):m(D)}function x(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(D):(t.enter("tableDelimiterRow"),l=!1,Ve(D)?et(t,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):v(D))}function v(D){return D===45||D===58?k(D):D===124?(l=!0,t.enter("tableCellDivider"),t.consume(D),t.exit("tableCellDivider"),S):M(D)}function S(D){return Ve(D)?et(t,k,"whitespace")(D):k(D)}function k(D){return D===58?(s+=1,l=!0,t.enter("tableDelimiterMarker"),t.consume(D),t.exit("tableDelimiterMarker"),w):D===45?(s+=1,w(D)):D===null||Ne(D)?E(D):M(D)}function w(D){return D===45?(t.enter("tableDelimiterFiller"),N(D)):M(D)}function N(D){return D===45?(t.consume(D),N):D===58?(l=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(D),t.exit("tableDelimiterMarker"),C):(t.exit("tableDelimiterFiller"),C(D))}function C(D){return Ve(D)?et(t,E,"whitespace")(D):E(D)}function E(D){return D===124?v(D):D===null||Ne(D)?!l||i!==s?M(D):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(D)):M(D)}function M(D){return n(D)}function R(D){return t.enter("tableRow"),_(D)}function _(D){return D===124?(t.enter("tableCellDivider"),t.consume(D),t.exit("tableCellDivider"),_):D===null||Ne(D)?(t.exit("tableRow"),e(D)):Ve(D)?et(t,_,"whitespace")(D):(t.enter("data"),V(D))}function V(D){return D===null||D===124||kt(D)?(t.exit("data"),_(D)):(t.consume(D),D===92?G:V)}function G(D){return D===92||D===124?(t.consume(D),V):V(D)}}function hH(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],l=[0,0,0,0],c=!1,u=0,f,p,m;const O=new lH;for(;++n<t.length;){const x=t[n],v=x[1];x[0]==="enter"?v.type==="tableHead"?(c=!1,u!==0&&(VT(O,e,u,f,p),p=void 0,u=0),f={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},O.add(n,0,[["enter",f,e]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,m=void 0,s=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},O.add(n,0,[["enter",p,e]])),i=v.type==="tableDelimiterRow"?2:p?3:1):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],m=im(O,e,s,i,void 0,m),s=[0,0,0,0]),l[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(l[0]=l[1],m=im(O,e,s,i,void 0,m)),s=l,l=[s[1],n,0,0])):v.type==="tableHead"?(c=!0,u=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(u=n,s[1]!==0?(l[0]=l[1],m=im(O,e,s,i,n,m)):l[1]!==0&&(m=im(O,e,l,i,n,m)),i=0):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(l[3]=n)}for(u!==0&&VT(O,e,u,f,p),O.consume(e.events),n=-1;++n<e.events.length;){const x=e.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=cH(e.events,n))}return t}function im(t,e,n,r,i,s){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},gc(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const u=gc(e.events,n[1]);if(s={type:l,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const f=gc(e.events,n[2]),p=gc(e.events,n[3]),m={type:c,start:Object.assign({},f),end:Object.assign({},p)};if(t.add(n[2],0,[["enter",m,e]]),r!==2){const O=e.events[n[2]],x=e.events[n[3]];if(O[1].end=Object.assign({},x[1].end),O[1].type="chunkText",O[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,S=n[3]-n[2]-1;t.add(v,S,[])}}t.add(n[3]+1,0,[["exit",m,e]])}return i!==void 0&&(s.end=Object.assign({},gc(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function VT(t,e,n,r,i){const s=[],l=gc(e.events,n);i&&(i.end=Object.assign({},l),s.push(["exit",i,e])),r.end=Object.assign({},l),s.push(["exit",r,e]),t.add(n+1,0,s)}function gc(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const fH={name:"tasklistCheck",tokenize:mH};function pH(){return{text:{91:fH}}}function mH(t,e,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),s)}function s(u){return kt(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),l):n(u)}function l(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),c):n(u)}function c(u){return Ne(u)?e(u):Ve(u)?t.check({tokenize:gH},e,n)(u):n(u)}}function gH(t,e,n){return et(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function OH(t){return Y5([qF(),KF(),aH(t),uH(),pH()])}const xH={};function M3(t){const e=this,n=t||xH,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(OH(n)),s.push(DF()),l.push(LF(n))}let p1=[],z3=[];(()=>{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,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,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768)return!1;for(let e=0,n=p1.length;;){let r=e+n>>1;if(t<p1[r])n=r;else if(t>=z3[r])e=r+1;else return!0;if(e==n)return!1}}function UT(t){return t>=127462&&t<=127487}const WT=8205;function vH(t,e,n=!0,r=!0){return(n?D3:yH)(t,e,r)}function D3(t,e,n){if(e==t.length)return e;e&&L3(t.charCodeAt(e))&&X3(t.charCodeAt(e-1))&&e--;let r=$v(t,e);for(e+=GT(r);e<t.length;){let i=$v(t,e);if(r==WT||i==WT||n&&bH(i))e+=GT(i),r=i;else if(UT(i)){let s=0,l=e-2;for(;l>=0&&UT($v(t,l));)s++,l-=2;if(s%2==0)break;e+=2}else break}return e}function yH(t,e,n){for(;e>0;){let r=D3(t,e-2,n);if(r<e)return r;e--}return 0}function $v(t,e){let n=t.charCodeAt(e);if(!X3(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return L3(r)?(n-55296<<10)+(r-56320)+65536:n}function L3(t){return t>=56320&&t<57344}function X3(t){return t>=55296&&t<56320}function GT(t){return t<65536?1:2}class Je{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,r){[e,n]=Kc(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Fi.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Kc(this,e,n);let r=[];return this.decompose(e,n,r,0),Fi.from(r,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),r=this.length-this.scanIdentical(e,-1),i=new ah(this),s=new ah(e);for(let l=n,c=n;;){if(i.next(l),s.next(l),l=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(c+=i.value.length,i.done||c>=r)return!0}}iter(e=1){return new ah(this,e)}iterRange(e,n=this.length){return new Z3(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new q3(r)}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]?Je.empty:e.length<=32?new Jt(e):Fi.from(Jt.split(e,[]))}}class Jt extends Je{constructor(e,n=SH(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let l=this.text[s],c=i+l.length;if((n?r:c)>=e)return new wH(i,c,r,l);i=c+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new Jt(FT(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let l=r.pop(),c=Dm(s.text,l.text.slice(),0,s.length);if(c.length<=32)r.push(new Jt(c,l.length+s.length));else{let u=c.length>>1;r.push(new Jt(c.slice(0,u)),new Jt(c.slice(u)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof Jt))return super.replace(e,n,r);[e,n]=Kc(this,e,n);let i=Dm(this.text,Dm(r.text,FT(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new Jt(i,s):Fi.from(Jt.split(i,[]),s)}sliceString(e,n=this.length,r=`
|
|
551
|
+
`){[e,n]=Kc(this,e,n);let i="";for(let s=0,l=0;s<=n&&l<this.text.length;l++){let c=this.text[l],u=s+c.length;s>e&&l&&(i+=r),e<u&&n>s&&(i+=c.slice(Math.max(0,e-s),n-s)),s=u+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(n.push(new Jt(r,i)),r=[],i=-1);return i>-1&&n.push(new Jt(r,i)),n}}class Fi extends Je{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let s=0;;s++){let l=this.children[s],c=i+l.length,u=r+l.lines-1;if((n?u:c)>=e)return l.lineInner(e,n,r,i);i=c+1,r=u+1}}decompose(e,n,r,i){for(let s=0,l=0;l<=n&&s<this.children.length;s++){let c=this.children[s],u=l+c.length;if(e<=u&&n>=l){let f=i&((l<=e?1:0)|(u>=n?2:0));l>=e&&u<=n&&!f?r.push(c):c.decompose(e-l,n-l,r,f)}l=u+1}}replace(e,n,r){if([e,n]=Kc(this,e,n),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let l=this.children[i],c=s+l.length;if(e>=s&&n<=c){let u=l.replace(e-s,n-s,r),f=this.lines-l.lines+u.lines;if(u.lines<f>>4&&u.lines>f>>6){let p=this.children.slice();return p[i]=u,new Fi(p,this.length-(n-e)+r.length)}return super.replace(s,c,u)}s=c+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
|
552
|
+
`){[e,n]=Kc(this,e,n);let i="";for(let s=0,l=0;s<this.children.length&&l<=n;s++){let c=this.children[s],u=l+c.length;l>e&&s&&(i+=r),e<u&&n>l&&(i+=c.sliceString(e-l,n-l,r)),l=u+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Fi))return 0;let r=0,[i,s,l,c]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==l||s==c)return r;let u=this.children[i],f=e.children[s];if(u!=f)return r+u.scanIdentical(f,n);r+=u.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let x of e)r+=x.lines;if(r<32){let x=[];for(let v of e)v.flatten(x);return new Jt(x,n)}let i=Math.max(32,r>>5),s=i<<1,l=i>>1,c=[],u=0,f=-1,p=[];function m(x){let v;if(x.lines>s&&x instanceof Fi)for(let S of x.children)m(S);else x.lines>l&&(u>l||!u)?(O(),c.push(x)):x instanceof Jt&&u&&(v=p[p.length-1])instanceof Jt&&x.lines+v.lines<=32?(u+=x.lines,f+=x.length+1,p[p.length-1]=new Jt(v.text.concat(x.text),v.length+1+x.length)):(u+x.lines>i&&O(),u+=x.lines,f+=x.length+1,p.push(x))}function O(){u!=0&&(c.push(p.length==1?p[0]:Fi.from(p,f)),f=-1,u=p.length=0)}for(let x of e)m(x);return O(),c.length==1?c[0]:new Fi(c,n)}}Je.empty=new Jt([""],0);function SH(t){let e=-1;for(let n of t)e+=n.length+1;return e}function Dm(t,e,n=0,r=1e9){for(let i=0,s=0,l=!0;s<t.length&&i<=r;s++){let c=t[s],u=i+c.length;u>=n&&(u>r&&(c=c.slice(0,r-i)),i<n&&(c=c.slice(n-i)),l?(e[e.length-1]+=c,l=!1):e.push(c)),i=u+1}return e}function FT(t,e,n){return Dm(t,[""],e,n)}class ah{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 Jt?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],l=s>>1,c=i instanceof Jt?i.text.length:i.children.length;if(l==(n>0?c:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
553
|
+
`,this;e--}else if(i instanceof Jt){let u=i.text[l+(n<0?-1:0)];if(this.offsets[r]+=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=i.children[l+(n<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(n>0?1:(u instanceof Jt?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 Z3{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new ah(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}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 r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),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 q3{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Je.prototype[Symbol.iterator]=function(){return this.iter()},ah.prototype[Symbol.iterator]=Z3.prototype[Symbol.iterator]=q3.prototype[Symbol.iterator]=function(){return this});let wH=class{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function Kc(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Dn(t,e,n=!0,r=!0){return vH(t,e,n,r)}function kH(t){return t>=56320&&t<57344}function jH(t){return t>=55296&&t<56320}function QH(t,e){let n=t.charCodeAt(e);if(!jH(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return kH(r)?(n-55296<<10)+(r-56320)+65536:n}function CH(t){return t<65536?1:2}const m1=/\r\n?|\n/;var Gn=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Gn||(Gn={}));class ss{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 r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let s=this.sections[n++],l=this.sections[n++];l<0?(e(r,i,s),i+=s):i+=l,r+=s}}iterChangedRanges(e,n=!1){g1(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new ss(e)}composeDesc(e){return this.empty?e:e.empty?this:I3(this,e)}mapDesc(e,n=!1){return e.empty?this:O1(this,e,n)}mapPos(e,n=-1,r=Gn.Simple){let i=0,s=0;for(let l=0;l<this.sections.length;){let c=this.sections[l++],u=this.sections[l++],f=i+c;if(u<0){if(f>e)return s+(e-i);s+=c}else{if(r!=Gn.Simple&&f>=e&&(r==Gn.TrackDel&&i<e&&f>e||r==Gn.TrackBefore&&i<e||r==Gn.TrackAfter&&f>e))return null;if(f>e||f==e&&n<0&&!c)return e==i||n<0?s:s+u;s+=u}i=f}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let s=this.sections[r++],l=this.sections[r++],c=i+s;if(l>=0&&i<=n&&c>=e)return i<e&&c>n?"cover":!0;i=c}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}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 ss(e)}static create(e){return new ss(e)}}class hn extends ss{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 g1(this,(n,r,i,s,l)=>e=e.replace(i,i+(r-n),l),!1),e}mapDesc(e,n=!1){return O1(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i<n.length;i+=2){let l=n[i],c=n[i+1];if(c>=0){n[i]=c,n[i+1]=l;let u=i>>1;for(;r.length<u;)r.push(Je.empty);r.push(l?e.slice(s,s+l):Je.empty)}s+=l}return new hn(n,r)}compose(e){return this.empty?e:e.empty?this:I3(this,e,!0)}map(e,n=!1){return e.empty?this:O1(this,e,n,!0)}iterChanges(e,n=!1){g1(this,e,n)}get desc(){return ss.create(this.sections)}filter(e){let n=[],r=[],i=[],s=new Ah(this);e:for(let l=0,c=0;;){let u=l==e.length?1e9:e[l++];for(;c<u||c==u&&s.len==0;){if(s.done)break e;let p=Math.min(s.len,u-c);Mn(i,p,-1);let m=s.ins==-1?-1:s.off==0?s.ins:0;Mn(n,p,m),m>0&&Ua(r,n,s.text),s.forward(p),c+=p}let f=e[l++];for(;c<f;){if(s.done)break e;let p=Math.min(s.len,f-c);Mn(n,p,-1),Mn(i,p,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(p),c+=p}}return{changes:new hn(n,r),filtered:ss.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],l=0,c=null;function u(p=!1){if(!p&&!i.length)return;l<n&&Mn(i,n-l,-1);let m=new hn(i,s);c=c?c.compose(m.map(c)):m,i=[],s=[],l=0}function f(p){if(Array.isArray(p))for(let m of p)f(m);else if(p instanceof hn){if(p.length!=n)throw new RangeError(`Mismatched change set length (got ${p.length}, expected ${n})`);u(),c=c?c.compose(p.map(c)):p}else{let{from:m,to:O=m,insert:x}=p;if(m>O||m<0||O>n)throw new RangeError(`Invalid change range ${m} to ${O} (in doc of length ${n})`);let v=x?typeof x=="string"?Je.of(x.split(r||m1)):x:Je.empty,S=v.length;if(m==O&&S==0)return;m<l&&u(),m>l&&Mn(i,m-l,-1),Mn(i,O-m,S),Ua(s,i,v),l=O}}return f(e),u(!c),c}static empty(e){return new hn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((l,c)=>c&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length<i;)r.push(Je.empty);r[i]=Je.of(s.slice(1)),n.push(s[0],r[i].length)}}}return new hn(n,r)}static createSet(e,n){return new hn(e,n)}}function Mn(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function Ua(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(Je.empty);t.push(n)}}function g1(t,e,n){let r=t.inserted;for(let i=0,s=0,l=0;l<t.sections.length;){let c=t.sections[l++],u=t.sections[l++];if(u<0)i+=c,s+=c;else{let f=i,p=s,m=Je.empty;for(;f+=c,p+=u,u&&r&&(m=m.append(r[l-2>>1])),!(n||l==t.sections.length||t.sections[l+1]<0);)c=t.sections[l++],u=t.sections[l++];e(i,f,s,p,m),i=f,s=p}}}function O1(t,e,n,r=!1){let i=[],s=r?[]:null,l=new Ah(t),c=new Ah(e);for(let u=-1;;){if(l.done&&c.len||c.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&c.ins==-1){let f=Math.min(l.len,c.len);Mn(i,f,-1),l.forward(f),c.forward(f)}else if(c.ins>=0&&(l.ins<0||u==l.i||l.off==0&&(c.len<l.len||c.len==l.len&&!n))){let f=c.len;for(Mn(i,c.ins,-1);f;){let p=Math.min(l.len,f);l.ins>=0&&u<l.i&&l.len<=p&&(Mn(i,0,l.ins),s&&Ua(s,i,l.text),u=l.i),l.forward(p),f-=p}c.next()}else if(l.ins>=0){let f=0,p=l.len;for(;p;)if(c.ins==-1){let m=Math.min(p,c.len);f+=m,p-=m,c.forward(m)}else if(c.ins==0&&c.len<p)p-=c.len,c.next();else break;Mn(i,f,u<l.i?l.ins:0),s&&u<l.i&&Ua(s,i,l.text),u=l.i,l.forward(l.len-p)}else{if(l.done&&c.done)return s?hn.createSet(i,s):ss.create(i);throw new Error("Mismatched change set lengths")}}}function I3(t,e,n=!1){let r=[],i=n?[]:null,s=new Ah(t),l=new Ah(e);for(let c=!1;;){if(s.done&&l.done)return i?hn.createSet(r,i):ss.create(r);if(s.ins==0)Mn(r,s.len,0,c),s.next();else if(l.len==0&&!l.done)Mn(r,0,l.ins,c),i&&Ua(i,r,l.text),l.next();else{if(s.done||l.done)throw new Error("Mismatched change set lengths");{let u=Math.min(s.len2,l.len),f=r.length;if(s.ins==-1){let p=l.ins==-1?-1:l.off?0:l.ins;Mn(r,u,p,c),i&&p&&Ua(i,r,l.text)}else l.ins==-1?(Mn(r,s.off?0:s.len,u,c),i&&Ua(i,r,s.textBit(u))):(Mn(r,s.off?0:s.len,l.off?0:l.ins,c),i&&!l.off&&Ua(i,r,l.text));c=(s.ins>u||l.ins>=0&&l.len>u)&&(c||r.length>f),s.forward2(u),l.forward(u)}}}}class Ah{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?Je.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?Je.empty:n[r].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 Ll{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}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 r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Ll(r,i,this.flags)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return pe.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return pe.range(this.anchor,i,void 0,void 0,r)}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,r){return new Ll(e,n,r)}}class pe{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:pe.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],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 r=this.ranges.slice();return r[n]=e,pe.create(r,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=>Ll.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 r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return pe.normalized(e.slice(),n);r=s.to}return new pe(e,n)}static cursor(e,n=0,r,i){return Ll.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i,s){let l=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!s&&e!=n&&(s=n<e?1:-1),n<e?Ll.create(n,e,48|l):Ll.create(e,n,(s?s<0?8:16:0)|l)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],l=e[i-1];if(s.empty?s.from<=l.to:s.from<l.to){let c=l.from,u=Math.max(s.to,l.to);i<=n&&n--,e.splice(--i,2,s.anchor>s.head?pe.range(u,c):pe.range(c,u))}}return new pe(e,n)}}function B3(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let ak=0;class Ae{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=ak++,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,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:lk),!!e.static,e.enables)}of(e){return new Lm([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Lm(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Lm(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function lk(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Lm{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=ak++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,l=e[s]>>1,c=this.type==2,u=!1,f=!1,p=[];for(let m of this.dependencies)m=="doc"?u=!0:m=="selection"?f=!0:(((n=e[m.id])!==null&&n!==void 0?n:1)&1)==0&&p.push(e[m.id]);return{create(m){return m.values[l]=r(m),1},update(m,O){if(u&&O.docChanged||f&&(O.docChanged||O.selection)||x1(m,p)){let x=r(m);if(c?!HT(x,m.values[l],i):!i(x,m.values[l]))return m.values[l]=x,1}return 0},reconfigure:(m,O)=>{let x,v=O.config.address[s];if(v!=null){let S=kg(O,v);if(this.dependencies.every(k=>k instanceof Ae?O.facet(k)===m.facet(k):k instanceof ta?O.field(k,!1)==m.field(k,!1):!0)||(c?HT(x=r(m),S,i):i(x=r(m),S)))return m.values[l]=S,0}else x=r(m);return m.values[l]=x,1}}}}function HT(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function x1(t,e){let n=!1;for(let r of e)lh(t,r)&1&&(n=!0);return n}function NH(t,e,n){let r=n.map(u=>t[u.id]),i=n.map(u=>u.type),s=r.filter(u=>!(u&1)),l=t[e.id]>>1;function c(u){let f=[];for(let p=0;p<r.length;p++){let m=kg(u,r[p]);if(i[p]==2)for(let O of m)f.push(O);else f.push(m)}return e.combine(f)}return{create(u){for(let f of r)lh(u,f);return u.values[l]=c(u),1},update(u,f){if(!x1(u,s))return 0;let p=c(u);return e.compare(p,u.values[l])?0:(u.values[l]=p,1)},reconfigure(u,f){let p=x1(u,r),m=f.config.facets[e.id],O=f.facet(e);if(m&&!p&&lk(n,m))return u.values[l]=O,0;let x=c(u);return e.compare(x,O)?(u.values[l]=O,0):(u.values[l]=x,1)}}}const sm=Ae.define({static:!0});class ta{constructor(e,n,r,i,s){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let n=new ta(ak++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(sm).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],l=this.updateF(s,i);return this.compareF(s,l)?0:(r.values[n]=l,1)},reconfigure:(r,i)=>{let s=r.facet(sm),l=i.facet(sm),c;return(c=s.find(u=>u.field==this))&&c!=l.find(u=>u.field==this)?(r.values[n]=c.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,sm.of({field:this,create:e})]}get extension(){return this}}const _l={lowest:4,low:3,default:2,high:1,highest:0};function Cd(t){return e=>new Y3(e,t)}const yf={highest:Cd(_l.highest),high:Cd(_l.high),default:Cd(_l.default),low:Cd(_l.low),lowest:Cd(_l.lowest)};class Y3{constructor(e,n){this.inner=e,this.prec=n}}class fO{of(e){return new b1(this,e)}reconfigure(e){return fO.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class b1{constructor(e,n){this.compartment=e,this.inner=n}}class wg{constructor(e,n,r,i,s,l){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=l,this.statusTemplate=[];this.statusTemplate.length<r.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,r){let i=[],s=Object.create(null),l=new Map;for(let O of TH(e,n,l))O instanceof ta?i.push(O):(s[O.facet.id]||(s[O.facet.id]=[])).push(O);let c=Object.create(null),u=[],f=[];for(let O of i)c[O.id]=f.length<<1,f.push(x=>O.slot(x));let p=r==null?void 0:r.config.facets;for(let O in s){let x=s[O],v=x[0].facet,S=p&&p[O]||[];if(x.every(k=>k.type==0))if(c[v.id]=u.length<<1|1,lk(S,x))u.push(r.facet(v));else{let k=v.combine(x.map(w=>w.value));u.push(r&&v.compare(k,r.facet(v))?r.facet(v):k)}else{for(let k of x)k.type==0?(c[k.id]=u.length<<1|1,u.push(k.value)):(c[k.id]=f.length<<1,f.push(w=>k.dynamicSlot(w)));c[v.id]=f.length<<1,f.push(k=>NH(k,v,x))}}let m=f.map(O=>O(c));return new wg(e,l,m,c,u,s)}}function TH(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(l,c){let u=i.get(l);if(u!=null){if(u<=c)return;let f=r[u].indexOf(l);f>-1&&r[u].splice(f,1),l instanceof b1&&n.delete(l.compartment)}if(i.set(l,c),Array.isArray(l))for(let f of l)s(f,c);else if(l instanceof b1){if(n.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let f=e.get(l.compartment)||l.inner;n.set(l.compartment,f),s(f,c)}else if(l instanceof Y3)s(l.inner,l.prec);else if(l instanceof ta)r[c].push(l),l.provides&&s(l.provides,c);else if(l instanceof Lm)r[c].push(l),l.facet.extensions&&s(l.facet.extensions,_l.default);else{let f=l.extension;if(!f)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(f,c)}}return s(t,_l.default),r.reduce((l,c)=>l.concat(c))}function lh(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function kg(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const V3=Ae.define(),v1=Ae.define({combine:t=>t.some(e=>e),static:!0}),U3=Ae.define({combine:t=>t.length?t[0]:void 0,static:!0}),W3=Ae.define(),G3=Ae.define(),F3=Ae.define(),H3=Ae.define({combine:t=>t.length?t[0]:!1});class na{constructor(e,n){this.type=e,this.value=n}static define(){return new $H}}class $H{of(e){return new na(this,e)}}class EH{constructor(e){this.map=e}of(e){return new Mt(this,e)}}class Mt{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 Mt(this.type,n)}is(e){return this.type==e}static define(e={}){return new EH(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}Mt.reconfigure=Mt.define();Mt.appendConfig=Mt.define();class on{constructor(e,n,r,i,s,l){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=l,this._doc=null,this._state=null,r&&B3(r,n.newLength),s.some(c=>c.type==on.time)||(this.annotations=s.concat(on.time.of(Date.now())))}static create(e,n,r,i,s,l){return new on(e,n,r,i,s,l)}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(on.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}on.time=na.define();on.userEvent=na.define();on.addToHistory=na.define();on.remote=na.define();function PH(t,e){let n=[];for(let r=0,i=0;;){let s,l;if(r<t.length&&(i==e.length||e[i]>=t[r]))s=t[r++],l=t[r++];else if(i<e.length)s=e[i++],l=e[i++];else return n;!n.length||n[n.length-1]<s?n.push(s,l):n[n.length-1]<l&&(n[n.length-1]=l)}}function K3(t,e,n){var r;let i,s,l;return n?(i=e.changes,s=hn.empty(e.changes.length),l=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),l=t.changes.compose(i)),{changes:l,selection:e.selection?e.selection.map(s):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:Mt.mapEffects(t.effects,i).concat(Mt.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function y1(t,e,n){let r=e.selection,i=jc(e.annotations);return e.userEvent&&(i=i.concat(on.userEvent.of(e.userEvent))),{changes:e.changes instanceof hn?e.changes:hn.of(e.changes||[],n,t.facet(U3)),selection:r&&(r instanceof pe?r:pe.single(r.anchor,r.head)),effects:jc(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function J3(t,e,n){let r=y1(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 l=!!e[s].sequential;r=K3(r,y1(t,e[s],l?r.changes.newLength:t.doc.length),l)}let i=on.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return RH(n?AH(i):i)}function AH(t){let e=t.startState,n=!0;for(let i of e.facet(W3)){let s=i(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:PH(n,s))}if(n!==!0){let i,s;if(n===!1)s=t.changes.invertedDesc,i=hn.empty(e.doc.length);else{let l=t.changes.filter(n);i=l.changes,s=l.filtered.mapDesc(l.changes).invertedDesc}t=on.create(e,i,t.selection&&t.selection.map(s),Mt.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let r=e.facet(G3);for(let i=r.length-1;i>=0;i--){let s=r[i](t);s instanceof on?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof on?t=s[0]:t=J3(e,jc(s),!1)}return t}function RH(t){let e=t.startState,n=e.facet(F3),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=K3(r,y1(e,s,t.changes.newLength),!0))}return r==t?t:on.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const _H=[];function jc(t){return t==null?_H:Array.isArray(t)?t:[t]}var Ls=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Ls||(Ls={}));const MH=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let S1;try{S1=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function zH(t){if(S1)return S1.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||MH.test(n)))return!0}return!1}function DH(t){return e=>{if(!/\S/.test(e))return Ls.Space;if(zH(e))return Ls.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Ls.Word;return Ls.Other}}class st{constructor(e,n,r,i,s,l){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,l&&(l._state=this);for(let c=0;c<this.config.dynamicSlots.length;c++)lh(this,c<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return lh(this,r),kg(this,r)}update(...e){return J3(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let c of e.effects)c.is(fO.reconfigure)?(n&&(i=new Map,n.compartments.forEach((u,f)=>i.set(f,u)),n=null),i.set(c.value.compartment,c.value.extension)):c.is(Mt.reconfigure)?(n=null,r=c.value):c.is(Mt.appendConfig)&&(n=null,r=jc(r).concat(c.value));let s;n?s=e.startState.values.slice():(n=wg.resolve(r,i,this),s=new st(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(u,f)=>f.reconfigure(u,this),null).values);let l=e.startState.facet(v1)?e.newSelection:e.newSelection.asSingle();new st(n,e.newDoc,l,s,(c,u)=>u.update(c,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,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],l=jc(r.effects);for(let c=1;c<n.ranges.length;c++){let u=e(n.ranges[c]),f=this.changes(u.changes),p=f.map(i);for(let O=0;O<c;O++)s[O]=s[O].map(p);let m=i.mapDesc(f,!0);s.push(u.range.map(m)),i=i.compose(p),l=Mt.mapEffects(l,p).concat(Mt.mapEffects(jc(u.effects),m))}return{changes:i,selection:pe.create(s,n.mainIndex),effects:l}}changes(e=[]){return e instanceof hn?e:hn.of(e,this.doc.length,this.facet(st.lineSeparator))}toText(e){return Je.of(e.split(this.facet(st.lineSeparator)||m1))}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:(lh(this,n),kg(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof ta&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let l=r[s],c=e[s];i.push(l.init(u=>l.spec.fromJSON(c,u)))}}return st.create({doc:e.doc,selection:pe.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=wg.resolve(e.extensions||[],new Map),r=e.doc instanceof Je?e.doc:Je.of((e.doc||"").split(n.staticFacet(st.lineSeparator)||m1)),i=e.selection?e.selection instanceof pe?e.selection:pe.single(e.selection.anchor,e.selection.head):pe.single(0);return B3(i,r.length),n.staticFacet(v1)||(i=i.asSingle()),new st(n,r,i,n.dynamicSlots.map(()=>null),(s,l)=>l.create(s),null)}get tabSize(){return this.facet(st.tabSize)}get lineBreak(){return this.facet(st.lineSeparator)||`
|
|
554
|
+
`}get readOnly(){return this.facet(H3)}phrase(e,...n){for(let r of this.facet(st.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(V3))for(let l of s(this,n,r))Object.prototype.hasOwnProperty.call(l,e)&&i.push(l[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return DH(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),l=e-r,c=e-r;for(;l>0;){let u=Dn(n,l,!1);if(s(n.slice(u,l))!=Ls.Word)break;l=u}for(;c<i;){let u=Dn(n,c);if(s(n.slice(c,u))!=Ls.Word)break;c=u}return l==c?null:pe.range(l+r,c+r)}}st.allowMultipleSelections=v1;st.tabSize=Ae.define({combine:t=>t.length?t[0]:4});st.lineSeparator=U3;st.readOnly=H3;st.phrases=Ae.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});st.languageData=V3;st.changeFilter=W3;st.transactionFilter=G3;st.transactionExtender=F3;fO.reconfigure=Mt.define();function LH(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let l=i[s],c=r[s];if(c===void 0)r[s]=l;else if(!(c===l||l===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](c,l);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class Ga{eq(e){return this==e}range(e,n=e){return w1.create(e,n,this)}}Ga.prototype.startSide=Ga.prototype.endSide=0;Ga.prototype.point=!1;Ga.prototype.mapMode=Gn.TrackDel;function ok(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let w1=class eM{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new eM(e,n,r)}};function k1(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class ck{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let l=i,c=s.length;;){if(l==c)return l;let u=l+c>>1,f=s[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-n;if(u==l)return f>=0?l:c;f>=0?c=u:l=u+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),l=this.findIndex(r,1e9,!1,s);s<l;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let r=[],i=[],s=[],l=-1,c=-1;for(let u=0;u<this.value.length;u++){let f=this.value[u],p=this.from[u]+e,m=this.to[u]+e,O,x;if(p==m){let v=n.mapPos(p,f.startSide,f.mapMode);if(v==null||(O=x=v,f.startSide!=f.endSide&&(x=n.mapPos(p,f.endSide),x<O)))continue}else if(O=n.mapPos(p,f.startSide),x=n.mapPos(m,f.endSide),O>x||O==x&&f.startSide>0&&f.endSide<=0)continue;(x-O||f.endSide-f.startSide)<0||(l<0&&(l=O),f.point&&(c=Math.max(c,x-O)),r.push(f),i.push(O-l),s.push(x-l))}return{mapped:r.length?new ck(i,s,r,c):null,pos:l}}}class gt{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new gt(e,n,r,i)}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:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,l=e.filter;if(n.length==0&&!l)return this;if(r&&(n=n.slice().sort(k1)),this.isEmpty)return n.length?gt.of(n):this;let c=new tM(this,null,-1).goto(0),u=0,f=[],p=new Rh;for(;c.value||u<n.length;)if(u<n.length&&(c.from-n[u].from||c.startSide-n[u].value.startSide)>=0){let m=n[u++];p.addInner(m.from,m.to,m.value)||f.push(m)}else c.rangeIndex==1&&c.chunkIndex<this.chunk.length&&(u==n.length||this.chunkEnd(c.chunkIndex)<n[u].from)&&(!l||i>this.chunkEnd(c.chunkIndex)||s<this.chunkPos[c.chunkIndex])&&p.addChunk(this.chunkPos[c.chunkIndex],this.chunk[c.chunkIndex])?c.nextChunk():((!l||i>c.to||s<c.from||l(c.from,c.to,c.value))&&(p.addInner(c.from,c.to,c.value)||f.push(w1.create(c.from,c.to,c.value))),c.next());return p.finishInner(this.nextLayer.isEmpty&&!f.length?gt.empty:this.nextLayer.update({add:f,filter:l,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let l=0;l<this.chunk.length;l++){let c=this.chunkPos[l],u=this.chunk[l],f=e.touchesRange(c,c+u.length);if(f===!1)i=Math.max(i,u.maxPoint),n.push(u),r.push(e.mapPos(c));else if(f===!0){let{mapped:p,pos:m}=u.map(c,e);p&&(i=Math.max(i,p.maxPoint),n.push(p),r.push(m))}}let s=this.nextLayer.map(e);return n.length==0?s:new gt(r,n,s||gt.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],l=this.chunk[i];if(n>=s&&e<=s+l.length&&l.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return _h.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return _h.from(e).goto(n)}static compare(e,n,r,i,s=-1){let l=e.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=s),c=n.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=s),u=KT(l,c,r),f=new Nd(l,u,s),p=new Nd(c,u,s);r.iterGaps((m,O,x)=>JT(f,m,p,O,x,i)),r.empty&&r.length==0&&JT(f,0,p,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let s=e.filter(p=>!p.isEmpty&&n.indexOf(p)<0),l=n.filter(p=>!p.isEmpty&&e.indexOf(p)<0);if(s.length!=l.length)return!1;if(!s.length)return!0;let c=KT(s,l),u=new Nd(s,c,0).goto(r),f=new Nd(l,c,0).goto(r);for(;;){if(u.to!=f.to||!j1(u.active,f.active)||u.point&&(!f.point||!ok(u.point,f.point)))return!1;if(u.to>i)return!0;u.next(),f.next()}}static spans(e,n,r,i,s=-1){let l=new Nd(e,null,s).goto(n),c=n,u=l.openStart;for(;;){let f=Math.min(l.to,r);if(l.point){let p=l.activeForPoint(l.to),m=l.pointFrom<n?p.length+1:l.point.startSide<0?p.length:Math.min(p.length,u);i.point(c,f,l.point,p,m,l.pointRank),u=Math.min(l.openEnd(f),p.length)}else f>c&&(i.span(c,f,l.active,u),u=l.openEnd(f));if(l.to>r)return u+(l.point&&l.to>r?1:0);c=l.to,l.next()}}static of(e,n=!1){let r=new Rh;for(let i of e instanceof w1?[e]:n?XH(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return gt.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=gt.empty;i=i.nextLayer)n=new gt(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}gt.empty=new gt([],[],null,-1);function XH(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(k1(e,r)>0)return t.slice().sort(k1);e=r}return t}gt.empty.nextLayer=gt.empty;class Rh{finishChunk(e){this.chunks.push(new ck(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,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Rh)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<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=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.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 r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(gt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=gt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function KT(t,e,n){let r=new Map;for(let s of t)for(let l=0;l<s.chunk.length;l++)s.chunk[l].maxPoint<=0&&r.set(s.chunk[l],s.chunkPos[l]);let i=new Set;for(let s of e)for(let l=0;l<s.chunk.length;l++){let c=r.get(s.chunk[l]);c!=null&&(n?n.mapPos(c):c)==s.chunkPos[l]&&!(n!=null&&n.touchesRange(c,c+s.chunk[l].length))&&i.add(s.chunk[l])}return i}class tM{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}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,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}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],r=e+n.from[this.rangeIndex];if(this.from=r,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 _h{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let l=e[s];!l.isEmpty;l=l.nextLayer)l.maxPoint>=r&&i.push(new tM(l,n,r,s));return i.length==1?i[0]:new _h(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)Ev(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)Ev(this.heap,r);(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(),Ev(this.heap,0)}}}function Ev(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class Nd{constructor(e,n,r){this.minPoint=r,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=_h.from(e,n,r)}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){am(this.active,e),am(this.activeTo,e),am(this.activeRank,e),this.minActive=e$(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||i-this.activeTo[n])>0;)n++;lm(this.active,n,r),lm(this.activeTo,n,i),lm(this.activeRank,n,s),e&&lm(e,n,this.cursor.from),this.minActive=e$(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&am(r,i)}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(r),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(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function JT(t,e,n,r,i,s){t.goto(e),n.goto(r);let l=r+i,c=r,u=r-e,f=!!s.boundChange;for(let p=!1;;){let m=t.to+u-n.to,O=m||t.endSide-n.endSide,x=O<0?t.to+u:n.to,v=Math.min(x,l);if(t.point||n.point?(t.point&&n.point&&ok(t.point,n.point)&&j1(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(c,v,t.point,n.point),p=!1):(p&&s.boundChange(c),v>c&&!j1(t.active,n.active)&&s.compareRange(c,v,t.active,n.active),f&&v<l&&(m||t.openEnd(x)!=n.openEnd(x))&&(p=!0)),x>l)break;c=x,O<=0&&t.next(),O>=0&&n.next()}}function j1(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!ok(t[n],e[n]))return!1;return!0}function am(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function lm(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function e$(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function Ws(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=Dn(t,i));return r}function ZH(t,e,n,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=Dn(t,i)}return t.length}const Q1="ͼ",t$=typeof Symbol>"u"?"__"+Q1:Symbol.for(Q1),C1=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),n$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Fa{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function s(l,c,u,f){let p=[],m=/^@(\w+)\b/.exec(l[0]),O=m&&m[1]=="keyframes";if(m&&c==null)return u.push(l[0]+";");for(let x in c){let v=c[x];if(/&/.test(x))s(x.split(/,\s*/).map(S=>l.map(k=>S.replace(/&/,k))).reduce((S,k)=>S.concat(k)),v,u);else if(v&&typeof v=="object"){if(!m)throw new RangeError("The value of a property ("+x+") should be a primitive value.");s(i(x),v,p,O)}else v!=null&&p.push(x.replace(/_.*/,"").replace(/[A-Z]/g,S=>"-"+S.toLowerCase())+": "+v+";")}(p.length||O)&&u.push((r&&!m&&!f?l.map(r):l).join(", ")+" {"+p.join(" ")+"}")}for(let l in e)s(i(l),e[l],this.rules)}getRules(){return this.rules.join(`
|
|
555
|
+
`)}static newName(){let e=n$[t$]||1;return n$[t$]=e+1,Q1+e.toString(36)}static mount(e,n,r){let i=e[C1],s=r&&r.nonce;i?s&&i.setNonce(s):i=new qH(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let r$=new Map;class qH{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=r$.get(r);if(s)return e[C1]=s;this.sheet=new i.CSSStyleSheet,r$.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[C1]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let l=0;l<e.length;l++){let c=e[l],u=this.modules.indexOf(c);if(u<s&&u>-1&&(this.modules.splice(u,1),s--,u=-1),u==-1){if(this.modules.splice(s++,0,c),r)for(let f=0;f<c.rules.length;f++)r.insertRule(c.rules[f],i++)}else{for(;s<u;)i+=this.modules[s++].rules.length;i+=c.rules.length,s++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let l="";for(let u=0;u<this.modules.length;u++)l+=this.modules[u].getRules()+`
|
|
556
|
+
`;this.styleTag.textContent=l;let c=n.head||n;this.styleTag.parentNode!=c&&c.insertBefore(this.styleTag,c.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Ha={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:"'"},Mh={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},IH=typeof navigator<"u"&&/Mac/.test(navigator.platform),BH=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Nn=0;Nn<10;Nn++)Ha[48+Nn]=Ha[96+Nn]=String(Nn);for(var Nn=1;Nn<=24;Nn++)Ha[Nn+111]="F"+Nn;for(var Nn=65;Nn<=90;Nn++)Ha[Nn]=String.fromCharCode(Nn+32),Mh[Nn]=String.fromCharCode(Nn);for(var Pv in Ha)Mh.hasOwnProperty(Pv)||(Mh[Pv]=Ha[Pv]);function YH(t){var e=IH&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||BH&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Mh:Ha)[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 Un=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},N1=typeof document<"u"?document:{documentElement:{style:{}}};const T1=/Edge\/(\d+)/.exec(Un.userAgent),nM=/MSIE \d/.test(Un.userAgent),$1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Un.userAgent),pO=!!(nM||$1||T1),i$=!pO&&/gecko\/(\d+)/i.test(Un.userAgent),Av=!pO&&/Chrome\/(\d+)/.exec(Un.userAgent),VH="webkitFontSmoothing"in N1.documentElement.style,E1=!pO&&/Apple Computer/.test(Un.vendor),s$=E1&&(/Mobile\/\w+/.test(Un.userAgent)||Un.maxTouchPoints>2);var we={mac:s$||/Mac/.test(Un.platform),windows:/Win/.test(Un.platform),linux:/Linux|X11/.test(Un.platform),ie:pO,ie_version:nM?N1.documentMode||6:$1?+$1[1]:T1?+T1[1]:0,gecko:i$,gecko_version:i$?+(/Firefox\/(\d+)/.exec(Un.userAgent)||[0,0])[1]:0,chrome:!!Av,chrome_version:Av?+Av[1]:0,ios:s$,android:/Android\b/.test(Un.userAgent),webkit_version:VH?+(/\bAppleWebKit\/(\d+)/.exec(Un.userAgent)||[0,0])[1]:0,safari:E1,safari_version:E1?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Un.userAgent)||[0,0])[1]:0,tabSize:N1.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function uk(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 jg=Object.create(null);function dk(t,e,n){if(t==e)return!0;t||(t=jg),e||(e=jg);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function UH(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function a$(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function WH(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class yu{eq(e){return!1}updateDOM(e,n,r){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,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var si=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(si||(si={}));class $t extends Ga{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Sf(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new io(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:l}=rM(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(l?n?2e8:1:-6e8)+1}return new io(e,r,i,n,e.widget||null,!0)}static line(e){return new wf(e)}static set(e,n=!1){return gt.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}$t.none=gt.empty;class Sf extends $t{constructor(e){let{start:n,end:r}=rM(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?uk(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||jg}eq(e){return this==e||e instanceof Sf&&this.tagName==e.tagName&&dk(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)}}Sf.prototype.point=!1;class wf extends $t{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof wf&&this.spec.class==e.spec.class&&dk(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)}}wf.prototype.mapMode=Gn.TrackBefore;wf.prototype.point=!0;class io extends $t{constructor(e,n,r,i,s,l){super(n,r,s,e),this.block=i,this.isReplace=l,this.mapMode=i?n<=0?Gn.TrackBefore:Gn.TrackAfter:Gn.TrackDel}get type(){return this.startSide!=this.endSide?si.WidgetRange:this.startSide<=0?si.WidgetBefore:si.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof io&&GH(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)}}io.prototype.point=!0;function rM(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function GH(t,e){return t==e||!!(t&&e&&t.compare(e))}function Qc(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class zh extends Ga{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof zh&&this.tagName==e.tagName&&dk(this.attributes,e.attributes)}static create(e){return new zh(e.tagName,e.attributes||jg)}static set(e,n=!1){return gt.of(e,n)}}zh.prototype.startSide=zh.prototype.endSide=-1;function Dh(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function P1(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function oh(t,e){if(!e.anchorNode)return!1;try{return P1(t,e.anchorNode)}catch{return!1}}function ch(t){return t.nodeType==3?Xh(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function uh(t,e,n,r){return n?l$(t,e,n,r,-1)||l$(t,e,n,r,1):!1}function Ka(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Qg(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function l$(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Gs(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=Ka(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?Gs(t):0}else return!1}}function Gs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Lh(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function FH(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 iM(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function HH(t,e,n,r,i,s,l,c){let u=t.ownerDocument,f=u.defaultView||window;for(let p=t,m=!1;p&&!m;)if(p.nodeType==1){let O,x=p==u.body,v=1,S=1;if(x)O=FH(f);else{if(/^(fixed|sticky)$/.test(getComputedStyle(p).position)&&(m=!0),p.scrollHeight<=p.clientHeight&&p.scrollWidth<=p.clientWidth){p=p.assignedSlot||p.parentNode;continue}let N=p.getBoundingClientRect();({scaleX:v,scaleY:S}=iM(p,N)),O={left:N.left,right:N.left+p.clientWidth*v,top:N.top,bottom:N.top+p.clientHeight*S}}let k=0,w=0;if(i=="nearest")e.top<O.top?(w=e.top-(O.top+l),n>0&&e.bottom>O.bottom+w&&(w=e.bottom-O.bottom+l)):e.bottom>O.bottom&&(w=e.bottom-O.bottom+l,n<0&&e.top-w<O.top&&(w=e.top-(O.top+l)));else{let N=e.bottom-e.top,C=O.bottom-O.top;w=(i=="center"&&N<=C?e.top+N/2-C/2:i=="start"||i=="center"&&n<0?e.top-l:e.bottom-C+l)-O.top}if(r=="nearest"?e.left<O.left?(k=e.left-(O.left+s),n>0&&e.right>O.right+k&&(k=e.right-O.right+s)):e.right>O.right&&(k=e.right-O.right+s,n<0&&e.left<O.left+k&&(k=e.left-(O.left+s))):k=(r=="center"?e.left+(e.right-e.left)/2-(O.right-O.left)/2:r=="start"==c?e.left-s:e.right-(O.right-O.left)+s)-O.left,k||w)if(x)f.scrollBy(k,w);else{let N=0,C=0;if(w){let E=p.scrollTop;p.scrollTop+=w/S,C=(p.scrollTop-E)*S}if(k){let E=p.scrollLeft;p.scrollLeft+=k/v,N=(p.scrollLeft-E)*v}e={left:e.left-N,top:e.top-C,right:e.right-N,bottom:e.bottom-C},N&&Math.abs(N-k)<1&&(r="nearest"),C&&Math.abs(C-w)<1&&(i="nearest")}if(x)break;(e.top<O.top||e.bottom>O.bottom||e.left<O.left||e.right>O.right)&&(e={left:Math.max(e.left,O.left),right:Math.min(e.right,O.right),top:Math.max(e.top,O.top),bottom:Math.min(e.bottom,O.bottom)}),p=p.assignedSlot||p.parentNode}else if(p.nodeType==11)p=p.host;else break}function sM(t,e=!0){let n=t.ownerDocument,r=null,i=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||r)&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),e&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:i}}class KH{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:r}=e;this.set(n,Math.min(e.anchorOffset,n?Gs(n):0),r,Math.min(e.focusOffset,r?Gs(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Pl=null;we.safari&&we.safari_version>=26&&(Pl=!1);function aM(t){if(t.setActive)return t.setActive();if(Pl)return t.focus(Pl);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Pl==null?{get preventScroll(){return Pl={preventScroll:!0},!0}}:void 0),!Pl){Pl=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],s=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let o$;function Xh(t,e,n=e){let r=o$||(o$=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function Cc(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,t.dispatchEvent(s);let l=new KeyboardEvent("keyup",i);return l.synthetic=!0,t.dispatchEvent(l),s.defaultPrevented||l.defaultPrevented}function JH(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function eK(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,Gs(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=Gs(n))}else{if(n==t)return!0;r=Ka(n),n=n.parentNode}}function lM(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 oM(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Gs(n)}else if(n.parentNode&&!Qg(n))r=Ka(n),n=n.parentNode;else return null}}function cM(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Qg(n))r=Ka(n)+1,n=n.parentNode;else return null}}class vi{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new vi(e.parentNode,Ka(e),n)}static after(e,n){return new vi(e.parentNode,Ka(e)+1,n)}}var cn=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(cn||(cn={}));const so=cn.LTR,hk=cn.RTL;function uM(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const tK=uM("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),nK=uM("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),A1=Object.create(null),Li=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);A1[e]=n,A1[n]=-e}function dM(t){return t<=247?tK[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?nK[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const rK=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Ki{get dir(){return this.level%2?hk:so}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let s=-1;for(let l=0;l<e.length;l++){let c=e[l];if(c.from<=n&&c.to>=n){if(c.level==r)return l;(s<0||(i!=0?i<0?c.from<n:c.to>n:e[s].level>c.level))&&(s=l)}}if(s<0)throw new RangeError("Index out of range");return s}}function hM(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!hM(r.inner,i.inner))return!1}return!0}const wt=[];function iK(t,e,n,r,i){for(let s=0;s<=r.length;s++){let l=s?r[s-1].to:e,c=s<r.length?r[s].from:n,u=s?256:i;for(let f=l,p=u,m=u;f<c;f++){let O=dM(t.charCodeAt(f));O==512?O=p:O==8&&m==4&&(O=16),wt[f]=O==4?2:O,O&7&&(m=O),p=O}for(let f=l,p=u,m=u;f<c;f++){let O=wt[f];if(O==128)f<c-1&&p==wt[f+1]&&p&24?O=wt[f]=p:wt[f]=256;else if(O==64){let x=f+1;for(;x<c&&wt[x]==64;)x++;let v=f&&p==8||x<n&&wt[x]==8?m==1?1:8:256;for(let S=f;S<x;S++)wt[S]=v;f=x-1}else O==8&&m==1&&(wt[f]=1);p=O,O&7&&(m=O)}}}function sK(t,e,n,r,i){let s=i==1?2:1;for(let l=0,c=0,u=0;l<=r.length;l++){let f=l?r[l-1].to:e,p=l<r.length?r[l].from:n;for(let m=f,O,x,v;m<p;m++)if(x=A1[O=t.charCodeAt(m)])if(x<0){for(let S=c-3;S>=0;S-=3)if(Li[S+1]==-x){let k=Li[S+2],w=k&2?i:k&4?k&1?s:i:0;w&&(wt[m]=wt[Li[S]]=w),c=S;break}}else{if(Li.length==189)break;Li[c++]=m,Li[c++]=O,Li[c++]=u}else if((v=wt[m])==2||v==1){let S=v==i;u=S?0:1;for(let k=c-3;k>=0;k-=3){let w=Li[k+2];if(w&2)break;if(S)Li[k+2]|=2;else{if(w&4)break;Li[k+2]|=4}}}}}function aK(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let l=i?n[i-1].to:t,c=i<n.length?n[i].from:e;for(let u=l;u<c;){let f=wt[u];if(f==256){let p=u+1;for(;;)if(p==c){if(i==n.length)break;p=n[i++].to,c=i<n.length?n[i].from:e}else if(wt[p]==256)p++;else break;let m=s==1,O=(p<e?wt[p]:r)==1,x=m==O?m?1:2:r;for(let v=p,S=i,k=S?n[S-1].to:t;v>u;)v==k&&(v=n[--S].from,k=S?n[S-1].to:t),wt[--v]=x;u=p}else s=f,u++}}}function R1(t,e,n,r,i,s,l){let c=r%2?2:1;if(r%2==i%2)for(let u=e,f=0;u<n;){let p=!0,m=!1;if(f==s.length||u<s[f].from){let S=wt[u];S!=c&&(p=!1,m=S==16)}let O=!p&&c==1?[]:null,x=p?r:r+1,v=u;e:for(;;)if(f<s.length&&v==s[f].from){if(m)break e;let S=s[f];if(!p)for(let k=S.to,w=f+1;;){if(k==n)break e;if(w<s.length&&s[w].from==k)k=s[w++].to;else{if(wt[k]==c)break e;break}}if(f++,O)O.push(S);else{S.from>u&&l.push(new Ki(u,S.from,x));let k=S.direction==so!=!(x%2);_1(t,k?r+1:r,i,S.inner,S.from,S.to,l),u=S.to}v=S.to}else{if(v==n||(p?wt[v]!=c:wt[v]==c))break;v++}O?R1(t,u,v,r+1,i,O,l):u<v&&l.push(new Ki(u,v,x)),u=v}else for(let u=n,f=s.length;u>e;){let p=!0,m=!1;if(!f||u>s[f-1].to){let S=wt[u-1];S!=c&&(p=!1,m=S==16)}let O=!p&&c==1?[]:null,x=p?r:r+1,v=u;e:for(;;)if(f&&v==s[f-1].to){if(m)break e;let S=s[--f];if(!p)for(let k=S.from,w=f;;){if(k==e)break e;if(w&&s[w-1].to==k)k=s[--w].from;else{if(wt[k-1]==c)break e;break}}if(O)O.push(S);else{S.to<u&&l.push(new Ki(S.to,u,x));let k=S.direction==so!=!(x%2);_1(t,k?r+1:r,i,S.inner,S.from,S.to,l),u=S.from}v=S.from}else{if(v==e||(p?wt[v-1]!=c:wt[v-1]==c))break;v--}O?R1(t,v,u,r+1,i,O,l):v<u&&l.push(new Ki(v,u,x)),u=v}}function _1(t,e,n,r,i,s,l){let c=e%2?2:1;iK(t,i,s,r,c),sK(t,i,s,r,c),aK(i,s,r,c),R1(t,i,s,e,n,r,l)}function lK(t,e,n){if(!t)return[new Ki(0,0,e==hk?1:0)];if(e==so&&!n.length&&!rK.test(t))return fM(t.length);if(n.length)for(;t.length>wt.length;)wt[wt.length]=256;let r=[],i=e==so?0:1;return _1(t,i,i,n,0,t.length,r),r}function fM(t){return[new Ki(0,t,0)]}let pM="";function oK(t,e,n,r,i){var s;let l=r.head-t.from,c=Ki.find(e,l,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),u=e[c],f=u.side(i,n);if(l==f){let O=c+=i?1:-1;if(O<0||O>=e.length)return null;u=e[c=O],l=u.side(!i,n),f=u.side(i,n)}let p=Dn(t.text,l,u.forward(i,n));(p<u.from||p>u.to)&&(p=f),pM=t.text.slice(Math.min(l,p),Math.max(l,p));let m=c==(i?e.length-1:0)?null:e[c+(i?1:-1)];return m&&p==f&&m.level+(i?0:1)<u.level?pe.cursor(m.side(!i,n)+t.from,m.forward(i,n)?1:-1,m.level):pe.cursor(p+t.from,u.forward(i,n)?-1:1,u.level)}function cK(t,e,n){for(let r=e;r<n;r++){let i=dM(t.charCodeAt(r));if(i==1)return so;if(i==2||i==4)return hk}return so}const mM=Ae.define(),gM=Ae.define(),OM=Ae.define(),xM=Ae.define(),M1=Ae.define(),bM=Ae.define(),vM=Ae.define(),fk=Ae.define(),pk=Ae.define(),yM=Ae.define({combine:t=>t.some(e=>e)}),uK=Ae.define({combine:t=>t.some(e=>e)}),SM=Ae.define();class Nc{constructor(e,n="nearest",r="nearest",i=5,s=5,l=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=l}map(e){return e.empty?this:new Nc(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 Nc(pe.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const om=Mt.define({map:(t,e)=>t.map(e)}),wM=Mt.define();function Ji(t,e,n){let r=t.facet(xM);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Ds=Ae.define({combine:t=>t.length?t[0]:!0});let dK=0;const vc=Ae.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class Ja{constructor(e,n,r,i,s){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(vc.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(vc.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:l}=n||{};return new Ja(dK++,e,r,i,c=>{let u=[];return l&&u.push(mO.of(f=>{let p=f.plugin(c);return p?l(p):$t.none})),s&&u.push(s(c)),u})}static fromClass(e,n){return Ja.define((r,i)=>new e(r,i),n)}}class Rv{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(r){if(Ji(n.state,r,"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){Ji(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(r){Ji(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const kM=Ae.define(),mk=Ae.define(),mO=Ae.define(),jM=Ae.define(),gk=Ae.define(),kf=Ae.define(),QM=Ae.define();function c$(t,e){let n=t.state.facet(QM);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return gt.spans(r,e.from,e.to,{point(){},span(s,l,c,u){let f=s-e.from,p=l-e.from,m=i;for(let O=c.length-1;O>=0;O--,u--){let x=c[O].spec.bidiIsolate,v;if(x==null&&(x=cK(e.text,f,p)),u>0&&m.length&&(v=m[m.length-1]).to==f&&v.direction==x)v.to=p,m=v.inner;else{let S={from:f,to:p,direction:x,inner:[]};m.push(S),m=S.inner}}}}),i}const CM=Ae.define();function NM(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(CM)){let l=s(t);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(n=Math.max(n,l.right)),l.top!=null&&(r=Math.max(r,l.top)),l.bottom!=null&&(i=Math.max(i,l.bottom)))}return{left:e,right:n,top:r,bottom:i}}const Wd=Ae.define();class ei{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new ei(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,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,s=0,l=0;;){let c=i<e.length?e[i].fromB:1e9,u=s<n.length?n[s]:1e9,f=Math.min(c,u);if(f==1e9)break;let p=f+l,m=f,O=p;for(;;)if(s<n.length&&n[s]<=m){let x=n[s+1];s+=2,m=Math.max(m,x);for(let v=i;v<e.length&&e[v].fromB<=m;v++)l=e[v].toA-e[v].toB;O=Math.max(O,x+l)}else if(i<e.length&&e[i].fromB<=m){let x=e[i++];m=Math.max(m,x.toB),O=Math.max(O,x.toA),l=x.toA-x.toB}else break;r.push(new ei(p,O,f,m))}return r}}class Cg{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=hn.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,l,c,u)=>i.push(new ei(s,l,c,u))),this.changedRanges=i}static create(e,n,r){return new Cg(e,n,r)}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 hK=[];class Ut{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return hK}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&&UH(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 r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.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 r=Ka(this.dom),i=this.length?e>0:n>0;return new vi(this.parent.dom,r+(i?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 OO)return e;return null}static get(e){return e.cmTile}}class gO extends Ut{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,r=null,i,s=(e==null?void 0:e.node)==n?e:null,l=0;for(let c of this.children){if(c.sync(e),l+=c.length+c.breakAfter,i=r?r.nextSibling:n.firstChild,s&&i!=c.dom&&(s.written=!0),c.dom.parentNode==n)for(;i&&i!=c.dom;)i=u$(i);else n.insertBefore(c.dom,i);r=c.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=u$(i);this.length=l}}function u$(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class OO extends gO{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=Ut.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&s++,i=n.pop()}else{let l=r.children[i++];if(l instanceof Bs)n.push(i),r=l,i=0;else{let c=s+l.length,u=e(l,s);if(u!==void 0)return u;s=c+l.breakAfter}}}resolveBlock(e,n){let r,i=-1,s,l=-1;if(this.blockTiles((c,u)=>{let f=u+c.length;if(e>=u&&e<=f){if(c.isWidget()&&n>=-1&&n<=1){if(c.flags&32)return!0;c.flags&16&&(r=void 0)}(u<e||e==f&&(n<-1?c.length:c.covers(1)))&&(!r||!c.isWidget()&&r.isWidget())&&(r=c,i=e-u),(f>e||e==u&&(n>1?c.length:c.covers(-1)))&&(!s||!c.isWidget()&&s.isWidget())&&(s=c,l=e-u)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&n<0||!s?{tile:r,offset:i}:{tile:s,offset:l}}}class Bs extends gO{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 r=new Bs(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Jc extends gO{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new Jc(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,s=-1,l=null,c=-1;function u(p,m){for(let O=0,x=0;O<p.children.length&&x<=m;O++){let v=p.children[O],S=x+v.length;S>=m&&(v.isComposite()?u(v,m-x):(!l||l.isHidden&&(n>0||r&&pK(l,v)))&&(S>m||v.flags&32)?(l=v,c=m-x):(x<m||v.flags&16&&!v.isHidden)&&(i=v,s=m-x)),x=S}}u(this,e);let f=(n<0?i:l)||i||l;return f?{tile:f,offset:f==i?s:c}:null}coordsIn(e,n){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):fK(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new vi(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:n);let l=r.tile.parent,c=!1;for(let u of l.children){if(c)return new vi(u.dom,0);u==r.tile&&(c=!0)}}return new vi(this.dom,0)}}function fK(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=ch(e);return n[n.length-1]||null}function pK(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class pr extends gO{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new pr(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Xl extends Ut{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 r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,s=e,l=0;e==0&&n<0||e==r&&n>=0?we.chrome||we.gecko||(e?(i--,l=1):s<r&&(s++,l=-1)):n<0?i--:s<r&&s++;let c=Xh(this.dom,i,s).getClientRects();if(!c.length)return null;let u=c[(l?l<0:n>=0)?0:c.length-1];return we.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,f=>f.width)||u),l?Lh(u,l<0):u||null}static of(e,n){let r=new Xl(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class ao extends Ut{constructor(e,n,r,i){super(e,n,i),this.widget=r}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,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return Lh(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),l=null;if(!s.length)return null;let c=this.flags&16?!0:this.flags&32?!1:e>0;for(let u=c?s.length-1:0;l=s[u],!(e>0?u==0:u==s.length-1||l.top<l.bottom);u+=c?-1:1);return Lh(l,!c)}}get overrideDOMText(){if(!this.length)return Je.empty;let{root:e}=this;if(!e)return Je.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,r,i,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new ao(s,r,e,i)}}class Ng extends Ut{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 Je.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class mK{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:s,beforeBreak:l,parents:c}=this;for(;e||n>0;)if(i.isComposite())if(l){if(!e)break;r&&r.break(),e--,l=!1}else if(s==i.children.length){if(!e&&!c.length)break;r&&r.leave(i),l=!!i.breakAfter,{tile:i,index:s}=c.pop(),s++}else{let u=i.children[s],f=u.breakAfter;(n>0?u.length<=e:u.length<e)&&(!r||r.skip(u,0,u.length)!==!1||!u.isComposite)?(l=!!f,s++,e-=u.length):(c.push({tile:i,index:s}),i=u,s=0,r&&u.isComposite()&&r.enter(u))}else if(s==i.length)l=!!i.breakAfter,{tile:i,index:s}=c.pop(),s++;else if(e){let u=Math.min(e,i.length-s);r&&r.skip(i,s,s+u),e-=u,s+=u}else break;return this.tile=i,this.index=s,this.beforeBreak=l,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class gK{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class OK{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var s;this.flushBuffer();let l=this.ensureMarks(n,r),c=l.lastChild;if(c&&c.isText()&&!(c.flags&8)&&c.length+e.length<512){this.cache.reused.set(c,2);let u=l.children[l.children.length-1]=new Xl(c.dom,c.text+e);u.parent=l}else l.append(i||Xl.of(e,(s=this.cache.find(Xl))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?_v(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let c=n.marks.length-1;c>=0;c--){let u=n.marks[c],f=i.lastChild;if(f instanceof pr&&f.mark.eq(u.mark))f.dom!=u.dom&&f.setDOM(_v(u.dom)),i=f;else{if(this.cache.reused.get(u)){let m=Ut.get(u.dom);m&&m.setDOM(_v(u.dom))}let p=pr.of(u.mark,u.dom);i.append(p),i=p}this.cache.reused.set(u,2)}let s=Ut.get(e.text);s&&this.cache.reused.set(s,2);let l=new Xl(e.text,e.text.nodeValue);l.flags|=8,i.append(l)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let s=this.ensureMarks(n,r);!i&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).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 r;e||(e=TM);let i=Jc.start(e,n||((r=this.cache.find(Jc))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}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 r;let i=this.curLine;for(let s=e.length-1;s>=0;s--){let l=e[s],c;if(n>0&&(c=i.lastChild)&&c instanceof pr&&c.mark.eq(l))i=c,n--;else{let u=pr.of(l,(r=this.cache.find(pr,f=>f.mark.eq(l)))===null||r===void 0?void 0:r.dom);i.append(u),i=u,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!d$(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(we.ios&&d$(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Mv,0,32)||new ao(Mv.toDOM(),0,Mv,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=new gK(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof Bs&&i.wrapper.eq(r.wrapper))n=i;else{let s=Bs.of(r.wrapper,(e=this.cache.find(Bs,l=>l.wrapper.eq(r.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),r=this.cache.find(Ng,void 0,1);return r&&(r.flags=n),r||new Ng(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class xK{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:i,lineBreak:s,done:l}=this.cursor.next(this.skipCount);if(this.skipCount=0,l)throw new Error("Ran out of text content when drawing inline views");this.text=i;let c=this.textOff=Math.min(e,i.length);return s?null:i.slice(0,c)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const Tg=[ao,Jc,Xl,pr,Ng,Bs,OO];for(let t=0;t<Tg.length;t++)Tg[t].bucket=t;class bK{constructor(e){this.view=e,this.buckets=Tg.map(()=>[]),this.index=Tg.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,s=this.buckets[i],l=this.index[i];for(let c=s.length-1;c>=0;c--){let u=(c+l)%s.length,f=s[u];if((!n||n(f))&&!this.reused.has(f))return s.splice(u,1),u<l&&this.index[i]--,this.reused.set(f,r),f}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let s=0,l=0;;s++){if(s==i.length){if(l)return null;l=1,s=0}let c=i[s];if(!this.reused.has(c)&&(l==0?c.widget.compare(e):c.widget.constructor==e.constructor&&e.updateDOM(c.dom,this.view,c.widget)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,c.widget==e&&c.length==n&&(c.flags&497)==r?(this.reused.set(c,1),c):(this.reused.set(c,2),new ao(c.dom,n,e,c.flags&-498|r))}}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 vK{constructor(e,n,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new bK(e),this.text=new xK(e.state.doc),this.builder=new OK(this.cache,new OO(e,e.contentDOM),gt.iter(r)),this.cache.reused.set(n,2),this.old=new mK(n),this.reuseWalker={skip:(l,c,u)=>{if(this.cache.add(l),l.isComposite())return!1},enter:l=>this.cache.add(l),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,s=0,l=0;;){let c=l<e.length?e[l++]:null,u=c?c.fromA:this.old.root.length;if(u>i){let f=u-i;this.preserve(f,!l,!c),i=u,s+=f}if(!c)break;n&&c.fromA<=n.range.fromA&&c.toA>=n.range.toA?(this.forward(c.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,c.toA),this.emit(n.range.toB,c.toB)):(this.forward(c.fromA,c.toA),this.emit(s,c.toB)),s=c.toB,i=c.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=wK(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(l,c,u)=>{if(l.isWidget())if(this.openWidget)this.builder.continueWidget(u-c);else{let f=u>0||c<l.length?ao.of(l.widget,this.view,u-c,l.flags&496,this.cache.maybeReuse(l)):this.cache.reuse(l);f.flags&256?(f.flags&=-2,this.builder.addBlockWidget(f)):(this.builder.ensureLine(null),this.builder.addInlineWidget(f,i,s),s=i.length)}else if(l.isText())this.builder.ensureLine(null),!c&&u==l.length&&!this.cache.reused.has(l)?this.builder.addText(l.text,i,s,this.cache.reuse(l)):(this.cache.add(l),this.builder.addText(l.text.slice(c,u),i,s)),s=i.length;else if(l.isLine())l.flags&=-2,this.cache.reused.set(l,1),this.builder.addLine(l);else if(l instanceof Ng)this.cache.add(l);else if(l instanceof pr)this.builder.ensureLine(null),this.builder.addMark(l,i,s),this.cache.reused.set(l,1),s=i.length;else return!1;this.openWidget=!1},enter:l=>{l.isLine()?this.builder.addLineStart(l.attrs,this.cache.maybeReuse(l)):(this.cache.add(l),l instanceof pr&&i.unshift(l.mark)),this.openWidget=!1},leave:l=>{l.isLine()?i.length&&(i.length=s=0):l instanceof pr&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,s=0,l=gt.spans(this.decorations,e,n,{point:(c,u,f,p,m,O)=>{if(f instanceof io){if(this.disallowBlockEffectsFor[O]){if(f.block)throw new RangeError("Block decorations may not be specified via plugins");if(u>this.view.state.doc.lineAt(c).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=p.length,m>p.length)i.continueWidget(u-c);else{let x=f.widget||(f.block?eu.block:eu.inline),v=yK(f),S=this.cache.findWidget(x,u-c,v)||ao.of(x,this.view,u-c,v);f.block?(f.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(S)):(i.ensureLine(r),i.addInlineWidget(S,p,m))}r=null}else r=SK(r,f);u>c&&this.text.skip(u-c)},span:(c,u,f,p)=>{for(let m=c;m<u;){let O=this.text.next(Math.min(512,u-m));O==null?(i.addLineStartIfNotCovered(r),i.addBreak(),m++):(i.ensureLine(r),i.addText(O,f,m==c?p:f.length),m+=O.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=l>s,this.openMarks=l}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let s=Ut.get(i);if(i==this.view.contentDOM)break;s instanceof pr?n.push(s):s!=null&&s.isLine()?r=s:s instanceof Bs||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new Jc(i,TM):r||n.push(pr.of(new Sf({tagName:i.nodeName.toLowerCase(),attributes:WH(i)}),i)))}return{line:r,marks:n}}}function d$(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function yK(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 TM={class:"cm-line"};function SK(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&uk(n,t),r&&(t.class+=" "+r)),t}function wK(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof pr&&e.push(r.mark)}return e}function _v(t){let e=Ut.get(t);return e&&e.setDOM(t.cloneNode()),t}class eu extends yu{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}}eu.inline=new eu("span");eu.block=new eu("div");const Mv=new class extends yu{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class h${constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=$t.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 OO(e,e.contentDOM),this.updateInner([new ei(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:p,toA:m})=>m<this.minWidthFrom||p>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 i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!PK(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?jK(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:p,to:m}=this.hasComposition;r=new ei(p,m,e.changes.mapPos(p,-1),e.changes.mapPos(m,1)).addToSet(r.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 l=this.decorations,c=this.blockWrappers;this.updateDeco();let u=NK(l,this.decorations,e.changes);u.length&&(r=ei.extendWithRanges(r,u));let f=$K(c,this.blockWrappers,e.changes);return f.length&&(r=ei.extendWithRanges(r,f)),s&&!r.some(p=>p.fromA<=s.range.fromA&&p.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let l=this.tile,c=new vK(this.view,l,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Ut.get(n.text)&&c.cache.reused.set(Ut.get(n.text),2),this.tile=c.run(e,n),z1(l,c.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:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];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 zv&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(wM)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,l=!s&&!(this.view.state.facet(Ds)||r.tabIndex>-1)&&oh(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||n||l))return;let c=this.forceSelection;this.forceSelection=!1;let u=this.view.state.selection.main,f,p;if(u.empty?p=f=this.inlineDOMNearPos(u.anchor,u.assoc||1):(p=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&&kK(f)){let O=document.createTextNode("");this.view.observer.ignore(()=>f.node.insertBefore(O,f.node.childNodes[f.offset]||null)),f=p=new vi(O,0),c=!0}let m=this.view.observer.selectionRange;(c||!m.focusNode||(!uh(f.node,f.offset,m.anchorNode,m.anchorOffset)||!uh(p.node,p.offset,m.focusNode,m.focusOffset))&&!this.suppressWidgetCursorChange(m,u))&&(this.view.observer.ignore(()=>{we.android&&we.chrome&&r.contains(m.focusNode)&&EK(m.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let O=Dh(this.view.root);if(O)if(u.empty){if(we.gecko){let x=QK(f.node,f.offset);if(x&&x!=3){let v=(x==1?oM:cM)(f.node,f.offset);v&&(f=new vi(v.node,v.offset))}}O.collapse(f.node,f.offset),u.bidiLevel!=null&&O.caretBidiLevel!==void 0&&(O.caretBidiLevel=u.bidiLevel)}else if(O.extend){O.collapse(f.node,f.offset);try{O.extend(p.node,p.offset)}catch{}}else{let x=document.createRange();u.anchor>u.head&&([f,p]=[p,f]),x.setEnd(p.node,p.offset),x.setStart(f.node,f.offset),O.removeAllRanges(),O.addRange(x)}l&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(f,p)),this.impreciseAnchor=f.precise?null:new vi(m.anchorNode,m.anchorOffset),this.impreciseHead=p.precise?null:new vi(m.focusNode,m.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&uh(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,r=Dh(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let l=this.lineAt(n.head,n.assoc);if(!l)return;let c=l.posAtStart;if(n.head==c||n.head==c+l.length)return;let u=this.coordsAt(n.head,-1),f=this.coordsAt(n.head,1);if(!u||!f||u.bottom>f.top)return;let p=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(p.node,p.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let m=e.observer.selectionRange;e.docView.posFromDOM(m.anchorNode,m.anchorOffset)!=n.from&&r.collapse(i,s)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[n];else{let l=Gs(e)==0?0:n==0?-1:1;for(;;){let c=e.parentNode;if(c==r.dom)break;l==0&&c.firstChild!=c.lastChild&&(e==c.firstChild?l=-1:l=1),e=c}l<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!Ut.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let l=0,c=i;;l++){let u=r.children[l];if(u.dom==s)return c;c+=u.length+u.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(e,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,s=!1,l,c=-1,u=!1;return this.tile.blockTiles((f,p)=>{if(f.isWidget()){if(f.flags&32&&p>=e)return!0;f.flags&16&&(s=!0)}else{let m=p+f.length;if(p<=e&&(r=f,i=e-p,s=m<e),m>=e&&!l&&(l=f,c=e-p,u=p>e),p>e&&l)return!0}}),!r&&!l?this.domAtPos(e,n):(s&&l?r=null:u&&r&&(l=null),r&&n<0||!l?r.domIn(i,n):l.domIn(c,n))}coordsAt(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof zv?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(s,l){if(s.isComposite())for(let c of s.children){if(c.length>=l){let u=i(c,l);if(u)return u}if(l-=c.length,l<0)break}else if(s.isText()&&l<s.length){let c=Dn(s.text,l);if(c==l)return null;let u=Xh(s.dom,l,c).getClientRects();for(let f=0;f<u.length;f++){let p=u[f];if(f==u.length-1||p.top<p.bottom&&p.left<p.right)return p}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,l=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,c=-1,u=this.view.textDirection==cn.LTR,f=0,p=(m,O,x)=>{for(let v=0;v<m.children.length&&!(O>i);v++){let S=m.children[v],k=O+S.length,w=S.dom.getBoundingClientRect(),{height:N}=w;if(x&&!v&&(f+=w.top-x.top),S instanceof Bs)k>r&&p(S,O,w);else if(O>=r&&(f>0&&n.push(-f),n.push(N+f),f=0,l)){let C=S.dom.lastChild,E=C?ch(C):[];if(E.length){let M=E[E.length-1],R=u?M.right-w.left:w.right-M.left;R>c&&(c=R,this.minWidth=s,this.minWidthFrom=O,this.minWidthTo=k)}}x&&v==m.children.length-1&&(f+=x.bottom-w.bottom),O=k+S.breakAfter}};return p(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?cn.RTL:cn.LTR}measureTextSize(){let e=this.tile.blockTiles(l=>{if(l.isLine()&&l.children.length&&l.length<=20){let c=0,u;for(let f of l.children){if(!f.isText()||/[^ -~]/.test(f.text))return;let p=ch(f.dom);if(p.length!=1)return;c+=p[0].width,u=p[0].height}if(c)return{lineHeight:l.dom.getBoundingClientRect().height,charWidth:c/l.length,textHeight:u}}});if(e)return e;let n=document.createElement("div"),r,i,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 l=ch(n.firstChild)[0];r=n.getBoundingClientRect().height,i=l&&l.width?l.width/27:7,s=l&&l.height?l.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],l=s?s.from-1:this.view.state.doc.length;if(l>r){let c=(n.lineBlockAt(l).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push($t.replace({widget:new zv(c),block:!0,inclusive:!0,isBlockGap:!0}).range(r,l))}if(!s)break;r=s.to+1}return $t.set(e)}updateDeco(){let e=1,n=this.view.state.facet(mO).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(gk).map((s,l)=>{let c=typeof s=="function";return c&&(r=!0),c?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(gt.join(i))),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(jM).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var n;if(e.isSnapshot){let p=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=p.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let p of this.view.state.facet(SM))try{if(p(this.view,e.range,e))return!0}catch(m){Ji(this.view.state,m,"scroll handler")}let{range:r}=e,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),s;if(!i)return;!r.empty&&(s=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let l=NM(this.view),c={left:i.left-l.left,top:i.top-l.top,right:i.right+l.right,bottom:i.bottom+l.bottom},{offsetWidth:u,offsetHeight:f}=this.view.scrollDOM;if(HH(this.view.scrollDOM,c,r.head<r.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==cn.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let p=this.view.docView.lineAt(r.head,1);p&&p.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){z1(this.tile)}}function z1(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)z1(r,e)}}function kK(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 $M(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=oM(n.focusNode,n.focusOffset),i=cM(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let c=Ut.get(i.node);if(!c||c.isText()&&c.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let u=Ut.get(r.node);!u||u.isText()&&u.text!=r.node.nodeValue||(s=i)}}if(t.docView.lastCompositionAfterCursor=s!=r,!s)return null;let l=e-s.offset;return{from:l,to:l+s.node.nodeValue.length,node:s.node}}function jK(t,e,n){let r=$M(t,n);if(!r)return null;let{node:i,from:s,to:l}=r,c=i.nodeValue;if(/[\n\r]/.test(c)||t.state.doc.sliceString(r.from,r.to)!=c)return null;let u=e.invertedDesc;return{range:new ei(u.mapPos(s),u.mapPos(l),s,l),text:i}}function QK(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 CK=class{constructor(){this.changes=[]}compareRange(e,n){Qc(e,n,this.changes)}comparePoint(e,n){Qc(e,n,this.changes)}boundChange(e){Qc(e,e,this.changes)}};function NK(t,e,n){let r=new CK;return gt.compare(t,e,n,r),r.changes}class TK{constructor(){this.changes=[]}compareRange(e,n){Qc(e,n,this.changes)}comparePoint(){}boundChange(e){Qc(e,e,this.changes)}}function $K(t,e,n){let r=new TK;return gt.compare(t,e,n,r),r.changes}function EK(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 PK(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class zv extends yu{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 AK(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return pe.cursor(e);s==0?n=1:s==i.length&&(n=-1);let l=s,c=s;n<0?l=Dn(i.text,s,!1):c=Dn(i.text,s);let u=r(i.text.slice(l,c));for(;l>0;){let f=Dn(i.text,l,!1);if(r(i.text.slice(f,l))!=u)break;l=f}for(;c<i.length;){let f=Dn(i.text,c);if(r(i.text.slice(c,f))!=u)break;c=f}return pe.range(l+i.from,c+i.from)}function RK(t,e,n,r,i){let s=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let c=t.viewState.heightOracle.textHeight,u=Math.floor((i-n.top-(t.defaultLineHeight-c)*.5)/c);s+=u*t.viewState.heightOracle.lineLength}let l=t.state.sliceDoc(n.from,n.to);return n.from+ZH(l,s,t.state.tabSize)}function _K(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==si.Text&&(i.type!=s.type||(n<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function MK(t,e,n,r){let i=_K(t,e.head,e.assoc||-1),s=!r||i.type!=si.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let l=t.dom.getBoundingClientRect(),c=t.textDirectionAt(i.from),u=t.posAtCoords({x:n==(c==cn.LTR)?l.right-1:l.left+1,y:(s.top+s.bottom)/2});if(u!=null)return pe.cursor(u,n?-1:1)}return pe.cursor(n?i.to:i.from,n?-1:1)}function f$(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),l=t.textDirectionAt(i.from);for(let c=e,u=null;;){let f=oK(i,s,l,c,n),p=pM;if(!f){if(i.number==(n?t.state.doc.lines:1))return c;p=`
|
|
557
|
+
`,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),f=t.visualLineSide(i,!n)}if(u){if(!u(p))return c}else{if(!r)return f;u=r(p)}c=f}}function zK(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let l=r(s);return i==Ls.Space&&(i=l),i==l}}function DK(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return pe.cursor(i,e.assoc);let l=e.goalColumn,c,u=t.contentDOM.getBoundingClientRect(),f=t.coordsAtPos(i,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),p=t.documentTop;if(f)l==null&&(l=f.left-u.left),c=s<0?f.top:f.bottom;else{let v=t.viewState.lineBlockAt(i);l==null&&(l=Math.min(u.right-u.left,t.defaultCharacterWidth*(i-v.from))),c=(s<0?v.top:v.bottom)+p}let m=u.left+l,O=t.viewState.heightOracle.textHeight>>1,x=r??O;for(let v=0;;v+=O){let S=c+(x+v)*s,k=D1(t,{x:m,y:S},!1,s);if(n?S>u.bottom:S<u.top)return pe.cursor(k.pos,k.assoc);let w=t.coordsAtPos(k.pos,k.assoc),N=w?(w.top+w.bottom)/2:0;if(!w||(n?N>c:N<c))return pe.cursor(k.pos,k.assoc,void 0,l)}}function dh(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(s,l,c)=>{if(e>s&&e<l){let u=r||n||(e-s<l-e?-1:1);e=u<0?s:l,r=u}});if(!r)return e}}function EM(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let l=dh(t,i.from,0);l!=i.from&&(s=pe.cursor(l,-1))}else{let l=dh(t,i.from,-1),c=dh(t,i.to,1);(l!=i.from||c!=i.to)&&(s=pe.range(i.from==i.anchor?l:c,i.from==i.head?l:c))}s&&(n||(n=e.ranges.slice()),n[r]=s)}return n?pe.create(n,e.mainIndex):e}function Dv(t,e,n){let r=dh(t.state.facet(kf).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:pe.cursor(r,r<n.from?1:-1)}class Hi{constructor(e,n){this.pos=e,this.assoc=n}}function D1(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),s=i.top+t.viewState.paddingTop,{x:l,y:c}=e,u=c-s,f;for(;;){if(u<0)return new Hi(0,1);if(u>t.viewState.docHeight)return new Hi(t.state.doc.length,-1);if(f=t.elementAtHeight(u),r==null)break;if(f.type==si.Text){if(r<0?f.to<t.viewport.from:f.from>t.viewport.to)break;let O=t.docView.coordsAt(r<0?f.from:f.to,r>0?-1:1);if(O&&(r<0?O.top<=u+s:O.bottom>=u+s))break}let m=t.viewState.heightOracle.textHeight/2;u=r>0?f.bottom+m:f.top-m}if(t.viewport.from>=f.to||t.viewport.to<=f.from){if(n)return null;if(f.type==si.Text){let m=RK(t,i,f,l,c);return new Hi(m,m==f.from?1:-1)}}if(f.type!=si.Text)return u<(f.top+f.bottom)/2?new Hi(f.from,1):new Hi(f.to,-1);let p=t.docView.lineAt(f.from,2);return(!p||p.length!=f.length)&&(p=t.docView.lineAt(f.from,-2)),new LK(t,l,c,t.textDirectionAt(f.from)).scanTile(p,f.from)}class LK{constructor(e,n,r,i){this.view=e,this.x=n,this.y=r,this.baseDir=i,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:r,spans:i}=this.bidiSpansAt(e);return i[Ki.find(i,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[Ki.find(i,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(e,n){let r=0,i=e.length-1,s=new Set,l=this.bidiIn(e[0],e[i]),c,u,f=-1,p=1e9,m;e:for(;r<i;){let x=i-r,v=r+i>>1;t:if(s.has(v)){let k=r+Math.floor(Math.random()*x);for(let w=0;w<x;w++){if(!s.has(k)){v=k;break t}k++,k==i&&(k=r)}break e}s.add(v);let S=n(v);if(S)for(let k=0;k<S.length;k++){let w=S[k],N=0;if(!(w.width==0&&S.length>1)){if(w.bottom<this.y)(!c||c.bottom<w.bottom)&&(c=w),N=1;else if(w.top>this.y)(!u||u.top>w.top)&&(u=w),N=-1;else{let C=w.left>this.x?this.x-w.left:w.right<this.x?this.x-w.right:0,E=Math.abs(C);E<p&&(f=v,p=E,m=w),C&&(N=C<0==(this.baseDir==cn.LTR)?-1:1)}N==-1&&(!l||this.baseDirAt(e[v],1))?i=v:N==1&&(!l||this.baseDirAt(e[v+1],-1))&&(r=v+1)}}}if(!m){let x=c&&(!u||this.y-c.bottom<u.top-this.y)?c:u;return this.y=(x.top+x.bottom)/2,this.scan(e,n)}let O=(l?this.dirAt(e[f],1):this.baseDir)==cn.LTR;return{i:f,after:this.x>(m.left+m.right)/2==O}}scanText(e,n){let r=[];for(let s=0;s<e.length;s=Dn(e.text,s))r.push(n+s);r.push(n+e.length);let i=this.scan(r,s=>{let l=r[s]-n,c=r[s+1]-n;return Xh(e.dom,l,c).getClientRects()});return i.after?new Hi(r[i.i+1],-1):new Hi(r[i.i],1)}scanTile(e,n){if(!e.length)return new Hi(n,1);if(e.children.length==1){let c=e.children[0];if(c.isText())return this.scanText(c,n);if(c.isComposite())return this.scanTile(c,n)}let r=[n];for(let c=0,u=n;c<e.children.length;c++)r.push(u+=e.children[c].length);let i=this.scan(r,c=>{let u=e.children[c];return u.flags&48?null:(u.dom.nodeType==1?u.dom:Xh(u.dom,0,u.length)).getClientRects()}),s=e.children[i.i],l=r[i.i];return s.isText()?this.scanText(s,l):s.isComposite()?this.scanTile(s,l):i.after?new Hi(r[i.i+1],-1):new Hi(l,1)}}const Oc="";class XK{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(st.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Oc}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let l=Ut.get(i),c=i.nextSibling;if(c==n){l!=null&&l.breakAfter&&!c&&r!=this.view.contentDOM&&this.lineBreak();break}let u=Ut.get(c);(l&&u?l.breakAfter:(l?l.breakAfter:Qg(i))||Qg(c)&&(i.nodeName!="BR"||l!=null&&l.isWidget())&&this.text.length>s)&&!qK(c,n)&&this.lineBreak(),i=c}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,l=1,c;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),l=this.lineSeparator.length):(c=i.exec(n))&&(s=c.index,l=c[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),l>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=l-1);r=s+l}}readNode(e){let n=Ut.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.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 r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(ZK(e,r.node,r.offset)?n:0))}}function ZK(t,e,n){for(;;){if(!e||n<Gs(e))return!1;if(e==t)return!0;n=Ka(e)+1,e=e.parentNode}}function qK(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=Ut.get(t);if(!(r!=null&&r.isWidget()))return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i!=null&&i.length)return!1}return!0}class p${constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class IK{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:l}=e.docView,c=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=PM(e.docView.tile,n,r,0))){let u=s||l?[]:YK(e),f=new XK(u,e);f.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=f.text,this.newSel=VK(u,this.bounds.from)}else{let u=e.observer.selectionRange,f=s&&s.node==u.focusNode&&s.offset==u.focusOffset||!P1(e.contentDOM,u.focusNode)?c.main.head:e.docView.posFromDOM(u.focusNode,u.focusOffset),p=l&&l.node==u.anchorNode&&l.offset==u.anchorOffset||!P1(e.contentDOM,u.anchorNode)?c.main.anchor:e.docView.posFromDOM(u.anchorNode,u.anchorOffset),m=e.viewport;if((we.ios||we.chrome)&&c.main.empty&&f!=p&&(m.from>0||m.to<e.state.doc.length)){let O=Math.min(f,p),x=Math.max(f,p),v=m.from-O,S=m.to-x;(v==0||v==1||O==0)&&(S==0||S==-1||x==e.state.doc.length)&&(f=0,p=e.state.doc.length)}if(e.inputState.composing>-1&&c.ranges.length>1)this.newSel=c.replaceRange(pe.range(p,f));else if(e.lineWrapping&&p==f&&!(c.main.empty&&c.main.head==f)&&e.inputState.lastTouchTime>Date.now()-100){let O=e.coordsAtPos(f,-1),x=0;O&&(x=e.inputState.lastTouchY<=O.bottom?-1:1),this.newSel=pe.create([pe.cursor(f,x)])}else this.newSel=pe.single(p,f)}}}function PM(t,e,n,r){if(t.isComposite()){let i=-1,s=-1,l=-1,c=-1;for(let u=0,f=r,p=r;u<t.children.length;u++){let m=t.children[u],O=f+m.length;if(f<e&&O>n)return PM(m,e,n,f);if(O>=e&&i==-1&&(i=u,s=f),f>n&&m.dom.parentNode==t.dom){l=u,c=p;break}p=O,f=O+m.breakAfter}return{from:s,to:c<0?r+t.length:c,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:l<t.children.length&&l>=0?t.children[l].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function AM(t,e){let n,{newSel:r}=e,{state:i}=t,s=i.selection.main,l=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:c,to:u}=e.bounds,f=s.from,p=null;(l===8||we.android&&e.text.length<u-c)&&(f=s.to,p="end");let m=i.doc.sliceString(c,u,Oc),O,x;!s.empty&&s.from>=c&&s.to<=u&&(e.typeOver||m!=e.text)&&m.slice(0,s.from-c)==e.text.slice(0,s.from-c)&&m.slice(s.to-c)==e.text.slice(O=e.text.length-(m.length-(s.to-c)))?n={from:s.from,to:s.to,insert:Je.of(e.text.slice(s.from-c,O).split(Oc))}:(x=RM(m,e.text,f-c,p))&&(we.chrome&&l==13&&x.toB==x.from+2&&e.text.slice(x.from,x.toB)==Oc+Oc&&x.toB--,n={from:c+x.from,to:c+x.toA,insert:Je.of(e.text.slice(x.from,x.toB).split(Oc))})}else r&&(!t.hasFocus&&i.facet(Ds)||$g(r,s))&&(r=null);if(!n&&!r)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"?(r&&n.insert.length==2&&(r=pe.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Je.of([n.insert.toString().replace("."," ")])}):i.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:i.toText(t.inputState.insertingText)}:we.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
|
|
558
|
+
`&&t.lineWrapping&&(r&&(r=pe.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:Je.of([" "])}),n)return Ok(t,n,r,l);if(r&&!$g(r,s)){let c=!1,u="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(c=!0),u=t.inputState.lastSelectionOrigin,u=="select.pointer"&&(r=EM(i.facet(kf).map(f=>f(t)),r))),t.dispatch({selection:r,scrollIntoView:c,userEvent:u}),!0}else return!1}function Ok(t,e,n,r=-1){if(we.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(we.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Cc(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&Cc(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Cc(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let l,c=()=>l||(l=BK(t,e,n));return t.state.facet(bM).some(u=>u(t,e.from,e.to,s,c))||t.dispatch(c()),!0}function BK(t,e,n){let r,i=t.state,s=i.selection.main,l=-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,p=dh(i.facet(kf).map(m=>m(t)),f,u);e.from==p&&(l=p)}if(l>-1)r={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?i.sliceDoc(s.from,e.from):"",f=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(u+e.insert.sliceString(0,void 0,t.state.lineBreak)+f))}else{let u=i.changes(e),f=n&&n.main.to<=u.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let p=t.state.sliceDoc(e.from,e.to),m,O=n&&$M(t,n.main.head);if(O){let v=e.insert.length-(e.to-e.from);m={from:O.from,to:O.to-v}}else m=t.state.doc.lineAt(s.head);let x=s.to-e.to;r=i.changeByRange(v=>{if(v.from==s.from&&v.to==s.to)return{changes:u,range:f||v.map(u)};let S=v.to-x,k=S-p.length;if(t.state.sliceDoc(k,S)!=p||S>=m.from&&k<=m.to)return{range:v};let w=i.changes({from:k,to:S,insert:e.insert}),N=v.to-s.to;return{changes:w,range:f?pe.range(Math.max(0,f.anchor+N),Math.max(0,f.head+N)):v.map(w)}})}else r={changes:u,selection:f&&i.selection.replaceRange(f)}}let c="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,c+=".compose",t.inputState.compositionFirstChange&&(c+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:c,scrollIntoView:!0})}function RM(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s<i&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&t.length==e.length)return null;let l=t.length,c=e.length;for(;l>0&&c>0&&t.charCodeAt(l-1)==e.charCodeAt(c-1);)l--,c--;if(r=="end"){let u=Math.max(0,s-Math.min(l,c));n-=l+u-s}if(l<s&&t.length<e.length){let u=n<=s&&n>=l?s-n:0;s-=u,c=s+(c-l),l=s}else if(c<s){let u=n<=s&&n>=c?s-n:0;s-=u,l=s+(l-c),c=s}return{from:s,toA:l,toB:c}}function YK(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new p$(n,r)),(i!=n||s!=r)&&e.push(new p$(i,s))),e}function VK(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?pe.single(n+e,r+e):null}function $g(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class UK{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&&oJ(e.contentDOM.ownerDocument)}handleEvent(e){!tJ(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 r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=WK(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let l=!n[s].handlers.length,c=r[s];c&&l!=!c.handlers.length&&(i.removeEventListener(s,this.handleEvent),c=null),c||i.addEventListener(s,this.handleEvent,{passive:l})}for(let s in r)s!="scroll"&&!n[s]&&i.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&&MM.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=_M.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||GK.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,Cc(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 m$(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Ji(n.state,i)}}}function WK(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,l=i&&i.plugin.domEventObservers;if(s)for(let c in s){let u=s[c];u&&n(c).handlers.push(m$(r.value,u))}if(l)for(let c in l){let u=l[c];u&&n(c).observers.push(m$(r.value,u))}}for(let r in ji)n(r).handlers.push(ji[r]);for(let r in br)n(r).observers.push(br[r]);return e}const _M=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],GK="dthko",MM=[16,17,18,20,91,92,224,225],cm=6;function um(t){return Math.max(0,t)*.7+8}function FK(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class HK{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=sM(e.contentDOM),this.atoms=e.state.facet(kf).map(l=>l(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(st.allowMultipleSelections)&&KK(e,n),this.dragging=eJ(e,n)&&LM(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&&FK(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,l=this.view.win.innerWidth,c=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:c}=this.scrollParents.y.getBoundingClientRect());let u=NM(this.view);e.clientX-u.left<=i+cm?n=-um(i-e.clientX):e.clientX+u.right>=l-cm&&(n=um(e.clientX-l)),e.clientY-u.top<=s+cm?r=-um(s-e.clientY):e.clientY+u.bottom>=c-cm&&(r=um(e.clientY-c)),this.setScrollSpeed(n,r)}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,r=EM(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,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 KK(t,e){let n=t.state.facet(mM);return n.length?n[0](e):we.mac?e.metaKey:e.ctrlKey}function JK(t,e){let n=t.state.facet(gM);return n.length?n[0](e):we.mac?!e.altKey:!e.ctrlKey}function eJ(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Dh(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let l=i[s];if(l.left<=e.clientX&&l.right>=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function tJ(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Ut.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const ji=Object.create(null),br=Object.create(null),zM=we.ie&&we.ie_version<15||we.ios&&we.webkit_version<604;function nJ(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(),DM(t,n.value)},50)}function xO(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function DM(t,e){e=xO(t.state,fk,e);let{state:n}=t,r,i=1,s=n.toText(e),l=s.lines==n.selection.ranges.length;if(L1!=null&&n.selection.ranges.every(u=>u.empty)&&L1==s.toString()){let u=-1;r=n.changeByRange(f=>{let p=n.doc.lineAt(f.from);if(p.from==u)return{range:f};u=p.from;let m=n.toText((l?s.line(i++).text:e)+n.lineBreak);return{changes:{from:p.from,insert:m},range:pe.cursor(f.from+m.length)}})}else l?r=n.changeByRange(u=>{let f=s.line(i++);return{changes:{from:u.from,to:u.to,insert:f.text},range:pe.cursor(u.from+f.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}br.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};br.wheel=br.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};ji.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);br.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};br.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};ji.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(OM))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=iJ(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new HK(t,e,n,r)),r&&t.observer.ignore(()=>{aM(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function g$(t,e,n,r){if(r==1)return pe.cursor(e,n);if(r==2)return AK(t.state,e,n);{let i=t.docView.lineAt(e,n),s=t.state.doc.lineAt(i?i.posAtEnd:e),l=i?i.posAtStart:s.from,c=i?i.posAtEnd:s.to;return c<t.state.doc.length&&c==s.to&&c++,pe.range(l,c)}}const rJ=we.ie&&we.ie_version<=11;let O$=null,x$=0,b$=0;function LM(t){if(!rJ)return t.detail;let e=O$,n=b$;return O$=t,b$=Date.now(),x$=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(x$+1)%3:1}function iJ(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=LM(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,l,c){let u=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),f,p=g$(t,u.pos,u.assoc,r);if(n.pos!=u.pos&&!l){let m=g$(t,n.pos,n.assoc,r),O=Math.min(m.from,p.from),x=Math.max(m.to,p.to);p=O<p.from?pe.range(O,x,p.assoc):pe.range(x,O,p.assoc)}return l?i.replaceRange(i.main.extend(p.from,p.to,p.assoc)):c&&r==1&&i.ranges.length>1&&(f=sJ(i,u.pos))?f:c?i.addRange(p):pe.create([p])}}}function sJ(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=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}ji.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let s=i.posAtStart,l=s+i.length;(s>=n.to||l<=n.from)&&(n=pe.range(s,l))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",xO(t.state,pk,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};ji.dragend=t=>(t.inputState.draggedContent=null,!1);function v$(t,e,n,r){if(n=xO(t.state,fk,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,l=r&&s&&JK(t,e)?{from:s.from,to:s.to}:null,c={from:i,insert:n},u=t.state.changes(l?[l,c]:c);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(i,-1),head:u.mapPos(i,1)},userEvent:l?"move.drop":"input.drop"}),t.inputState.draggedContent=null}ji.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&v$(t,e,r.filter(l=>l!=null).join(t.state.lineBreak),!1)};for(let l=0;l<n.length;l++){let c=new FileReader;c.onerror=s,c.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(c.result)||(r[l]=c.result),s()},c.readAsText(n[l])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return v$(t,e,r,!0),!0}return!1};ji.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=zM?null:e.clipboardData;return n?(DM(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(nJ(t),!1)};function aJ(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function lJ(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let l=t.doc.lineAt(s);l.number>i&&(e.push(l.text),n.push({from:l.from,to:Math.min(t.doc.length,l.to+1)})),i=l.number}r=!0}return{text:xO(t,pk,e.join(t.lineBreak)),ranges:n,linewise:r}}let L1=null;ji.copy=ji.cut=(t,e)=>{if(!oh(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=lJ(t.state);if(!n&&!i)return!1;L1=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=zM?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(aJ(t,n),!1)};const XM=na.define();function ZM(t,e){let n=[];for(let r of t.facet(vM)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:XM.of(!0)}):null}function qM(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=ZM(t.state,e);n?t.dispatch(n):t.update([])}},10)}br.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),qM(t)};br.blur=t=>{t.observer.clearSelectionRange(),qM(t)};br.compositionstart=br.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};br.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))};br.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};ji.beforeinput=(t,e)=>{var n,r;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"),l=e.getTargetRanges();if(s&&l.length){let c=l[0],u=t.posAtDOM(c.startContainer,c.startOffset),f=t.posAtDOM(c.endContainer,c.endOffset);return Ok(t,{from:u,to:f,insert:t.state.toText(s)},null),!0}}let i;if(we.chrome&&we.android&&(i=_M.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var l;(((l=window.visualViewport)===null||l===void 0?void 0:l.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(()=>br.compositionend(t,e),20),!1};const y$=new Set;function oJ(t){y$.has(t)||(y$.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const S$=["pre-wrap","normal","pre-line","break-spaces"];let tu=!1;function w$(){tu=!1}class cJ{constructor(e){this.lineWrapping=e,this.doc=Je.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}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 S$.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,s,l){let c=S$.indexOf(e)>-1,u=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=c||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=c,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,u){this.heightSamples={};for(let f=0;f<l.length;f++){let p=l[f];p<0?f++:this.heightSamples[Math.floor(p*10)]=!0}}return u}}class uJ{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class bi{constructor(e,n,r,i,s){this.from=e,this.length=n,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?si.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 io?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 bi(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var Nt=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Nt||(Nt={}));const Xm=.001;class Hn{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}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)>Xm&&(tu=!0),this.height=e)}replace(e,n,r){return Hn.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,l=r.doc;for(let c=i.length-1;c>=0;c--){let{fromA:u,toA:f,fromB:p,toB:m}=i[c],O=s.lineAt(u,Nt.ByPosNoHeight,r.setDoc(n),0,0),x=O.to>=f?O:s.lineAt(f,Nt.ByPosNoHeight,r,0,0);for(m+=x.to-f,f=x.to;c>0&&O.from<=i[c-1].toA;)u=i[c-1].fromA,p=i[c-1].fromB,c--,u<O.from&&(O=s.lineAt(u,Nt.ByPosNoHeight,r,0,0));p+=O.from-u,u=O.from;let v=xk.build(r.setDoc(l),e,p,m);s=Eg(s,s.replace(u,f,v))}return s.updateHeight(r,0)}static empty(){return new Ar(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,s=0;for(;;)if(n==r)if(i>s*2){let c=e[n-1];c.break?e.splice(--n,1,c.left,null,c.right):e.splice(--n,1,c.left,c.right),r+=1+c.break,i-=c.size}else if(s>i*2){let c=e[r];c.break?e.splice(r,1,c.left,null,c.right):e.splice(r,1,c.left,c.right),r+=2+c.break,s-=c.size}else break;else if(i<s){let c=e[n++];c&&(i+=c.size)}else{let c=e[--r];c&&(s+=c.size)}let l=0;return e[n-1]==null?(l=1,n--):e[n]==null&&(l=1,r++),new hJ(Hn.of(e.slice(0,n)),l,Hn.of(e.slice(r)))}}function Eg(t,e){return t==e?t:(t.constructor!=e.constructor&&(tu=!0),e)}Hn.prototype.size=1;const dJ=$t.replace({});class IM extends Hn{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new bi(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new bi(i,0,r,this.spaceAbove,dJ):this.mainBlock(r,i)}lineAt(e,n,r,i,s){let l=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(l):l}forEachLine(e,n,r,i,s,l){e<=s+this.length&&n>=s&&l(this.lineAt(0,Nt.ByPos,r,i,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,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ar extends IM{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new bi(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Ar||i instanceof jn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof jn?i=new Ar(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Hn.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||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 jn extends Hn{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,l,c=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*s);l=u/s,this.length>s+1&&(c=(this.height-u)/(this.length-s-1))}else l=this.height/s;return{firstLine:r,lastLine:i,perLine:l,perChar:c}}blockAt(e,n,r,i){let{firstLine:s,lastLine:l,perLine:c,perChar:u}=this.heightMetrics(n,i);if(n.lineWrapping){let f=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),p=n.doc.lineAt(f),m=c+p.length*u,O=Math.max(r,e-m/2);return new bi(p.from,p.length,O,m,0)}else{let f=Math.max(0,Math.min(l-s,Math.floor((e-r)/c))),{from:p,length:m}=n.doc.line(s+f);return new bi(p,m,r+c*f,c,0)}}lineAt(e,n,r,i,s){if(n==Nt.ByHeight)return this.blockAt(e,r,i,s);if(n==Nt.ByPosNoHeight){let{from:x,to:v}=r.doc.lineAt(e);return new bi(x,v-x,0,0,0)}let{firstLine:l,perLine:c,perChar:u}=this.heightMetrics(r,s),f=r.doc.lineAt(e),p=c+f.length*u,m=f.number-l,O=i+c*m+u*(f.from-s-m);return new bi(f.from,f.length,Math.max(i,Math.min(O,i+this.height-p)),p,0)}forEachLine(e,n,r,i,s,l){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:c,perLine:u,perChar:f}=this.heightMetrics(r,s);for(let p=e,m=i;p<=n;){let O=r.doc.lineAt(p);if(p==e){let v=O.number-c;m+=u*v+f*(e-s-v)}let x=u+f*O.length;l(new bi(O.from,O.length,m,x,0)),m+=x,p=O.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let s=r[r.length-1];s instanceof jn?r[r.length-1]=new jn(s.length+i):r.push(null,new jn(i-1))}if(e>0){let s=r[0];s instanceof jn?r[0]=new jn(e+s.length):r.unshift(new jn(e-1),null)}return Hn.of(r)}decomposeLeft(e,n){n.push(new jn(e-1),null)}decomposeRight(e,n){n.push(null,new jn(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let l=[],c=Math.max(n,i.from),u=-1;for(i.from>n&&l.push(new jn(i.from-n-1).updateHeight(e,n));c<=s&&i.more;){let p=e.doc.lineAt(c).length;l.length&&l.push(null);let m=i.heights[i.index++],O=0;m<0&&(O=-m,m=i.heights[i.index++]),u==-1?u=m:Math.abs(m-u)>=Xm&&(u=-2);let x=new Ar(p,m,O);x.outdated=!1,l.push(x),c+=p+1}c<=s&&l.push(null,new jn(s-c).updateHeight(e,c));let f=Hn.of(l);return(u<0||Math.abs(f.height-this.height)>=Xm||Math.abs(u-this.heightMetrics(e,n).perLine)>=Xm)&&(tu=!0),Eg(this,f)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class hJ extends Hn{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,s,i+this.left.length+this.break)}lineAt(e,n,r,i,s){let l=i+this.left.height,c=s+this.left.length+this.break,u=n==Nt.ByHeight?e<l:e<c,f=u?this.left.lineAt(e,n,r,i,s):this.right.lineAt(e,n,r,l,c);if(this.break||(u?f.to<c:f.from>c))return f;let p=n==Nt.ByPosNoHeight?Nt.ByPosNoHeight:Nt.ByPos;return u?f.join(this.right.lineAt(c,p,r,l,c)):this.left.lineAt(c,p,r,i,s).join(f)}forEachLine(e,n,r,i,s,l){let c=i+this.left.height,u=s+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,n,r,i,s,l),n>=u&&this.right.forEachLine(e,n,r,c,u,l);else{let f=this.lineAt(u,Nt.ByPos,r,i,s);e<f.from&&this.left.forEachLine(e,f.from-1,r,i,s,l),f.to>=e&&f.from<=n&&l(f),n>f.to&&this.right.forEachLine(f.to+1,n,r,c,u,l)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let l=s.length;for(let c of r)s.push(c);if(e>0&&k$(s,l-1),n<this.length){let c=s.length;this.decomposeRight(n,s),k$(s,c)}return Hn.of(s)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?Hn.of(this.break?[e,null,n]:[e,n]):(this.left=Eg(this.left,e),this.right=Eg(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,r=!1,i){let{left:s,right:l}=this,c=n+s.length+this.break,u=null;return i&&i.from<=n+s.length&&i.more?u=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=c+l.length&&i.more?u=l=l.updateHeight(e,c,r,i):l.updateHeight(e,c,r),u?this.balanced(s,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function k$(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof jn&&(r=t[e+1])instanceof jn&&t.splice(e-1,3,new jn(n.length+1+r.length))}const fJ=5;class xk{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 r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Ar?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Ar(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let l=n-e;r.block?this.addBlock(new IM(l,i,r)):(l||s||i>=fJ)&&this.addLineDeco(i,s,l)}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 Ar(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new jn(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ar)return e;let n=new Ar(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,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Ar)&&!this.isCovered?this.nodes.push(new Ar(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof Ar&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let s=new xk(r,e);return gt.spans(n,r,i,s,0),s.finish(r)}}function pJ(t,e,n){let r=new mJ;return gt.compare(t,e,n,r,0),r.changes}class mJ{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&Qc(e,n,this.changes,5)}}function gJ(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,s=Math.max(0,n.left),l=Math.min(i.innerWidth,n.right),c=Math.max(0,n.top),u=Math.min(i.innerHeight,n.bottom);for(let f=t.parentNode;f&&f!=r.body;)if(f.nodeType==1){let p=f,m=window.getComputedStyle(p);if((p.scrollHeight>p.clientHeight||p.scrollWidth>p.clientWidth)&&m.overflow!="visible"){let O=p.getBoundingClientRect();s=Math.max(s,O.left),l=Math.min(l,O.right),c=Math.max(c,O.top),u=Math.min(f==t.parentNode?i.innerHeight:u,O.bottom)}f=m.position=="absolute"||m.position=="fixed"?p.offsetParent:p.parentNode}else if(f.nodeType==11)f=f.host;else break;return{left:s-n.left,right:Math.max(s,l)-n.left,top:c-(n.top+e),bottom:Math.max(c,u)-(n.top+e)}}function OJ(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 xJ(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Lv{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=n[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,n){return $t.replace({widget:new bJ(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class bJ extends yu{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 j${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=Q$,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=cn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(mk).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new cJ(r),this.stateDeco=C$(n),this.heightMap=Hn.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle.setDoc(n.doc),[new ei(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=$t.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:l})=>i>=s&&i<=l)){let{from:s,to:l}=this.lineBlockAt(i);e.push(new dm(s,l))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Q$:new bk(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(Gd(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=C$(this.state);let i=e.changedRanges,s=ei.extendWithRanges(i,pJ(r,this.stateDeco,e?e.changes:hn.empty(this.state.doc.length))),l=this.heightMap.height,c=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);w$(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=l||tu)&&(e.flags|=2),c?(this.scrollAnchorPos=e.changes.mapPos(c.from,-1),this.scrollAnchorHeight=c.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);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(uK)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?cn.RTL:cn.LTR;let l=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",c=n.getBoundingClientRect(),u=l||this.mustMeasureContent||this.contentDOMHeight!=c.height;this.contentDOMHeight=c.height,this.mustMeasureContent=!1;let f=0,p=0;if(c.width&&c.height){let{scaleX:M,scaleY:R}=iM(n,c);(M>.005&&Math.abs(this.scaleX-M)>.005||R>.005&&Math.abs(this.scaleY-R)>.005)&&(this.scaleX=M,this.scaleY=R,f|=16,l=u=!0)}let m=(parseInt(r.paddingTop)||0)*this.scaleY,O=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=m||this.paddingBottom!=O)&&(this.paddingTop=m,this.paddingBottom=O,f|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,f|=16);let x=sM(this.view.contentDOM,!1).y;x!=this.scrollParent&&(this.scrollParent=x,this.scrollAnchorHeight=-1,this.scrollOffset=0);let v=this.getScrollOffset();this.scrollOffset!=v&&(this.scrollAnchorHeight=-1,this.scrollOffset=v),this.scrolledToBottom=lM(this.scrollParent||e.win);let S=(this.printing?xJ:gJ)(n,this.paddingTop),k=S.top-this.pixelViewport.top,w=S.bottom-this.pixelViewport.bottom;this.pixelViewport=S;let N=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(N!=this.inView&&(this.inView=N,N&&(u=!0)),!this.inView&&!this.scrollTarget&&!OJ(e.dom))return 0;let C=c.width;if((this.contentDOMWidth!=C||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=c.width,this.editorHeight=e.scrollDOM.clientHeight,f|=16),u){let M=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(M)&&(l=!0),l||i.lineWrapping&&Math.abs(C-this.contentDOMWidth)>i.charWidth){let{lineHeight:R,charWidth:_,textHeight:V}=e.docView.measureTextSize();l=R>0&&i.refresh(s,R,_,V,Math.max(5,C/_),M),l&&(e.docView.minWidth=0,f|=16)}k>0&&w>0?p=Math.max(k,w):k<0&&w<0&&(p=Math.min(k,w)),w$();for(let R of this.viewports){let _=R.from==this.viewport.from?M:e.docView.measureVisibleLineHeights(R);this.heightMap=(l?Hn.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle,[new ei(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,l,new uJ(R.from,_))}tu&&(f|=2)}let E=!this.viewportIsAppropriate(this.viewport,p)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return E&&(f&2&&(f|=this.updateScaler()),this.viewport=this.getViewport(p,this.scrollTarget),f|=this.updateForViewport()),(f&2||E)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]: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 r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:l,visibleBottom:c}=this,u=new dm(i.lineAt(l-r*1e3,Nt.ByHeight,s,0,0).from,i.lineAt(c+(1-r)*1e3,Nt.ByHeight,s,0,0).to);if(n){let{head:f}=n.range;if(f<u.from||f>u.to){let p=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=i.lineAt(f,Nt.ByPos,s,0,0),O;n.y=="center"?O=(m.top+m.bottom)/2-p/2:n.y=="start"||n.y=="nearest"&&f<u.from?O=m.top:O=m.bottom-p,u=new dm(i.lineAt(O-1e3/2,Nt.ByHeight,s,0,0).from,i.lineAt(O+p+1e3/2,Nt.ByHeight,s,0,0).to)}}return u}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new dm(this.heightMap.lineAt(r,Nt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,Nt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,Nt.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,Nt.ByPos,this.heightOracle,0,0),{visibleTop:l,visibleBottom:c}=this;return(e==0||i<=l-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=c+Math.max(10,Math.min(r,250)))&&i>l-2*1e3&&s<c+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new Lv(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,l=i<<1;if(this.defaultTextDirection!=cn.LTR&&!r)return[];let c=[],u=(p,m,O,x)=>{if(m-p<s)return;let v=this.state.selection.main,S=[v.from];v.empty||S.push(v.to);for(let w of S)if(w>p&&w<m){u(p,w-10,O,x),u(w+10,m,O,x);return}let k=yJ(e,w=>w.from>=O.from&&w.to<=O.to&&Math.abs(w.from-p)<s&&Math.abs(w.to-m)<s&&!S.some(N=>w.from<N&&w.to>N));if(!k){if(m<O.to&&n&&r&&n.visibleRanges.some(C=>C.from<=m&&C.to>=m)){let C=n.moveToLineBoundary(pe.cursor(m),!1,!0).head;C>p&&(m=C)}let w=this.gapSize(O,p,m,x),N=r||w<2e6?w:2e6;k=new Lv(p,m,w,N)}c.push(k)},f=p=>{if(p.length<l||p.type!=si.Text)return;let m=vJ(p.from,p.to,this.stateDeco);if(m.total<l)return;let O=this.scrollTarget?this.scrollTarget.range.head:null,x,v;if(r){let S=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,k,w;if(O!=null){let N=fm(m,O),C=((this.visibleBottom-this.visibleTop)/2+S)/p.height;k=N-C,w=N+C}else k=(this.visibleTop-p.top-S)/p.height,w=(this.visibleBottom-p.top+S)/p.height;x=hm(m,k),v=hm(m,w)}else{let S=m.total*this.heightOracle.charWidth,k=i*this.heightOracle.charWidth,w=0;if(S>2e6)for(let R of e)R.from>=p.from&&R.from<p.to&&R.size!=R.displaySize&&R.from*this.heightOracle.charWidth+w<this.pixelViewport.left&&(w=R.size-R.displaySize);let N=this.pixelViewport.left+w,C=this.pixelViewport.right+w,E,M;if(O!=null){let R=fm(m,O),_=((C-N)/2+k)/S;E=R-_,M=R+_}else E=(N-k)/S,M=(C+k)/S;x=hm(m,E),v=hm(m,M)}x>p.from&&u(p.from,x,p,m),v<p.to&&u(v,p.to,p,m)};for(let p of this.viewportLines)Array.isArray(p.type)?p.type.forEach(f):f(p);return c}gapSize(e,n,r,i){let s=fm(i,r)-fm(i,n);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){Lv.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=$t.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 r=[];gt.spans(n,this.viewport.from,this.viewport.to,{span(s,l){r.push({from:s,to:l})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let l=this.visibleRanges[s],c=r[s];(l.from!=c.from||l.to!=c.to)&&(i|=4,e&&e.mapPos(l.from,-1)==c.from&&e.mapPos(l.to,1)==c.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Gd(this.heightMap.lineAt(e,Nt.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)||Gd(this.heightMap.lineAt(this.scaler.fromDOM(e),Nt.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 Gd(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}}class dm{constructor(e,n){this.from=e,this.to=n}}function vJ(t,e,n){let r=[],i=t,s=0;return gt.spans(n,t,e,{span(){},point(l,c){l>i&&(r.push({from:i,to:l}),s+=l-i),i=c}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function hm({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:l}=e[i],c=l-s;if(r<=c)return s+r;r-=c}}function fm(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function yJ(t,e){for(let n of t)if(e(n))return n}const Q$={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function C$(t){let e=t.facet(mO).filter(r=>typeof r!="function"),n=t.facet(gk).filter(r=>typeof r!="function");return n.length&&e.push(gt.join(n)),e}class bk{constructor(e,n,r){let i=0,s=0,l=0;this.viewports=r.map(({from:c,to:u})=>{let f=n.lineAt(c,Nt.ByPos,e,0,0).top,p=n.lineAt(u,Nt.ByPos,e,0,0).bottom;return i+=p-f,{from:c,to:u,top:f,bottom:p,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let c of this.viewports)c.domTop=l+(c.top-s)*this.scale,l=c.domBottom=c.domTop+(c.bottom-c.top),s=c.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof bk?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Gd(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new bi(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Gd(i,e)):t._content)}const pm=Ae.define({combine:t=>t.join(" ")}),X1=Ae.define({combine:t=>t.indexOf(!0)>-1}),Z1=Fa.newName(),BM=Fa.newName(),YM=Fa.newName(),VM={"&light":"."+BM,"&dark":"."+YM};function q1(t,e,n){return new Fa(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const SJ=q1("."+Z1,{"&":{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":{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"}},VM),wJ={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Xv=we.ie&&we.ie_version<=11;class kJ{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new KH,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 r of n)this.queue.push(r);(we.ie&&we.ie_version<=11||we.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.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 QJ(e),e.state.facet(Ds)&&(e.contentDOM.editContext=this.editContext.editContext)),Xv&&(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,r)=>n!=e[r]))){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:r}=this,i=this.selectionRange;if(r.state.facet(Ds)?r.root.activeElement!=this.dom:!oh(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(we.ie&&we.ie_version<=11||we.android&&we.chrome)&&!r.state.selection.main.empty&&i.focusNode&&uh(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Dh(e.root);if(!n)return!1;let r=we.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&jJ(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=oh(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&eK(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(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 r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.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,wJ),Xv&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Xv&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Cc(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.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,r=-1,i=!1;for(let s of e){let l=this.readMutation(s);l&&(l.typeOver&&(i=!0),n==-1?{from:n,to:r}=l:(n=Math.min(l.from,n),r=Math.max(l.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&oh(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new IK(this.view,e,n,r);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 r=this.view.state,i=AM(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!$g(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}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 r=N$(n,e.previousSibling||e.target.previousSibling,-1),i=N$(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):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(Ds)!=e.state.facet(Ds)&&(e.view.contentDOM.editContext=e.state.facet(Ds)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.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 N$(t,e,n){for(;e;){let r=Ut.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function T$(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,l=t.docView.domAtPos(t.state.selection.main.anchor,1);return uh(l.node,l.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function jJ(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return T$(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?T$(t,n):null}class QJ{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=r=>{let i=e.state.selection.main,{anchor:s,head:l}=i,c=this.toEditorPos(r.updateRangeStart),u=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:c,drifted:!1});let f=u-c>r.text.length;c==this.from&&s<this.from?c=s:u==this.to&&s>this.to&&(u=s);let p=RM(e.state.sliceDoc(c,u),r.text,(f?i.from:i.to)-c,f?"end":null);if(!p){let O=pe.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));$g(O,i)||e.dispatch({selection:O,userEvent:"select"});return}let m={from:p.from+c,to:p.toA+c,insert:Je.of(r.text.slice(p.from,p.toB).split(`
|
|
559
|
+
`))};if((we.mac||we.android)&&m.from==l-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:c,to:u,insert:Je.of([r.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let O=this.to-this.from+(m.to-m.from+m.insert.length);Ok(e,m,pe.single(this.toEditorPos(r.selectionStart,O),this.toEditorPos(r.selectionEnd,O)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),m.from<m.to&&!m.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let l=this.toEditorPos(r.rangeStart),c=this.toEditorPos(r.rangeEnd);l<c;l++){let u=e.coordsForChar(l);s=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||s||new DOMRect,i.push(s)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let l=s.underlineStyle,c=s.underlineThickness;if(!/none/i.test(l)&&!/none/i.test(c)){let u=this.toEditorPos(s.rangeStart),f=this.toEditorPos(s.rangeEnd);if(u<f){let p=`text-decoration: underline ${/^[a-z]/.test(l)?l+" ":l=="Dashed"?"dashed ":l=="Squiggle"?"wavy ":""}${/thin/i.test(c)?1:2}px`;i.push($t.mark({attributes:{style:p}}).range(u,f))}}}e.dispatch({effects:wM.of($t.set(i))})},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:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Dh(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,l,c,u,f)=>{if(r)return;let p=f.length-(l-s);if(i&&l>=i.to)if(i.from==s&&i.to==l&&i.insert.eq(f)){i=this.pendingContextChange=null,n+=p,this.to+=p;return}else i=null,this.revertPending(e.state);if(s+=n,l+=n,l<=this.from)this.from+=p,this.to+=p;else if(s<this.to){if(s<this.from||l>this.to||this.to-this.from+f.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(l),f.toString()),this.to+=p}n+=p}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.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,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}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 r=this.composing;return r&&r.drifted?r.editorBase+(e-r.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 Te{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:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||JH(e.parent)||document,this.viewState=new j$(this,e.state||st.create(e)),e.scrollTo&&e.scrollTo.is(om)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(vc).map(i=>new Rv(i));for(let i of this.plugins)i.update(this);this.observer=new kJ(this),this.inputState=new UK(this),this.inputState.ensureHandlers(this.plugins),this.docView=new h$(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 on?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,r=!1,i,s=this.state;for(let O of e){if(O.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=O.state}if(this.destroyed){this.viewState.state=s;return}let l=this.hasFocus,c=0,u=null;e.some(O=>O.annotation(XM))?(this.inputState.notifiedFocused=l,c=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,u=ZM(s,l),u||(c=1));let f=this.observer.delayedAndroidKey,p=null;if(f?(this.observer.clearDelayedAndroidKey(),p=this.observer.readChange(),(p&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(p=null)):this.observer.clear(),s.facet(st.phrases)!=this.state.facet(st.phrases))return this.setState(s);i=Cg.create(this,s,e),i.flags|=c;let m=this.viewState.scrollTarget;try{this.updateState=2;for(let O of e){if(m&&(m=m.map(O.changes)),O.scrollIntoView){let{main:x}=O.state.selection;m=new Nc(x.empty?x:pe.cursor(x.head,x.head>x.anchor?-1:1))}for(let x of O.effects)x.is(om)&&(m=x.value.clip(this.state))}this.viewState.update(i,m),this.bidiCache=Pg.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Wd)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(O=>O.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(pm)!=i.state.facet(pm)&&(this.viewState.mustMeasureContent=!0),(n||r||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let O of this.state.facet(M1))try{O(i)}catch(x){Ji(this.state,x,"update listener")}(u||p)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),p&&!AM(this,p)&&f.force&&Cc(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 r of this.plugins)r.destroy(this);this.viewState=new j$(this,e),this.plugins=e.facet(vc).map(r=>new Rv(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new h$(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(vc),r=e.state.facet(vc);if(n!=r){let i=[];for(let s of r){let l=n.indexOf(s);if(l<0)i.push(new Rv(s));else{let c=this.plugins[l];c.mustUpdate=e,i.push(c)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&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(r){Ji(this.state,r,"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,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:l}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let c=0;;c++){if(l<0)if(lM(r||this.win))s=-1,l=this.viewState.heightMap.height;else{let x=this.viewState.scrollAnchorAt(i);s=x.from,l=x.top}this.updateState=1;let u=this.viewState.measure();if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(c>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 p=f.map(x=>{try{return x.read(this)}catch(v){return Ji(this.state,v),$$}}),m=Cg.create(this,this.state,[]),O=!1;m.flags|=u,n?n.flags|=u:n=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),O=this.docView.update(m),O&&this.docViewUpdate());for(let x=0;x<f.length;x++)if(p[x]!=$$)try{let v=f[x];v.write&&v.write(p[x],this)}catch(v){Ji(this.state,v)}if(O&&this.docView.updateSelection(!0),!m.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,l=-1;continue}else{let v=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-l)/this.scaleY;if((v>1||v<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+v,r?r.scrollTop+=v:this.win.scrollBy(0,v),l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let c of this.state.facet(M1))c(n)}get themeClasses(){return Z1+" "+(this.state.facet(X1)?YM:BM)+" "+this.state.facet(pm)}updateAttrs(){let e=E$(this,kM,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ds)?"true":"false",class:"cm-content",style:`${we.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),E$(this,mk,n);let r=this.observer.ignore(()=>{let i=a$(this.contentDOM,this.contentAttrs,n),s=a$(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(Te.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Wd);let e=this.state.facet(Te.cspNonce);Fa.mount(this.root,this.styleModules.concat(SJ).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(r=>r.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,r){return Dv(this,e,f$(this,e,n,r))}moveByGroup(e,n){return Dv(this,e,f$(this,e,n,r=>zK(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return pe.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return MK(this,e,n,r)}moveVertically(e,n,r){return Dv(this,e,DK(this,e,n,r))}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 r=D1(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),D1(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),l=s[Ki.find(s,e-i.from,-1,n)];return Lh(r,l.dir==cn.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(yM)||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>CJ)return fM(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||hM(s.isolates,r=c$(this,e))))return s.order;r||(r=c$(this,e));let i=lK(e.text,n,r);return this.bidiCache.push(new Pg(e.from,e.to,n,r,!0,i)),i}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(()=>{aM(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={}){return om.of(new Nc(typeof e=="number"?pe.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return om.of(new Nc(pe.cursor(r.from),"start","start",r.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 Ja.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ja.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Fa.newName(),i=[pm.of(r),Wd.of(q1(`.${r}`,e))];return n&&n.dark&&i.push(X1.of(!0)),i}static baseTheme(e){return yf.lowest(Wd.of(q1("."+Z1,e,VM)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Ut.get(r)||Ut.get(e);return((n=i==null?void 0:i.root)===null||n===void 0?void 0:n.view)||null}}Te.styleModule=Wd;Te.inputHandler=bM;Te.clipboardInputFilter=fk;Te.clipboardOutputFilter=pk;Te.scrollHandler=SM;Te.focusChangeEffect=vM;Te.perLineTextDirection=yM;Te.exceptionSink=xM;Te.updateListener=M1;Te.editable=Ds;Te.mouseSelectionStyle=OM;Te.dragMovesSelection=gM;Te.clickAddsSelectionRange=mM;Te.decorations=mO;Te.blockWrappers=jM;Te.outerDecorations=gk;Te.atomicRanges=kf;Te.bidiIsolatedRanges=QM;Te.scrollMargins=CM;Te.darkTheme=X1;Te.cspNonce=Ae.define({combine:t=>t.length?t[0]:""});Te.contentAttributes=mk;Te.editorAttributes=kM;Te.lineWrapping=Te.contentAttributes.of({class:"cm-lineWrapping"});Te.announce=Mt.define();const CJ=4096,$$={};class Pg{constructor(e,n,r,i,s,l){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=l}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:cn.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let l=e[s];l.dir==i&&!n.touchesRange(l.from,l.to)&&r.push(new Pg(n.mapPos(l.from,1),n.mapPos(l.to,-1),l.dir,l.isolates,!1,l.order))}return r}}function E$(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],l=typeof s=="function"?s(t):s;l&&uk(l,n)}return n}const NJ=we.mac?"mac":we.windows?"win":we.linux?"linux":"key";function TJ(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,l,c;for(let u=0;u<n.length-1;++u){const f=n[u];if(/^(cmd|meta|m)$/i.test(f))c=!0;else if(/^a(lt)?$/i.test(f))i=!0;else if(/^(c|ctrl|control)$/i.test(f))s=!0;else if(/^s(hift)?$/i.test(f))l=!0;else if(/^mod$/i.test(f))e=="mac"?c=!0:s=!0;else throw new Error("Unrecognized modifier name: "+f)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),c&&(r="Meta-"+r),l&&(r="Shift-"+r),r}function mm(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 $J=yf.default(Te.domEventHandlers({keydown(t,e){return RJ(EJ(e.state),t,e,"editor")}})),bO=Ae.define({enables:$J}),P$=new WeakMap;function EJ(t){let e=t.facet(bO),n=P$.get(e);return n||P$.set(e,n=AJ(e.reduce((r,i)=>r.concat(i),[]))),n}let Ma=null;const PJ=4e3;function AJ(t,e=NJ){let n=Object.create(null),r=Object.create(null),i=(l,c)=>{let u=r[l];if(u==null)r[l]=c;else if(u!=c)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},s=(l,c,u,f,p)=>{var m,O;let x=n[l]||(n[l]=Object.create(null)),v=c.split(/ (?!$)/).map(w=>TJ(w,e));for(let w=1;w<v.length;w++){let N=v.slice(0,w).join(" ");i(N,!0),x[N]||(x[N]={preventDefault:!0,stopPropagation:!1,run:[C=>{let E=Ma={view:C,prefix:N,scope:l};return setTimeout(()=>{Ma==E&&(Ma=null)},PJ),!0}]})}let S=v.join(" ");i(S,!1);let k=x[S]||(x[S]={preventDefault:!1,stopPropagation:!1,run:((O=(m=x._any)===null||m===void 0?void 0:m.run)===null||O===void 0?void 0:O.slice())||[]});u&&k.run.push(u),f&&(k.preventDefault=!0),p&&(k.stopPropagation=!0)};for(let l of t){let c=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let f of c){let p=n[f]||(n[f]=Object.create(null));p._any||(p._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:m}=l;for(let O in p)p[O].run.push(x=>m(x,I1))}let u=l[e]||l.key;if(u)for(let f of c)s(f,u,l.run,l.preventDefault,l.stopPropagation),l.shift&&s(f,"Shift-"+u,l.shift,l.preventDefault,l.stopPropagation)}return n}let I1=null;function RJ(t,e,n,r){I1=e;let i=YH(e),s=QH(i,0),l=CH(s)==i.length&&i!=" ",c="",u=!1,f=!1,p=!1;Ma&&Ma.view==n&&Ma.scope==r&&(c=Ma.prefix+" ",MM.indexOf(e.keyCode)<0&&(f=!0,Ma=null));let m=new Set,O=k=>{if(k){for(let w of k.run)if(!m.has(w)&&(m.add(w),w(n)))return k.stopPropagation&&(p=!0),!0;k.preventDefault&&(k.stopPropagation&&(p=!0),f=!0)}return!1},x=t[r],v,S;return x&&(O(x[c+mm(i,e,!l)])?u=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(we.windows&&e.ctrlKey&&e.altKey)&&!(we.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(v=Ha[e.keyCode])&&v!=i?(O(x[c+mm(v,e,!0)])||e.shiftKey&&(S=Mh[e.keyCode])!=i&&S!=v&&O(x[c+mm(S,e,!1)]))&&(u=!0):l&&e.shiftKey&&O(x[c+mm(i,e,!0)])&&(u=!0),!u&&O(x._any)&&(u=!0)),f&&(u=!0),u&&p&&e.stopPropagation(),I1=null,u}class _J extends yu{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?ch(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=Lh(n[0],r.direction!="rtl"),s=parseInt(r.lineHeight);return i.bottom-i.top>s*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+s}:i}ignoreEvent(){return!1}}function MJ(t){let e=Ja.fromClass(class{constructor(n){this.view=n,this.placeholder=t?$t.set([$t.widget({widget:new _J(t),side:1}).range(0)]):$t.none}get decorations(){return this.view.state.doc.length?$t.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,Te.contentAttributes.of({"aria-placeholder":t})]:e}class nu extends Ga{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}nu.prototype.elementClass="";nu.prototype.toDOM=void 0;nu.prototype.mapMode=Gn.TrackBefore;nu.prototype.startSide=nu.prototype.endSide=-1;nu.prototype.point=!0;const UM=1024;let zJ=0;class ti{constructor(e,n){this.from=e,this.to=n}}class Re{constructor(e={}){this.id=zJ++,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=fn.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Re.closedBy=new Re({deserialize:t=>t.split(" ")});Re.openedBy=new Re({deserialize:t=>t.split(" ")});Re.group=new Re({deserialize:t=>t.split(" ")});Re.isolate=new Re({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Re.contextHash=new Re({perNode:!0});Re.lookAhead=new Re({perNode:!0});Re.mounted=new Re({perNode:!0});class Tc{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[Re.mounted.id]}}const DJ=Object.create(null);class fn{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):DJ,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new fn(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),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 i}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(Re.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Re.group),s=-1;s<(i?i.length:0);s++){let l=n[s<0?r.name:i[s]];if(l)return l}}}}fn.none=new fn("",Object.create(null),0,8);class jf{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 r of this.types){let i=null;for(let s of e){let l=s(r);if(l){i||(i=Object.assign({},r.props));let c=l[1],u=l[0];u.combine&&u.id in i&&(c=u.combine(i[u.id],c)),i[u.id]=c}}n.push(i?new fn(r.name,i,r.id,r.flags):r)}return new jf(n)}}const gm=new WeakMap,A$=new WeakMap;var dt;(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"})(dt||(dt={}));class ot{constructor(e,n,r,i,s){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[l,c]of s)this.props[typeof l=="number"?l:l.id]=c}}toString(){let e=Tc.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}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 Ag(this.topNode,e)}cursorAt(e,n=0,r=0){let i=gm.get(this)||this.topNode,s=new Ag(i);return s.moveTo(e,n),gm.set(this,s._tree),s}get topNode(){return new li(this,0,0,null)}resolve(e,n=0){let r=Zh(gm.get(this)||this.topNode,e,n,!1);return gm.set(this,r),r}resolveInner(e,n=0){let r=Zh(A$.get(this)||this.topNode,e,n,!0);return A$.set(this,r),r}resolveStack(e,n=0){return ZJ(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:s=this.length}=e,l=e.mode||0,c=(l&dt.IncludeAnonymous)>0;for(let u=this.cursor(l|dt.IncludeAnonymous);;){let f=!1;if(u.from<=s&&u.to>=i&&(!c&&u.type.isAnonymous||n(u)!==!1)){if(u.firstChild())continue;f=!0}for(;f&&r&&(c||!u.type.isAnonymous)&&r(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:Sk(fn.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new ot(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new ot(fn.none,n,r,i)))}static build(e){return qJ(e)}}ot.empty=new ot(fn.none,[],[],0);class vk{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 vk(this.buffer,this.index)}}class el{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return fn.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],r=this.buffer[e+3],i=this.set.types[n],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let l=[];for(;e<r;)l.push(this.childString(e)),e=this.buffer[e+3];return s+"("+l.join(",")+")"}findChild(e,n,r,i,s){let{buffer:l}=this,c=-1;for(let u=e;u!=n&&!(WM(s,i,l[u+1],l[u+2])&&(c=u,r>0));u=l[u+3]);return c}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),l=0;for(let c=e,u=0;c<n;){s[u++]=i[c++],s[u++]=i[c++]-r;let f=s[u++]=i[c++]-r;s[u++]=i[c++]-e,l=Math.max(l,f)}return new el(s,l,this.set)}}function WM(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Zh(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let l=!r&&t instanceof li&&t.index<0?null:t.parent;if(!l)return t;t=l}let s=r?0:dt.IgnoreOverlays;if(r)for(let l=t,c=l.parent;c;l=c,c=l.parent)l instanceof li&&l.index<0&&((i=c.enter(e,n,s))===null||i===void 0?void 0:i.from)!=l.from&&(t=c);for(;;){let l=t.enter(e,n,s);if(!l)return t;t=l}}class GM{cursor(e=0){return new Ag(this,e)}getChild(e,n=null,r=null){let i=R$(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return R$(this,e,n,r)}resolve(e,n=0){return Zh(this,e,n,!1)}resolveInner(e,n=0){return Zh(this,e,n,!0)}matchContext(e){return B1(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}let li=class Zm extends GM{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,s=0){for(let l=this;;){for(let{children:c,positions:u}=l._tree,f=n>0?c.length:-1;e!=f;e+=n){let p=c[e],m=u[e]+l.from,O;if(!(!(s&dt.EnterBracketed&&p instanceof ot&&(O=Tc.get(p))&&!O.overlay&&O.bracketed&&r>=m&&r<=m+p.length)&&!WM(i,r,m,m+p.length))){if(p instanceof el){if(s&dt.ExcludeBuffers)continue;let x=p.findChild(0,p.buffer.length,n,r-m,i);if(x>-1)return new es(new LJ(l,p,e,m),null,x)}else if(s&dt.IncludeAnonymous||!p.type.isAnonymous||yk(p)){let x;if(!(s&dt.IgnoreMounts)&&(x=Tc.get(p))&&!x.overlay)return new Zm(x.tree,m,e,l);let v=new Zm(p,m,e,l);return s&dt.IncludeAnonymous||!v.type.isAnonymous?v:v.nextChild(n<0?p.children.length-1:0,n,r,i,s)}}}if(s&dt.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+n:e=n<0?-1:l._parent._tree.children.length,l=l._parent,!l))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,r=0){let i;if(!(r&dt.IgnoreOverlays)&&(i=Tc.get(this._tree))&&i.overlay){let s=e-this.from,l=r&dt.EnterBracketed&&i.bracketed;for(let{from:c,to:u}of i.overlay)if((n>0||l?c<=s:c<s)&&(n<0||l?u>=s:u>s))return new Zm(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}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 R$(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let l=!1;!l;)if(l=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function B1(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class LJ{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class es extends GM{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,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new es(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,r=0){if(r&dt.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new es(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 es(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 es(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let l=r.buffer[this.index+1];e.push(r.slice(i,s,l)),n.push(0)}return new ot(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function FM(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let l=t[s];(l.from>n.from||l.to<n.to)&&(n=l,e=s)}let r=n instanceof li&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new XJ(i,n)}class XJ{constructor(e,n){this.heads=e,this.node=n}get next(){return FM(this.heads)}}function ZJ(t,e,n){let r=t.resolveInner(e,n),i=null;for(let s=r instanceof li?r:r.context.parent;s;s=s.parent)if(s.index<0){let l=s.parent;(i||(i=[r])).push(l.resolve(e,n)),s=l}else{let l=Tc.get(s.tree);if(l&&l.overlay&&l.overlay[0].from<=e&&l.overlay[l.overlay.length-1].to>=e){let c=new li(l.tree,l.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Zh(c,e,n,!1))}}return i?FM(i):r}class Ag{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&~dt.EnterBracketed,e instanceof li)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.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:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof li?(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,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);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,r=this.mode){return this.buffer?r&dt.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&dt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&dt.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,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<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,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let s=n+e,l=e<0?-1:r._tree.children.length;s!=l;s+=e){let c=r._tree.children[s];if(this.mode&dt.IncludeAnonymous||c instanceof el||!c.type.isAnonymous||yk(c))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,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let l=e;l;l=l._parent)if(l.index==i){if(i==this.index)return l;n=l,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)n=new es(this.buffer,n,this.stack[i]);return this.bufferNode=new es(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return B1(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return B1(this._tree,e,i);let l=r[n.buffer[this.stack[s]]];if(!l.isAnonymous){if(e[i]&&e[i]!=l.name)return!1;i--}}return!0}}function yk(t){return t.children.some(e=>e instanceof el||!e.type.isAnonymous||yk(e))}function qJ(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=UM,reused:s=[],minRepeatType:l=r.types.length}=t,c=Array.isArray(n)?new vk(n,n.length):n,u=r.types,f=0,p=0;function m(M,R,_,V,G,D){let{id:L,start:Z,end:te,size:I}=c,B=p,X=f;if(I<0)if(c.next(),I==-1){let P=s[L];_.push(P),V.push(Z-M);return}else if(I==-3){f=L;return}else if(I==-4){p=L;return}else throw new RangeError(`Unrecognized record size: ${I}`);let q=u[L],K,ne,$=Z-M;if(te-Z<=i&&(ne=k(c.pos-R,G))){let P=new Uint16Array(ne.size-ne.skip),U=c.pos-ne.size,T=P.length;for(;c.pos>U;)T=w(ne.start,P,T);K=new el(P,te-ne.start,r),$=ne.start-M}else{let P=c.pos-I;c.next();let U=[],T=[],J=L>=l?L:-1,W=0,re=te;for(;c.pos>P;)J>=0&&c.id==J&&c.size>=0?(c.end<=re-i&&(v(U,T,Z,W,c.end,re,J,B,X),W=U.length,re=c.end),c.next()):D>2500?O(Z,P,U,T):m(Z,P,U,T,J,D+1);if(J>=0&&W>0&&W<U.length&&v(U,T,Z,W,Z,re,J,B,X),U.reverse(),T.reverse(),J>-1&&W>0){let oe=x(q,X);K=Sk(q,U,T,0,U.length,0,te-Z,oe,oe)}else K=S(q,U,T,te-Z,B-te,X)}_.push(K),V.push($)}function O(M,R,_,V){let G=[],D=0,L=-1;for(;c.pos>R;){let{id:Z,start:te,end:I,size:B}=c;if(B>4)c.next();else{if(L>-1&&te<L)break;L<0&&(L=I-i),G.push(Z,te,I),D++,c.next()}}if(D){let Z=new Uint16Array(D*4),te=G[G.length-2];for(let I=G.length-3,B=0;I>=0;I-=3)Z[B++]=G[I],Z[B++]=G[I+1]-te,Z[B++]=G[I+2]-te,Z[B++]=B;_.push(new el(Z,G[2]-te,r)),V.push(te-M)}}function x(M,R){return(_,V,G)=>{let D=0,L=_.length-1,Z,te;if(L>=0&&(Z=_[L])instanceof ot){if(!L&&Z.type==M&&Z.length==G)return Z;(te=Z.prop(Re.lookAhead))&&(D=V[L]+Z.length+te)}return S(M,_,V,G,D,R)}}function v(M,R,_,V,G,D,L,Z,te){let I=[],B=[];for(;M.length>V;)I.push(M.pop()),B.push(R.pop()+_-G);M.push(S(r.types[L],I,B,D-G,Z-D,te)),R.push(G-_)}function S(M,R,_,V,G,D,L){if(D){let Z=[Re.contextHash,D];L=L?[Z].concat(L):[Z]}if(G>25){let Z=[Re.lookAhead,G];L=L?[Z].concat(L):[Z]}return new ot(M,R,_,V,L)}function k(M,R){let _=c.fork(),V=0,G=0,D=0,L=_.end-i,Z={size:0,start:0,skip:0};e:for(let te=_.pos-M;_.pos>te;){let I=_.size;if(_.id==R&&I>=0){Z.size=V,Z.start=G,Z.skip=D,D+=4,V+=4,_.next();continue}let B=_.pos-I;if(I<0||B<te||_.start<L)break;let X=_.id>=l?4:0,q=_.start;for(_.next();_.pos>B;){if(_.size<0)if(_.size==-3||_.size==-4)X+=4;else break e;else _.id>=l&&(X+=4);_.next()}G=q,V+=I,D+=X}return(R<0||V==M)&&(Z.size=V,Z.start=G,Z.skip=D),Z.size>4?Z:void 0}function w(M,R,_){let{id:V,start:G,end:D,size:L}=c;if(c.next(),L>=0&&V<l){let Z=_;if(L>4){let te=c.pos-(L-4);for(;c.pos>te;)_=w(M,R,_)}R[--_]=Z,R[--_]=D-M,R[--_]=G-M,R[--_]=V}else L==-3?f=V:L==-4&&(p=V);return _}let N=[],C=[];for(;c.pos>0;)m(t.start||0,t.bufferStart||0,N,C,-1,0);let E=(e=t.length)!==null&&e!==void 0?e:N.length?C[0]+N[0].length:0;return new ot(u[t.topID],N.reverse(),C.reverse(),E)}const _$=new WeakMap;function qm(t,e){if(!t.isAnonymous||e instanceof el||e.type!=t)return 1;let n=_$.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof ot)){n=1;break}n+=qm(t,r)}_$.set(e,n)}return n}function Sk(t,e,n,r,i,s,l,c,u){let f=0;for(let v=r;v<i;v++)f+=qm(t,e[v]);let p=Math.ceil(f*1.5/8),m=[],O=[];function x(v,S,k,w,N){for(let C=k;C<w;){let E=C,M=S[C],R=qm(t,v[C]);for(C++;C<w;C++){let _=qm(t,v[C]);if(R+_>=p)break;R+=_}if(C==E+1){if(R>p){let _=v[E];x(_.children,_.positions,0,_.children.length,S[E]+N);continue}m.push(v[E])}else{let _=S[C-1]+v[C-1].length-M;m.push(Sk(t,v,S,E,C,M,_,null,u))}O.push(M+N-s)}}return x(e,n,r,i,0),(c||u)(m,O,l)}class HM{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof es?this.setBuffer(e.context.buffer,e.index,n):e instanceof li&&this.map.set(e.tree,n)}get(e){return e instanceof es?this.getBuffer(e.context.buffer,e.index):e instanceof li?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 Ys{constructor(e,n,r,i,s=!1,l=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new Ys(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,l=e.length?e[0]:null;for(let c=0,u=0,f=0;;c++){let p=c<n.length?n[c]:null,m=p?p.fromA:1e9;if(m-u>=r)for(;l&&l.from<m;){let O=l;if(u>=O.from||m<=O.to||f){let x=Math.max(O.from,u)-f,v=Math.min(O.to,m)-f;O=x>=v?null:new Ys(x,v,O.tree,O.offset+f,c>0,!!p)}if(O&&i.push(O),l.to>m)break;l=s<e.length?e[s++]:null}if(!p)break;u=p.toA,f=p.toA-p.toB}return i}}class wk{startParse(e,n,r){return typeof e=="string"&&(e=new IJ(e)),r=r?r.length?r.map(i=>new ti(i.from,i.to)):[new ti(0,0)]:[new ti(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let s=i.advance();if(s)return s}}}class IJ{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 KM(t){return(e,n,r,i)=>new YJ(e,t,n,r,i)}class M${constructor(e,n,r,i,s,l){this.parser=e,this.parse=n,this.overlay=r,this.bracketed=i,this.target=s,this.from=l}}function z$(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class BJ{constructor(e,n,r,i,s,l,c,u){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=s,this.bracketed=l,this.target=c,this.prev=u,this.depth=0,this.ranges=[]}}const Y1=new Re({perNode:!0});class YJ{constructor(e,n,r,i,s){this.nest=n,this.input=r,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new ot(r.type,r.children,r.positions,r.length,r.propValues.concat([[Y1,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[Re.mounted.id]=new Tc(n,e.overlay,e.parser,e.bracketed),e.target.props=r}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 WJ(this.fragments),n=null,r=null,i=new Ag(new li(this.baseTree,this.ranges[0].from,0,null),dt.IncludeAnonymous|dt.IgnoreMounts);e:for(let s,l;;){let c=!0,u;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)c=!1;else if(e.hasNode(i)){if(n){let f=n.mounts.find(p=>p.frag.from<=i.from&&p.frag.to>=i.to&&p.mount.overlay);if(f)for(let p of f.mount.overlay){let m=p.from+f.pos,O=p.to+f.pos;m>=i.from&&O<=i.to&&!n.ranges.some(x=>x.from<O&&x.to>m)&&n.ranges.push({from:m,to:O})}}c=!1}else if(r&&(l=VJ(r.ranges,i.from,i.to)))c=l!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.from<i.to||!s.overlay)){i.tree||(UJ(i),n&&n.depth++,r&&r.depth++);let f=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")n=new BJ(s.parser,s.overlay,f,this.inner.length,i.from,!!s.bracketed,i.tree,n);else{let p=X$(this.ranges,s.overlay||(i.from<i.to?[new ti(i.from,i.to)]:[]));p.length&&z$(p),(p.length||!s.overlay)&&this.inner.push(new M$(s.parser,p.length?s.parser.startParse(this.input,Z$(f,p),p):s.parser.startParse(""),s.overlay?s.overlay.map(m=>new ti(m.from-i.from,m.to-i.from)):null,!!s.bracketed,i.tree,p.length?p[0].from:i.from)),s.overlay?p.length&&(r={ranges:p,depth:0,prev:r}):c=!1}}else if(n&&(u=n.predicate(i))&&(u===!0&&(u=new ti(i.from,i.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(c&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let f=X$(this.ranges,n.ranges);f.length&&(z$(f),this.inner.splice(n.index,0,new M$(n.parser,n.parser.startParse(this.input,Z$(n.mounts,f),f),n.ranges.map(p=>new ti(p.from-n.start,p.to-n.start)),n.bracketed,n.target,f[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function VJ(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function D$(t,e,n,r,i,s){if(e<n){let l=t.buffer[e+1];r.push(t.slice(e,n,l)),i.push(l-s)}}function UJ(t){let{node:e}=t,n=[],r=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let i=t.tree,s=i.children.indexOf(r),l=i.children[s],c=l.buffer,u=[s];function f(p,m,O,x,v,S){let k=n[S],w=[],N=[];D$(l,p,k,w,N,x);let C=c[k+1],E=c[k+2];u.push(w.length);let M=S?f(k+4,c[k+3],l.set.types[c[k]],C,E-C,S-1):e.toTree();return w.push(M),N.push(C-x),D$(l,c[k+3],m,w,N,x),new ot(O,w,N,v)}i.children[s]=f(0,c.length,fn.none,0,l.length,n.length-1);for(let p of u){let m=t.tree.children[p],O=t.tree.positions[p];t.yield(new li(m,O+t.from,p,t._tree))}}class L${constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(dt.IncludeAnonymous|dt.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from<r;)n.to>=e&&n.enter(r,1,dt.IgnoreOverlays|dt.ExcludeBuffers)||n.next(!1)||(this.done=!0)}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 ot)n=n.children[0];else break}return!1}}let WJ=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(Y1))!==null&&n!==void 0?n:r.to,this.inner=new L$(r.tree,-r.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(Y1))!==null&&e!==void 0?e:n.to,this.inner=new L$(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let l=(r=s.tree)===null||r===void 0?void 0:r.prop(Re.mounted);if(l&&l.parser==n)for(let c=this.fragI;c<this.fragments.length;c++){let u=this.fragments[c];if(u.from>=s.to)break;u.tree==this.curFrag.tree&&i.push({frag:u,pos:s.from-u.offset,mount:l})}}}return i}};function X$(t,e){let n=null,r=e;for(let i=1,s=0;i<t.length;i++){let l=t[i-1].to,c=t[i].from;for(;s<r.length;s++){let u=r[s];if(u.from>=c)break;u.to<=l||(n||(r=n=e.slice()),u.from<l?(n[s]=new ti(u.from,l),u.to>c&&n.splice(s+1,0,new ti(c,u.to))):u.to>c?n[s--]=new ti(c,u.to):n.splice(s--,1))}}return r}function GJ(t,e,n,r){let i=0,s=0,l=!1,c=!1,u=-1e9,f=[];for(;;){let p=i==t.length?1e9:l?t[i].to:t[i].from,m=s==e.length?1e9:c?e[s].to:e[s].from;if(l!=c){let O=Math.max(u,n),x=Math.min(p,m,r);O<x&&f.push(new ti(O,x))}if(u=Math.min(p,m),u==1e9)break;p==u&&(l?(l=!1,i++):l=!0),m==u&&(c?(c=!1,s++):c=!0)}return f}function Z$(t,e){let n=[];for(let{pos:r,mount:i,frag:s}of t){let l=r+(i.overlay?i.overlay[0].from:0),c=l+i.tree.length,u=Math.max(s.from,l),f=Math.min(s.to,c);if(i.overlay){let p=i.overlay.map(O=>new ti(O.from+r,O.to+r)),m=GJ(e,p,u,f);for(let O=0,x=u;;O++){let v=O==m.length,S=v?f:m[O].from;if(S>x&&n.push(new Ys(x,S,i.tree,-l,s.from>=x||s.openStart,s.to<=S||s.openEnd)),v)break;x=m[O].to}}else n.push(new Ys(u,f,i.tree,-l,s.from>=l||s.openStart,s.to<=c||s.openEnd))}return n}let FJ=0,Wi=class V1{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=FJ++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof V1&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new V1(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new Rg(e);return r=>r.modified.indexOf(n)>-1?r:Rg.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}},HJ=0;class Rg{constructor(e){this.name=e,this.instances=[],this.id=HJ++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(c=>c.base==e&&KJ(n,c.modified));if(r)return r;let i=[],s=new Wi(e.name,i,e,n);for(let c of n)c.instances.push(s);let l=JJ(n);for(let c of e.set)if(!c.modified.length)for(let u of l)i.push(Rg.get(c,u));return s}}function KJ(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function JJ(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function bo(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],l=2,c=i;for(let m=0;;){if(c=="..."&&m>0&&m+3==i.length){l=1;break}let O=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c);if(!O)throw new RangeError("Invalid path: "+i);if(s.push(O[0]=="*"?"":O[0][0]=='"'?JSON.parse(O[0]):O[0]),m+=O[0].length,m==i.length)break;let x=i[m++];if(m==i.length&&x=="!"){l=0;break}if(x!="/")throw new RangeError("Invalid path: "+i);c=i.slice(m)}let u=s.length-1,f=s[u];if(!f)throw new RangeError("Invalid path: "+i);let p=new qh(r,l,u>0?s.slice(0,u):null);e[f]=p.sort(e[f])}}return JM.add(e)}const JM=new Re({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let s=new qh(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class qh{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}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}}qh.empty=new qh([],2,null);function e4(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 l of s.tag)n[l.id]=s.class;let{scope:r,all:i=null}=e||{};return{style:s=>{let l=i;for(let c of s)for(let u of c.set){let f=n[u.id];if(f){l=l?l+" "+f:f;break}}return l},scope:r}}function eee(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function tee(t,e,n,r=0,i=t.length){let s=new nee(r,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),r,i,"",s.highlighters),s.flush(i)}class nee{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,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,r,i,s){let{type:l,from:c,to:u}=e;if(c>=r||u<=n)return;l.isTop&&(s=this.highlighters.filter(x=>!x.scope||x.scope(l)));let f=i,p=ree(e)||qh.empty,m=eee(s,p.tags);if(m&&(f&&(f+=" "),f+=m,p.mode==1&&(i+=(i?" ":"")+m)),this.startSpan(Math.max(n,c),f),p.opaque)return;let O=e.tree&&e.tree.prop(Re.mounted);if(O&&O.overlay){let x=e.node.enter(O.overlay[0].from+c,1),v=this.highlighters.filter(k=>!k.scope||k.scope(O.tree.type)),S=e.firstChild();for(let k=0,w=c;;k++){let N=k<O.overlay.length?O.overlay[k]:null,C=N?N.from+c:u,E=Math.max(n,w),M=Math.min(r,C);if(E<M&&S)for(;e.from<M&&(this.highlightRange(e,E,M,i,s),this.startSpan(Math.min(M,e.to),f),!(e.to>=C||!e.nextSibling())););if(!N||C>r)break;w=N.to+c,w>n&&(this.highlightRange(x.cursor(),Math.max(n,N.from+c),Math.min(r,w),"",v),this.startSpan(Math.min(r,w),f))}S&&e.parent()}else if(e.firstChild()){O&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,s),this.startSpan(Math.min(r,e.to),f)}while(e.nextSibling());e.parent()}}}function ree(t){let e=t.type.prop(JM);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const be=Wi.define,Om=be(),Ra=be(),q$=be(Ra),I$=be(Ra),_a=be(),xm=be(_a),Zv=be(_a),qi=be(),Ql=be(qi),Xi=be(),Zi=be(),U1=be(),Td=be(U1),bm=be(),z={comment:Om,lineComment:be(Om),blockComment:be(Om),docComment:be(Om),name:Ra,variableName:be(Ra),typeName:q$,tagName:be(q$),propertyName:I$,attributeName:be(I$),className:be(Ra),labelName:be(Ra),namespace:be(Ra),macroName:be(Ra),literal:_a,string:xm,docString:be(xm),character:be(xm),attributeValue:be(xm),number:Zv,integer:be(Zv),float:be(Zv),bool:be(_a),regexp:be(_a),escape:be(_a),color:be(_a),url:be(_a),keyword:Xi,self:be(Xi),null:be(Xi),atom:be(Xi),unit:be(Xi),modifier:be(Xi),operatorKeyword:be(Xi),controlKeyword:be(Xi),definitionKeyword:be(Xi),moduleKeyword:be(Xi),operator:Zi,derefOperator:be(Zi),arithmeticOperator:be(Zi),logicOperator:be(Zi),bitwiseOperator:be(Zi),compareOperator:be(Zi),updateOperator:be(Zi),definitionOperator:be(Zi),typeOperator:be(Zi),controlOperator:be(Zi),punctuation:U1,separator:be(U1),bracket:Td,angleBracket:be(Td),squareBracket:be(Td),paren:be(Td),brace:be(Td),content:qi,heading:Ql,heading1:be(Ql),heading2:be(Ql),heading3:be(Ql),heading4:be(Ql),heading5:be(Ql),heading6:be(Ql),contentSeparator:be(qi),list:be(qi),quote:be(qi),emphasis:be(qi),strong:be(qi),link:be(qi),monospace:be(qi),strikethrough:be(qi),inserted:be(),deleted:be(),changed:be(),invalid:be(),meta:bm,documentMeta:be(bm),annotation:be(bm),processingInstruction:be(bm),definition:Wi.defineModifier("definition"),constant:Wi.defineModifier("constant"),function:Wi.defineModifier("function"),standard:Wi.defineModifier("standard"),local:Wi.defineModifier("local"),special:Wi.defineModifier("special")};for(let t in z){let e=z[t];e instanceof Wi&&(e.name=t)}e4([{tag:z.link,class:"tok-link"},{tag:z.heading,class:"tok-heading"},{tag:z.emphasis,class:"tok-emphasis"},{tag:z.strong,class:"tok-strong"},{tag:z.keyword,class:"tok-keyword"},{tag:z.atom,class:"tok-atom"},{tag:z.bool,class:"tok-bool"},{tag:z.url,class:"tok-url"},{tag:z.labelName,class:"tok-labelName"},{tag:z.inserted,class:"tok-inserted"},{tag:z.deleted,class:"tok-deleted"},{tag:z.literal,class:"tok-literal"},{tag:z.string,class:"tok-string"},{tag:z.number,class:"tok-number"},{tag:[z.regexp,z.escape,z.special(z.string)],class:"tok-string2"},{tag:z.variableName,class:"tok-variableName"},{tag:z.local(z.variableName),class:"tok-variableName tok-local"},{tag:z.definition(z.variableName),class:"tok-variableName tok-definition"},{tag:z.special(z.variableName),class:"tok-variableName2"},{tag:z.definition(z.propertyName),class:"tok-propertyName tok-definition"},{tag:z.typeName,class:"tok-typeName"},{tag:z.namespace,class:"tok-namespace"},{tag:z.className,class:"tok-className"},{tag:z.macroName,class:"tok-macroName"},{tag:z.propertyName,class:"tok-propertyName"},{tag:z.operator,class:"tok-operator"},{tag:z.comment,class:"tok-comment"},{tag:z.meta,class:"tok-meta"},{tag:z.invalid,class:"tok-invalid"},{tag:z.punctuation,class:"tok-punctuation"}]);var qv;const Zl=new Re;function kk(t){return Ae.define({combine:t?e=>e.concat(t):void 0})}const jk=new Re;class ni{constructor(e,n,r=[],i=""){this.data=e,this.name=i,st.prototype.hasOwnProperty("tree")||Object.defineProperty(st.prototype,"tree",{get(){return Gt(this)}}),this.parser=n,this.extension=[iu.of(this),st.languageData.of((s,l,c)=>{let u=B$(s,l,c),f=u.type.prop(Zl);if(!f)return[];let p=s.facet(f),m=u.type.prop(jk);if(m){let O=u.resolve(l-u.from,c);for(let x of m)if(x.test(O,s)){let v=s.facet(x.facet);return x.type=="replace"?v:v.concat(p)}}return p})].concat(r)}isActiveAt(e,n,r=-1){return B$(e,n,r).type.prop(Zl)==this.data}findRegions(e){let n=e.facet(iu);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,l)=>{if(s.prop(Zl)==this.data){r.push({from:l,to:l+s.length});return}let c=s.prop(Re.mounted);if(c){if(c.tree.prop(Zl)==this.data){if(c.overlay)for(let u of c.overlay)r.push({from:u.from+l,to:u.to+l});else r.push({from:l,to:l+s.length});return}else if(c.overlay){let u=r.length;if(i(c.tree,c.overlay[0].from+l),r.length>u)return}}for(let u=0;u<s.children.length;u++){let f=s.children[u];f instanceof ot&&i(f,s.positions[u]+l)}};return i(Gt(e),0),r}get allowsNesting(){return!0}}ni.setState=Mt.define();function B$(t,e,n){let r=t.facet(iu),i=Gt(t).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,n,dt.ExcludeBuffers|dt.EnterBracketed))s.type.isTop&&(i=s);return i}class lo extends ni{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=kk(e.languageData);return new lo(n,e.parser.configure({props:[Zl.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new lo(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Gt(t){let e=t.field(ni.state,!1);return e?e.tree:ot.empty}class iee{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 r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let $d=null;class Ih{constructor(e,n,r=[],i,s,l,c,u){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=l,this.skipped=c,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Ih(e,n,[],ot.empty,0,r,[],null)}startParse(){return this.parser.startParse(new iee(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=ot.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}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 i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Ys.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,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(Ys.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=$d;$d=this;try{return e()}finally{$d=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=Y$(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:l,skipped:c}=this;if(this.takeTree(),!e.empty){let u=[];if(e.iterChangedRanges((f,p,m,O)=>u.push({fromA:f,toA:p,fromB:m,toB:O})),r=Ys.applyChanges(r,u),i=ot.empty,s=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){c=[];for(let f of this.skipped){let p=e.mapPos(f.from,1),m=e.mapPos(f.to,-1);p<m&&c.push({from:p,to:m})}}}return new Ih(this.parser,n,r,i,s,l,c,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 r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=Y$(this.fragments,i,s),this.skipped.splice(r--,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 wk{createParse(n,r,i){let s=i[0].from,l=i[i.length-1].to;return{parsedPos:s,advance(){let u=$d;if(u){for(let f of i)u.tempSkipped.push(f);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=l,new ot(fn.none,[],[],l-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 $d}}function Y$(t,e,n){return Ys.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class ru{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),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new ru(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Ih.create(e.facet(iu).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new ru(r)}}ni.state=ta.define({create:ru.init,update(t,e){for(let n of e.effects)if(n.is(ni.setState))return n.value;return e.startState.facet(iu)!=e.state.facet(iu)?ru.init(e.state):t.apply(e)}});let t4=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(t4=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Iv=typeof navigator<"u"&&(!((qv=navigator.scheduling)===null||qv===void 0)&&qv.isInputPending)?()=>navigator.scheduling.isInputPending():null,see=Ja.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(ni.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(ni.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=t4(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:r,viewport:{to:i}}=this.view,s=r.field(ni.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,e&&!Iv?Math.max(25,e.timeRemaining()-5):1e9),c=s.context.treeLen<i&&r.doc.length>i+1e3,u=s.context.work(()=>Iv&&Iv()||Date.now()>l,i+(c?0:1e5));this.chunkBudget-=Date.now()-n,(u||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ni.setState.of(new ru(s.context))})),this.chunkBudget>0&&!(u&&!c)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ji(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()}}}),iu=Ae.define({combine(t){return t.length?t[0]:null},enables:t=>[ni.state,see,Te.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class su{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class _g{constructor(e,n,r,i,s,l=void 0){this.name=e,this.alias=n,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=l,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:r}=e;if(!n){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(r)}return new _g(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,n,r)}static matchFilename(e,n){for(let i of e)if(i.filename&&i.filename.test(n))return i;let r=/\.([^.]+)$/.exec(n);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,n,r=!0){n=n.toLowerCase();for(let i of e)if(i.alias.some(s=>s==n))return i;if(r)for(let i of e)for(let s of i.alias){let l=n.indexOf(s);if(l>-1&&(s.length>2||!/\w/.test(n[l-1])&&!/\w/.test(n[l+s.length])))return i}return null}}const aee=Ae.define(),Qf=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 Mg(t){let e=t.facet(Qf);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function zg(t,e){let n="",r=t.tabSize,i=t.facet(Qf)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let s=0;s<e;s++)n+=i;return n}function n4(t,e){t instanceof st&&(t=new vO(t));for(let r of t.state.facet(aee)){let i=r(t,e);if(i!==void 0)return i}let n=Gt(t.state);return n.length>=e?lee(t,n,e):null}class vO{constructor(e,n={}){this.state=e,this.options=n,this.unit=Mg(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.countColumn(r,e-i),l=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return l>-1&&(s+=l-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,n=e.length){return Ws(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let l=s(i);if(l>-1)return l}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Su=new Re;function lee(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let l=i;l&&!(l.from<r.node.from||l.to>r.node.to||l.from==r.node.from&&l.type==r.node.type);l=l.parent)s.push(l);for(let l=s.length-1;l>=0;l--)r={node:s[l],next:r}}return r4(r,t,n)}function r4(t,e,n){for(let r=t;r;r=r.next){let i=cee(r.node);if(i)return i(Qk.create(e,n,r))}return 0}function oee(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function cee(t){let e=t.type.prop(Su);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Re.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return l=>i4(l,!0,1,void 0,s&&!oee(l)?i.from:void 0)}return t.parent==null?uee:null}function uee(){return 0}class Qk extends vO{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Qk(e,n,r)}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 r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(dee(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return r4(this.context.next,this.base,this.pos)}}function dee(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function hee(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),l=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let c=n.to;;){let u=e.childAfter(c);if(!u||u==r)return null;if(!u.type.isSkipped){if(u.from>=l)return null;let f=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+f}}c=u.to}}function W1({closing:t,align:e=!0,units:n=1}){return r=>i4(r,e,n,t)}function i4(t,e,n,r,i){let s=t.textAfter,l=s.match(/^\s*/)[0].length,c=r&&s.slice(l,l+r.length)==r||i==t.pos+l,u=e?hee(t):null;return u?c?t.column(u.from):t.column(u.to):t.baseIndent+(c?0:t.unit*n)}const fee=t=>t.baseIndent;function Im({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const pee=Ae.define(),wu=new Re;function Ck(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 Cf{constructor(e,n){this.specs=e;let r;function i(c){let u=Fa.newName();return(r||(r=Object.create(null)))["."+u]=c,u}const s=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,l=n.scope;this.scope=l instanceof ni?c=>c.prop(Zl)==l.data:l?c=>c==l:void 0,this.style=e4(e.map(c=>({tag:c.tag,class:c.class||i(Object.assign({},c,{tag:null}))})),{all:s}).style,this.module=r?new Fa(r):null,this.themeType=n.themeType}static define(e,n){return new Cf(e,n||{})}}const G1=Ae.define(),mee=Ae.define({combine(t){return t.length?[t[0]]:null}});function Bv(t){let e=t.facet(G1);return e.length?e:t.facet(mee)}function s4(t,e){let n=[Oee],r;return t instanceof Cf&&(t.module&&n.push(Te.styleModule.of(t.module)),r=t.themeType),r?n.push(G1.computeN([Te.darkTheme],i=>i.facet(Te.darkTheme)==(r=="dark")?[t]:[])):n.push(G1.of(t)),n}class gee{constructor(e){this.markCache=Object.create(null),this.tree=Gt(e.state),this.decorations=this.buildDeco(e,Bv(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Gt(e.state),r=Bv(e.state),i=r!=Bv(e.startState),{viewport:s}=e.view,l=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!i&&n.type==this.tree.type&&l>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=l):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return $t.none;let r=new Rh;for(let{from:i,to:s}of e.visibleRanges)tee(this.tree,n,(l,c,u)=>{r.add(l,c,this.markCache[u]||(this.markCache[u]=$t.mark({class:u})))},i,s);return r.finish()}}const Oee=yf.high(Ja.fromClass(gee,{decorations:t=>t.decorations})),xee=Cf.define([{tag:z.meta,color:"#404740"},{tag:z.link,textDecoration:"underline"},{tag:z.heading,textDecoration:"underline",fontWeight:"bold"},{tag:z.emphasis,fontStyle:"italic"},{tag:z.strong,fontWeight:"bold"},{tag:z.strikethrough,textDecoration:"line-through"},{tag:z.keyword,color:"#708"},{tag:[z.atom,z.bool,z.url,z.contentSeparator,z.labelName],color:"#219"},{tag:[z.literal,z.inserted],color:"#164"},{tag:[z.string,z.deleted],color:"#a11"},{tag:[z.regexp,z.escape,z.special(z.string)],color:"#e40"},{tag:z.definition(z.variableName),color:"#00f"},{tag:z.local(z.variableName),color:"#30a"},{tag:[z.typeName,z.namespace],color:"#085"},{tag:z.className,color:"#167"},{tag:[z.special(z.variableName),z.macroName],color:"#256"},{tag:z.definition(z.propertyName),color:"#00c"},{tag:z.comment,color:"#940"},{tag:z.invalid,color:"#f00"}]),bee=1e4,vee="()[]{}",a4=new Re;function F1(t,e,n){let r=t.prop(e<0?Re.openedBy:Re.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function H1(t){let e=t.type.prop(a4);return e?e(t.node):t}function yc(t,e,n,r={}){let i=r.maxScanDistance||bee,s=r.brackets||vee,l=Gt(t),c=l.resolveInner(e,n);for(let u=c;u;u=u.parent){let f=F1(u.type,n,s);if(f&&u.from<u.to){let p=H1(u);if(p&&(n>0?e>=p.from&&e<p.to:e>p.from&&e<=p.to))return yee(t,e,n,u,p,f,s)}}return See(t,e,n,l,c.type,i,s)}function yee(t,e,n,r,i,s,l){let c=r.parent,u={from:i.from,to:i.to},f=0,p=c==null?void 0:c.cursor();if(p&&(n<0?p.childBefore(r.from):p.childAfter(r.to)))do if(n<0?p.to<=r.from:p.from>=r.to){if(f==0&&s.indexOf(p.type.name)>-1&&p.from<p.to){let m=H1(p);return{start:u,end:m?{from:m.from,to:m.to}:void 0,matched:!0}}else if(F1(p.type,n,l))f++;else if(F1(p.type,-n,l)){if(f==0){let m=H1(p);return{start:u,end:m&&m.from<m.to?{from:m.from,to:m.to}:void 0,matched:!1}}f--}}while(n<0?p.prevSibling():p.nextSibling());return{start:u,matched:!1}}function See(t,e,n,r,i,s,l){let c=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=l.indexOf(c);if(u<0||u%2==0!=n>0)return null;let f={from:n<0?e-1:e,to:n>0?e+1:e},p=t.doc.iterRange(e,n>0?t.doc.length:0),m=0;for(let O=0;!p.next().done&&O<=s;){let x=p.value;n<0&&(O+=x.length);let v=e+O*n;for(let S=n>0?0:x.length-1,k=n>0?x.length:-1;S!=k;S+=n){let w=l.indexOf(x[S]);if(!(w<0||r.resolveInner(v+S,1).type!=i))if(w%2==0==n>0)m++;else{if(m==1)return{start:f,end:{from:v+S,to:v+S+1},matched:w>>1==u>>1};m--}}n>0&&(O+=x.length)}return p.done?{start:f,matched:!1}:null}const wee=Object.create(null),V$=[fn.none],U$=[],W$=Object.create(null),kee=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"]])kee[t]=jee(wee,e);function Yv(t,e){U$.indexOf(t)>-1||(U$.push(t),console.warn(e))}function jee(t,e){let n=[];for(let c of e.split(" ")){let u=[];for(let f of c.split(".")){let p=t[f]||z[f];p?typeof p=="function"?u.length?u=u.map(p):Yv(f,`Modifier ${f} used at start of tag`):u.length?Yv(f,`Tag ${f} used as modifier`):u=Array.isArray(p)?p:[p]:Yv(f,`Unknown highlighting tag ${f}`)}for(let f of u)n.push(f)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(c=>c.id),s=W$[i];if(s)return s.id;let l=W$[i]=fn.define({id:V$.length,name:r,props:[bo({[r]:n})]});return V$.push(l),l.id}cn.RTL,cn.LTR;class Qee{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=Gt(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),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),s=i.search($ee(e));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function G$(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 Cee(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let s=1;s<i.length;s++)n[i[s]]=!0}let r=G$(e)+G$(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function Nee(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:Cee(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:n}:null}}function Tee(t,e){return n=>{for(let r=Gt(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}function $ee(t,e){var n;let{source:r}=t,i=r[r.length-1]!="$";return i?new RegExp(`(?:${r})${i?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":""):t}const Eee=na.define(),Pee=Te.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"},".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 Aee{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class Nk{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Gn.TrackDel),r=e.mapPos(this.to,1,Gn.TrackDel);return n==null||r==null?null:new Nk(this.field,n,r)}}class Tk{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],s=e.doc.lineAt(n),l=/^\s*/.exec(s.text)[0];for(let u of this.lines){if(r.length){let f=l,p=/^\t*/.exec(u)[0].length;for(let m=0;m<p;m++)f+=e.facet(Qf);i.push(n+f.length-p),u=f+u.slice(p)}r.push(u),n+=u.length+1}let c=this.fieldPositions.map(u=>new Nk(u.field,i[u.line]+u.from,i[u.line]+u.to));return{text:r,ranges:c}}static parse(e){let n=[],r=[],i=[],s;for(let l of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(l);){let c=s[1]?+s[1]:null,u=s[2]||s[3]||"",f=-1,p=u.replace(/\\[{}]/g,m=>m[1]);for(let m=0;m<n.length;m++)(c!=null?n[m].seq==c:p&&n[m].name==p)&&(f=m);if(f<0){let m=0;for(;m<n.length&&(c==null||n[m].seq!=null&&n[m].seq<c);)m++;n.splice(m,0,{seq:c,name:p}),f=m;for(let O of i)O.field>=f&&O.field++}for(let m of i)if(m.line==r.length&&m.from>s.index){let O=s[2]?3+(s[1]||"").length:2;m.from-=O,m.to-=O}i.push(new Aee(f,r.length,s.index,s.index+p.length)),l=l.slice(0,s.index)+u+l.slice(s.index+s[0].length)}l=l.replace(/\\([{}])/g,(c,u,f)=>{for(let p of i)p.line==r.length&&p.from>f&&(p.from--,p.to--);return u}),r.push(l)}return new Tk(r,i)}}let Ree=$t.widget({widget:new class extends yu{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),_ee=$t.mark({class:"cm-snippetField"});class ku{constructor(e,n){this.ranges=e,this.active=n,this.deco=$t.set(e.map(r=>(r.from==r.to?Ree:_ee).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new ku(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const Nf=Mt.define({map(t,e){return t&&t.map(e)}}),Mee=Mt.define(),Bh=ta.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Nf))return n.value;if(n.is(Mee)&&t)return new ku(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=>Te.decorations.from(t,e=>e?e.deco:$t.none)});function $k(t,e){return pe.create(t.filter(n=>n.field==e).map(n=>pe.range(n.from,n.to)))}function zee(t){let e=Tk.parse(t);return(n,r,i,s)=>{let{text:l,ranges:c}=e.instantiate(n.state,i),{main:u}=n.state.selection,f={changes:{from:i,to:s==u.from?u.to:s,insert:Je.of(l)},scrollIntoView:!0,annotations:r?[Eee.of(r),on.userEvent.of("input.complete")]:void 0};if(c.length&&(f.selection=$k(c,0)),c.some(p=>p.field>0)){let p=new ku(c,0),m=f.effects=[Nf.of(p)];n.state.field(Bh,!1)===void 0&&m.push(Mt.appendConfig.of([Bh,qee,Iee,Pee]))}n.dispatch(n.state.update(f))}}function l4(t){return({state:e,dispatch:n})=>{let r=e.field(Bh,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,s=t>0&&!r.ranges.some(l=>l.field==i+t);return n(e.update({selection:$k(r.ranges,i),effects:Nf.of(s?null:new ku(r.ranges,i)),scrollIntoView:!0})),!0}}const Dee=({state:t,dispatch:e})=>t.field(Bh,!1)?(e(t.update({effects:Nf.of(null)})),!0):!1,Lee=l4(1),Xee=l4(-1),Zee=[{key:"Tab",run:Lee,shift:Xee},{key:"Escape",run:Dee}],F$=Ae.define({combine(t){return t.length?t[0]:Zee}}),qee=yf.highest(bO.compute([F$],t=>t.facet(F$)));function cr(t,e){return{...e,apply:zee(t)}}const Iee=Te.domEventHandlers({mousedown(t,e){let n=e.state.field(Bh,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:$k(n.ranges,i.field),effects:Nf.of(n.ranges.some(s=>s.field>i.field)?new ku(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),o4=new class extends Ga{};o4.startSide=1;o4.endSide=-1;class Dg{static create(e,n,r,i,s){let l=i+(i<<8)+e+(n<<4)|0;return new Dg(e,n,r,l,s,[],[])}constructor(e,n,r,i,s,l,c){this.type=e,this.value=n,this.from=r,this.hash=i,this.end=s,this.children=l,this.positions=c,this.hashProp=[[Re.contextHash,i]]}addChild(e,n){e.prop(Re.contextHash)!=this.hash&&(e=new ot(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(n)}toTree(e,n=this.end){let r=this.children.length-1;return r>=0&&(n=Math.max(n,this.positions[r]+this.children[r].length+this.from)),new ot(e.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(i,s,l)=>new ot(fn.none,i,s,l,this.hashProp)})}}var Oe;(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"})(Oe||(Oe={}));class Bee{constructor(e,n){this.start=e,this.content=n,this.marks=[],this.parsers=[]}}class Yee{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 hh(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,r=0){for(let i=n;i<e;i++)r+=this.text.charCodeAt(i)==9?4-r%4:1;return r}findColumn(e){let n=0;for(let r=0;n<this.text.length&&r<e;n++)r+=this.text.charCodeAt(n)==9?4-r%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 H$(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 r=(t.type==Oe.OrderedList?Ak:Pk)(n,e,!1);return r>0&&(t.type!=Oe.BulletList||Ek(n,e,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==t.value}const c4={[Oe.Blockquote](t,e,n){return n.next!=62?!1:(n.markers.push(Ke(Oe.QuoteMark,e.lineStart+n.pos,e.lineStart+n.pos+1)),n.moveBase(n.pos+(di(n.text.charCodeAt(n.pos+1))?2:1)),t.end=e.lineStart+n.text.length,!0)},[Oe.ListItem](t,e,n){return n.indent<n.baseIndent+t.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+t.value),!0)},[Oe.OrderedList]:H$,[Oe.BulletList]:H$,[Oe.Document](){return!0}};function di(t){return t==32||t==9||t==10||t==13}function hh(t,e=0){for(;e<t.length&&di(t.charCodeAt(e));)e++;return e}function K$(t,e,n){for(;e>n&&di(t.charCodeAt(e-1));)e--;return e}function u4(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 d4(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function Ek(t,e,n){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let r=1;for(let i=t.pos+1;i<t.text.length;i++){let s=t.text.charCodeAt(i);if(s==t.next)r++;else if(!di(s))return-1}return n&&t.next==45&&p4(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(x4.SetextHeading)>-1||r<3?-1:1}function h4(t,e){for(let n=t.stack.length-1;n>=0;n--)if(t.stack[n].type==e)return!0;return!1}function Pk(t,e,n){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||di(t.text.charCodeAt(t.pos+1)))&&(!n||h4(e,Oe.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function Ak(t,e,n){let r=t.pos,i=t.next;for(;i>=48&&i<=57;){r++;if(r==t.text.length)return-1;i=t.text.charCodeAt(r)}return r==t.pos||r>t.pos+9||i!=46&&i!=41||r<t.text.length-1&&!di(t.text.charCodeAt(r+1))||n&&!h4(e,Oe.OrderedList)&&(t.skipSpace(r+1)==t.text.length||r>t.pos+1||t.next!=49)?-1:r+1-t.pos}function f4(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 p4(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&&di(t.text.charCodeAt(e));)e++;return e==t.text.length?n:-1}const K1=/^[ \t]*$/,m4=/-->/,g4=/\?>/,J1=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,m4],[/^\s*<\?/,g4],[/^\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,K1],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,K1]];function O4(t,e,n){if(t.next!=60)return-1;let r=t.text.slice(t.pos);for(let i=0,s=J1.length-(n?1:0);i<s;i++)if(J1[i][0].test(r))return i;return-1}function J$(t,e){let n=t.countIndent(e,t.pos,t.indent),r=t.countIndent(t.skipSpace(e),e,n);return r>=n+5?n+1:r}function Ta(t,e,n){let r=t.length-1;r>=0&&t[r].to==e&&t[r].type==Oe.CodeText?t[r].to=n:t.push(Ke(Oe.CodeText,e,n))}const vm={LinkReference:void 0,IndentedCode(t,e){let n=e.baseIndent+4;if(e.indent<n)return!1;let r=e.findColumn(n),i=t.lineStart+r,s=t.lineStart+e.text.length,l=[],c=[];for(Ta(l,i,s);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){Ta(c,t.lineStart-1,t.lineStart);for(let u of e.markers)c.push(u)}else{if(e.indent<n)break;{if(c.length){for(let f of c)f.type==Oe.CodeText?Ta(l,f.from,f.to):l.push(f);c=[]}Ta(l,t.lineStart-1,t.lineStart);for(let f of e.markers)l.push(f);s=t.lineStart+e.text.length;let u=t.lineStart+e.findColumn(e.baseIndent+4);u<s&&Ta(l,u,s)}}return c.length&&(c=c.filter(u=>u.type!=Oe.CodeText),c.length&&(e.markers=c.concat(e.markers))),t.addNode(t.buffer.writeElements(l,-i).finish(Oe.CodeBlock,s-i),i),!0},FencedCode(t,e){let n=u4(e);if(n<0)return!1;let r=t.lineStart+e.pos,i=e.next,s=n-e.pos,l=e.skipSpace(n),c=K$(e.text,e.text.length,l),u=[Ke(Oe.CodeMark,r,r+s)];l<c&&u.push(Ke(Oe.CodeInfo,t.lineStart+l,t.lineStart+c));for(let f=!0,p=!0,m=!1;t.nextLine()&&e.depth>=t.stack.length;f=!1){let O=e.pos;if(e.indent-e.baseIndent<4)for(;O<e.text.length&&e.text.charCodeAt(O)==i;)O++;if(O-e.pos>=s&&e.skipSpace(O)==e.text.length){for(let x of e.markers)u.push(x);p&&m&&Ta(u,t.lineStart-1,t.lineStart),u.push(Ke(Oe.CodeMark,t.lineStart+e.pos,t.lineStart+O)),t.nextLine();break}else{m=!0,f||(Ta(u,t.lineStart-1,t.lineStart),p=!1);for(let S of e.markers)u.push(S);let x=t.lineStart+e.basePos,v=t.lineStart+e.text.length;x<v&&(Ta(u,x,v),p=!1)}}return t.addNode(t.buffer.writeElements(u,-r).finish(Oe.FencedCode,t.prevLineEnd()-r),r),!0},Blockquote(t,e){let n=d4(e);return n<0?!1:(t.startContext(Oe.Blockquote,e.pos),t.addNode(Oe.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+n),null)},HorizontalRule(t,e){if(Ek(e,t,!1)<0)return!1;let n=t.lineStart+e.pos;return t.nextLine(),t.addNode(Oe.HorizontalRule,n),!0},BulletList(t,e){let n=Pk(e,t,!1);if(n<0)return!1;t.block.type!=Oe.BulletList&&t.startContext(Oe.BulletList,e.basePos,e.next);let r=J$(e,e.pos+1);return t.startContext(Oe.ListItem,e.basePos,r-e.baseIndent),t.addNode(Oe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},OrderedList(t,e){let n=Ak(e,t,!1);if(n<0)return!1;t.block.type!=Oe.OrderedList&&t.startContext(Oe.OrderedList,e.basePos,e.text.charCodeAt(e.pos+n-1));let r=J$(e,e.pos+n);return t.startContext(Oe.ListItem,e.basePos,r-e.baseIndent),t.addNode(Oe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},ATXHeading(t,e){let n=f4(e);if(n<0)return!1;let r=e.pos,i=t.lineStart+r,s=K$(e.text,e.text.length,r),l=s;for(;l>r&&e.text.charCodeAt(l-1)==e.next;)l--;(l==s||l==r||!di(e.text.charCodeAt(l-1)))&&(l=e.text.length);let c=t.buffer.write(Oe.HeaderMark,0,n).writeElements(t.parser.parseInline(e.text.slice(r+n+1,l),i+n+1),-i);l<e.text.length&&c.write(Oe.HeaderMark,l-r,s-r);let u=c.finish(Oe.ATXHeading1-1+n,e.text.length-r);return t.nextLine(),t.addNode(u,i),!0},HTMLBlock(t,e){let n=O4(e,t,!1);if(n<0)return!1;let r=t.lineStart+e.pos,i=J1[n][1],s=[],l=i!=K1;for(;!i.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){l=!1;break}for(let f of e.markers)s.push(f)}l&&t.nextLine();let c=i==m4?Oe.CommentBlock:i==g4?Oe.ProcessingInstructionBlock:Oe.HTMLBlock,u=t.prevLineEnd();return t.addNode(t.buffer.writeElements(s,-r).finish(c,u-r),r),!0},SetextHeading:void 0};class Vee{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,n,r){if(this.stage==-1)return!1;let i=r.content+`
|
|
560
|
+
`+n.scrub(),s=this.advance(i);return s>-1&&s<i.length?this.complete(e,r,s):!1}finish(e,n){return(this.stage==2||this.stage==3)&&hh(n.content,this.pos)==n.content.length?this.complete(e,n,n.content.length):!1}complete(e,n,r){return e.addLeafElement(n,Ke(Oe.LinkReference,this.start,this.start+r,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(C4(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(Ke(Oe.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(j4(e,hh(e,this.pos),this.start)))return-1}else if(this.stage==2){let n=hh(e,this.pos),r=0;if(n>this.pos){let i=Q4(e,n,this.start);if(i){let s=Vv(e,i.to-this.start);s>0&&(this.nextStage(i),r=s)}}return r||(r=Vv(e,this.pos)),r>0&&r<e.length?r:-1}else return Vv(e,this.pos)}}}function Vv(t,e){for(;e<t.length;e++){let n=t.charCodeAt(e);if(n==10)break;if(!di(n))return-1}return e}class Uee{nextLine(e,n,r){let i=n.depth<e.stack.length?-1:p4(n),s=n.next;if(i<0)return!1;let l=Ke(Oe.HeaderMark,e.lineStart+n.pos,e.lineStart+i);return e.nextLine(),e.addLeafElement(r,Ke(s==61?Oe.SetextHeading1:Oe.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),l])),!0}finish(){return!1}}const x4={LinkReference(t,e){return e.content.charCodeAt(0)==91?new Vee(e):null},SetextHeading(){return new Uee}},Wee=[(t,e)=>f4(e)>=0,(t,e)=>u4(e)>=0,(t,e)=>d4(e)>=0,(t,e)=>Pk(e,t,!0)>=0,(t,e)=>Ak(e,t,!0)>=0,(t,e)=>Ek(e,t,!0)>=0,(t,e)=>O4(e,t,!0)>=0],Gee={text:"",end:0};class Fee{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.line=new Yee,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=Dg.create(Oe.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new Jee(r,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 r=0;;){let i=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!i||e.markers[r].from<i.end);){let s=e.markers[r++];this.addNode(s.type,s.from,s.to)}if(!i)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 r of this.parser.blockParsers)if(r){let i=r(this,e);if(i!=!1){if(i==!0)return null;e.forward();continue e}}break}let n=new Bee(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let i=r(this,n);i&&n.parsers.push(i)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,n))break e}for(let r of n.parsers)if(r.nextLine(this,e,n))return null;n.content+=`
|
|
561
|
+
`+e.scrub();for(let r of e.markers)n.marks.push(r)}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=N4(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=Gee;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 r=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<n.end;){i++;let s=this.ranges[i].from,l=this.lineChunkAt(s);n.end=s+l.length,n.text=n.text.slice(0,this.ranges[i-1].to-r)+l,r=n.end-n.text.length}}return n}readLine(){let{line:e}=this,{text:n,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(n);e.depth<this.stack.length;e.depth++){let i=this.stack[e.depth],s=this.parser.skipContextMarkup[i.type];if(!s)throw new Error("Unhandled block context "+Oe[i.type]);let l=this.line.markers.length;if(!s(i,this,e)){this.line.markers.length>l&&(i.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let n=this.input.chunk(e),r;if(this.input.lineChunks)r=n==`
|
|
562
|
+
`?"":n;else{let i=n.indexOf(`
|
|
563
|
+
`);r=i<0?n:n.slice(0,i)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,n,r=0){this.block=Dg.create(e,r,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,n,r=0){this.startContext(this.parser.getNodeType(e),n,r)}addNode(e,n,r){typeof e=="number"&&(e=new ot(this.parser.nodeSet.types[e],au,au,(r??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(tS(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?b4(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let n=tS(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(n,-e.start).finish(Oe.Paragraph,e.content.length),e.start)}elt(e,n,r,i){return typeof e=="string"?Ke(this.parser.getNodeType(e),n,r,i):new S4(e,n)}get buffer(){return new y4(this.parser.nodeSet)}}function b4(t,e,n,r,i){let s=t[e].to,l=[],c=[],u=n.from+r;function f(p,m){for(;m?p>=s:p>s;){let O=t[e+1].from-s;r+=O,p+=O,e++,s=t[e].to}}for(let p=n.firstChild;p;p=p.nextSibling){f(p.from+r,!0);let m=p.from+r,O,x=i.get(p.tree);x?O=x:p.to+r>s?(O=b4(t,e,p,r,i),f(p.to+r,!1)):O=p.toTree(),l.push(O),c.push(m-u)}return f(n.to+r,!1),new ot(n.type,l,c,n.to+r-u,n.tree?n.tree.propValues:void 0)}class yO extends wk{constructor(e,n,r,i,s,l,c,u,f){super(),this.nodeSet=e,this.blockParsers=n,this.leafBlockParsers=r,this.blockNames=i,this.endLeafBlock=s,this.skipContextMarkup=l,this.inlineParsers=c,this.inlineNames=u,this.wrappers=f,this.nodeTypes=Object.create(null);for(let p of e.types)this.nodeTypes[p.name]=p.id}createParse(e,n,r){let i=new Fee(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}configure(e){let n=eS(e);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,s=this.blockParsers.slice(),l=this.leafBlockParsers.slice(),c=this.blockNames.slice(),u=this.inlineParsers.slice(),f=this.inlineNames.slice(),p=this.endLeafBlock.slice(),m=this.wrappers;if(Ed(n.defineNodes)){i=Object.assign({},i);let O=r.types.slice(),x;for(let v of n.defineNodes){let{name:S,block:k,composite:w,style:N}=typeof v=="string"?{name:v}:v;if(O.some(M=>M.name==S))continue;w&&(i[O.length]=(M,R,_)=>w(R,_,M.value));let C=O.length,E=w?["Block","BlockContext"]:k?C>=Oe.ATXHeading1&&C<=Oe.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;O.push(fn.define({id:C,name:S,props:E&&[[Re.group,E]]})),N&&(x||(x={}),Array.isArray(N)||N instanceof Wi?x[S]=N:Object.assign(x,N))}r=new jf(O),x&&(r=r.extend(bo(x)))}if(Ed(n.props)&&(r=r.extend(...n.props)),Ed(n.remove))for(let O of n.remove){let x=this.blockNames.indexOf(O),v=this.inlineNames.indexOf(O);x>-1&&(s[x]=l[x]=void 0),v>-1&&(u[v]=void 0)}if(Ed(n.parseBlock))for(let O of n.parseBlock){let x=c.indexOf(O.name);if(x>-1)s[x]=O.parse,l[x]=O.leaf;else{let v=O.before?ym(c,O.before):O.after?ym(c,O.after)+1:c.length-1;s.splice(v,0,O.parse),l.splice(v,0,O.leaf),c.splice(v,0,O.name)}O.endLeaf&&p.push(O.endLeaf)}if(Ed(n.parseInline))for(let O of n.parseInline){let x=f.indexOf(O.name);if(x>-1)u[x]=O.parse;else{let v=O.before?ym(f,O.before):O.after?ym(f,O.after)+1:f.length-1;u.splice(v,0,O.parse),f.splice(v,0,O.name)}}return n.wrap&&(m=m.concat(n.wrap)),new yO(r,s,l,c,p,i,u,f,m)}getNodeType(e){let n=this.nodeTypes[e];if(n==null)throw new RangeError(`Unknown node type '${e}'`);return n}parseInline(e,n){let r=new Rk(this,e,n);e:for(let i=n;i<r.end;){let s=r.char(i);for(let l of this.inlineParsers)if(l){let c=l(r,s,i);if(c>=0){i=c;continue e}}i++}return r.resolveMarkers(0)}}function Ed(t){return t!=null&&t.length>0}function eS(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=eS(t[0]);if(t.length==1)return e;let n=eS(t.slice(1));if(!n||!e)return e||n;let r=(l,c)=>(l||au).concat(c||au),i=e.wrap,s=n.wrap;return{props:r(e.props,n.props),defineNodes:r(e.defineNodes,n.defineNodes),parseBlock:r(e.parseBlock,n.parseBlock),parseInline:r(e.parseInline,n.parseInline),remove:r(e.remove,n.remove),wrap:i?s?(l,c,u,f)=>i(s(l,c,u,f),c,u,f):i:s}}function ym(t,e){let n=t.indexOf(e);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return n}let v4=[fn.none];for(let t=1,e;e=Oe[t];t++)v4[t]=fn.define({id:t,name:e,props:t>=Oe.Escape?[]:[[Re.group,t in c4?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const au=[];class y4{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,n,r,i=0){return this.content.push(e,n,r,4+i*4),this}writeElements(e,n=0){for(let r of e)r.writeTo(this,n);return this}finish(e,n){return ot.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:n})}}let Yh=class{constructor(e,n,r,i=au){this.type=e,this.from=n,this.to=r,this.children=i}writeTo(e,n){let r=e.content.length;e.writeElements(this.children,n),e.content.push(this.type,this.from+n,this.to+n,e.content.length+4-r)}toTree(e){return new y4(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class S4{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 au}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 Ke(t,e,n,r){return new Yh(t,e,n,r)}const w4={resolve:"Emphasis",mark:"EmphasisMark"},k4={resolve:"Emphasis",mark:"EmphasisMark"},Ml={},Lg={};class Rr{constructor(e,n,r,i){this.type=e,this.from=n,this.to=r,this.side=i}}const eE="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Vh=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Vh=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const Uv={Escape(t,e,n){if(e!=92||n==t.end-1)return-1;let r=t.char(n+1);for(let i=0;i<eE.length;i++)if(eE.charCodeAt(i)==r)return t.append(Ke(Oe.Escape,n,n+2));return-1},Entity(t,e,n){if(e!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(n+1,n+31));return r?t.append(Ke(Oe.Entity,n,n+1+r[0].length)):-1},InlineCode(t,e,n){if(e!=96||n&&t.char(n-1)==96)return-1;let r=n+1;for(;r<t.end&&t.char(r)==96;)r++;let i=r-n,s=0;for(;r<t.end;r++)if(t.char(r)==96){if(s++,s==i&&t.char(r+1)!=96)return t.append(Ke(Oe.InlineCode,n,r+1,[Ke(Oe.CodeMark,n,n+i),Ke(Oe.CodeMark,r+1-i,r+1)]))}else s=0;return-1},HTMLTag(t,e,n){if(e!=60||n==t.end-1)return-1;let r=t.slice(n+1,t.end),i=/^(?:[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(r);if(i)return t.append(Ke(Oe.Autolink,n,n+1+i[0].length,[Ke(Oe.LinkMark,n,n+1),Ke(Oe.URL,n+1,n+i[0].length),Ke(Oe.LinkMark,n+i[0].length,n+1+i[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(s)return t.append(Ke(Oe.Comment,n,n+1+s[0].length));let l=/^\?[^]*?\?>/.exec(r);if(l)return t.append(Ke(Oe.ProcessingInstruction,n,n+1+l[0].length));let c=/^(?:![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(r);return c?t.append(Ke(Oe.HTMLTag,n,n+1+c[0].length)):-1},Emphasis(t,e,n){if(e!=95&&e!=42)return-1;let r=n+1;for(;t.char(r)==e;)r++;let i=t.slice(n-1,n),s=t.slice(r,r+1),l=Vh.test(i),c=Vh.test(s),u=/\s|^$/.test(i),f=/\s|^$/.test(s),p=!f&&(!c||u||l),m=!u&&(!l||f||c),O=p&&(e==42||!m||l),x=m&&(e==42||!p||c);return t.append(new Rr(e==95?w4:k4,n,r,(O?1:0)|(x?2:0)))},HardBreak(t,e,n){if(e==92&&t.char(n+1)==10)return t.append(Ke(Oe.HardBreak,n,n+2));if(e==32){let r=n+1;for(;t.char(r)==32;)r++;if(t.char(r)==10&&r>=n+2)return t.append(Ke(Oe.HardBreak,n,r+1))}return-1},Link(t,e,n){return e==91?t.append(new Rr(Ml,n,n+1,1)):-1},Image(t,e,n){return e==33&&t.char(n+1)==91?t.append(new Rr(Lg,n,n+2,1)):-1},LinkEnd(t,e,n){if(e!=93)return-1;for(let r=t.parts.length-1;r>=0;r--){let i=t.parts[r];if(i instanceof Rr&&(i.type==Ml||i.type==Lg)){if(!i.side||t.skipSpace(i.to)==n&&!/[(\[]/.test(t.slice(n+1,n+2)))return t.parts[r]=null,-1;let s=t.takeContent(r),l=t.parts[r]=Hee(t,s,i.type==Ml?Oe.Link:Oe.Image,i.from,n+1);if(i.type==Ml)for(let c=0;c<r;c++){let u=t.parts[c];u instanceof Rr&&u.type==Ml&&(u.side=0)}return l.to}}return-1}};function Hee(t,e,n,r,i){let{text:s}=t,l=t.char(i),c=i;if(e.unshift(Ke(Oe.LinkMark,r,r+(n==Oe.Image?2:1))),e.push(Ke(Oe.LinkMark,i-1,i)),l==40){let u=t.skipSpace(i+1),f=j4(s,u-t.offset,t.offset),p;f&&(u=t.skipSpace(f.to),u!=f.to&&(p=Q4(s,u-t.offset,t.offset),p&&(u=t.skipSpace(p.to)))),t.char(u)==41&&(e.push(Ke(Oe.LinkMark,i,i+1)),c=u+1,f&&e.push(f),p&&e.push(p),e.push(Ke(Oe.LinkMark,u,c)))}else if(l==91){let u=C4(s,i-t.offset,t.offset,!1);u&&(e.push(u),c=u.to)}return Ke(n,r,c,e)}function j4(t,e,n){if(t.charCodeAt(e)==60){for(let i=e+1;i<t.length;i++){let s=t.charCodeAt(i);if(s==62)return Ke(Oe.URL,e+n,i+1+n);if(s==60||s==10)return!1}return null}else{let i=0,s=e;for(let l=!1;s<t.length;s++){let c=t.charCodeAt(s);if(di(c))break;if(l)l=!1;else if(c==40)i++;else if(c==41){if(!i)break;i--}else c==92&&(l=!0)}return s>e?Ke(Oe.URL,e+n,s+n):s==t.length?null:!1}}function Q4(t,e,n){let r=t.charCodeAt(e);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let s=e+1,l=!1;s<t.length;s++){let c=t.charCodeAt(s);if(l)l=!1;else{if(c==i)return Ke(Oe.LinkTitle,e+n,s+1+n);c==92&&(l=!0)}}return null}function C4(t,e,n,r){for(let i=!1,s=e+1,l=Math.min(t.length,s+999);s<l;s++){let c=t.charCodeAt(s);if(i)i=!1;else{if(c==93)return r?!1:Ke(Oe.LinkLabel,e+n,s+1+n);if(r&&!di(c)&&(r=!1),c==91)return!1;c==92&&(i=!0)}}return null}class Rk{constructor(e,n,r){this.parser=e,this.text=n,this.offset=r,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,r,i,s){return this.append(new Rr(e,n,r,(i?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 Rr&&(n.type==Ml||n.type==Lg))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let r=e;r<this.parts.length;r++){let i=this.parts[r];if(!(i instanceof Rr&&i.type.resolve&&i.side&2))continue;let s=i.type==w4||i.type==k4,l=i.to-i.from,c,u=r-1;for(;u>=e;u--){let S=this.parts[u];if(S instanceof Rr&&S.side&1&&S.type==i.type&&!(s&&(i.side&1||S.side&2)&&(S.to-S.from+l)%3==0&&((S.to-S.from)%3||l%3))){c=S;break}}if(!c)continue;let f=i.type.resolve,p=[],m=c.from,O=i.to;if(s){let S=Math.min(2,c.to-c.from,l);m=c.to-S,O=i.from+S,f=S==1?"Emphasis":"StrongEmphasis"}c.type.mark&&p.push(this.elt(c.type.mark,m,c.to));for(let S=u+1;S<r;S++)this.parts[S]instanceof Yh&&p.push(this.parts[S]),this.parts[S]=null;i.type.mark&&p.push(this.elt(i.type.mark,i.from,O));let x=this.elt(f,m,O,p);this.parts[u]=s&&c.from!=m?new Rr(c.type,c.from,m,c.side):null,(this.parts[r]=s&&i.to!=O?new Rr(i.type,O,i.to,i.side):null)?this.parts.splice(r,0,x):this.parts[r]=x}let n=[];for(let r=e;r<this.parts.length;r++){let i=this.parts[r];i instanceof Yh&&n.push(i)}return n}findOpeningDelimiter(e){for(let n=this.parts.length-1;n>=0;n--){let r=this.parts[n];if(r instanceof Rr&&r.type==e&&r.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 Rr?n:null}skipSpace(e){return hh(this.text,e-this.offset)+this.offset}elt(e,n,r,i){return typeof e=="string"?Ke(this.parser.getNodeType(e),n,r,i):new S4(e,n)}}Rk.linkStart=Ml;Rk.imageStart=Lg;function tS(t,e){if(!e.length)return t;if(!t.length)return e;let n=t.slice(),r=0;for(let i of e){for(;r<n.length&&n[r].to<i.to;)r++;if(r<n.length&&n[r].from<i.from){let s=n[r];s instanceof Yh&&(n[r]=new Yh(s.type,s.from,s.to,tS(s.children,[i])))}else n.splice(r++,0,i)}return n}const Kee=[Oe.CodeBlock,Oe.ListItem,Oe.OrderedList,Oe.BulletList];let Jee=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)!=`
|
|
564
|
+
`;)s--;this.fragmentEnd=s?s-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let i=e+this.fragment.offset;for(;r.to<=i;)if(!r.parent())return!1;for(;;){if(r.from>=i)return this.fragment.from<=n;if(!r.childAfter(i))return!1}}matches(e){let n=this.cursor.tree;return n&&n.prop(Re.contextHash)==e}takeNodes(e){let n=this.cursor,r=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,l=s,c=e.block.children.length,u=l,f=c;for(;;){if(n.to-r>i){if(n.type.isAnonymous&&n.firstChild())continue;break}let p=N4(n.from-r,e.ranges);if(n.to-r<=e.ranges[e.rangeI].to)e.addNode(n.tree,p);else{let m=new ot(e.parser.nodeSet.types[Oe.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(m,n.tree),e.addNode(m,p)}if(n.type.is("Block")&&(Kee.indexOf(n.type.id)<0?(l=n.to-r,c=e.block.children.length):(l=u,c=f),u=n.to-r,f=e.block.children.length),!n.nextSibling())break}for(;e.block.children.length>c;)e.block.children.pop(),e.block.positions.pop();return l-s}};function N4(t,e){let n=t;for(let r=1;r<e.length;r++){let i=e[r-1].to,s=e[r].from;i<t&&(n-=s-i)}return n}const ete=bo({"Blockquote/...":z.quote,HorizontalRule:z.contentSeparator,"ATXHeading1/... SetextHeading1/...":z.heading1,"ATXHeading2/... SetextHeading2/...":z.heading2,"ATXHeading3/...":z.heading3,"ATXHeading4/...":z.heading4,"ATXHeading5/...":z.heading5,"ATXHeading6/...":z.heading6,"Comment CommentBlock":z.comment,Escape:z.escape,Entity:z.character,"Emphasis/...":z.emphasis,"StrongEmphasis/...":z.strong,"Link/... Image/...":z.link,"OrderedList/... BulletList/...":z.list,"BlockQuote/...":z.quote,"InlineCode CodeText":z.monospace,"URL Autolink":z.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":z.processingInstruction,"CodeInfo LinkLabel":z.labelName,LinkTitle:z.string,Paragraph:z.content}),tte=new yO(new jf(v4).extend(ete),Object.keys(vm).map(t=>vm[t]),Object.keys(vm).map(t=>x4[t]),Object.keys(vm),Wee,c4,Object.keys(Uv).map(t=>Uv[t]),Object.keys(Uv),[]);function nte(t,e,n){let r=[];for(let i=t.firstChild,s=e;;i=i.nextSibling){let l=i?i.from:n;if(l>s&&r.push({from:s,to:l}),!i)break;s=i.to}return r}function rte(t){let{codeParser:e,htmlParser:n}=t;return{wrap:KM((i,s)=>{let l=i.type.id;if(e&&(l==Oe.CodeBlock||l==Oe.FencedCode)){let c="";if(l==Oe.FencedCode){let f=i.node.getChild(Oe.CodeInfo);f&&(c=s.read(f.from,f.to))}let u=e(c);if(u)return{parser:u,overlay:f=>f.type.id==Oe.CodeText,bracketed:l==Oe.FencedCode}}else if(n&&(l==Oe.HTMLBlock||l==Oe.HTMLTag||l==Oe.CommentBlock))return{parser:n,overlay:nte(i.node,i.from,i.to)};return null})}}const ite={resolve:"Strikethrough",mark:"StrikethroughMark"},ste={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":z.strikethrough}},{name:"StrikethroughMark",style:z.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,n){if(e!=126||t.char(n+1)!=126||t.char(n+2)==126)return-1;let r=t.slice(n-1,n),i=t.slice(n+2,n+3),s=/\s|^$/.test(r),l=/\s|^$/.test(i),c=Vh.test(r),u=Vh.test(i);return t.addDelimiter(ite,n,n+2,!l&&(!u||s||c),!s&&(!c||l||u))},after:"Emphasis"}]};function fh(t,e,n=0,r,i=0){let s=0,l=!0,c=-1,u=-1,f=!1,p=()=>{r.push(t.elt("TableCell",i+c,i+u,t.parser.parseInline(e.slice(c,u),i+c)))};for(let m=n;m<e.length;m++){let O=e.charCodeAt(m);O==124&&!f?((!l||c>-1)&&s++,l=!1,r&&(c>-1&&p(),r.push(t.elt("TableDelimiter",m+i,m+i+1))),c=u=-1):(f||O!=32&&O!=9)&&(c<0&&(c=m),u=m+1),f=!f&&O==92}return c>-1&&(s++,r&&p()),s}function tE(t,e){for(let n=e;n<t.length;n++){let r=t.charCodeAt(n);if(r==124)return!0;r==92&&n++}return!1}const T4=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class nE{constructor(){this.rows=null}nextLine(e,n,r){if(this.rows==null){this.rows=!1;let i;if((n.next==45||n.next==58||n.next==124)&&T4.test(i=n.text.slice(n.pos))){let s=[];fh(e,r.content,0,s,r.start)==fh(e,i,n.pos)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,s),e.elt("TableDelimiter",e.lineStart+n.pos,e.lineStart+n.text.length)])}}else if(this.rows){let i=[];fh(e,n.text,n.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+n.pos,e.lineStart+n.text.length,i))}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 ate={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":z.heading}},"TableRow",{name:"TableCell",style:z.content},{name:"TableDelimiter",style:z.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return tE(e.content,0)?new nE:null},endLeaf(t,e,n){if(n.parsers.some(i=>i instanceof nE)||!tE(e.text,e.basePos))return!1;let r=t.peekLine();return T4.test(r)&&fh(t,e.text,e.basePos)==fh(t,r,e.basePos)},before:"SetextHeading"}]};class lte{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 ote={defineNodes:[{name:"Task",block:!0,style:z.list},{name:"TaskMarker",style:z.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new lte:null},after:"SetextHeading"}]},rE=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,iE=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,cte=/[\w-]+\.[\w-]+($|\/)/,sE=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,aE=/\/[a-zA-Z\d@.]+/gy;function lE(t,e,n,r){let i=0;for(let s=e;s<n;s++)t[s]==r&&i++;return i}function ute(t,e){iE.lastIndex=e;let n=iE.exec(t);if(!n||cte.exec(n[0])[0].indexOf("_")>-1)return-1;let r=e+n[0].length;for(;;){let i=t[r-1],s;if(/[?!.,:*_~]/.test(i)||i==")"&&lE(t,e,r,")")>lE(t,e,r,"("))r--;else if(i==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,r))))r=e+s.index;else break}return r}function oE(t,e){sE.lastIndex=e;let n=sE.exec(t);if(!n)return-1;let r=n[0][n[0].length-1];return r=="_"||r=="-"?-1:e+n[0].length-(r=="."?1:0)}const dte={parseInline:[{name:"Autolink",parse(t,e,n){let r=n-t.offset;if(r&&/\w/.test(t.text[r-1]))return-1;rE.lastIndex=r;let i=rE.exec(t.text),s=-1;if(!i)return-1;if(i[1]||i[2]){if(s=ute(t.text,r+i[0].length),s>-1&&t.hasOpenLink){let l=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(r,s));s=r+l[0].length}}else i[3]?s=oE(t.text,r):(s=oE(t.text,r+i[0].length),s>-1&&i[0]=="xmpp:"&&(aE.lastIndex=s,i=aE.exec(t.text),i&&(s=i.index+i[0].length)));return s<0?-1:(t.addElement(t.elt("URL",n,s+t.offset)),s+t.offset)}}]},hte=[ate,ote,ste,dte];function $4(t,e,n){return(r,i,s)=>{if(i!=t||r.char(s+1)==t)return-1;let l=[r.elt(n,s,s+1)];for(let c=s+1;c<r.end;c++){let u=r.char(c);if(u==t)return r.addElement(r.elt(e,s,c+1,l.concat(r.elt(n,c,c+1))));if(u==92&&l.push(r.elt("Escape",c,c+++2)),di(u))break}return-1}}const fte={defineNodes:[{name:"Superscript",style:z.special(z.content)},{name:"SuperscriptMark",style:z.processingInstruction}],parseInline:[{name:"Superscript",parse:$4(94,"Superscript","SuperscriptMark")}]},pte={defineNodes:[{name:"Subscript",style:z.special(z.content)},{name:"SubscriptMark",style:z.processingInstruction}],parseInline:[{name:"Subscript",parse:$4(126,"Subscript","SubscriptMark")}]},mte={defineNodes:[{name:"Emoji",style:z.character}],parseInline:[{name:"Emoji",parse(t,e,n){let r;return e!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(t.slice(n+1,t.end)))?-1:t.addElement(t.elt("Emoji",n,n+1+r[0].length))}}]};var cE={};class Xg{constructor(e,n,r,i,s,l,c,u,f,p=0,m){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=s,this.score=l,this.buffer=c,this.bufferBase=u,this.curContext=f,this.lookAhead=p,this.parent=m}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new Xg(e,[],n,r,r,0,[],0,i?new uE(i,i.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 r=e>>19,i=e&65535,{parser:s}=this.p,l=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),c=s.dynamicPrecedence(i);if(c&&(this.score+=c),r==0){this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i<s.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,l?8:4,!0),this.reduceContext(i,this.reducePos);return}let u=this.stack.length-(r-1)*3-(e&262144?6:0),f=u?this.stack[u-2]:this.p.ranges[0].from,p=this.reducePos-f;p>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(f==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=p):this.p.lastBigReductionSize<p&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=f,this.p.lastBigReductionSize=p));let m=u?this.stack[u-1]:0,O=this.bufferBase+this.buffer.length-m;if(i<s.minRepeatTerm||e&131072){let x=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,f,x,O+4,!0)}if(e&262144)this.state=this.stack[u];else{let x=this.stack[u-3];this.state=s.getGoto(x,i,!0)}for(;this.stack.length>u;)this.stack.pop();this.reduceContext(i,f)}storeNode(e,n,r,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let l=this,c=this.buffer.length;if(c==0&&l.parent&&(c=l.bufferBase-l.parent.bufferBase,l=l.parent),c>0&&l.buffer[c-4]==0&&l.buffer[c-1]>-1){if(n==r)return;if(l.buffer[c-2]>=n){l.buffer[c-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,n,r,i);else{let l=this.buffer.length;if(l>0&&(this.buffer[l-4]!=0||this.buffer[l-1]<0)){let c=!1;for(let u=l;u>0&&this.buffer[u-2]>r;u-=4)if(this.buffer[u-1]>=0){c=!0;break}if(c)for(;l>0&&this.buffer[l-2]>r;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,i>4&&(i-=4)}this.buffer[l]=e,this.buffer[l+1]=n,this.buffer[l+2]=r,this.buffer[l+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:l}=this.p;this.pos=i;let c=l.stateFlag(s,1);!c&&(i>r||n<=l.maxNode)&&(this.reducePos=i),this.pushState(s,c?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=l.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,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>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new Xg(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new gte(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}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 i=[];for(let s=0,l;s<n.length;s+=2)(l=n[s+1])!=this.state&&this.p.parser.hasAction(l,e)&&i.push(n[s],l);if(this.stack.length<120)for(let s=0;i.length<8&&s<n.length;s+=2){let l=n[s+1];i.some((c,u)=>u&1&&c==l)||i.push(n[s],l)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let s=n[i+1];if(s==this.state)continue;let l=this.split();l.pushState(s,this.pos),l.storeNode(0,l.pos,l.pos,4,!0),l.shiftContext(n[i],this.pos),l.reducePos=this.pos,l.score-=200,r.push(l)}return r}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 r=n>>19,i=n&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;n=l}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=[],r=(i,s)=>{if(!n.includes(i))return n.push(i),e.allActions(i,l=>{if(!(l&393216))if(l&65536){let c=(l>>19)-s;if(c>1){let u=l&65535,f=this.stack.length-c*3;if(f>=0&&e.getGoto(this.stack[f],u,!1)>=0)return c<<19|65536|u}}else{let c=r(l,s+1);if(c!=null)return c}})};return r(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 uE(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 uE{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class gte{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class Zg{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new Zg(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 Zg(this.stack,this.pos,this.index)}}function Fd(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let s=0;for(;;){let l=t.charCodeAt(r++),c=!1;if(l==126){s=65535;break}l>=92&&l--,l>=34&&l--;let u=l-32;if(u>=46&&(u-=46,c=!0),s+=u,c)break;s*=46}n?n[i++]=s:n=new e(s)}return n}class Bm{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const dE=new Bm;class Ote{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=dE,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 r=this.range,i=this.rangeIndex,s=this.pos+e;for(;s<r.from;){if(!i)return null;let l=this.ranges[--i];s-=r.from-l.to,r=l}for(;n<0?s>r.to:s>=r.to;){if(i==this.ranges.length-1)return null;let l=this.ranges[++i];s+=l.from-r.to,r=l}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,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(r=s,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let l=this.rangeIndex,c=this.range;for(;c.to<=r;)c=this.ranges[++l];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>c.to&&(this.chunk2=this.chunk2.slice(0,c.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}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=dE,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 r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class $c{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;E4(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}$c.prototype.contextual=$c.prototype.fallback=$c.prototype.extend=!1;class qg{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?Fd(e):e}token(e,n){let r=e.pos,i=0;for(;;){let s=e.next<0,l=e.resolveOffset(1,1);if(E4(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,l==null)break;e.reset(l,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}qg.prototype.contextual=$c.prototype.fallback=$c.prototype.extend=!1;class $n{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function E4(t,e,n,r,i,s){let l=0,c=1<<r,{dialect:u}=n.p.parser;e:for(;(c&t[l])!=0;){let f=t[l+1];for(let x=l+3;x<f;x+=2)if((t[x+1]&c)>0){let v=t[x];if(u.allows(v)&&(e.token.value==-1||e.token.value==v||xte(v,e.token.value,i,s))){e.acceptToken(v);break}}let p=e.next,m=0,O=t[l+2];if(e.next<0&&O>m&&t[f+O*3-3]==65535){l=t[f+O*3-1];continue e}for(;m<O;){let x=m+O>>1,v=f+x+(x<<1),S=t[v],k=t[v+1]||65536;if(p<S)O=x;else if(p>=k)m=x+1;else{l=t[v+2],e.advance();continue e}}break}}function hE(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function xte(t,e,n,r){let i=hE(n,r,e);return i<0||hE(n,r,t)<i}const Tr=typeof process<"u"&&cE&&/\bparse\b/.test(cE.LOG);let Wv=null;function fE(t,e,n){let r=t.cursor(dt.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class bte{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?fE(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?fE(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 r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=r.children[i],l=this.start[n]+r.positions[i];if(l>e)return this.nextStart=l,null;if(s instanceof ot){if(l==e){if(l<this.safeFrom)return null;let c=l+s.length;if(c<=this.safeTo){let u=s.prop(Re.lookAhead);if(!u||c+u<this.fragment.to)return s}}this.index[n]++,l+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(l),this.index.push(0))}else this.index[n]++,this.nextStart=l+s.length}}}class vte{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Bm)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,l=i.stateSlot(e.state,3),c=e.curContext?e.curContext.hash:0,u=0;for(let f=0;f<s.length;f++){if((1<<f&l)==0)continue;let p=s[f],m=this.tokens[f];if(!(r&&!p.fallback)&&((p.contextual||m.start!=e.pos||m.mask!=l||m.context!=c)&&(this.updateCachedToken(m,p,e),m.mask=l,m.context=c),m.lookAhead>m.end+25&&(u=Math.max(m.lookAhead,u)),m.value!=0)){let O=n;if(m.extended>-1&&(n=this.addActions(e,m.extended,m.end,n)),n=this.addActions(e,m.value,m.end,n),!p.extend&&(r=m,n>O))break}}for(;this.actions.length>n;)this.actions.pop();return u&&e.setLookAhead(u),!r&&e.pos==this.stream.end&&(r=new Bm,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Bm,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let l=0;l<s.specialized.length;l++)if(s.specialized[l]==e.value){let c=s.specializers[l](this.stream.read(e.start,e.end),r);if(c>=0&&r.p.parser.dialect.allows(c>>1)){(c&1)==0?e.value=c>>1:e.extended=c>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let s=0;s<i;s+=3)if(this.actions[s]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:s}=e,{parser:l}=e.p,{data:c}=l;for(let u=0;u<2;u++)for(let f=l.stateSlot(s,u?2:1);;f+=3){if(c[f]==65535)if(c[f+1]==1)f=_s(c,f+2);else{i==0&&c[f+1]==2&&(i=this.putAction(_s(c,f+2),n,r,i));break}c[f]==n&&(i=this.putAction(_s(c,f+1),n,r,i))}return i}}class yte{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,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 Ote(n,i),this.tokens=new vte(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[Xg.start(this,e.top[0],s)],this.fragments=r.length&&this.stream.end-s>e.bufferLength*4?new bte(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[l]=e;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;l<e.length;l++){let c=e[l];for(;;){if(this.tokens.mainToken=null,c.pos>n)r.push(c);else{if(this.advanceStack(c,r,e))continue;{i||(i=[],s=[]),i.push(c);let u=this.tokens.getMainToken(c);s.push(u.value,u.end)}}break}}if(!r.length){let l=i&&wte(i);if(l)return Tr&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw Tr&&i&&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&&i){let l=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(l)return Tr&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(r.length>l)for(r.sort((c,u)=>u.score-c.score);r.length>l;)r.pop();r.some(c=>c.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let l=0;l<r.length-1;l++){let c=r[l];for(let u=l+1;u<r.length;u++){let f=r[u];if(c.sameState(f)||c.buffer.length>500&&f.buffer.length>500)if((c.score-f.score||c.buffer.length-f.buffer.length)>0)r.splice(u--,1);else{r.splice(l--,1);continue e}}}r.length>12&&(r.sort((l,c)=>c.score-l.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let l=1;l<r.length;l++)r[l].pos<this.minStackPos&&(this.minStackPos=r[l].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,r){let i=e.pos,{parser:s}=this,l=Tr?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let f=e.curContext&&e.curContext.tracker.strict,p=f?e.curContext.hash:0;for(let m=this.fragments.nodeAt(i);m;){let O=this.parser.nodeSet.types[m.type.id]==m.type?s.getGoto(e.state,m.type.id):-1;if(O>-1&&m.length&&(!f||(m.prop(Re.contextHash)||0)==p))return e.useNode(m,O),Tr&&console.log(l+this.stackID(e)+` (via reuse of ${s.getName(m.type.id)})`),!0;if(!(m instanceof ot)||m.children.length==0||m.positions[0]>0)break;let x=m.children[0];if(x instanceof ot&&m.positions[0]==0)m=x;else break}}let c=s.stateSlot(e.state,4);if(c>0)return e.reduce(c),Tr&&console.log(l+this.stackID(e)+` (via always-reduce ${s.getName(c&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 p=u[f++],m=u[f++],O=u[f++],x=f==u.length||!r,v=x?e:e.split(),S=this.tokens.mainToken;if(v.apply(p,m,S?S.start:v.pos,O),Tr&&console.log(l+this.stackID(v)+` (via ${(p&65536)==0?"shift":`reduce of ${s.getName(p&65535)}`} for ${s.getName(m)} @ ${i}${v==e?"":", split"})`),x)return!0;v.pos>i?n.push(v):r.push(v)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return pE(e,n),!0}}runRecovery(e,n,r){let i=null,s=!1;for(let l=0;l<e.length;l++){let c=e[l],u=n[l<<1],f=n[(l<<1)+1],p=Tr?this.stackID(c)+" -> ":"";if(c.deadEnd&&(s||(s=!0,c.restart(),Tr&&console.log(p+this.stackID(c)+" (restarted)"),this.advanceFully(c,r))))continue;let m=c.split(),O=p;for(let x=0;x<10&&m.forceReduce()&&(Tr&&console.log(O+this.stackID(m)+" (via force-reduce)"),!this.advanceFully(m,r));x++)Tr&&(O=this.stackID(m)+" -> ");for(let x of c.recoverByInsert(u))Tr&&console.log(p+this.stackID(x)+" (via recover-insert)"),this.advanceFully(x,r);this.stream.end>c.pos?(f==c.pos&&(f++,u=0),c.recoverByDelete(u,f),Tr&&console.log(p+this.stackID(c)+` (via recover-delete ${this.parser.getName(u)})`),pE(c,r)):(!i||i.score<m.score)&&(i=m)}return i}stackToTree(e){return e.close(),ot.build({buffer:Zg.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=(Wv||(Wv=new WeakMap)).get(e);return n||Wv.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function pE(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class Ste{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const Gv=t=>t;class _k{constructor(e){this.start=e.start,this.shift=e.shift||Gv,this.reduce=e.reduce||Gv,this.reuse=e.reuse||Gv,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class oo extends wk{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 c=0;c<e.repeatNodeCount;c++)n.push("");let r=Object.keys(e.topRules).map(c=>e.topRules[c][1]),i=[];for(let c=0;c<n.length;c++)i.push([]);function s(c,u,f){i[c].push([u,u.deserialize(String(f))])}if(e.nodeProps)for(let c of e.nodeProps){let u=c[0];typeof u=="string"&&(u=Re[u]);for(let f=1;f<c.length;){let p=c[f++];if(p>=0)s(p,u,c[f++]);else{let m=c[f+-p];for(let O=-p;O>0;O--)s(c[f++],u,m);f++}}}this.nodeSet=new jf(n.map((c,u)=>fn.define({name:u>=this.minRepeatTerm?void 0:c,id:u,props:i[u],top:r.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=UM;let l=Fd(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let c=0;c<this.specializerSpecs.length;c++)this.specialized[c]=this.specializerSpecs[c].term;this.specializers=this.specializerSpecs.map(mE),this.states=Fd(e.states,Uint32Array),this.data=Fd(e.stateData),this.goto=Fd(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(c=>typeof c=="number"?new $c(l,c):c),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,r){let i=new yte(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let s=i[n+1];;){let l=i[s++],c=l&1,u=i[s++];if(c&&r)return u;for(let f=s+(l>>1);s<f;s++)if(i[s]==e)return u;if(c)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let s=this.stateSlot(e,i?2:1),l;;s+=3){if((l=r[s])==65535)if(r[s+1]==1)l=r[s=_s(r,s+2)];else{if(r[s+1]==2)return _s(r,s+2);break}if(l==n||l==0)return _s(r,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,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=_s(this.data,s+2);else break;i=n(_s(this.data,s+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=_s(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((s,l)=>l&1&&s==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(oo.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(c=>c.from==r.external);if(!s)return r;let l=Object.assign(Object.assign({},r),{external:s.to});return n.specializers[i]=mE(l),l})),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),r=n.map(()=>!1);if(e)for(let s of e.split(" ")){let l=n.indexOf(s);l>=0&&(r[l]=!0)}let i=null;for(let s=0;s<n.length;s++)if(!r[s])for(let l=this.dialects[n[s]],c;(c=this.data[l++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[c]=1;return new Ste(e,r,i)}static deserialize(e){return new oo(e)}}function _s(t,e){return t[e]|t[e+1]<<16}function wte(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function mE(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}const kte=55,jte=1,Qte=56,Cte=2,Nte=57,Tte=3,gE=4,$te=5,Mk=6,P4=7,A4=8,R4=9,_4=10,Ete=11,Pte=12,Ate=13,Fv=58,Rte=14,_te=15,OE=59,M4=21,Mte=23,z4=24,zte=25,nS=27,D4=28,Dte=29,Lte=32,Xte=35,Zte=37,qte=38,Ite=0,Bte=1,Yte={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},Vte={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},xE={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 Ute(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let bE=null,vE=null,yE=0;function rS(t,e){let n=t.pos+e;if(yE==n&&vE==t)return bE;let r=t.peek(e),i="";for(;Ute(r);)i+=String.fromCharCode(r),r=t.peek(++e);return vE=t,yE=n,bE=i?i.toLowerCase():r==Wte||r==Gte?void 0:null}const L4=60,Ig=62,zk=47,Wte=63,Gte=33,Fte=45;function SE(t,e){this.name=t,this.parent=e}const Hte=[Mk,_4,P4,A4,R4],Kte=new _k({start:null,shift(t,e,n,r){return Hte.indexOf(e)>-1?new SE(rS(r,1)||"",t):t},reduce(t,e){return e==M4&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==Mk||i==Zte?new SE(rS(r,1)||"",t):t},strict:!1}),Jte=new $n((t,e)=>{if(t.next!=L4){t.next<0&&e.context&&t.acceptToken(Fv);return}t.advance();let n=t.next==zk;n&&t.advance();let r=rS(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?_te:Rte);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(Ete);if(i&&Vte[i])return t.acceptToken(Fv,-2);if(e.dialectEnabled(Ite))return t.acceptToken(Pte);for(let s=e.context;s;s=s.parent)if(s.name==r)return;t.acceptToken(Ate)}else{if(r=="script")return t.acceptToken(P4);if(r=="style")return t.acceptToken(A4);if(r=="textarea")return t.acceptToken(R4);if(Yte.hasOwnProperty(r))return t.acceptToken(_4);i&&xE[i]&&xE[i][r]?t.acceptToken(Fv,-1):t.acceptToken(Mk)}},{contextual:!0}),ene=new $n(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(OE);break}if(t.next==Fte)e++;else if(t.next==Ig&&e>=2){n>=3&&t.acceptToken(OE,-2);break}else e=0;t.advance()}});function tne(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const nne=new $n((t,e)=>{if(t.next==zk&&t.peek(1)==Ig){let n=e.dialectEnabled(Bte)||tne(e.context);t.acceptToken(n?$te:gE,2)}else t.next==Ig&&t.acceptToken(gE,1)});function Dk(t,e,n){let r=2+t.length;return new $n(i=>{for(let s=0,l=0,c=0;;c++){if(i.next<0){c&&i.acceptToken(e);break}if(s==0&&i.next==L4||s==1&&i.next==zk||s>=2&&s<r&&i.next==t.charCodeAt(s-2))s++,l++;else if(s==r&&i.next==Ig){c>l?i.acceptToken(e,-l):i.acceptToken(n,-(l-2));break}else if((i.next==10||i.next==13)&&c){i.acceptToken(e,1);break}else s=l=0;i.advance()}})}const rne=Dk("script",kte,jte),ine=Dk("style",Qte,Cte),sne=Dk("textarea",Nte,Tte),ane=bo({"Text RawText IncompleteTag IncompleteCloseTag":z.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":z.angleBracket,TagName:z.tagName,"MismatchedCloseTag/TagName":[z.tagName,z.invalid],AttributeName:z.attributeName,"AttributeValue UnquotedAttributeValue":z.attributeValue,Is:z.definitionOperator,"EntityReference CharacterReference":z.character,Comment:z.blockComment,ProcessingInst:z.processingInstruction,DoctypeDecl:z.documentMeta}),lne=oo.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'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59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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:Kte,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:[ane],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$qr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:0,selfClosing:515},tokenPrec:517});function X4(t,e){let n=Object.create(null);for(let r of t.getChildren(z4)){let i=r.getChild(zte),s=r.getChild(nS)||r.getChild(D4);i&&(n[e.read(i.from,i.to)]=s?s.type.id==nS?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return n}function wE(t,e){let n=t.getChild(Mte);return n?e.read(n.from,n.to):" "}function Hv(t,e,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||(r=X4(t.node.parent.firstChild,e))))return{parser:i.parser,bracketed:!0};return null}function Z4(t=[],e=[]){let n=[],r=[],i=[],s=[];for(let c of t)(c.tag=="script"?n:c.tag=="style"?r:c.tag=="textarea"?i:s).push(c);let l=e.length?Object.create(null):null;for(let c of e)(l[c.name]||(l[c.name]=[])).push(c);return KM((c,u)=>{let f=c.type.id;if(f==Dte)return Hv(c,u,n);if(f==Lte)return Hv(c,u,r);if(f==Xte)return Hv(c,u,i);if(f==M4&&s.length){let p=c.node,m=p.firstChild,O=m&&wE(m,u),x;if(O){for(let v of s)if(v.tag==O&&(!v.attrs||v.attrs(x||(x=X4(m,u))))){let S=p.lastChild,k=S.type.id==qte?S.from:p.to;if(k>m.to)return{parser:v.parser,overlay:[{from:m.to,to:k}]}}}}if(l&&f==z4){let p=c.node,m;if(m=p.firstChild){let O=l[u.read(m.from,m.to)];if(O)for(let x of O){if(x.tagName&&x.tagName!=wE(p.parent,u))continue;let v=p.lastChild;if(v.type.id==nS){let S=v.from+1,k=v.lastChild,w=v.to-(k&&k.isError?0:1);if(w>S)return{parser:x.parser,overlay:[{from:S,to:w}],bracketed:!0}}else if(v.type.id==D4)return{parser:x.parser,overlay:[{from:v.from,to:v.to}]}}}}return null})}const one=122,kE=1,cne=123,une=124,q4=2,dne=125,hne=3,fne=4,I4=[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],pne=58,mne=40,B4=95,gne=91,Ym=45,One=46,xne=35,bne=37,vne=38,yne=92,Sne=10,wne=42;function Uh(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function Lk(t){return t>=48&&t<=57}function jE(t){return Lk(t)||t>=97&&t<=102||t>=65&&t<=70}const Y4=(t,e,n)=>(r,i)=>{for(let s=!1,l=0,c=0;;c++){let{next:u}=r;if(Uh(u)||u==Ym||u==B4||s&&Lk(u))!s&&(u!=Ym||c>0)&&(s=!0),l===c&&u==Ym&&l++,r.advance();else if(u==yne&&r.peek(1)!=Sne){if(r.advance(),jE(r.next)){do r.advance();while(jE(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();s=!0}else{s&&r.acceptToken(l==2&&i.canShift(q4)?e:u==mne?n:t);break}}},kne=new $n(Y4(cne,q4,une)),jne=new $n(Y4(dne,hne,fne)),Qne=new $n(t=>{if(I4.includes(t.peek(-1))){let{next:e}=t;(Uh(e)||e==B4||e==xne||e==One||e==wne||e==gne||e==pne&&Uh(t.peek(1))||e==Ym||e==vne)&&t.acceptToken(one)}}),Cne=new $n(t=>{if(!I4.includes(t.peek(-1))){let{next:e}=t;if(e==bne&&(t.advance(),t.acceptToken(kE)),Uh(e)){do t.advance();while(Uh(t.next)||Lk(t.next));t.acceptToken(kE)}}}),Nne=bo({"AtKeyword import charset namespace keyframes media supports":z.definitionKeyword,"from to selector":z.keyword,NamespaceName:z.namespace,KeyframeName:z.labelName,KeyframeRangeName:z.operatorKeyword,TagName:z.tagName,ClassName:z.className,PseudoClassName:z.constant(z.className),IdName:z.labelName,"FeatureName PropertyName":z.propertyName,AttributeName:z.attributeName,NumberLiteral:z.number,KeywordQuery:z.keyword,UnaryQueryOp:z.operatorKeyword,"CallTag ValueName":z.atom,VariableName:z.variableName,Callee:z.operatorKeyword,Unit:z.unit,"UniversalSelector NestingSelector":z.definitionOperator,"MatchOp CompareOp":z.compareOperator,"ChildOp SiblingOp, LogicOp":z.logicOperator,BinOp:z.arithmeticOperator,Important:z.modifier,Comment:z.blockComment,ColorLiteral:z.color,"ParenthesizedContent StringLiteral":z.string,":":z.punctuation,"PseudoOp #":z.derefOperator,"; ,":z.separator,"( )":z.paren,"[ ]":z.squareBracket,"{ }":z.brace}),Tne={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},$ne={__proto__:null,or:98,and:98,not:106,only:106,layer:170},Ene={__proto__:null,selector:112,layer:166},Pne={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},Ane={__proto__:null,to:207},Rne=oo.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#Cz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ZR$x#kQ%b$YR&Z%bQ&X%aR&u&X__OP`kz!{$d^UOP`kz!{$dQ!VYQ!WZQ#XuQ#YvQ#ZwQ#[xQ$]!vQ$m#`R&b%mR$q#aQ!gaQ!oc[#q!c!d!e#t#v#xQ$a!zd$o#a$p$s%q%u%z&d&l&x'QQ$r#cQ%R#{S%g$a%iQ%l$kQ&^%hR&p&P]#s!c!d!e#t#v#xW!Z]b!g$PQ!ufQ#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector 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 , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp 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 AtRule Styles",maxTerm:143,nodeProps:[["isolate",-2,5,36,""],["openedBy",20,"(",28,"[",31,"{"],["closedBy",21,")",29,"]",32,"}"]],propSources:[Nne],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}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}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));Kv=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return Kv||[]}const QE=["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})),CE=["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}))),_ne=["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})),Mne=["@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})),As=/^(\w[\w-]*|-\w[\w-]*|)$/,zne=/^-(-[\w-]*)?$/;function Dne(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return(r==null?void 0:r.name)!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const NE=new HM,Lne=["Declaration"];function Xne(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function V4(t,e,n){if(e.to-e.from>4096){let r=NE.get(e);if(r)return r;let i=[],s=new Set,l=e.cursor(dt.IncludeAnonymous);if(l.firstChild())do for(let c of V4(t,l.node,n))s.has(c.label)||(s.add(c.label),i.push(c));while(l.nextSibling());return NE.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(s=>{var l;if(n(s)&&s.matchContext(Lne)&&((l=s.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let c=t.sliceString(s.from,s.to);i.has(c)||(i.add(c),r.push({label:c,type:"variable"}))}}),r}}const Zne=t=>e=>{let{state:n,pos:r}=e,i=Gt(n).resolveInner(r,-1),s=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(s||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:Jv(),validFor:As};if(i.name=="ValueName")return{from:i.from,options:CE,validFor:As};if(i.name=="PseudoClassName")return{from:i.from,options:QE,validFor:As};if(t(i)||(e.explicit||s)&&Dne(i,n.doc))return{from:t(i)||s?i.from:r,options:V4(n.doc,Xne(i),t),validFor:zne};if(i.name=="TagName"){for(let{parent:u}=i;u;u=u.parent)if(u.name=="Block")return{from:i.from,options:Jv(),validFor:As};return{from:i.from,options:_ne,validFor:As}}if(i.name=="AtKeyword")return{from:i.from,options:Mne,validFor:As};if(!e.explicit)return null;let l=i.resolve(r),c=l.childBefore(r);return c&&c.name==":"&&l.name=="PseudoClassSelector"?{from:r,options:QE,validFor:As}:c&&c.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:r,options:CE,validFor:As}:l.name=="Block"||l.name=="Styles"?{from:r,options:Jv(),validFor:As}:null},qne=Zne(t=>t.name=="VariableName"),Bg=lo.define({name:"css",parser:Rne.configure({props:[Su.add({Declaration:Im()}),wu.add({"Block KeyframeList":Ck})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Ine(){return new su(Bg,Bg.data.of({autocomplete:qne}))}const Bne=316,Yne=317,TE=1,Vne=2,Une=3,Wne=4,Gne=318,Fne=320,Hne=321,Kne=5,Jne=6,ere=0,iS=[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],U4=125,tre=59,sS=47,nre=42,rre=43,ire=45,sre=60,are=44,lre=63,ore=46,cre=91,ure=new _k({start:!1,shift(t,e){return e==Kne||e==Jne||e==Fne?t:e==Hne},strict:!1}),dre=new $n((t,e)=>{let{next:n}=t;(n==U4||n==-1||e.context)&&t.acceptToken(Gne)},{contextual:!0,fallback:!0}),hre=new $n((t,e)=>{let{next:n}=t,r;iS.indexOf(n)>-1||n==sS&&((r=t.peek(1))==sS||r==nre)||n!=U4&&n!=tre&&n!=-1&&!e.context&&t.acceptToken(Bne)},{contextual:!0}),fre=new $n((t,e)=>{t.next==cre&&!e.context&&t.acceptToken(Yne)},{contextual:!0}),pre=new $n((t,e)=>{let{next:n}=t;if(n==rre||n==ire){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(TE);t.acceptToken(r?TE:Vne)}}else n==lre&&t.peek(1)==ore&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(Une))},{contextual:!0});function ey(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const mre=new $n((t,e)=>{if(t.next!=sre||!e.dialectEnabled(ere)||(t.advance(),t.next==sS))return;let n=0;for(;iS.indexOf(t.next)>-1;)t.advance(),n++;if(ey(t.next,!0)){for(t.advance(),n++;ey(t.next,!1);)t.advance(),n++;for(;iS.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==are)return;for(let r=0;;r++){if(r==7){if(!ey(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(Wne,-n)}),gre=bo({"get set async static":z.modifier,"for while do if else switch try catch finally return throw break continue default case defer":z.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":z.operatorKeyword,"let var const using function class extends":z.definitionKeyword,"import export from":z.moduleKeyword,"with debugger new":z.keyword,TemplateString:z.special(z.string),super:z.atom,BooleanLiteral:z.bool,this:z.self,null:z.null,Star:z.modifier,VariableName:z.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":z.function(z.variableName),VariableDefinition:z.definition(z.variableName),Label:z.labelName,PropertyName:z.propertyName,PrivatePropertyName:z.special(z.propertyName),"CallExpression/MemberExpression/PropertyName":z.function(z.propertyName),"FunctionDeclaration/VariableDefinition":z.function(z.definition(z.variableName)),"ClassDeclaration/VariableDefinition":z.definition(z.className),"NewExpression/VariableName":z.className,PropertyDefinition:z.definition(z.propertyName),PrivatePropertyDefinition:z.definition(z.special(z.propertyName)),UpdateOp:z.updateOperator,"LineComment Hashbang":z.lineComment,BlockComment:z.blockComment,Number:z.number,String:z.string,Escape:z.escape,ArithOp:z.arithmeticOperator,LogicOp:z.logicOperator,BitOp:z.bitwiseOperator,CompareOp:z.compareOperator,RegExp:z.regexp,Equals:z.definitionOperator,Arrow:z.function(z.punctuation),": Spread":z.punctuation,"( )":z.paren,"[ ]":z.squareBracket,"{ }":z.brace,"InterpolationStart InterpolationEnd":z.special(z.brace),".":z.derefOperator,", ;":z.separator,"@":z.meta,TypeName:z.typeName,TypeDefinition:z.definition(z.typeName),"type enum interface implements namespace module declare":z.definitionKeyword,"abstract global Privacy readonly override":z.modifier,"is keyof unique infer asserts":z.operatorKeyword,JSXAttributeValue:z.attributeValue,JSXText:z.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":z.angleBracket,"JSXIdentifier JSXNameSpacedName":z.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":z.attributeName,"JSXBuiltin/JSXIdentifier":z.standard(z.tagName)}),Ore={__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},xre={__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},bre={__proto__:null,"<":193},vre=oo.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO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efinition 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:ure,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:[gre],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;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j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<%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:[hre,fre,pre,mre,2,3,4,5,6,7,8,9,10,11,12,13,14,dre,new qg("$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 qg("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=>Ore[t]||-1},{term:343,get:t=>xre[t]||-1},{term:95,get:t=>bre[t]||-1}],tokenPrec:15201}),W4=[cr("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),cr("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),cr("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),cr("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),cr("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),cr(`try {
|
|
565
|
+
\${}
|
|
566
|
+
} catch (\${error}) {
|
|
567
|
+
\${}
|
|
568
|
+
}`,{label:"try",detail:"/ catch block",type:"keyword"}),cr("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),cr(`if (\${}) {
|
|
569
|
+
\${}
|
|
570
|
+
} else {
|
|
571
|
+
\${}
|
|
572
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),cr(`class \${name} {
|
|
573
|
+
constructor(\${params}) {
|
|
574
|
+
\${}
|
|
575
|
+
}
|
|
576
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),cr('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),cr('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],yre=W4.concat([cr("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),cr("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),cr("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),$E=new HM,G4=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Pd(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const Sre=["FunctionDeclaration"],wre={FunctionDeclaration:Pd("function"),ClassDeclaration:Pd("class"),ClassExpression:()=>!0,EnumDeclaration:Pd("constant"),TypeAliasDeclaration:Pd("type"),NamespaceDeclaration:Pd("namespace"),VariableDefinition(t,e){t.matchContext(Sre)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function F4(t,e){let n=$E.get(e);if(n)return n;let r=[],i=!0;function s(l,c){let u=t.sliceString(l.from,l.to);r.push({label:u,type:c})}return e.cursor(dt.IncludeAnonymous).iterate(l=>{if(i)i=!1;else if(l.name){let c=wre[l.name];if(c&&c(l,s)||G4.has(l.name))return!1}else if(l.to-l.from>8192){for(let c of F4(t,l.node))r.push(c);return!1}}),$E.set(e,r),r}const EE=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,H4=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function kre(t){let e=Gt(t.state).resolveInner(t.pos,-1);if(H4.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&EE.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)G4.has(i.name)&&(r=r.concat(F4(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:EE}}const as=lo.define({name:"javascript",parser:vre.configure({props:[Su.add({IfStatement:Im({except:/^\s*({|else\b)/}),TryStatement:Im({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:fee,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:W1({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Im({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}}),wu.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Ck,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,r=t.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?t.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),K4={test:t=>/^JSX/.test(t.name),facet:kk({commentTokens:{block:{open:"{/*",close:"*/}"}}})},J4=as.configure({dialect:"ts"},"typescript"),ez=as.configure({dialect:"jsx",props:[jk.add(t=>t.isTop?[K4]:void 0)]}),tz=as.configure({dialect:"jsx ts",props:[jk.add(t=>t.isTop?[K4]:void 0)]},"typescript");let nz=t=>({label:t,type:"keyword"});const rz="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(nz),jre=rz.concat(["declare","implements","private","protected","public"].map(nz));function iz(t={}){let e=t.jsx?t.typescript?tz:ez:t.typescript?J4:as,n=t.typescript?yre.concat(jre):W4.concat(rz);return new su(e,[as.data.of({autocomplete:Tee(H4,Nee(n))}),as.data.of({autocomplete:kre}),t.jsx?Nre:[]])}function Qre(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 PE(t,e,n=t.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const Cre=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Nre=Te.inputHandler.of((t,e,n,r,i)=>{if((Cre?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!as.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:l}=s,c=l.changeByRange(u=>{var f;let{head:p}=u,m=Gt(l).resolveInner(p-1,-1),O;if(m.name=="JSXStartTag"&&(m=m.parent),!(l.doc.sliceString(p-1,p)!=r||m.name=="JSXAttributeValue"&&m.to>p)){if(r==">"&&m.name=="JSXFragmentTag")return{range:u,changes:{from:p,insert:"</>"}};if(r=="/"&&m.name=="JSXStartCloseTag"){let x=m.parent,v=x.parent;if(v&&x.from==p-2&&((O=PE(l.doc,v.firstChild,p))||((f=v.firstChild)===null||f===void 0?void 0:f.name)=="JSXFragmentTag")){let S=`${O}>`;return{range:pe.cursor(p+S.length,-1),changes:{from:p,insert:S}}}}else if(r==">"){let x=Qre(m);if(x&&x.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(l.doc.sliceString(p,p+2))&&(O=PE(l.doc,x,p)))return{range:u,changes:{from:p,insert:`</${O}>`}}}}return{range:u}});return c.changes.empty?!1:(t.dispatch([s,l.update(c,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Ad=["_blank","_self","_top","_parent"],ty=["ascii","utf-8","utf-16","latin1","latin1"],ny=["get","post","put","delete"],ry=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],$r=["true","false"],Qe={},Tre={a:{attrs:{href:null,ping:null,type:null,media:null,target:Ad,hreflang:null}},abbr:Qe,address:Qe,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Qe,aside:Qe,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Qe,base:{attrs:{href:null,target:Ad}},bdi:Qe,bdo:Qe,blockquote:{attrs:{cite:null}},body:Qe,br:Qe,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:ry,formmethod:ny,formnovalidate:["novalidate"],formtarget:Ad,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Qe,center:Qe,cite:Qe,code:Qe,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:Qe,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Qe,div:Qe,dl:Qe,dt:Qe,em:Qe,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Qe,figure:Qe,footer:Qe,form:{attrs:{action:null,name:null,"accept-charset":ty,autocomplete:["on","off"],enctype:ry,method:ny,novalidate:["novalidate"],target:Ad}},h1:Qe,h2:Qe,h3:Qe,h4:Qe,h5:Qe,h6:Qe,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Qe,hgroup:Qe,hr:Qe,html:{attrs:{manifest:null}},i:Qe,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:ry,formmethod:ny,formnovalidate:["novalidate"],formtarget:Ad,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:Qe,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Qe,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:Qe,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:ty,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:Qe,noscript:Qe,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:Qe,param:{attrs:{name:null,value:null}},pre:Qe,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Qe,rt:Qe,ruby:Qe,samp:Qe,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:ty}},section:Qe,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Qe,source:{attrs:{src:null,type:null,media:null}},span:Qe,strong:Qe,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Qe,summary:Qe,sup:Qe,table:Qe,tbody:Qe,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Qe,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:Qe,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Qe,time:{attrs:{datetime:null}},title:Qe,tr:Qe,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Qe,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:Qe},sz={accesskey:null,class:null,contenteditable:$r,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:$r,autocorrect:$r,autocapitalize:$r,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":$r,"aria-autocomplete":["inline","list","both","none"],"aria-busy":$r,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":$r,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":$r,"aria-hidden":$r,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":$r,"aria-multiselectable":$r,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":$r,"aria-relevant":null,"aria-required":$r,"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},az="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 az)sz[t]=null;class Wh{constructor(e,n){this.tags={...Tre,...e},this.globalAttrs={...sz,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Wh.default=new Wh;function lu(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}function ou(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function lz(t,e,n){let r=n.tags[lu(t,ou(e))];return(r==null?void 0:r.children)||n.allTags}function Xk(t,e){let n=[];for(let r=ou(e);r&&!r.type.isTop;r=ou(r.parent)){let i=lu(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}const oz=/^[:\-\.\w\u00b7-\uffff]*$/;function AE(t,e,n,r,i){let s=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",l=ou(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:lz(t.doc,l,e).map(c=>({label:c,type:"type"})).concat(Xk(t.doc,n).map((c,u)=>({label:"/"+c,apply:"/"+c+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function RE(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:Xk(t.doc,e).map((s,l)=>({label:s,apply:s+i,type:"type",boost:99-l})),validFor:oz}}function $re(t,e,n,r){let i=[],s=0;for(let l of lz(t.doc,n,e))i.push({label:"<"+l,type:"type"});for(let l of Xk(t.doc,n))i.push({label:"</"+l+">",type:"type",boost:99-s++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Ere(t,e,n,r,i){let s=ou(n),l=s?e.tags[lu(t.doc,s)]:null,c=l&&l.attrs?Object.keys(l.attrs):[],u=l&&l.globalAttrs===!1?c:c.length?c.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:u.map(f=>({label:f,type:"property"})),validFor:oz}}function Pre(t,e,n,r,i){var s;let l=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),c=[],u;if(l){let f=t.sliceDoc(l.from,l.to),p=e.globalAttrs[f];if(!p){let m=ou(n),O=m?e.tags[lu(t.doc,m)]:null;p=(O==null?void 0:O.attrs)&&O.attrs[f]}if(p){let m=t.sliceDoc(r,i).toLowerCase(),O='"',x='"';/^['"]/.test(m)?(u=m[0]=='"'?/^[^"]*$/:/^[^']*$/,O="",x=t.sliceDoc(i,i+1)==m[0]?"":m[0],m=m.slice(1),r++):u=/^[^\s<>='"]*$/;for(let v of p)c.push({label:v,apply:O+v+x,type:"constant"})}}return{from:r,to:i,options:c,validFor:u}}function cz(t,e){let{state:n,pos:r}=e,i=Gt(n).resolveInner(r,-1),s=i.resolve(r);for(let l=r,c;s==i&&(c=i.childBefore(l));){let u=c.lastChild;if(!u||!u.type.isError||u.from<u.to)break;s=i=c,l=u.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?RE(n,i,i.from,r):AE(n,t,i,i.from,r):i.name=="StartTag"||i.name=="IncompleteTag"?AE(n,t,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?RE(n,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?Ere(n,t,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?Pre(n,t,i,i.name=="Is"?r:i.from,r):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?$re(n,t,i,r):null}function Are(t){return cz(Wh.default,t)}function Rre(t){let{extraTags:e,extraGlobalAttributes:n}=t,r=n||e?new Wh(e,n):Wh.default;return i=>cz(r,i)}const _re=as.parser.configure({top:"SingleExpression"}),uz=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:J4.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:ez.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:tz.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:_re},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:as.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:Bg.parser}],dz=[{name:"style",parser:Bg.parser.configure({top:"Styles"})}].concat(az.map(t=>({name:t,parser:as.parser}))),hz=lo.define({name:"html",parser:lne.configure({props:[Su.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 r=t.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((n=e.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),wu.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}}}),a4.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Vm=hz.configure({wrap:Z4(uz,dz)});function fz(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=Z4((t.nestedLanguages||[]).concat(uz),(t.nestedAttributes||[]).concat(dz)));let r=n?hz.configure({wrap:n,dialect:e}):e?Vm.configure({dialect:e}):Vm;return new su(r,[Vm.data.of({autocomplete:Rre(t)}),t.autoCloseTags!==!1?Mre:[],iz().support,Ine().support])}const _E=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Mre=Te.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!Vm.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:l}=s,c=l.changeByRange(u=>{var f,p,m;let O=l.doc.sliceString(u.from-1,u.to)==r,{head:x}=u,v=Gt(l).resolveInner(x,-1),S;if(O&&r==">"&&v.name=="EndTag"){let k=v.parent;if(((p=(f=k.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=lu(l.doc,k.parent,x))&&!_E.has(S)){let w=x+(l.doc.sliceString(x,x+1)===">"?1:0),N=`</${S}>`;return{range:u,changes:{from:x,to:w,insert:N}}}}else if(O&&r=="/"&&v.name=="IncompleteCloseTag"){let k=v.parent;if(v.from==x-2&&((m=k.lastChild)===null||m===void 0?void 0:m.name)!="CloseTag"&&(S=lu(l.doc,k,x))&&!_E.has(S)){let w=x+(l.doc.sliceString(x,x+1)===">"?1:0),N=`${S}>`;return{range:pe.cursor(x+N.length,-1),changes:{from:x,to:w,insert:N}}}}return{range:u}});return c.changes.empty?!1:(t.dispatch([s,l.update(c,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),pz=kk({commentTokens:{block:{open:"<!--",close:"-->"}}}),mz=new Re,gz=tte.configure({props:[wu.add(t=>!t.is("Block")||t.is("Document")||aS(t)!=null||zre(t)?void 0:(e,n)=>({from:n.doc.lineAt(e.from).to,to:e.to})),mz.add(aS),Su.add({Document:()=>null}),Zl.add({Document:pz})]});function aS(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function zre(t){return t.name=="OrderedList"||t.name=="BulletList"}function Dre(t,e){let n=t;for(;;){let r=n.nextSibling,i;if(!r||(i=aS(r.type))!=null&&i<=e)break;n=r}return n.to}const Lre=pee.of((t,e,n)=>{for(let r=Gt(t).resolveInner(n,-1);r&&!(r.from<e);r=r.parent){let i=r.type.prop(mz);if(i==null)continue;let s=Dre(r,i);if(s>n)return{from:n,to:s}}return null});function Zk(t){return new ni(pz,t,[],"markdown")}const Xre=Zk(gz),Zre=gz.configure([hte,pte,fte,mte,{props:[wu.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),Yg=Zk(Zre);function qre(t,e){return n=>{if(n&&t){let r=null;if(n=/\S*/.exec(n)[0],typeof t=="function"?r=t(n):r=_g.matchLanguageName(t,n,!0),r instanceof _g)return r.support?r.support.language.parser:Ih.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}let iy=class{constructor(e,n,r,i,s,l,c){this.node=e,this.from=n,this.to=r,this.spaceBefore=i,this.spaceAfter=s,this.type=l,this.item=c}blank(e,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length<e;)r+=" ";return r}else{for(let i=this.to-this.from-r.length-this.spaceAfter.length;i>0;i--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(e,n){let r=this.node.name=="OrderedList"?String(+xz(this.item,e)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}};function Oz(t,e){let n=[],r=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return r;(i.name=="ListItem"||i.name=="Blockquote")&&n.push(i)}for(let i=n.length-1;i>=0;i--){let s=n[i],l,c=e.lineAt(s.from),u=s.from-c.from;if(s.name=="Blockquote"&&(l=/^ *>( ?)/.exec(c.text.slice(u))))r.push(new iy(s,u,u+l[0].length,"",l[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(l=/^( *)\d+([.)])( *)/.exec(c.text.slice(u)))){let f=l[3],p=l[0].length;f.length>=4&&(f=f.slice(0,f.length-4),p-=4),r.push(new iy(s.parent,u,u+p,l[1],f,l[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(l=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(c.text.slice(u)))){let f=l[4],p=l[0].length;f.length>4&&(f=f.slice(0,f.length-4),p-=4);let m=l[2];l[3]&&(m+=l[3].replace(/[xX]/," ")),r.push(new iy(s.parent,u,u+p,l[1],f,m,s))}}return r}function xz(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function sy(t,e,n,r=0){for(let i=-1,s=t;;){if(s.name=="ListItem"){let c=xz(s,e),u=+c[2];if(i>=0){if(u!=i+1)return;n.push({from:s.from+c[1].length,to:s.from+c[0].length,insert:String(i+2+r)})}i=u}let l=s.nextSibling;if(!l)break;s=l}}function qk(t,e){let n=/^[ \t]*/.exec(t)[0].length;if(!n||e.facet(Qf)!=" ")return t;let r=Ws(t,4,n),i="";for(let s=r;s>0;)s>=4?(i+=" ",s-=4):(i+=" ",s--);return i+t.slice(n)}const Ire=(t={})=>({state:e,dispatch:n})=>{let r=Gt(e),{doc:i}=e,s=null,l=e.changeByRange(c=>{if(!c.empty||!Yg.isActiveAt(e,c.from,-1)&&!Yg.isActiveAt(e,c.from,1))return s={range:c};let u=c.from,f=i.lineAt(u),p=Oz(r.resolveInner(u,-1),i);for(;p.length&&p[p.length-1].from>u-f.from;)p.pop();if(!p.length)return s={range:c};let m=p[p.length-1];if(m.to-m.spaceAfter.length>u-f.from)return s={range:c};let O=u>=m.to-m.spaceAfter.length&&!/\S/.test(f.text.slice(m.to));if(m.item&&O){let w=m.node.firstChild,N=m.node.getChild("ListItem","ListItem");if(w.to>=u||N&&N.to<u||f.from>0&&!/[^\s>]/.test(i.lineAt(f.from-1).text)||t.nonTightLists===!1){let C=p.length>1?p[p.length-2]:null,E,M="";C&&C.item?(E=f.from+C.from,M=C.marker(i,1)):E=f.from+(C?C.to:0);let R=[{from:E,to:u,insert:M}];return m.node.name=="OrderedList"&&sy(m.item,i,R,-2),C&&C.node.name=="OrderedList"&&sy(C.item,i,R),{range:pe.cursor(E+M.length),changes:R}}else{let C=zE(p,e,f);return{range:pe.cursor(u+C.length+1),changes:{from:f.from,insert:C+e.lineBreak}}}}if(m.node.name=="Blockquote"&&O&&f.from){let w=i.lineAt(f.from-1),N=/>\s*$/.exec(w.text);if(N&&N.index==m.from){let C=e.changes([{from:w.from+N.index,to:w.to},{from:f.from+m.from,to:f.to}]);return{range:c.map(C),changes:C}}}let x=[];m.node.name=="OrderedList"&&sy(m.item,i,x);let v=m.item&&m.item.from<f.from,S="";if(!v||/^[\s\d.)\-+*>]*/.exec(f.text)[0].length>=m.to)for(let w=0,N=p.length-1;w<=N;w++)S+=w==N&&!v?p[w].marker(i,1):p[w].blank(w<N?Ws(f.text,4,p[w+1].from)-S.length:null);let k=u;for(;k>f.from&&/\s/.test(f.text.charAt(k-f.from-1));)k--;return S=qk(S,e),Yre(m.node,e.doc)&&(S=zE(p,e,f)+e.lineBreak+S),x.push({from:k,to:u,insert:e.lineBreak+S}),{range:pe.cursor(k+S.length+1),changes:x}});return s?!1:(n(e.update(l,{scrollIntoView:!0,userEvent:"input"})),!0)},Bre=Ire();function ME(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Yre(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let n=t.firstChild,r=t.getChild("ListItem","ListItem");if(!r)return!1;let i=e.lineAt(n.to),s=e.lineAt(r.from),l=/^[\s>]*$/.test(i.text);return i.number+(l?0:1)<s.number}function zE(t,e,n){let r="";for(let i=0,s=t.length-2;i<=s;i++)r+=t[i].blank(i<s?Ws(n.text,4,t[i+1].from)-r.length:null,i<s);return qk(r,e)}function Vre(t,e){let n=t.resolveInner(e,-1),r=e;ME(n)&&(r=n.from,n=n.parent);for(let i;i=n.childBefore(r);)if(ME(i))r=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")n=i.lastChild,r=n.to;else break;return n}const Ure=({state:t,dispatch:e})=>{let n=Gt(t),r=null,i=t.changeByRange(s=>{let l=s.from,{doc:c}=t;if(s.empty&&Yg.isActiveAt(t,s.from)){let u=c.lineAt(l),f=Oz(Vre(n,l),c);if(f.length){let p=f[f.length-1],m=p.to-p.spaceAfter.length+(p.spaceAfter?1:0);if(l-u.from>m&&!/\S/.test(u.text.slice(m,l-u.from)))return{range:pe.cursor(u.from+m),changes:{from:u.from+m,to:l}};if(l-u.from==m&&(!p.item||u.from<=p.item.from||!/\S/.test(u.text.slice(0,p.to)))){let O=u.from+p.from;if(p.item&&p.node.from<p.item.from&&/\S/.test(u.text.slice(p.from,p.to))){let x=p.blank(Ws(u.text,4,p.to)-Ws(u.text,4,p.from));return O==u.from&&(x=qk(x,t)),{range:pe.cursor(O+x.length),changes:{from:O,to:u.from+p.to,insert:x}}}if(O<l)return{range:pe.cursor(O),changes:{from:O,to:l}}}}}return r={range:s}});return r?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},Wre=[{key:"Enter",run:Bre},{key:"Backspace",run:Ure}],bz=fz({matchClosingTags:!1});function Gre(t={}){let{codeLanguages:e,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=Xre,completeHTMLTags:s=!0,pasteURLAsLink:l=!0,htmlTagLanguage:c=bz}=t;if(!(i instanceof yO))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let u=t.extensions?[t.extensions]:[],f=[c.support,Lre],p;l&&f.push(Jre),n instanceof su?(f.push(n.support),p=n.language):n&&(p=n);let m=e||p?qre(e,p):void 0;u.push(rte({codeParser:m,htmlParser:c.language.parser})),r&&f.push(yf.high(bO.of(Wre)));let O=Zk(i.configure(u));return s&&f.push(O.data.of({autocomplete:Fre})),new su(O,f)}function Fre(t){let{state:e,pos:n}=t,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(n-25,n));if(!r)return null;let i=Gt(e).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:n-r[0].length,to:n,options:Hre(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let ay=null;function Hre(){if(ay)return ay;let t=Are(new Qee(st.create({extensions:bz}),0,!0));return ay=t?t.options:[]}const Kre=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Jre=Te.domEventHandlers({paste:(t,e)=>{var n;let{main:r}=e.state.selection;if(r.empty)return!1;let i=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!Yg.isActiveAt(e.state,r.from,1)))return!1;let s=Gt(e.state),l=!1;return s.iterate({from:r.from,to:r.to,enter:c=>{(c.from>r.from||Kre.test(c.name))&&(l=!0)},leave:c=>{c.to<r.to&&(l=!0)}}),l?!1:(e.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),xc=63,DE=64,eie=1,tie=2,vz=3,nie=4,yz=5,rie=6,iie=7,Sz=65,sie=66,aie=8,lie=9,oie=10,cie=11,uie=12,wz=13,die=19,hie=20,fie=29,pie=33,mie=34,gie=47,Oie=0,Ik=1,lS=2,Gh=3,oS=4;class zl{constructor(e,n,r){this.parent=e,this.depth=n,this.type=r,this.hash=(e?e.hash+e.hash<<8:0)+n+(n<<4)+r}}zl.top=new zl(null,-1,Oie);function ph(t,e){for(let n=0,r=e-t.pos-1;;r--,n++){let i=t.peek(r);if(Fs(i)||i==-1)return n}}function cS(t){return t==32||t==9}function Fs(t){return t==10||t==13}function kz(t){return cS(t)||Fs(t)}function ql(t){return t<0||kz(t)}const xie=new _k({start:zl.top,reduce(t,e){return t.type==Gh&&(e==hie||e==mie)?t.parent:t},shift(t,e,n,r){if(e==vz)return new zl(t,ph(r,r.pos),Ik);if(e==Sz||e==yz)return new zl(t,ph(r,r.pos),lS);if(e==xc)return t.parent;if(e==die||e==pie)return new zl(t,0,Gh);if(e==wz&&t.type==oS)return t.parent;if(e==gie){let i=/[1-9]/.exec(r.read(r.pos,n.pos));if(i)return new zl(t,t.depth+ +i[0],oS)}return t},hash(t){return t.hash}});function cu(t,e,n=0){return t.peek(n)==e&&t.peek(n+1)==e&&t.peek(n+2)==e&&ql(t.peek(n+3))}const bie=new $n((t,e)=>{if(t.next==-1&&e.canShift(DE))return t.acceptToken(DE);let n=t.peek(-1);if((Fs(n)||n<0)&&e.context.type!=Gh){if(cu(t,45))if(e.canShift(xc))t.acceptToken(xc);else return t.acceptToken(eie,3);if(cu(t,46))if(e.canShift(xc))t.acceptToken(xc);else return t.acceptToken(tie,3);let r=0;for(;t.next==32;)r++,t.advance();(r<e.context.depth||r==e.context.depth&&e.context.type==Ik&&(t.next!=45||!ql(t.peek(1))))&&t.next!=-1&&!Fs(t.next)&&t.next!=35&&t.acceptToken(xc,-r)}},{contextual:!0}),vie=new $n((t,e)=>{if(e.context.type==Gh){t.next==63&&(t.advance(),ql(t.next)&&t.acceptToken(iie));return}if(t.next==45)t.advance(),ql(t.next)&&t.acceptToken(e.context.type==Ik&&e.context.depth==ph(t,t.pos-1)?nie:vz);else if(t.next==63)t.advance(),ql(t.next)&&t.acceptToken(e.context.type==lS&&e.context.depth==ph(t,t.pos-1)?rie:yz);else{let n=t.pos;for(;;)if(cS(t.next)){if(t.pos==n)return;t.advance()}else if(t.next==33)jz(t);else if(t.next==38)uS(t);else if(t.next==42){uS(t);break}else if(t.next==39||t.next==34){if(Bk(t,!0))break;return}else if(t.next==91||t.next==123){if(!Sie(t))return;break}else{Qz(t,!0,!1,0);break}for(;cS(t.next);)t.advance();if(t.next==58){if(t.pos==n&&e.canShift(fie))return;let r=t.peek(1);ql(r)&&t.acceptTokenTo(e.context.type==lS&&e.context.depth==ph(t,n)?sie:Sz,n)}}},{contextual:!0});function yie(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 LE(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function XE(t,e){return t.next==37?(t.advance(),LE(t.next)&&t.advance(),LE(t.next)&&t.advance(),!0):yie(t.next)||e&&t.next==44?(t.advance(),!0):!1}function jz(t){if(t.advance(),t.next==60){for(t.advance();;)if(!XE(t,!0)){t.next==62&&t.advance();break}}else for(;XE(t,!1););}function uS(t){for(t.advance();!ql(t.next)&&Vg(t.next)!="f";)t.advance()}function Bk(t,e){let n=t.next,r=!1,i=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(Fs(s)){if(e)return!1;r=!0}else if(e&&t.pos>=i+1024)return!1}return!r}function Sie(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(!Bk(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||Fs(t.next))return!1;t.advance()}}const wie="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function Vg(t){return t<33?"u":t>125?"s":wie[t-33]}function ly(t,e){let n=Vg(t);return n!="u"&&!(e&&n=="f")}function Qz(t,e,n,r){if(Vg(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&ly(t.peek(1),n))t.advance();else return!1;let i=t.pos;for(;;){let s=t.next,l=0,c=r+1;for(;kz(s);){if(Fs(s)){if(e)return!1;c=0}else c++;s=t.peek(++l)}if(!(s>=0&&(s==58?ly(t.peek(l+1),n):s==35?t.peek(l-1)!=32:ly(s,n)))||!n&&c<=r||c==0&&!n&&(cu(t,45,l)||cu(t,46,l)))break;if(e&&Vg(s)=="f")return!1;for(let f=l;f>=0;f--)t.advance();if(e&&t.pos>i+1024)return!1}return!0}const kie=new $n((t,e)=>{if(t.next==33)jz(t),t.acceptToken(uie);else if(t.next==38||t.next==42){let n=t.next==38?oie:cie;uS(t),t.acceptToken(n)}else t.next==39||t.next==34?(Bk(t,!1),t.acceptToken(lie)):Qz(t,!1,e.context.type==Gh,e.context.depth)&&t.acceptToken(aie)}),jie=new $n((t,e)=>{let n=e.context.type==oS?e.context.depth:-1,r=t.pos;e:for(;;){let i=0,s=t.next;for(;s==32;)s=t.peek(++i);if(!i&&(cu(t,45,i)||cu(t,46,i))||!Fs(s)&&(n<0&&(n=Math.max(e.context.depth+1,i)),i<n))break;for(;;){if(t.next<0)break e;let l=Fs(t.next);if(t.advance(),l)continue e;r=t.pos}}t.acceptTokenTo(wz,r)}),Qie=bo({DirectiveName:z.keyword,DirectiveContent:z.attributeValue,"DirectiveEnd DocEnd":z.meta,QuotedLiteral:z.string,BlockLiteralHeader:z.special(z.string),BlockLiteralContent:z.content,Literal:z.content,"Key/Literal Key/QuotedLiteral":z.definition(z.propertyName),"Anchor Alias":z.labelName,Tag:z.typeName,Comment:z.lineComment,": , -":z.separator,"?":z.punctuation,"[ ]":z.squareBracket,"{ }":z.brace}),Cie=oo.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'#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b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#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:xie,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[Qie],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:[bie,vie,kie,jie,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),Nie=lo.define({name:"yaml",parser:Cie.configure({props:[Su.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.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:W1({closing:"}"}),FlowSequence:W1({closing:"]"})}),wu.add({"FlowMapping FlowSequence":Ck,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function Tie(){return new su(Nie)}const $ie=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=Vk(t.state,n.from);return r.line?Eie(t):r.block?Aie(t):!1};function Yk(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const Eie=Yk(Mie,0),Pie=Yk(Cz,0),Aie=Yk((t,e)=>Cz(t,e,_ie(e)),0);function Vk(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const Rd=50;function Rie(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-Rd,r),l=t.sliceDoc(i,i+Rd),c=/\s*$/.exec(s)[0].length,u=/^\s*/.exec(l)[0].length,f=s.length-c;if(s.slice(f-e.length,f)==e&&l.slice(u,u+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:i+u,margin:u&&1}};let p,m;i-r<=2*Rd?p=m=t.sliceDoc(r,i):(p=t.sliceDoc(r,r+Rd),m=t.sliceDoc(i-Rd,i));let O=/^\s*/.exec(p)[0].length,x=/\s*$/.exec(m)[0].length,v=m.length-x-n.length;return p.slice(O,O+e.length)==e&&m.slice(v,v+n.length)==n?{open:{pos:r+O+e.length,margin:/\s/.test(p.charAt(O+e.length))?1:0},close:{pos:i-x-n.length,margin:/\s/.test(m.charAt(v-1))?1:0}}:null}function _ie(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function Cz(t,e,n=e.selection.ranges){let r=n.map(s=>Vk(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,l)=>Rie(e,r[l],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(n.map((s,l)=>i[l]?[]:[{from:s.from,insert:r[l].open+" "},{from:s.to,insert:" "+r[l].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let l=0,c;l<i.length;l++)if(c=i[l]){let u=r[l],{open:f,close:p}=c;s.push({from:f.pos-u.open.length,to:f.pos+f.margin},{from:p.pos-p.margin,to:p.pos+u.close.length})}return{changes:s}}return null}function Mie(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:l}of n){let c=r.length,u=1e9,f;for(let p=s;p<=l;){let m=e.doc.lineAt(p);if(f==null&&(f=Vk(e,m.from).line,!f))continue e;if(m.from>i&&(s==l||l>m.from)){i=m.from;let O=/^\s*/.exec(m.text)[0].length,x=O==m.length,v=m.text.slice(O,O+f.length)==f?O:-1;O<m.text.length&&O<u&&(u=O),r.push({line:m,comment:v,token:f,indent:O,empty:x,single:!1})}p=m.to+1}if(u<1e9)for(let p=c;p<r.length;p++)r[p].indent<r[p].line.text.length&&(r[p].indent=u);r.length==c+1&&(r[c].single=!0)}if(t!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:c,token:u,indent:f,empty:p,single:m}of r)(m||!p)&&s.push({from:c.from+f,insert:u+" "});let l=e.changes(s);return{changes:l,selection:e.selection.map(l,1)}}else if(t!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:l,comment:c,token:u}of r)if(c>=0){let f=l.from+c,p=f+u.length;l.text[p-l.from]==" "&&p++,s.push({from:f,to:p})}return{changes:s}}return null}const dS=na.define(),zie=na.define(),Die=Ae.define(),Nz=Ae.define({combine(t){return LH(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),Tz=ta.define({create(){return ts.empty},update(t,e){let n=e.state.facet(Nz),r=e.annotation(dS);if(r){let u=mr.fromTransaction(e,r.selection),f=r.side,p=f==0?t.undone:t.done;return u?p=Ug(p,p.length,n.minDepth,u):p=Pz(p,e.startState.selection),new ts(f==0?r.rest:p,f==0?p:r.rest)}let i=e.annotation(zie);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(on.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=mr.fromTransaction(e),l=e.annotation(on.time),c=e.annotation(on.userEvent);return s?t=t.addChanges(s,l,c,n,e):e.selection&&(t=t.addSelection(e.startState.selection,l,c,n.newGroupDelay)),(i=="full"||i=="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 ts(t.done.map(mr.fromJSON),t.undone.map(mr.fromJSON))}});function Lie(t={}){return[Tz,Nz.of(t),Te.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?$z:e.inputType=="historyRedo"?hS:null;return r?(e.preventDefault(),r(n)):!1}})]}function SO(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(Tz,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const $z=SO(0,!1),hS=SO(1,!1),Xie=SO(0,!0),Zie=SO(1,!0);class mr{constructor(e,n,r,i,s){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new mr(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;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:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new mr(e.changes&&hn.fromJSON(e.changes),[],e.mapped&&ss.fromJSON(e.mapped),e.startSelection&&pe.fromJSON(e.startSelection),e.selectionsAfter.map(pe.fromJSON))}static fromTransaction(e,n){let r=ri;for(let i of e.startState.facet(Die)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new mr(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,ri)}static selection(e){return new mr(void 0,ri,void 0,void 0,e)}}function Ug(t,e,n,r){let i=e+1>n+20?e-n-1:0,s=t.slice(i,e);return s.push(r),s}function qie(t,e){let n=[],r=!1;return t.iterChangedRanges((i,s)=>n.push(i,s)),e.iterChangedRanges((i,s,l,c)=>{for(let u=0;u<n.length;){let f=n[u++],p=n[u++];c>=f&&l<=p&&(r=!0)}}),r}function Iie(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function Ez(t,e){return t.length?e.length?t.concat(e):t:e}const ri=[],Bie=200;function Pz(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Bie));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),Ug(t,t.length-1,1e9,n.setSelAfter(r)))}else return[mr.selection([e])]}function Yie(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 oy(t,e){if(!t.length)return t;let n=t.length,r=ri;for(;n;){let i=Vie(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=t.slice(0,n);return s[n-1]=i,s}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[mr.selection(r)]:ri}function Vie(t,e,n){let r=Ez(t.selectionsAfter.length?t.selectionsAfter.map(c=>c.map(e)):ri,n);if(!t.changes)return mr.selection(r);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),l=t.mapped?t.mapped.composeDesc(s):s;return new mr(i,Mt.mapEffects(t.effects,e),l,t.startSelection.map(s),r)}const Uie=/^(input\.type|delete)($|\.)/;class ts{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new ts(this.done,this.undone):this}addChanges(e,n,r,i,s){let l=this.done,c=l[l.length-1];return c&&c.changes&&!c.changes.empty&&e.changes&&(!r||Uie.test(r))&&(!c.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,qie(c.changes,e.changes))||r=="input.type.compose")?l=Ug(l,l.length-1,i.minDepth,new mr(e.changes.compose(c.changes),Ez(Mt.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,ri)):l=Ug(l,l.length,i.minDepth,e),new ts(l,ri,n,r)}addSelection(e,n,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:ri;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Iie(s[s.length-1],e)?this:new ts(Pz(this.done,e),this.undone,n,r)}addMapping(e){return new ts(oy(this.done,e),oy(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],l=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:dS.of({side:e,rest:Yie(i),selection:l}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let c=i.length==1?ri:i.slice(0,i.length-1);return s.mapped&&(c=oy(c,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:dS.of({side:e,rest:c,selection:l}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}ts.empty=new ts(ri,ri);const Wie=[{key:"Mod-z",run:$z,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:hS,preventDefault:!0},{linux:"Ctrl-Shift-z",run:hS,preventDefault:!0},{key:"Mod-u",run:Xie,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Zie,preventDefault:!0}];function ju(t,e){return pe.create(t.ranges.map(e),t.mainIndex)}function Ti(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function $i({state:t,dispatch:e},n){let r=ju(t.selection,n);return r.eq(t.selection,!0)?!1:(e(Ti(t,r)),!0)}function wO(t,e){return pe.cursor(e?t.to:t.from)}function Az(t,e){return $i(t,n=>n.empty?t.moveByChar(n,e):wO(n,e))}function Xn(t){return t.textDirectionAt(t.state.selection.main.head)==cn.LTR}const Rz=t=>Az(t,!Xn(t)),_z=t=>Az(t,Xn(t));function Mz(t,e){return $i(t,n=>n.empty?t.moveByGroup(n,e):wO(n,e))}const Gie=t=>Mz(t,!Xn(t)),Fie=t=>Mz(t,Xn(t));function Hie(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function kO(t,e,n){let r=Gt(t).resolveInner(e.head),i=n?Re.closedBy:Re.openedBy;for(let u=e.head;;){let f=n?r.childAfter(u):r.childBefore(u);if(!f)break;Hie(t,f,i)?r=f:u=n?f.to:f.from}let s=r.type.prop(i),l,c;return s&&(l=n?yc(t,r.from,1):yc(t,r.to,-1))&&l.matched?c=n?l.end.to:l.end.from:c=n?r.to:r.from,pe.cursor(c,n?-1:1)}const Kie=t=>$i(t,e=>kO(t.state,e,!Xn(t))),Jie=t=>$i(t,e=>kO(t.state,e,Xn(t)));function zz(t,e){return $i(t,n=>{if(!n.empty)return wO(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const Dz=t=>zz(t,!1),Lz=t=>zz(t,!0);function Xz(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let s of t.state.facet(Te.scrollMargins)){let l=s(t);l!=null&&l.top&&(n=Math.max(l==null?void 0:l.top,n)),l!=null&&l.bottom&&(r=Math.max(l==null?void 0:l.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function Zz(t,e){let n=Xz(t),{state:r}=t,i=ju(r.selection,l=>l.empty?t.moveVertically(l,e,n.height):wO(l,e));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let l=t.coordsAtPos(r.selection.main.head),c=t.scrollDOM.getBoundingClientRect(),u=c.top+n.marginTop,f=c.bottom-n.marginBottom;l&&l.top>u&&l.bottom<f&&(s=Te.scrollIntoView(i.main.head,{y:"start",yMargin:l.top-u}))}return t.dispatch(Ti(r,i),{effects:s}),!0}const ZE=t=>Zz(t,!1),fS=t=>Zz(t,!0);function il(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=pe.cursor(r.from+s))}return i}const ese=t=>$i(t,e=>il(t,e,!0)),tse=t=>$i(t,e=>il(t,e,!1)),nse=t=>$i(t,e=>il(t,e,!Xn(t))),rse=t=>$i(t,e=>il(t,e,Xn(t))),ise=t=>$i(t,e=>pe.cursor(t.lineBlockAt(e.head).from,1)),sse=t=>$i(t,e=>pe.cursor(t.lineBlockAt(e.head).to,-1));function ase(t,e,n){let r=!1,i=ju(t.selection,s=>{let l=yc(t,s.head,-1)||yc(t,s.head,1)||s.head>0&&yc(t,s.head-1,1)||s.head<t.doc.length&&yc(t,s.head+1,-1);if(!l||!l.end)return s;r=!0;let c=l.start.from==s.head?l.end.to:l.end.from;return pe.cursor(c)});return r?(e(Ti(t,i)),!0):!1}const lse=({state:t,dispatch:e})=>ase(t,e);function hi(t,e){let n=ju(t.state.selection,r=>{let i=e(r);return pe.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(Ti(t.state,n)),!0)}function qz(t,e){return hi(t,n=>t.moveByChar(n,e))}const Iz=t=>qz(t,!Xn(t)),Bz=t=>qz(t,Xn(t));function Yz(t,e){return hi(t,n=>t.moveByGroup(n,e))}const ose=t=>Yz(t,!Xn(t)),cse=t=>Yz(t,Xn(t)),use=t=>hi(t,e=>kO(t.state,e,!Xn(t))),dse=t=>hi(t,e=>kO(t.state,e,Xn(t)));function Vz(t,e){return hi(t,n=>t.moveVertically(n,e))}const Uz=t=>Vz(t,!1),Wz=t=>Vz(t,!0);function Gz(t,e){return hi(t,n=>t.moveVertically(n,e,Xz(t).height))}const qE=t=>Gz(t,!1),IE=t=>Gz(t,!0),hse=t=>hi(t,e=>il(t,e,!0)),fse=t=>hi(t,e=>il(t,e,!1)),pse=t=>hi(t,e=>il(t,e,!Xn(t))),mse=t=>hi(t,e=>il(t,e,Xn(t))),gse=t=>hi(t,e=>pe.cursor(t.lineBlockAt(e.head).from)),Ose=t=>hi(t,e=>pe.cursor(t.lineBlockAt(e.head).to)),BE=({state:t,dispatch:e})=>(e(Ti(t,{anchor:0})),!0),YE=({state:t,dispatch:e})=>(e(Ti(t,{anchor:t.doc.length})),!0),VE=({state:t,dispatch:e})=>(e(Ti(t,{anchor:t.selection.main.anchor,head:0})),!0),UE=({state:t,dispatch:e})=>(e(Ti(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),xse=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),bse=({state:t,dispatch:e})=>{let n=jO(t).map(({from:r,to:i})=>pe.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:pe.create(n),userEvent:"select"})),!0},vse=({state:t,dispatch:e})=>{let n=ju(t.selection,r=>{let i=Gt(t),s=i.resolveStack(r.from,1);if(r.empty){let l=i.resolveStack(r.from,-1);l.node.from>=s.node.from&&l.node.to<=s.node.to&&(s=l)}for(let l=s;l;l=l.next){let{node:c}=l;if((c.from<r.from&&c.to>=r.to||c.to>r.to&&c.from<=r.from)&&l.next)return pe.range(c.to,c.from)}return r});return n.eq(t.selection)?!1:(e(Ti(t,n)),!0)};function Fz(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let s of n.selection.ranges){let l=n.doc.lineAt(s.head);if(e?l.to<t.state.doc.length:l.from>0)for(let c=s;;){let u=t.moveVertically(c,e);if(u.head<l.from||u.head>l.to){i.some(f=>f.head==u.head)||i.push(u);break}else{if(u.head==c.head)break;c=u}}}return i.length==r.ranges.length?!1:(t.dispatch(Ti(n,pe.create(i,i.length-1))),!0)}const yse=t=>Fz(t,!1),Sse=t=>Fz(t,!0),wse=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=pe.create([n.main]):n.main.empty||(r=pe.create([pe.cursor(n.main.head)])),r?(e(Ti(t,r)),!0):!1};function Tf(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(s=>{let{from:l,to:c}=s;if(l==c){let u=e(s);u<l?(n="delete.backward",u=Sm(t,u,!1)):u>l&&(n="delete.forward",u=Sm(t,u,!0)),l=Math.min(l,u),c=Math.max(c,u)}else l=Sm(t,l,!1),c=Sm(t,c,!0);return l==c?{range:s}:{changes:{from:l,to:c},range:pe.cursor(l,l<s.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Te.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Sm(t,e,n){if(t instanceof Te)for(let r of t.state.facet(Te.atomicRanges).map(i=>i(t)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=n?s:i)});return e}const Hz=(t,e,n)=>Tf(t,r=>{let i=r.from,{state:s}=t,l=s.doc.lineAt(i),c,u;if(n&&!e&&i>l.from&&i<l.from+200&&!/[^ \t]/.test(c=l.text.slice(0,i-l.from))){if(c[c.length-1]==" ")return i-1;let f=Ws(c,s.tabSize),p=f%Mg(s)||Mg(s);for(let m=0;m<p&&c[c.length-1-m]==" ";m++)i--;u=i}else u=Dn(l.text,i-l.from,e,e)+l.from,u==i&&l.number!=(e?s.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(l.text.slice(u-l.from,i-l.from))&&(u=Dn(l.text,u-l.from,!1,!1)+l.from);return u}),pS=t=>Hz(t,!1,!0),Kz=t=>Hz(t,!0,!1),Jz=(t,e)=>Tf(t,n=>{let r=n.head,{state:i}=t,s=i.doc.lineAt(r),l=i.charCategorizer(r);for(let c=null;;){if(r==(e?s.to:s.from)){r==n.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let u=Dn(s.text,r-s.from,e)+s.from,f=s.text.slice(Math.min(r,u)-s.from,Math.max(r,u)-s.from),p=l(f);if(c!=null&&p!=c)break;(f!=" "||r!=n.head)&&(c=p),r=u}return r}),eD=t=>Jz(t,!1),kse=t=>Jz(t,!0),jse=t=>Tf(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),Qse=t=>Tf(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),Cse=t=>Tf(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),Nse=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Je.of(["",""])},range:pe.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Tse=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,s=t.doc.lineAt(i),l=i==s.from?i-1:Dn(s.text,i-s.from,!1)+s.from,c=i==s.to?i+1:Dn(s.text,i-s.from,!0)+s.from;return{changes:{from:l,to:c,insert:t.doc.slice(i,c).append(t.doc.slice(l,i))},range:pe.cursor(c)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function jO(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),s=t.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=t.doc.lineAt(r.to-1)),n>=i.number){let l=e[e.length-1];l.to=s.to,l.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return e}function tD(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of jO(t)){if(n?s.to==t.doc.length:s.from==0)continue;let l=t.doc.lineAt(n?s.to+1:s.from-1),c=l.length+1;if(n){r.push({from:s.to,to:l.to},{from:s.from,insert:l.text+t.lineBreak});for(let u of s.ranges)i.push(pe.range(Math.min(t.doc.length,u.anchor+c),Math.min(t.doc.length,u.head+c)))}else{r.push({from:l.from,to:s.from},{from:s.to,insert:t.lineBreak+l.text});for(let u of s.ranges)i.push(pe.range(u.anchor-c,u.head-c))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:pe.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const $se=({state:t,dispatch:e})=>tD(t,e,!1),Ese=({state:t,dispatch:e})=>tD(t,e,!0);function nD(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of jO(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Pse=({state:t,dispatch:e})=>nD(t,e,!1),Ase=({state:t,dispatch:e})=>nD(t,e,!0),Rse=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(jO(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=ju(e.selection,i=>{let s;if(t.lineWrapping){let l=t.lineBlockAt(i.head),c=t.coordsAtPos(i.head,i.assoc||1);c&&(s=l.bottom+t.documentTop-c.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function _se(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Gt(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(Re.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const WE=rD(!1),Mse=rD(!0);function rD(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:l}=i,c=e.doc.lineAt(s),u=!t&&s==l&&_se(e,s);t&&(s=l=(l<=c.to?c:e.doc.lineAt(l)).to);let f=new vO(e,{simulateBreak:s,simulateDoubleBreak:!!u}),p=n4(f,s);for(p==null&&(p=Ws(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));l<c.to&&/\s/.test(c.text[l-c.from]);)l++;u?{from:s,to:l}=u:s>c.from&&s<c.from+100&&!/\S/.test(c.text.slice(0,s))&&(s=c.from);let m=["",zg(e,p)];return u&&m.push(zg(e,f.lineIndent(c.from,-1))),{changes:{from:s,to:l,insert:Je.of(m)},range:pe.cursor(s+1+m[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Uk(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let l=r.from;l<=r.to;){let c=t.doc.lineAt(l);c.number>n&&(r.empty||r.to>c.from)&&(e(c,i,r),n=c.number),l=c.to+1}let s=t.changes(i);return{changes:i,range:pe.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const zse=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new vO(t,{overrideIndentation:s=>{let l=n[s];return l??-1}}),i=Uk(t,(s,l,c)=>{let u=n4(r,s.from);if(u==null)return;/\S/.test(s.text)||(u=0);let f=/^\s*/.exec(s.text)[0],p=zg(t,u);(f!=p||c.from<s.from+f.length)&&(n[s.from]=u,l.push({from:s.from,to:s.from+f.length,insert:p}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},Dse=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Uk(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Qf)})}),{userEvent:"input.indent"})),!0),Lse=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Uk(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=Ws(i,t.tabSize),l=0,c=zg(t,Math.max(0,s-Mg(t)));for(;l<i.length&&l<c.length&&i.charCodeAt(l)==c.charCodeAt(l);)l++;r.push({from:n.from+l,to:n.from+i.length,insert:c.slice(l)})}),{userEvent:"delete.dedent"})),!0),Xse=t=>(t.setTabFocusMode(),!0),Zse=[{key:"Ctrl-b",run:Rz,shift:Iz,preventDefault:!0},{key:"Ctrl-f",run:_z,shift:Bz},{key:"Ctrl-p",run:Dz,shift:Uz},{key:"Ctrl-n",run:Lz,shift:Wz},{key:"Ctrl-a",run:ise,shift:gse},{key:"Ctrl-e",run:sse,shift:Ose},{key:"Ctrl-d",run:Kz},{key:"Ctrl-h",run:pS},{key:"Ctrl-k",run:jse},{key:"Ctrl-Alt-h",run:eD},{key:"Ctrl-o",run:Nse},{key:"Ctrl-t",run:Tse},{key:"Ctrl-v",run:fS}],qse=[{key:"ArrowLeft",run:Rz,shift:Iz,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Gie,shift:ose,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:nse,shift:pse,preventDefault:!0},{key:"ArrowRight",run:_z,shift:Bz,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Fie,shift:cse,preventDefault:!0},{mac:"Cmd-ArrowRight",run:rse,shift:mse,preventDefault:!0},{key:"ArrowUp",run:Dz,shift:Uz,preventDefault:!0},{mac:"Cmd-ArrowUp",run:BE,shift:VE},{mac:"Ctrl-ArrowUp",run:ZE,shift:qE},{key:"ArrowDown",run:Lz,shift:Wz,preventDefault:!0},{mac:"Cmd-ArrowDown",run:YE,shift:UE},{mac:"Ctrl-ArrowDown",run:fS,shift:IE},{key:"PageUp",run:ZE,shift:qE},{key:"PageDown",run:fS,shift:IE},{key:"Home",run:tse,shift:fse,preventDefault:!0},{key:"Mod-Home",run:BE,shift:VE},{key:"End",run:ese,shift:hse,preventDefault:!0},{key:"Mod-End",run:YE,shift:UE},{key:"Enter",run:WE,shift:WE},{key:"Mod-a",run:xse},{key:"Backspace",run:pS,shift:pS,preventDefault:!0},{key:"Delete",run:Kz,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:eD,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:kse,preventDefault:!0},{mac:"Mod-Backspace",run:Qse,preventDefault:!0},{mac:"Mod-Delete",run:Cse,preventDefault:!0}].concat(Zse.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Ise=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Kie,shift:use},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Jie,shift:dse},{key:"Alt-ArrowUp",run:$se},{key:"Shift-Alt-ArrowUp",run:Pse},{key:"Alt-ArrowDown",run:Ese},{key:"Shift-Alt-ArrowDown",run:Ase},{key:"Mod-Alt-ArrowUp",run:yse},{key:"Mod-Alt-ArrowDown",run:Sse},{key:"Escape",run:wse},{key:"Mod-Enter",run:Mse},{key:"Alt-l",mac:"Ctrl-l",run:bse},{key:"Mod-i",run:vse,preventDefault:!0},{key:"Mod-[",run:Lse},{key:"Mod-]",run:Dse},{key:"Mod-Alt-\\",run:zse},{key:"Shift-Mod-k",run:Rse},{key:"Shift-Mod-\\",run:lse},{key:"Mod-/",run:$ie},{key:"Alt-A",run:Pie},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Xse}].concat(qse),Bse="#e5c07b",GE="#e06c75",Yse="#56b6c2",Vse="#ffffff",Um="#abb2bf",mS="#7d8799",Use="#61afef",Wse="#98c379",FE="#d19a66",Gse="#c678dd",Fse="#21252b",HE="#2c313a",KE="#282c34",cy="#353a42",Hse="#3E4451",JE="#528bff",Kse=Te.theme({"&":{color:Um,backgroundColor:KE},".cm-content":{caretColor:JE},".cm-cursor, .cm-dropCursor":{borderLeftColor:JE},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Hse},".cm-panels":{backgroundColor:Fse,color:Um},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:KE,color:mS,border:"none"},".cm-activeLineGutter":{backgroundColor:HE},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:cy},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:cy,borderBottomColor:cy},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:HE,color:Um}}},{dark:!0}),Jse=Cf.define([{tag:z.keyword,color:Gse},{tag:[z.name,z.deleted,z.character,z.propertyName,z.macroName],color:GE},{tag:[z.function(z.variableName),z.labelName],color:Use},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:FE},{tag:[z.definition(z.name),z.separator],color:Um},{tag:[z.typeName,z.className,z.number,z.changed,z.annotation,z.modifier,z.self,z.namespace],color:Bse},{tag:[z.operator,z.operatorKeyword,z.url,z.escape,z.regexp,z.link,z.special(z.string)],color:Yse},{tag:[z.meta,z.comment],color:mS},{tag:z.strong,fontWeight:"bold"},{tag:z.emphasis,fontStyle:"italic"},{tag:z.strikethrough,textDecoration:"line-through"},{tag:z.link,color:mS,textDecoration:"underline"},{tag:z.heading,fontWeight:"bold",color:GE},{tag:[z.atom,z.bool,z.special(z.variableName)],color:FE},{tag:[z.processingInstruction,z.string,z.inserted],color:Wse},{tag:z.invalid,color:Vse}]),eae=[Kse,s4(Jse)];function tae(t){switch(t){case"markdown":return Gre();case"yaml":return Tie();case"html":return fz();case"javascript":return iz();case"plaintext":return null}}function nae(t){var n;switch(((n=t.split(".").pop())==null?void 0:n.toLowerCase())??""){case"md":case"markdown":return"markdown";case"yaml":case"yml":return"yaml";case"html":case"htm":return"html";case"js":case"jsx":case"ts":case"tsx":case"json":return"javascript";default:return"plaintext"}}const rae=Te.theme({"&":{backgroundColor:"var(--color-bg)",color:"var(--color-text)",height:"100%"},".cm-content":{fontFamily:"var(--font-mono)",fontSize:"13px",padding:"16px 0"},".cm-gutters":{backgroundColor:"var(--color-bg)",borderRight:"1px solid var(--color-border-subtle)",color:"var(--color-muted)"},".cm-activeLineGutter":{backgroundColor:"var(--color-surface-raised)"},".cm-activeLine":{backgroundColor:"var(--color-surface-raised)"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:"rgba(255, 74, 0, 0.15) !important"},"&.cm-focused .cm-selectionBackground":{backgroundColor:"rgba(255, 74, 0, 0.2) !important"},".cm-scroller":{overflow:"auto"}});function iae({content:t,onChange:e,onSave:n,readOnly:r=!1,dark:i=!1,placeholder:s,language:l="markdown"}){const c=j.useRef(null),u=j.useRef(null),f=j.useRef(e),p=j.useRef(n);f.current=e,p.current=n;const m=j.useCallback(()=>{const O=[Lie(),bO.of([...Ise,...Wie,{key:"Mod-s",run:v=>{var S;return(S=p.current)==null||S.call(p,v.state.doc.toString()),!0}}]),Te.updateListener.of(v=>{var S;v.docChanged&&((S=f.current)==null||S.call(f,v.state.doc.toString()))}),Te.lineWrapping],x=tae(l);return x&&O.push(x),i?O.push(eae):O.push(rae,s4(xee)),r&&O.push(st.readOnly.of(!0)),s&&O.push(MJ(s)),O},[i,r,s,l]);return j.useEffect(()=>{if(!c.current)return;const O=st.create({doc:t,extensions:m()}),x=new Te({state:O,parent:c.current});return u.current=x,()=>{x.destroy(),u.current=null}},[m]),j.useEffect(()=>{const O=u.current;if(!O)return;const x=O.state.doc.toString();x!==t&&O.dispatch({changes:{from:0,to:x.length,insert:t}})},[t]),d.jsx("div",{ref:c,className:"h-full overflow-hidden"})}function sae(t){const e=t.match(/^---\n([\s\S]*?)\n---\n?/);return e?{frontmatter:e[1],body:t.slice(e[0].length)}:{frontmatter:null,body:t}}function aae({content:t}){const{frontmatter:e,body:n}=j.useMemo(()=>sae(t),[t]);return d.jsxs("div",{className:"markdown-preview",children:[e&&d.jsxs("div",{className:"not-prose mb-6 rounded-lg border border-[var(--color-border-subtle)] overflow-hidden",children:[d.jsx("div",{className:"px-3 py-1.5 bg-[var(--color-surface-raised)] border-b border-[var(--color-border-subtle)]",children:d.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Frontmatter"})}),d.jsx("pre",{className:"p-3 text-xs font-[var(--font-mono)] text-[var(--color-text)] whitespace-pre-wrap",children:e})]}),d.jsx(h3,{remarkPlugins:[M3],children:n})]})}function ai({content:t,filePath:e,onChange:n,onSave:r,readOnly:i=!1,defaultMode:s,hideModeTabs:l=!1}){const[c,u]=j.useState(s??"edit"),f=Sh(x=>x.theme),p=nae(e),m=p==="markdown",O=j.useCallback(x=>{(x.metaKey||x.ctrlKey)&&x.key==="s"&&(x.preventDefault(),r==null||r(t))},[t,r]);return d.jsxs("div",{className:"flex flex-col h-full",onKeyDown:O,children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-[var(--color-border-subtle)] shrink-0",children:[d.jsx("span",{className:"text-xs font-[var(--font-mono)] text-[var(--color-muted)] truncate mr-4",children:e}),!l&&d.jsx("div",{className:"flex gap-0.5 shrink-0",children:["edit","preview","split"].map(x=>d.jsx("button",{onClick:()=>u(x),className:`px-2.5 py-1 text-xs rounded transition-colors ${c===x?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:x.charAt(0).toUpperCase()+x.slice(1)},x))})]}),d.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[(c==="edit"||c==="split")&&d.jsx("div",{className:`${c==="split"?"w-1/2":"w-full"} overflow-hidden`,children:d.jsx(iae,{content:t,onChange:n,onSave:r,readOnly:i,dark:f==="dark",language:p})}),(c==="preview"||c==="split")&&d.jsx("div",{className:`${c==="split"?"w-1/2 border-l border-[var(--color-border-subtle)]":"w-full"} overflow-auto p-6`,children:m?d.jsx(aae,{content:t}):d.jsx("pre",{className:"text-sm font-[var(--font-mono)] whitespace-pre-wrap",children:t})})]})]})}function QO({title:t="Copy link to this view"}){const[e,n]=j.useState(!1);function r(){navigator.clipboard.writeText(window.location.href).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)}).catch(()=>{})}return d.jsx("button",{onClick:r,title:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)] transition-colors",children:e?d.jsx(VA,{size:15,className:"text-[var(--color-success)]"}):d.jsx(xI,{size:15})})}function lae(){const{id:t}=SA(),e=ds(),{notify:n}=co(),{data:r,isLoading:i,error:s}=uR(t??""),[l,c]=j.useState(!1),[u,f]=j.useState(null),[p,m]=j.useState(!1),[O,x]=j.useState(!1),[v,S]=j.useState(!1),{data:k}=XS(),{data:w}=ZS(),N=(w??[]).filter(E=>E.agentIds.includes(t??"")||E.agentIds.includes((r==null?void 0:r.name)??""));function C(){const E=!l;if(c(E),E&&r&&u===null){m(!0);const M=r.filePath.lastIndexOf("/_bmad/"),R=M>=0?r.filePath.slice(M+7):r.filePath;fetch(`/api/files/${R}`).then(_=>{if(!_.ok)throw new Error("Not found");return _.json()}).then(_=>{f(_.content)}).catch(()=>f("Failed to load source file.")).finally(()=>m(!1))}}return i?d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"h-8 w-48 rounded bg-[var(--color-surface-raised)] animate-pulse"}),d.jsx("div",{className:"h-40 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"})]}):s||!r?d.jsxs("div",{children:[d.jsxs(zt,{to:"/agents",className:"flex items-center gap-1 text-sm text-[var(--color-muted)] mb-4 hover:text-[var(--color-text)]",children:[d.jsx(Km,{size:16})," Back to Agents"]}),d.jsx("p",{className:"text-[var(--color-error)]",children:s?`Failed to load agent: ${s.message}`:"Agent not found"})]}):d.jsxs("div",{className:"max-w-3xl",children:[d.jsxs(zt,{to:"/agents",className:"flex items-center gap-1 text-sm text-[var(--color-muted)] mb-4 hover:text-[var(--color-text)]",children:[d.jsx(Km,{size:16})," Back to Agents"]}),d.jsxs("div",{className:"mb-8",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[r.icon?d.jsx("span",{className:"text-3xl leading-none",role:"img","aria-label":`${r.title||r.name} icon`,children:r.icon}):d.jsx("span",{className:"w-10 h-10 rounded-lg bg-[var(--color-accent)] text-white text-lg font-bold flex items-center justify-center shrink-0",children:r.name.charAt(0).toUpperCase()}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("h1",{className:"text-2xl font-extrabold truncate",children:r.title||r.name}),r.title&&d.jsxs("p",{className:"text-sm text-[var(--color-muted)]",children:["(",r.name,")"]})]})]}),d.jsx("p",{className:"text-[var(--color-muted)] text-sm mb-4",children:r.role}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(QO,{title:"Copy link to this agent"}),d.jsxs("button",{onClick:()=>S(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:[d.jsx(Kl,{size:14}),"Edit Agent"]})]})]}),(r.identity||r.communicationStyle||r.principles)&&d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"text-lg font-bold mb-3",children:"Persona"}),d.jsxs("div",{className:"rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] p-5 space-y-4",children:[r.identity&&d.jsxs("div",{children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-1",children:"Identity"}),d.jsx("p",{className:"text-sm text-[var(--color-text)]",children:r.identity})]}),r.communicationStyle&&d.jsxs("div",{children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-1",children:"Communication Style"}),d.jsxs("p",{className:"text-sm italic text-[var(--color-text)]",children:["“",r.communicationStyle,"”"]})]}),r.principles&&d.jsxs("div",{children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-1",children:"Principles"}),d.jsx("div",{className:"text-sm text-[var(--color-text)] whitespace-pre-line",children:r.principles})]})]})]}),d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"text-lg font-bold mb-3",children:"Details"}),d.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[d.jsxs("div",{className:"p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[d.jsx("span",{className:"text-[var(--color-muted)]",children:"Module"}),d.jsx("p",{className:"font-bold",children:r.module??"Unknown"})]}),d.jsxs("div",{className:"p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[d.jsx("span",{className:"text-[var(--color-muted)]",children:"Discussion Mode"}),d.jsx("p",{className:"font-bold",children:r.discussion?"Enabled":"Disabled"})]})]})]}),d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"text-lg font-bold mb-3",children:"How to Invoke"}),d.jsxs("div",{className:"rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] p-5 space-y-4",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-2",children:"In Claude Code"}),d.jsx("div",{className:"space-y-1.5",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("code",{className:"text-sm font-[var(--font-mono)] bg-[var(--color-bg)] border border-[var(--color-border-subtle)] px-2 py-1 rounded text-[var(--color-accent)]",children:["/",r.name]}),d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:"activate this agent"})]})})]}),r.menu.length>0&&d.jsxs("div",{children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-2",children:"Available Commands"}),d.jsxs("div",{className:"space-y-1",children:[r.menu.slice(0,6).map(E=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("code",{className:"text-xs font-[var(--font-mono)] bg-[var(--color-bg)] border border-[var(--color-border-subtle)] px-2 py-0.5 rounded text-[var(--color-accent)]",children:E.trigger}),d.jsx("span",{className:"text-xs text-[var(--color-muted)] truncate",children:E.input})]},E.trigger)),r.menu.length>6&&d.jsxs("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:["+",r.menu.length-6," more — scroll down to Commands"]})]})]})]})]}),d.jsxs("section",{className:"mb-8",children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsxs("h2",{className:"text-lg font-bold",children:["Skills (",r.skills.length,")"]}),d.jsxs("button",{onClick:()=>x(!0),className:"flex items-center gap-1 text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:[d.jsx(Yt,{size:14}),"Assign"]})]}),r.skills.length>0?d.jsx("div",{className:"flex flex-wrap gap-2",children:r.skills.map(E=>d.jsx("button",{onClick:()=>e("/skills"),className:"px-3 py-1 text-xs rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:text-[var(--color-accent)] transition-colors cursor-pointer",children:E},E))}):d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"No skills assigned"})]}),O&&d.jsxs("div",{className:"fixed inset-0 z-40 flex",children:[d.jsx("div",{className:"flex-1 bg-black/40",onClick:()=>x(!1)}),d.jsx("div",{className:"w-[700px] bg-[var(--color-bg)] border-l border-[var(--color-border-subtle)] shadow-xl",children:d.jsx(G7,{agentName:r.name,currentSkills:r.skills,onSave:async E=>{try{(await fetch(`/api/agents/${t}/skills`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({skills:E})})).ok?(n("success",`Updated skills for ${r.name}`),x(!1)):n("error","Failed to update skills")}catch{n("error","Failed to update skills")}},onClose:()=>x(!1)})})]}),r.menu.length>0&&d.jsxs("section",{className:"mb-8",children:[d.jsxs("h2",{className:"text-lg font-bold mb-3",children:["Commands (",r.menu.length,")"]}),d.jsx("div",{className:"space-y-2",children:r.menu.map(E=>d.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-bold text-sm font-[var(--font-mono)]",children:E.trigger}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-0.5",children:E.input})]}),E.route&&d.jsx("span",{className:"text-xs text-[var(--color-muted)] font-[var(--font-mono)]",children:E.route})]},E.trigger))})]}),d.jsxs("section",{className:"mb-8",children:[d.jsxs("h2",{className:"text-lg font-bold mb-3",children:["Teams (",N.length,")"]}),N.length>0?d.jsx("div",{className:"space-y-2",children:N.map(E=>d.jsxs("button",{onClick:()=>e("/teams"),className:"w-full flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors cursor-pointer text-left",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[E.icon?d.jsx("span",{className:"text-sm leading-none",role:"img","aria-label":`${E.name} icon`,children:E.icon}):d.jsx(Tn,{size:14,className:"text-[var(--color-accent)]"}),d.jsx("span",{className:"text-sm font-bold",children:E.name})]}),d.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[E.memberCount," members"]})]},E.id))}):d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"This agent is not part of any team"})]}),k&&k.length>0&&r&&d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"text-lg font-bold mb-3",children:"Workflow Participation"}),(()=>{const E=r.name.toLowerCase(),M=r.id.toLowerCase(),R=k.filter(_=>{const V=_.name.toLowerCase();return V.includes(M)||V.includes(E)});return R.length===0?d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"This agent is not directly referenced in any workflow names. Agents may still be invoked via workflow steps."}):d.jsx("div",{className:"space-y-2",children:R.map(_=>d.jsxs("button",{onClick:()=>e("/workflows"),className:"w-full flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors cursor-pointer text-left",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Or,{size:14,className:"text-[var(--color-muted)]"}),d.jsx("span",{className:"text-sm font-bold",children:_.name})]}),d.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[_.stepCount," steps"]})]},_.id))})})()]}),d.jsxs("section",{className:"mb-8",children:[d.jsxs("h2",{className:"text-lg font-bold mb-3 flex items-center gap-2",children:[d.jsx(KA,{size:18,className:"text-[var(--color-muted)]"}),"Override"]}),d.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] p-5",children:r.customizations&&Object.keys(r.customizations).length>0?d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx(UA,{size:14,className:"text-[var(--color-warning)] mt-0.5 shrink-0"}),d.jsx("p",{className:"text-sm text-[var(--color-text)]",children:"This agent has project-level customizations that extend the module's default behaviour. Overrides let you adjust an agent's persona, instructions, or skills without modifying the original module file — changes here survive module updates."})]}),d.jsxs("button",{onClick:()=>e(`/agents/${t}/override`),className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] hover:border-[var(--color-accent)] transition-colors",children:[d.jsx(Kl,{size:13}),"Edit Override"]})]}):d.jsxs("div",{className:"space-y-3",children:[d.jsxs("p",{className:"text-sm text-[var(--color-muted)]",children:["No overrides yet. An ",d.jsx("strong",{className:"text-[var(--color-text)]",children:"override"})," lets you customise this agent's behaviour for your project — adjusting its persona, adding project-specific instructions, or changing its skills — without touching the original module file. Your changes persist across module updates."]}),d.jsxs("button",{onClick:()=>e(`/agents/${t}/override`),className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] hover:border-[var(--color-accent)] transition-colors",children:[d.jsx(Kl,{size:13}),"Create Override"]})]})})]}),d.jsxs("section",{children:[d.jsxs("button",{onClick:C,className:"flex items-center gap-2 text-lg font-bold mb-3 hover:text-[var(--color-accent)] transition-colors",children:[l?d.jsx(gr,{size:18}):d.jsx(yi,{size:18}),"Source"]}),l&&d.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-96",children:p?d.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):d.jsx(ai,{content:u??"",filePath:r.filePath,onChange:()=>{},readOnly:!0})})]}),v&&r&&d.jsx(F7,{agent:r,onClose:()=>S(!1),onSaved:()=>{S(!1)}})]})}function oae(){const{id:t}=SA(),{data:e}=uR(t??""),{notify:n}=co(),[r,i]=j.useState(""),[s,l]=j.useState(""),[c,u]=j.useState(!1),[f,p]=j.useState(!1),[m,O]=j.useState(!1);j.useEffect(()=>{if(e&&!f){const v=`_config/agents/${e.id}.customize.yaml`;fetch(`/api/files/${v}`).then(S=>{if(!S.ok)throw new Error("Not found");return S.json()}).then(S=>{const k=S;i(k.content),l(k.content)}).catch(()=>{const S=`# Override customizations for ${e.name}
|
|
577
|
+
# Add custom instructions, modify behavior, or extend capabilities
|
|
578
|
+
|
|
579
|
+
`;i(S),l("")}).finally(()=>p(!0))}},[e,f]);async function x(){if(e){O(!0);try{const v=`_config/agents/${e.id}.customize.yaml`;(await fetch(`/api/files/${v}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r})})).ok?(l(r),u(!1),n("success",`Override saved for ${e.name}`)):n("error","Failed to save override")}catch{n("error","Failed to save override")}finally{O(!1)}}}return e?c?d.jsxs("div",{className:"h-[calc(100vh-8rem)]",children:[d.jsxs("h1",{className:"text-2xl font-extrabold mb-4",children:["Override Changes: ",e.name]}),m&&d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-2",children:"Saving..."}),d.jsx($5,{original:s,modified:r,onConfirm:x,onCancel:()=>u(!1)})]}):d.jsxs("div",{className:"h-[calc(100vh-8rem)]",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs(zt,{to:`/agents/${t}`,className:"flex items-center gap-1 text-sm text-[var(--color-muted)] hover:text-[var(--color-text)]",children:[d.jsx(Km,{size:16})," Back"]}),d.jsxs("h1",{className:"text-xl font-extrabold",children:["Override: ",e.name]})]}),d.jsx("button",{onClick:()=>u(!0),disabled:r===s,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Review Changes"})]}),d.jsx(ai,{content:r,filePath:`_bmad/_config/agents/${e.id}.customize.yaml`,onChange:i,onSave:()=>u(!0)})]}):d.jsxs("div",{children:[d.jsxs(zt,{to:`/agents/${t}`,className:"flex items-center gap-1 text-sm text-[var(--color-muted)] mb-4 hover:text-[var(--color-text)]",children:[d.jsx(Km,{size:16})," Back to Agent"]}),d.jsx("p",{className:"text-[var(--color-muted)]",children:"Loading agent..."})]})}function eP(t){const e=t.split(`
|
|
580
|
+
`).filter(s=>s.trim());if(e.length===0)return{headers:[],rows:[]};const n=s=>{const l=[];let c="",u=!1;for(let f=0;f<s.length;f++){const p=s[f];p==='"'?u&&s[f+1]==='"'?(c+='"',f++):u=!u:p===","&&!u?(l.push(c.trim()),c=""):c+=p}return l.push(c.trim()),l},r=n(e[0]),i=e.slice(1).map(n);return{headers:r,rows:i}}function uy(t,e){const n=r=>r.includes(",")||r.includes('"')||r.includes(`
|
|
581
|
+
`)?`"${r.replace(/"/g,'""')}"`:r;return[t,...e].map(r=>r.map(n).join(",")).join(`
|
|
582
|
+
`)}function Wg({content:t,editable:e,onChange:n}){const[r,i]=j.useState(null),[s,l]=j.useState(!0),{headers:c,rows:u}=j.useMemo(()=>eP(t),[t]),[f,p]=j.useState(()=>eP(t).rows),m=j.useMemo(()=>r===null?u:[...u].sort((k,w)=>{const N=k[r]??"",C=w[r]??"";return s?N.localeCompare(C):C.localeCompare(N)}),[u,r,s]),O=k=>{r===k?l(!s):(i(k),l(!0))},x=(k,w,N)=>{const C=f.map((E,M)=>M===k?E.map((R,_)=>_===w?N:R):E);p(C),n==null||n(uy(c,C))},v=k=>{const w=f.filter((N,C)=>C!==k);p(w),n==null||n(uy(c,w))},S=()=>{const k=Array(c.length).fill(""),w=[...f,k];p(w),n==null||n(uy(c,w))};return c.length===0?d.jsx("div",{className:"p-4 text-sm text-[var(--color-muted)]",children:"Empty or unparseable CSV content."}):e?d.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[d.jsx("div",{className:"overflow-auto flex-1",children:d.jsxs("table",{className:"w-full text-sm border-collapse",children:[d.jsx("thead",{className:"sticky top-0 z-10",children:d.jsxs("tr",{className:"bg-[var(--color-surface-raised)]",children:[d.jsx("th",{className:"w-6 px-1 py-2 border-b border-[var(--color-border-subtle)]"}),c.map((k,w)=>d.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider text-[var(--color-muted)] border-b border-[var(--color-border-subtle)] whitespace-nowrap",children:k},w))]})}),d.jsx("tbody",{children:f.map((k,w)=>d.jsxs("tr",{className:w%2===0?"bg-[var(--color-bg)]":"bg-[var(--color-surface-raised)]",children:[d.jsx("td",{className:"px-1 py-1 border-b border-[var(--color-border-subtle)]",children:d.jsx("button",{onClick:()=>v(w),className:"text-[var(--color-muted)] hover:text-[var(--color-error)] transition-colors","aria-label":`Delete row ${w+1}`,children:d.jsx(Wt,{size:12})})}),c.map((N,C)=>d.jsx("td",{className:"px-1 py-1 border-b border-[var(--color-border-subtle)]",children:d.jsx("input",{value:k[C]??"",onChange:E=>x(w,C,E.target.value),className:"w-full px-2 py-1 text-sm bg-transparent border border-transparent focus:border-[var(--color-accent)] rounded outline-none"})},C))]},w))})]})}),d.jsxs("div",{className:"px-3 py-2 border-t border-[var(--color-border-subtle)] flex items-center gap-3",children:[d.jsxs("button",{onClick:S,className:"flex items-center gap-1 text-xs text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:[d.jsx(Yt,{size:12}),"Add Row"]}),d.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[f.length," rows × ",c.length," columns"]})]})]}):d.jsxs("div",{className:"overflow-auto h-full",children:[d.jsxs("table",{className:"w-full text-sm border-collapse",children:[d.jsx("thead",{className:"sticky top-0 z-10",children:d.jsx("tr",{className:"bg-[var(--color-surface-raised)]",children:c.map((k,w)=>d.jsxs("th",{onClick:()=>O(w),className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider text-[var(--color-muted)] border-b border-[var(--color-border-subtle)] cursor-pointer hover:text-[var(--color-text)] select-none whitespace-nowrap",children:[k,r===w&&d.jsx("span",{className:"ml-1",children:s?"↑":"↓"})]},w))})}),d.jsx("tbody",{children:m.map((k,w)=>d.jsx("tr",{className:w%2===0?"bg-[var(--color-bg)]":"bg-[var(--color-surface-raised)]",children:c.map((N,C)=>d.jsx("td",{className:"px-3 py-2 border-b border-[var(--color-border-subtle)] whitespace-nowrap max-w-xs truncate",title:k[C]??"",children:k[C]??""},C))},w))})]}),d.jsxs("div",{className:"px-3 py-2 text-xs text-[var(--color-muted)] border-t border-[var(--color-border-subtle)]",children:[u.length," rows × ",c.length," columns"]})]})}function cae({teamId:t,teamName:e,onClose:n,onDeleted:r}){const[i,s]=j.useState(""),[l,c]=j.useState(null),[u,f]=j.useState(!1),p=i===e,m=async()=>{var O;if(p){f(!0),c(null);try{const x=await fetch(`/api/teams/${t}`,{method:"DELETE"});if(!x.ok){const v=await x.json();throw new Error(((O=v.error)==null?void 0:O.message)??"Failed to delete team")}r()}catch(x){c(x instanceof Error?x.message:"Failed to delete team")}finally{f(!1)}}};return d.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:n}),d.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"delete-team-title",className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[d.jsx(Us,{size:20,className:"text-[var(--color-error)]"}),d.jsx("h2",{id:"delete-team-title",className:"text-lg font-bold",children:"Delete Team"})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-sm",children:["This will permanently delete the ",d.jsx("strong",{children:e})," team YAML file. The party CSV will be preserved."]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm mb-1",children:["Type ",d.jsx("strong",{children:e})," to confirm:"]}),d.jsx("input",{type:"text",value:i,onChange:O=>s(O.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-error)] focus:outline-none"})]}),l&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:l})]}),d.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[d.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsxs("button",{onClick:m,disabled:!p||u,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-error)] text-white hover:opacity-90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[d.jsx(uo,{size:14}),u?"Deleting...":"Delete Team"]})]})]})]})}function uae({teamId:t,onClose:e,onTeamUpdated:n}){const r=ds(),i=tl(),{notify:s}=co(),{data:l,isLoading:c}=DB(t),{data:u}=LB(t),[f,p]=j.useState(!1),[m,O]=j.useState(!1),[x,v]=j.useState(!1),[S,k]=j.useState(""),[w,N]=j.useState(""),[C,E]=j.useState(""),[M,R]=j.useState(new Set),[_,V]=j.useState(""),[G,D]=j.useState([]),[L,Z]=j.useState(!1),[te,I]=j.useState(!1),[B,X]=j.useState("");j.useEffect(()=>{x&&l&&(k(l.name),N(l.icon),E(l.description),R(new Set(l.agentIds)),fetch("/api/agents").then(J=>J.json()).then(J=>D(J)).catch(()=>{}))},[x,l]);const q=j.useMemo(()=>{if(!l)return[];const J=new Set(l.members.map(W=>W.agentId));return l.agentIds.filter(W=>!J.has(W))},[l]),K=G.filter(J=>{if(!_)return!0;const W=_.toLowerCase();return J.name.toLowerCase().includes(W)||J.title.toLowerCase().includes(W)||J.role&&J.role.toLowerCase().includes(W)}),ne=J=>{R(W=>{const re=new Set(W);return re.has(J)?re.delete(J):re.add(J),re})},$=async()=>{var J;if(l){Z(!0);try{const W=await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:S.trim(),icon:w.trim(),description:C.trim(),agentIds:Array.from(M)})});if(!W.ok){const re=await W.json();throw new Error(((J=re.error)==null?void 0:J.message)??"Failed to update team")}s("success",`Team "${S}" updated`),v(!1),await i.invalidateQueries({queryKey:["teams"]}),n==null||n()}catch(W){s("error",W instanceof Error?W.message:"Failed to update team")}finally{Z(!1)}}},P=()=>{if(!l)return;const J="name,displayName,title,icon,role,identity,communicationStyle,principles,module,path",W=l.members.map(re=>{const oe=[re.agentId,re.displayName||re.agentId,re.title||"",re.icon||"",re.role||re.title||"",re.identity||"",re.communicationStyle||"collaborative",re.principles||"",re.module||l.module||"",""],ce=me=>me.includes(",")||me.includes('"')?`"${me.replace(/"/g,'""')}"`:me;return oe.map(ce).join(",")});X([J,...W].join(`
|
|
583
|
+
`))},U=async()=>{var J;if(l)try{const W=await fetch(`/api/teams/${t}/party`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:B})});if(!W.ok){const re=await W.json();throw new Error(((J=re.error)==null?void 0:J.message)??"Failed to save party CSV")}s("success","Party CSV updated"),I(!1),await i.invalidateQueries({queryKey:["teams"]})}catch(W){s("error",W instanceof Error?W.message:"Failed to save party CSV")}},T=async()=>{O(!1),await i.invalidateQueries({queryKey:["teams"]}),n==null||n(),e()};return d.jsxs("div",{className:"slide-over-backdrop",onClick:J=>{J.target===J.currentTarget&&e()},children:[d.jsx("div",{className:"slide-over-bg",onClick:e}),d.jsxs("aside",{className:"slide-over-panel",style:{width:"max(400px, 40vw)"},children:[d.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[(l==null?void 0:l.icon)&&d.jsx("span",{className:"text-xl leading-none",role:"img","aria-label":`${l.name} icon`,children:l.icon}),d.jsx("h2",{className:"text-lg font-bold truncate",children:(l==null?void 0:l.name)??"Loading..."})]}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[l&&!x&&d.jsxs(d.Fragment,{children:[d.jsx(QO,{}),d.jsx("button",{onClick:()=>v(!0),className:"text-[var(--color-muted)] hover:text-[var(--color-accent)] transition-colors",title:"Edit Team",children:d.jsx(Kl,{size:16})}),d.jsx("button",{onClick:()=>O(!0),className:"text-[var(--color-muted)] hover:text-[var(--color-error)] transition-colors",title:"Delete Team",children:d.jsx(uo,{size:16})})]}),d.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]})]}),c&&d.jsxs("div",{className:"p-6 space-y-3",children:[d.jsx("div",{className:"h-4 w-3/4 rounded bg-[var(--color-surface-raised)] animate-pulse"}),d.jsx("div",{className:"h-32 rounded bg-[var(--color-surface-raised)] animate-pulse"})]}),l&&!x&&d.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto",style:{maxHeight:"calc(100vh - 65px)"},children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:l.description}),l.module&&d.jsx("span",{className:"inline-block mt-2 text-xs px-2 py-0.5 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:l.module})]}),d.jsxs("div",{children:[d.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Members (",l.members.length,")"]}),d.jsx("div",{className:"space-y-2",children:l.members.map(J=>d.jsxs("button",{onClick:()=>r(`/agents/${J.agentId}`),className:"w-full flex items-start gap-3 p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors cursor-pointer text-left",children:[d.jsx("span",{className:"text-lg leading-none mt-0.5",role:"img","aria-label":`${J.displayName} icon`,children:J.icon}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm font-bold",children:J.displayName}),d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:J.title})]}),J.communicationStyle&&d.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1 line-clamp-2",children:J.communicationStyle})]})]},J.agentId))})]}),q.length>0&&d.jsxs("div",{children:[d.jsxs("h3",{className:"text-sm font-bold mb-2 flex items-center gap-1.5",children:[d.jsx(Us,{size:14,className:"text-[var(--color-warning)]"}),"Unresolved Agents (",q.length,")"]}),d.jsx("div",{className:"space-y-1",children:q.map(J=>d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-warning)]/30",children:[d.jsx(Us,{size:12,className:"text-[var(--color-warning)]"}),d.jsx("span",{className:"text-sm font-[var(--font-mono)]",children:J}),d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:"— not found in party CSV"})]},J))})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold mb-2",children:"Party Mode"}),d.jsxs("div",{className:"p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(rs,{size:14,className:"text-[var(--color-muted)]"}),d.jsx("span",{className:"text-sm",children:l.partyFile||"No party CSV"})]}),d.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[l.members.length," personas"]})]}),l.partyFile&&d.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[d.jsxs("button",{onClick:()=>p(!f),className:"flex items-center gap-1.5 text-xs text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:[f?d.jsx(gr,{size:12}):d.jsx(yi,{size:12}),f?"Hide":"View"," Party Personas"]}),f&&(u==null?void 0:u.content)&&!te&&d.jsxs("button",{onClick:()=>{X(u.content),I(!0)},className:"flex items-center gap-1.5 text-xs text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:[d.jsx(Kl,{size:10}),"Edit Party Personas"]})]})]}),f&&(u==null?void 0:u.content)&&!te&&d.jsx("div",{className:"mt-2 rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-64",children:d.jsx(Wg,{content:u.content})}),f&&te&&d.jsxs("div",{className:"mt-2 space-y-2",children:[d.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] overflow-hidden",style:{height:264},children:d.jsx(Wg,{content:B,editable:!0,onChange:J=>X(J)})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("button",{onClick:U,className:"px-3 py-1.5 text-xs font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[d.jsx(Bc,{size:12}),"Save Party CSV"]}),d.jsx("button",{onClick:()=>I(!1),className:"px-3 py-1.5 text-xs rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsx("button",{onClick:P,className:"px-3 py-1.5 text-xs rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Generate from Agents"})]})]})]})]}),l&&x&&d.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto",style:{maxHeight:"calc(100vh - 65px)"},children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),d.jsx("input",{type:"text",value:S,onChange:J=>k(J.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Icon"}),d.jsx("input",{type:"text",value:w,onChange:J=>N(J.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),d.jsx("textarea",{value:C,onChange:J=>E(J.target.value),rows:3,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-bold mb-1",children:["Agents (",M.size," selected)"]}),d.jsxs("div",{className:"relative mb-2",children:[d.jsx(hs,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),d.jsx("input",{type:"text",value:_,onChange:J=>V(J.target.value),placeholder:"Search agents...",className:"w-full pl-9 pr-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),d.jsx("div",{className:"max-h-48 overflow-y-auto border border-[var(--color-border-subtle)] rounded-md",children:K.length===0?d.jsx("p",{className:"text-xs text-[var(--color-muted)] p-3 text-center",children:"No agents found"}):K.map(J=>d.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-[var(--color-surface-raised)] cursor-pointer text-sm",children:[d.jsx("input",{type:"checkbox",checked:M.has(J.id),onChange:()=>ne(J.id),className:"accent-[var(--color-accent)]"}),d.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[J.icon&&d.jsx("span",{className:"text-sm leading-none","aria-hidden":"true",children:J.icon}),d.jsx("span",{className:"truncate font-bold",children:J.title||J.name})]})]},J.id))})]}),d.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[d.jsxs("button",{onClick:$,disabled:L||!S.trim(),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[d.jsx(Bc,{size:14}),L?"Saving...":"Save Changes"]}),d.jsx("button",{onClick:()=>v(!1),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"})]})]})]}),m&&l&&d.jsx(cae,{teamId:t,teamName:l.name,onClose:()=>O(!1),onDeleted:T})]})}function tP({onClose:t,onCreated:e}){const n=tl(),[r,i]=j.useState(""),[s,l]=j.useState(""),[c,u]=j.useState(""),[f,p]=j.useState(""),[m,O]=j.useState(new Set),[x,v]=j.useState(""),[S,k]=j.useState(null),[w,N]=j.useState(!1),[C,E]=j.useState([]),[M,R]=j.useState([]);j.useEffect(()=>{fetch("/api/modules").then(L=>L.json()).then(L=>{const Z=L;E(Z.map(te=>({name:te.name}))),Z.length===1&&p(Z[0].name)}).catch(()=>{}),fetch("/api/agents").then(L=>L.json()).then(L=>R(L)).catch(()=>{})},[]);const _=M.filter(L=>{if(!x)return!0;const Z=x.toLowerCase();return L.name.toLowerCase().includes(Z)||L.title.toLowerCase().includes(Z)||L.role&&L.role.toLowerCase().includes(Z)}),V=r.trim().length>0&&f.length>0,G=async()=>{var L;if(V){N(!0),k(null);try{const Z=await fetch("/api/teams",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r.trim(),icon:s.trim(),description:c.trim(),agentIds:Array.from(m),module:f})});if(!Z.ok){const te=await Z.json();throw new Error(((L=te.error)==null?void 0:L.message)??"Failed to create team")}await n.invalidateQueries({queryKey:["teams"]}),e()}catch(Z){k(Z instanceof Error?Z.message:"Failed to create team")}finally{N(!1)}}},D=L=>{O(Z=>{const te=new Set(Z);return te.has(L)?te.delete(L):te.add(L),te})};return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),d.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"create-team-title",className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6 max-h-[85vh] flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{id:"create-team-title",className:"text-lg font-bold",children:"New Team"}),d.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]}),d.jsxs("div",{className:"space-y-4 overflow-y-auto flex-1 pr-1",children:[d.jsxs("div",{className:"flex gap-3",children:[d.jsxs("div",{className:"flex-1",children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Name"}),d.jsx("input",{type:"text",value:r,onChange:L=>i(L.target.value),placeholder:"e.g. Frontend Squad",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),d.jsxs("div",{className:"w-20",children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Icon"}),d.jsx("input",{type:"text",value:s,onChange:L=>l(L.target.value),placeholder:"🚀",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] outline-none min-h-[36px] text-center"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Parent Module"}),d.jsxs("select",{value:f,onChange:L=>p(L.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[d.jsx("option",{value:"",children:"Select a module..."}),C.map(L=>d.jsx("option",{value:L.name,children:L.name},L.name))]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Description"}),d.jsx("textarea",{value:c,onChange:L=>u(L.target.value),placeholder:"What does this team do?",rows:3,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-bold mb-1",children:["Agents (",m.size," selected)"]}),d.jsxs("div",{className:"relative mb-2",children:[d.jsx(hs,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),d.jsx("input",{type:"text",value:x,onChange:L=>v(L.target.value),placeholder:"Search agents...",className:"w-full pl-9 pr-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),d.jsx("div",{className:"max-h-48 overflow-y-auto border border-[var(--color-border-subtle)] rounded-md",children:_.length===0?d.jsx("p",{className:"text-xs text-[var(--color-muted)] p-3 text-center",children:"No agents found"}):_.map(L=>d.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-[var(--color-surface-raised)] cursor-pointer text-sm",children:[d.jsx("input",{type:"checkbox",checked:m.has(L.id),onChange:()=>D(L.id),className:"accent-[var(--color-accent)]"}),d.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[L.icon&&d.jsx("span",{className:"text-sm leading-none",children:L.icon}),d.jsx("span",{className:"truncate font-bold",children:L.title||L.name}),L.title&&d.jsxs("span",{className:"text-xs text-[var(--color-muted)] truncate",children:["(",L.name,")"]})]})]},L.id))})]}),S&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:S})]}),d.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[d.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsxs("button",{onClick:G,disabled:!V||w,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[d.jsx(Yt,{size:14}),w?"Creating...":"Create Team"]})]})]})]})}function cs(t="detail"){const[e,n]=h6(),r=e.get(t),i=j.useCallback(s=>{n(l=>(s?l.set(t,s):l.delete(t),l),{replace:!1})},[t,n]);return[r,i]}function dae({team:t,isSelected:e,onClick:n}){return d.jsxs(PS,{onClick:n,selected:e,children:[d.jsx(RS,{icon:d.jsx(AS,{emoji:t.icon,fallbackIcon:d.jsx(Tn,{size:16})}),title:t.name,subtitle:`${t.memberCount} members`}),d.jsxs(_S,{children:[t.description?d.jsx(MS,{text:t.description}):d.jsx("div",{className:"h-4"}),t.agentIds&&t.agentIds.length>0&&d.jsxs("div",{className:"flex items-center gap-1 mt-2 flex-wrap",children:[t.agentIds.slice(0,6).map(r=>d.jsx("span",{title:r,className:"w-6 h-6 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-xs flex items-center justify-center font-bold text-[var(--color-muted)] uppercase shrink-0",children:r.charAt(0)},r)),t.agentIds.length>6&&d.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["+",t.agentIds.length-6]})]})]}),d.jsx(zS,{right:d.jsx(oR,{module:t.module})})]})}function hae(){const{data:t,isLoading:e,refetch:n}=ZS(),[r,i]=cs("detail"),[s,l]=j.useState("all"),[c,u]=j.useState(""),[f,p]=j.useState(!1),m=j.useMemo(()=>{if(!t)return[];const v=new Set;for(const S of t)S.module&&v.add(S.module);return Array.from(v).sort()},[t]),O=j.useMemo(()=>{if(!t)return[];let v=t;if(s!=="all"&&(v=v.filter(S=>S.module===s)),c){const S=c.toLowerCase();v=v.filter(k=>k.name.toLowerCase().includes(S)||k.description.toLowerCase().includes(S))}return v},[t,s,c]),x=j.useMemo(()=>{if(!t)return{};const v={};for(const S of t)S.module&&(v[S.module]=(v[S.module]??0)+1);return v},[t]);return e?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"Teams"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"Named groups of agents that collaborate on workflows and Party Mode sessions."}),d.jsx(eO,{count:3})]}):!t||t.length===0?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"Teams"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"Named groups of agents that collaborate on workflows and Party Mode sessions."}),d.jsx(Ci,{icon:Tn,title:"No teams found",description:"Teams group agents for collaborative workflows and Party Mode. Create a team to get started.",actions:d.jsxs("button",{onClick:()=>p(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[d.jsx(Yt,{size:14}),"New Team"]})}),f&&d.jsx(tP,{onClose:()=>p(!1),onCreated:()=>{p(!1),n()}})]}):d.jsxs("div",{children:[d.jsx(Jg,{title:"Teams",count:t.length,modules:m,moduleCounts:x,activeModule:s,onModuleChange:l,search:c,onSearchChange:u,actions:d.jsxs("button",{onClick:()=>p(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[d.jsx(Yt,{size:14}),"New Team"]})}),d.jsx(DS,{children:O.map(v=>d.jsx(dae,{team:v,isSelected:r===v.id,onClick:()=>i(r===v.id?null:v.id)},v.id))}),O.length===0&&t.length>0&&d.jsx("p",{className:"text-sm text-[var(--color-muted)] text-center py-8",children:"No teams match your search."}),r&&d.jsx(uae,{teamId:r,onClose:()=>i(null),onTeamUpdated:()=>n()}),f&&d.jsx(tP,{onClose:()=>p(!1),onCreated:()=>{p(!1),n()}})]})}function CO({open:t,onClose:e,title:n,actions:r,children:i,width:s}){const l=j.useRef(null),c=j.useRef(null);j.useEffect(()=>{var f;t?(c.current=document.activeElement,requestAnimationFrame(()=>{var p;return(p=l.current)==null?void 0:p.focus()})):((f=c.current)==null||f.focus(),c.current=null)},[t]);const u=j.useCallback(f=>{if(f.key==="Escape"){e();return}if(f.key!=="Tab")return;const p=l.current;if(!p)return;const m=Array.from(p.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(v=>!v.closest('[aria-hidden="true"]'));if(m.length===0){f.preventDefault();return}const O=m[0],x=m[m.length-1];f.shiftKey?(document.activeElement===O||document.activeElement===p)&&(f.preventDefault(),x.focus()):document.activeElement===x&&(f.preventDefault(),O.focus())},[e]);return j.useEffect(()=>{if(t)return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[t,u]),t?d.jsxs("div",{className:"slide-over-backdrop",role:"presentation",children:[d.jsx("div",{className:"slide-over-bg",onClick:e}),d.jsxs("aside",{ref:l,role:"dialog","aria-modal":"true","aria-label":typeof n=="string"?n:void 0,tabIndex:-1,className:"slide-over-panel outline-none",style:{width:s??"max(400px, 40vw)"},children:[d.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between shrink-0",children:[d.jsx("h2",{className:"text-lg font-bold truncate",children:n}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r,d.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)] transition-colors","aria-label":"Close panel",children:d.jsx(Wt,{size:18})})]})]}),d.jsx("div",{className:"p-6 space-y-6 overflow-y-auto",style:{maxHeight:"calc(100vh - 65px)"},children:i})]})]}):null}function fae({path:t,className:e,showIcon:n}){return d.jsxs("span",{className:`inline-flex items-center gap-2 text-xs ${e??""}`,children:[n&&d.jsx(FA,{size:12,className:"text-[var(--color-muted)] shrink-0"}),d.jsx(zt,{to:`/files?path=${encodeURIComponent(t)}`,className:"font-[var(--font-mono)] text-[var(--color-accent)] hover:underline break-all",children:t})]})}function pae(t){const e=[],n=/(?:in|from|see|follow)\s+(?:the\s+(?:instructions\s+in\s+)?)?[`"']?(\.\/[\w./-]+)[`"']?/gi;let r;for(;(r=n.exec(t))!==null;)e.push(r[1]);const i=/\.\/([\w-]+\.(?:md|yaml|yml|txt))/g;for(;(r=i.exec(t))!==null;){const l=`./${r[1]}`;e.includes(l)||e.push(l)}const s=e.map(l=>l.replace(/\.+$/,""));return[...new Set(s)]}function mae({reference:t,skillFilePath:e}){const[n,r]=j.useState(!1),[i,s]=j.useState(null),[l,c]=j.useState(!1),u=j.useCallback(async()=>{if(n){r(!1);return}if(r(!0),i===null){c(!0);try{const f=e.substring(0,e.lastIndexOf("/")),p=f.lastIndexOf("/_bmad/"),m=p>=0?f.slice(p+7):f,O=t.replace("./",""),x=m?`${m}/${O}`:O,v=await fetch(`/api/files/${x}`);if(v.ok){const S=await v.json();s(S.content)}else s("Could not load file.")}catch{s("Failed to load file.")}finally{c(!1)}}},[n,i,e,t]);return d.jsxs("div",{className:"border border-[var(--color-border-subtle)] rounded-lg overflow-hidden",children:[d.jsxs("button",{onClick:u,className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-[var(--color-surface-raised)] transition-colors",children:[n?d.jsx(gr,{size:14,className:"text-[var(--color-muted)]"}):d.jsx(yi,{size:14,className:"text-[var(--color-muted)]"}),d.jsx(rs,{size:14,className:"text-[var(--color-accent)]"}),d.jsx("span",{className:"text-xs font-[var(--font-mono)]",children:t})]}),n&&d.jsx("div",{className:"border-t border-[var(--color-border-subtle)] h-48",children:l?d.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):d.jsx(ai,{content:i??"",filePath:t,onChange:()=>{},readOnly:!0})})]})}function iD({skillId:t,onClose:e}){const{data:n,isLoading:r}=Y7(t),i=(n==null?void 0:n.content)??"",s=j.useMemo(()=>i?pae(i):[],[i]);return d.jsxs(CO,{open:!0,title:(n==null?void 0:n.name)??"Loading...",onClose:e,actions:d.jsx(QO,{}),children:[r&&d.jsxs("div",{className:"space-y-3",children:[d.jsx("div",{className:"h-4 w-3/4 rounded bg-[var(--color-surface-raised)] animate-pulse"}),d.jsx("div",{className:"h-32 rounded bg-[var(--color-surface-raised)] animate-pulse"})]}),n&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:n.description})}),d.jsxs("div",{className:"rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] p-4",children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-2",children:"How to Invoke"}),d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsxs("code",{className:"text-sm font-[var(--font-mono)] bg-[var(--color-bg)] border border-[var(--color-border-subtle)] px-2 py-1 rounded text-[var(--color-accent)]",children:["/",n.id]}),d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:"in Claude Code or your configured IDE"})]})]}),n.bestFor&&n.bestFor.length>0&&d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold mb-2",children:"Best for"}),d.jsx("div",{className:"flex flex-wrap gap-1",children:n.bestFor.map(l=>d.jsx("span",{className:"px-2 py-0.5 text-xs rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:l},l))})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold mb-2",children:"Content"}),d.jsx("div",{className:"h-64 rounded-lg overflow-hidden border border-[var(--color-border-subtle)]",children:d.jsx(ai,{content:n.content,filePath:n.filePath,onChange:()=>{},readOnly:!0,hideModeTabs:!0})})]}),s.length>0&&d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold mb-2",children:"Referenced Files"}),d.jsx("div",{className:"space-y-2",children:s.map(l=>d.jsx(mae,{reference:l,skillFilePath:n.filePath},l))})]}),d.jsx(fae,{path:n.filePath,showIcon:!0})]})]})}function nP(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function gae(t,e,n,r){const i=["---",`name: ${t}`];if(e&&i.push(`description: "${nP(e)}"`),n.length>0){i.push("best_for:");for(const s of n)i.push(` - "${nP(s.trim())}"`)}return i.push("---","",r||`# Skill Instructions
|
|
584
|
+
|
|
585
|
+
<!-- Add skill instructions here -->`),i.join(`
|
|
586
|
+
`)}const rP=/^[a-z][a-z0-9-]*$/;function Oae({onClose:t,onCreated:e}){const n=tl(),[r,i]=j.useState("create"),[s,l]=j.useState(""),[c,u]=j.useState(""),[f,p]=j.useState(""),[m,O]=j.useState(""),[x,v]=j.useState(""),[S,k]=j.useState(!1),[w,N]=j.useState(""),[C,E]=j.useState([]),[M,R]=j.useState(null),[_,V]=j.useState(!1);j.useEffect(()=>{fetch("/api/modules").then(I=>I.json()).then(I=>{const B=I;E(B.map(X=>({name:X.name}))),B.length===1&&O(B[0].name)}).catch(()=>{})},[]);const G=s.length===0||rP.test(s),D=f.split(",").map(I=>I.trim()).filter(Boolean),L=s.trim().length>0&&rP.test(s)&&m.length>0,Z=j.useCallback(I=>{var q;const B=(q=I.target.files)==null?void 0:q[0];if(!B)return;const X=new FileReader;X.onload=()=>{const K=X.result,ne=K.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);if(ne){const $=ne[1],P=ne[2],U=$.match(/^name:\s*(.+)$/m),T=$.match(/^description:\s*"?(.+?)"?$/m),J=$.match(/^best_for:\s*\n((?:\s+-\s+.+\n?)*)/m);if(U&&l(U[1].trim()),T&&u(T[1].trim()),J){const W=J[1].split(`
|
|
587
|
+
`).map(re=>re.replace(/^\s+-\s+/,"").trim()).filter(Boolean);p(W.join(", "))}v(P.trim())}else v(K);i("create")},X.readAsText(B)},[]),te=async()=>{var I;if(L){V(!0),R(null);try{const B=gae(s.trim(),c.trim(),D,x),X=await fetch(`/api/modules/${encodeURIComponent(m)}/entities`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"skill",name:s.trim(),content:B})});if(!X.ok){const q=await X.json();throw new Error(((I=q.error)==null?void 0:I.message)??"Failed to create skill")}await n.invalidateQueries({queryKey:["skills"]}),e()}catch(B){R(B instanceof Error?B.message:"Failed to create skill")}finally{V(!1)}}};return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),d.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"create-skill-title",className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-2xl p-6 max-h-[85vh] flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{id:"create-skill-title",className:"text-lg font-bold",children:"New Skill"}),d.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]}),d.jsxs("div",{className:"flex gap-1 mb-4 bg-[var(--color-surface-raised)] rounded-md p-0.5 self-start",children:[d.jsx("button",{onClick:()=>i("create"),className:`px-3 py-1.5 text-sm rounded min-h-[32px] transition-colors ${r==="create"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Create"}),d.jsx("button",{onClick:()=>i("import"),className:`px-3 py-1.5 text-sm rounded min-h-[32px] transition-colors ${r==="import"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Import"})]}),d.jsxs("div",{className:"space-y-4 overflow-y-auto flex-1 pr-1",children:[r==="import"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Upload .md file"}),d.jsxs("label",{className:"flex items-center justify-center gap-2 w-full px-4 py-6 border-2 border-dashed border-[var(--color-border-subtle)] rounded-lg cursor-pointer hover:border-[var(--color-accent)] transition-colors",children:[d.jsx(tg,{size:16,className:"text-[var(--color-muted)]"}),d.jsx("span",{className:"text-sm text-[var(--color-muted)]",children:"Click to upload or drag a .md file"}),d.jsx("input",{type:"file",accept:".md",onChange:Z,className:"hidden"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Or paste URL"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",value:w,onChange:I=>N(I.target.value),placeholder:"https://raw.githubusercontent.com/...",className:"flex-1 px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),d.jsx("button",{onClick:async()=>{if(w){try{const I=new URL(w);if(I.protocol!=="https:"&&I.protocol!=="http:"){R("URL must start with http:// or https://");return}}catch{R("Invalid URL");return}try{const I=await fetch(w);if(I.ok){const B=await I.text(),X={target:{files:[new File([B],"import.md")]}};Z(X)}}catch{R("Failed to fetch URL")}}},disabled:!w,className:"px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:bg-[var(--color-accent)] hover:text-white transition-colors disabled:opacity-50",children:"Fetch"})]})]}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Uploading or fetching will parse the file and switch to the Create tab with fields pre-populated."})]}),r==="create"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Name"}),d.jsx("input",{type:"text",value:s,onChange:I=>l(I.target.value),onBlur:()=>k(!0),placeholder:"e.g. advanced-elicitation",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),S&&!G&&d.jsx("p",{className:"text-xs text-[var(--color-error)] mt-1",children:"Name must be kebab-case (e.g., my-skill-name)"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Parent Module"}),d.jsxs("select",{value:m,onChange:I=>O(I.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[d.jsx("option",{value:"",children:"Select a module..."}),C.map(I=>d.jsx("option",{value:I.name,children:I.name},I.name))]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Description"}),d.jsx("textarea",{value:c,onChange:I=>u(I.target.value),placeholder:"What does this skill enable?",rows:2,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Best for (optional)"}),d.jsx("input",{type:"text",value:f,onChange:I=>p(I.target.value),placeholder:"e.g. pm, analyst, architect (comma-separated)",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Skill Content"}),d.jsx("div",{className:"h-48 rounded-lg overflow-hidden border border-[var(--color-border-subtle)]",children:d.jsx(ai,{content:x,filePath:"new-skill.md",onChange:v,defaultMode:"edit"})})]})]}),M&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:M})]}),d.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[d.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsxs("button",{onClick:te,disabled:!L||_,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[d.jsx(Yt,{size:14}),_?"Creating...":"Create Skill"]})]})]})]})}function xae(){const{data:t,isLoading:e,refetch:n}=Zw(),[r,i]=j.useState(""),[s,l]=cs("detail"),[c,u]=j.useState("all"),[f,p]=j.useState(!1),m=j.useMemo(()=>{if(!t)return[];const v=new Set;for(const S of t)S.module&&v.add(S.module);return Array.from(v).sort()},[t]),O=j.useMemo(()=>{if(!t)return[];let v=t;if(c!=="all"&&(v=v.filter(S=>S.module===c)),r){const S=r.toLowerCase();v=v.filter(k=>k.name.toLowerCase().includes(S)||k.description.toLowerCase().includes(S))}return v},[t,r,c]),x=j.useMemo(()=>{if(!t)return{};const v={};for(const S of t)S.module&&(v[S.module]=(v[S.module]??0)+1);return v},[t]);return e?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"Skills"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"Standalone prompts that can be invoked directly or assigned to agents."}),d.jsx(cR,{count:4})]}):!t||t.length===0?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"Skills"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"Standalone prompts that can be invoked directly or assigned to agents."}),d.jsx(Ci,{icon:Si,title:"No skills found",description:"Skills are reusable instruction sets — slash commands you invoke in your IDE like /create-prd or /sprint-planning. They can be attached to agents or called directly. Install a module to get a set of ready-made skills, or create your own.",actions:d.jsxs(d.Fragment,{children:[d.jsx(zt,{to:"/modules",className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Browse Modules"}),d.jsx("button",{onClick:()=>p(!0),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"New Skill"})]})})]}):d.jsxs("div",{children:[d.jsxs("div",{children:[d.jsx(Jg,{title:"Skills",count:t.length,modules:m,moduleCounts:x,activeModule:c,onModuleChange:u,search:r,onSearchChange:i,actions:d.jsxs("button",{onClick:()=>p(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[d.jsx(Yt,{size:14}),"New Skill"]})}),d.jsx("div",{className:"space-y-3",children:O.map(v=>d.jsxs("button",{onClick:()=>l(v.id),className:`w-full text-left p-4 rounded-lg flex items-center justify-between transition-colors ${s===v.id?"bg-[var(--color-surface-raised)] border border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Si,{size:16,className:"text-[var(--color-accent)] shrink-0"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-bold",children:v.name}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] truncate max-w-md",children:v.description})]})]}),v.module&&d.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:v.module})]},v.id))})]}),s&&d.jsx(iD,{skillId:s,onClose:()=>l(null)}),f&&d.jsx(Oae,{onClose:()=>p(!1),onCreated:()=>{p(!1),n()}})]})}function bae({workflow:t,onClose:e,onSaved:n}){const r=tl(),[i,s]=j.useState(t.description||""),[l,c]=j.useState(null),[u,f]=j.useState(!1),p=async()=>{var m;f(!0),c(null);try{const O=await fetch(`/api/workflows/${encodeURIComponent(t.id)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:i.trim()})});if(!O.ok){const x=await O.json();throw new Error(((m=x.error)==null?void 0:m.message)??"Failed to update workflow")}await r.invalidateQueries({queryKey:["workflows"]}),await r.invalidateQueries({queryKey:["workflow",t.id]}),n()}catch(O){c(O instanceof Error?O.message:"Failed to update workflow")}finally{f(!1)}};return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),d.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"text-lg font-bold",children:"Edit Workflow"}),d.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),d.jsx("input",{type:"text",value:t.name,disabled:!0,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] opacity-50 cursor-not-allowed"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Type"}),d.jsx("input",{type:"text",value:t.type??"step-based",disabled:!0,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] opacity-50 cursor-not-allowed"}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:"Type cannot be changed after creation"})]}),t.phase&&d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Phase"}),d.jsx("input",{type:"text",value:t.phase,disabled:!0,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] opacity-50 cursor-not-allowed"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),d.jsx("textarea",{value:i,onChange:m=>s(m.target.value),rows:3,placeholder:"What does this workflow do?",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),d.jsxs("div",{className:"text-xs text-[var(--color-muted)] space-y-1 pt-2 border-t border-[var(--color-border-subtle)]",children:[d.jsxs("p",{children:["Module: ",d.jsx("code",{className:"font-[var(--font-mono)]",children:t.module??"unknown"})]}),d.jsxs("p",{children:["Steps: ",d.jsx("code",{className:"font-[var(--font-mono)]",children:t.steps.length})]}),d.jsxs("p",{children:["File: ",d.jsx("code",{className:"font-[var(--font-mono)] break-all",children:t.entryPoint})]})]}),l&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:l})]}),d.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[d.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsxs("button",{onClick:p,disabled:u,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[d.jsx(Bc,{size:14}),u?"Saving...":"Save Changes"]})]})]})]})}function vae(t){const e=t.lastIndexOf("/_bmad/");return e>=0?t.slice(e+7):t}function yae(t){const e=t.replace(/\/$/,"").split("/");return e[e.length-1]??t}const Sae={"steps-c":"Conditional","steps-e":"Editorial","steps-v":"Validation"};function wae(t){return t?Sae[t]??t.replace(/^steps-/,"").replace(/-steps$/,"").split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):"Primary"}function kae(t){const e=new Map;return t.forEach((n,r)=>{const i=n.variantSet??"__primary";e.has(i)||e.set(i,{key:i,label:wae(n.variantSet),steps:[]}),e.get(i).steps.push({...n,globalIndex:r})}),Array.from(e.values()).sort((n,r)=>n.key==="__primary"?-1:r.key==="__primary"?1:n.key.localeCompare(r.key))}function sD({workflowId:t,onClose:e}){var J;const{data:n,isLoading:r}=zB(t),[i,s]=j.useState(!1),[l,c]=j.useState(null),[u,f]=j.useState(null),[p,m]=j.useState(!1),[O,x]=j.useState(null),[v,S]=j.useState(null),[k,w]=j.useState(!1),[N,C]=j.useState("__primary"),[E,M]=j.useState([]),[R,_]=j.useState(null),[V,G]=j.useState(null),[D,L]=j.useState(!1),Z=j.useRef(null),te=j.useRef(null),I=j.useRef(null);j.useEffect(()=>()=>{var W,re,oe;(W=Z.current)==null||W.abort(),(re=te.current)==null||re.abort(),(oe=I.current)==null||oe.abort()},[]),j.useEffect(()=>{if(!n||n.type!=="agent-based"){M([]);return}fetch(`/api/workflows/${t}/supporting-files`).then(W=>W.json()).then(W=>M(W.groups)).catch(()=>M([]))},[n,t]);const B=j.useCallback(async W=>{var oe;if(R===W){_(null),G(null);return}(oe=I.current)==null||oe.abort();const re=new AbortController;if(I.current=re,_(W),G(null),W.endsWith(".md")){L(!0);try{const ce=await fetch(`/api/files/${W}`,{signal:re.signal});if(ce.ok){const me=await ce.json();G(me.content)}else G("Could not load file.")}catch(ce){if(ce instanceof Error&&ce.name==="AbortError")return;G("Failed to load file.")}finally{re.signal.aborted||L(!1)}}},[R]),X=j.useMemo(()=>n?kae(n.steps):[],[n]),q=j.useMemo(()=>X.find(W=>W.key===N)??X[0],[X,N]),K=j.useMemo(()=>{if(!n)return[];const W=new Set,re=[];for(const oe of n.steps)oe.agent&&!W.has(oe.agent)&&(W.add(oe.agent),re.push(oe.agent));return re},[n]),{allInputs:ne,allOutputs:$}=j.useMemo(()=>{var oe,ce;if(!n)return{allInputs:[],allOutputs:[]};const W=new Set,re=new Set;for(const me of n.steps)(oe=me.inputs)==null||oe.forEach(ve=>W.add(ve)),(ce=me.outputs)==null||ce.forEach(ve=>re.add(ve));return{allInputs:Array.from(W),allOutputs:Array.from(re)}},[n]),P=(n==null?void 0:n.module)==="bmm"||(n==null?void 0:n.module)==="bmb",U=j.useCallback(async W=>{var oe;if(l===W){c(null),f(null);return}(oe=Z.current)==null||oe.abort();const re=new AbortController;Z.current=re,c(W),f(null),m(!0);try{const ce=await fetch(`/api/workflows/${t}/steps/${W}`,{signal:re.signal});if(ce.ok){const me=await ce.json();f(me.content)}else f("Could not load step instructions.")}catch(ce){if(ce instanceof Error&&ce.name==="AbortError")return;f("Failed to load step instructions.")}finally{re.signal.aborted||m(!1)}},[l,t]),T=j.useCallback(async W=>{var oe;if(O===W){x(null),S(null);return}(oe=te.current)==null||oe.abort();const re=new AbortController;te.current=re,x(W),S(null),w(!0);try{const ce=vae(W),me=await fetch(`/api/files/${ce}`,{signal:re.signal});if(me.ok){const ve=await me.json();S(ve.content)}else S("Could not load template.")}catch(ce){if(ce instanceof Error&&ce.name==="AbortError")return;S("Failed to load template.")}finally{re.signal.aborted||w(!1)}},[O]);return d.jsxs("div",{className:"slide-over-backdrop",onClick:W=>{W.target===W.currentTarget&&e()},children:[d.jsx("div",{className:"slide-over-bg",onClick:e}),d.jsxs("aside",{className:"slide-over-panel",style:{width:"max(400px, 40vw)"},children:[d.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.jsx("h2",{className:"text-lg font-bold truncate",children:(n==null?void 0:n.name)??"Loading..."}),n&&d.jsx(Ec,{type:n.type})]}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[d.jsx(QO,{}),n&&d.jsx("button",{onClick:()=>s(!0),className:"text-[var(--color-muted)] hover:text-[var(--color-accent)] transition-colors",title:"Edit Workflow",children:d.jsx(Kl,{size:16})}),d.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]})]}),r&&d.jsxs("div",{className:"p-6 space-y-3",children:[d.jsx("div",{className:"h-4 w-3/4 rounded bg-[var(--color-surface-raised)] animate-pulse"}),d.jsx("div",{className:"h-32 rounded bg-[var(--color-surface-raised)] animate-pulse"})]}),n&&d.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto",style:{maxHeight:"calc(100vh - 65px)"},children:[n.description&&d.jsx("div",{children:d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:n.description})}),d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.module&&d.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:n.module}),n.phase&&d.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:n.phase}),n.module&&d.jsxs("code",{className:"text-[10px] font-[var(--font-mono)] text-[var(--color-muted)]",title:"Namespaced identity",children:[n.module,"/",n.id]})]}),P&&d.jsxs("div",{className:"rounded-lg bg-amber-500/10 border border-amber-500/30 p-4",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx(BA,{size:14,className:"text-amber-400 shrink-0"}),d.jsx("span",{className:"text-xs font-bold text-amber-400",children:"BMAD Reference Implementation"})]}),d.jsxs("p",{className:"text-xs text-[var(--color-muted)]",children:["This workflow is part of the canonical BMAD methodology (",(J=n.module)==null?void 0:J.toUpperCase(),"). It’s a production-quality reference — read it to understand how BMAD structures complex workflows before building your own."]})]}),K.length>1&&d.jsxs("div",{className:"rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] p-4",children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-3",children:"Agent Sequence"}),d.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:K.map((W,re)=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[re>0&&d.jsx(Jm,{size:11,className:"text-[var(--color-muted)] shrink-0"}),d.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs px-2.5 py-1 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-accent)]",children:[d.jsx(Tn,{size:10}),W]})]},W))})]}),(ne.length>0||$.length>0)&&d.jsxs("div",{className:"rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] p-4",children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-3",children:"Inputs / Outputs"}),d.jsxs("div",{className:"space-y-2",children:[ne.length>0&&d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx(CN,{size:13,className:"text-[var(--color-muted)] mt-0.5 shrink-0"}),d.jsx("div",{className:"flex flex-wrap gap-1",children:ne.map(W=>d.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:W},W))})]}),$.length>0&&d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx(vh,{size:13,className:"text-[var(--color-success)] mt-0.5 shrink-0"}),d.jsx("div",{className:"flex flex-wrap gap-1",children:$.map(W=>d.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-success)]",children:W},W))})]})]})]}),n.type&&d.jsxs("div",{className:"rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] p-4",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Workflow Type"}),d.jsx(Ec,{type:n.type})]}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:At[n.type].description})]}),d.jsxs("div",{className:"rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] p-4",children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-2",children:"How to Invoke"}),d.jsxs("div",{className:"space-y-2",children:[n.entryPoint?d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsxs("code",{className:"text-sm font-[var(--font-mono)] bg-[var(--color-bg)] border border-[var(--color-border-subtle)] px-2 py-1 rounded text-[var(--color-accent)]",children:["/",n.entryPoint]}),d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:"in Claude Code or your configured IDE"})]}):d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsxs("code",{className:"text-sm font-[var(--font-mono)] bg-[var(--color-bg)] border border-[var(--color-border-subtle)] px-2 py-1 rounded text-[var(--color-accent)]",children:["/",n.id]}),d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:"in Claude Code or your configured IDE"})]}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Run this command in your IDE to start the workflow. The agent will guide you through each step."})]})]}),n.steps.length>0&&d.jsxs("div",{children:[d.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Steps (",n.steps.length,")"]}),X.length>1&&d.jsx("div",{className:"flex gap-1 mb-3 flex-wrap bg-[var(--color-surface-raised)] rounded-md p-1",children:X.map(W=>d.jsxs("button",{onClick:()=>C(W.key),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded transition-colors ${N===W.key?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:[W.label,d.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-accent)]/10 text-[var(--color-accent)] font-bold",children:W.steps.length})]},W.key))}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] mb-3",children:"Click a step to view its instructions"}),d.jsx("div",{className:"space-y-1.5",children:q==null?void 0:q.steps.map((W,re)=>{var me,ve,Ie,Dt;const oe=String(re+1).padStart(2,"0"),ce=W.description?W.description.split(`
|
|
588
|
+
`)[0].slice(0,80)+(W.description.length>80?"…":""):null;return d.jsxs("div",{className:W.isVariant?"ml-6 pl-4 border-l-2 border-[var(--color-border-subtle)]":"",children:[d.jsxs("button",{onClick:()=>W.filePath&&U(W.globalIndex),className:`w-full text-left px-3 py-2.5 rounded-lg border transition-colors ${l===W.globalIndex?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"} ${W.filePath?"cursor-pointer":""}`,children:[d.jsxs("div",{className:"flex items-center gap-2.5",children:[W.filePath?l===W.globalIndex?d.jsx(gr,{size:12,className:"text-[var(--color-accent)] shrink-0"}):d.jsx(yi,{size:12,className:"text-[var(--color-muted)] shrink-0"}):null,W.isVariant?d.jsx("span",{className:"text-xs text-[var(--color-muted)] shrink-0",children:"↳"}):d.jsx("span",{className:"text-xs font-bold text-[var(--color-accent)] font-[var(--font-mono)] w-5 shrink-0 text-right",children:oe}),d.jsx("span",{className:`text-sm font-bold truncate ${W.isVariant?"text-[var(--color-muted)]":""}`,children:W.title}),W.agent&&d.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-accent)] font-bold shrink-0",children:[d.jsx(Tn,{size:9}),W.agent]})]}),ce&&d.jsx("p",{className:`text-xs mt-1 ml-[calc(12px+0.625rem+1.25rem)] truncate ${W.isVariant?"text-[var(--color-muted)]/60":"text-[var(--color-muted)]"}`,children:ce}),(((me=W.inputs)==null?void 0:me.length)||((ve=W.outputs)==null?void 0:ve.length))&&d.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-1.5 ml-[calc(12px+0.625rem+1.25rem)]",children:[(Ie=W.inputs)==null?void 0:Ie.map(Rt=>d.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:[d.jsx(CN,{size:9}),Rt]},Rt)),(Dt=W.outputs)==null?void 0:Dt.map(Rt=>d.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-success)]",children:[d.jsx(vh,{size:9}),Rt]},Rt))]})]}),l===W.globalIndex&&d.jsx("div",{className:"mt-2 rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-64",children:p?d.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):d.jsx(ai,{content:u??"",filePath:W.filePath,onChange:()=>{},readOnly:!0})})]},W.globalIndex)})})]}),n.templates&&n.templates.length>0&&d.jsxs("div",{children:[d.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Templates (",n.templates.length,")"]}),d.jsx("div",{className:"space-y-2",children:n.templates.map(W=>d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>T(W.filePath),className:`w-full flex items-center gap-2 p-3 rounded-lg border transition-colors cursor-pointer text-left ${O===W.filePath?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[O===W.filePath?d.jsx(gr,{size:12,className:"text-[var(--color-accent)]"}):d.jsx(yi,{size:12,className:"text-[var(--color-muted)]"}),d.jsx(rs,{size:14,className:"text-[var(--color-muted)]"}),d.jsxs("span",{className:"text-sm",children:[W.name,".template.md"]})]}),O===W.filePath&&d.jsx("div",{className:"mt-2 rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-48",children:k?d.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):d.jsx(ai,{content:v??"",filePath:W.filePath,onChange:()=>{},readOnly:!0})})]},W.filePath))})]}),n.subWorkflows&&n.subWorkflows.length>0&&d.jsxs("div",{children:[d.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Sub-Workflows (",n.subWorkflows.length,")"]}),d.jsx("div",{className:"space-y-1",children:n.subWorkflows.map(W=>d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[d.jsx(yh,{size:14,className:"text-[var(--color-muted)]"}),d.jsx("span",{className:"text-sm",children:W.name})]},W.filePath))})]}),n.type==="agent-based"&&E.length>0&&d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold mb-3",children:"Agents & Resources"}),d.jsx("div",{className:"space-y-4",children:E.map(W=>d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(S0,{size:12,className:"text-[var(--color-muted)]"}),d.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-[var(--color-muted)]",children:W.name}),d.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-accent)]/10 text-[var(--color-accent)] font-bold",children:W.files.length})]}),d.jsx("div",{className:"space-y-1",children:W.files.map(re=>d.jsxs("div",{children:[re.name.endsWith(".md")?d.jsxs("button",{onClick:()=>B(re.relativePath),className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors cursor-pointer text-left ${R===re.relativePath?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[R===re.relativePath?d.jsx(gr,{size:12,className:"text-[var(--color-accent)]"}):d.jsx(yi,{size:12,className:"text-[var(--color-muted)]"}),d.jsx(rs,{size:14,className:"text-[var(--color-muted)]"}),d.jsx("span",{className:"text-sm",children:re.name})]}):d.jsxs(zt,{to:`/files?path=${encodeURIComponent(re.relativePath)}`,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors",children:[d.jsx(rs,{size:14,className:"text-[var(--color-muted)]"}),d.jsx("span",{className:"text-sm text-[var(--color-accent)] hover:underline",children:re.name})]}),R===re.relativePath&&re.name.endsWith(".md")&&d.jsx("div",{className:"mt-2 rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-48",children:D?d.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):d.jsx(ai,{content:V??"",filePath:re.relativePath,onChange:()=>{},readOnly:!0})})]},re.relativePath))})]},W.name))})]}),n.type!=="agent-based"&&n.supportingFiles&&n.supportingFiles.length>0&&d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold mb-3",children:"Supporting Files"}),d.jsx("div",{className:"space-y-1",children:n.supportingFiles.map(W=>d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[d.jsx(S0,{size:14,className:"text-[var(--color-muted)]"}),d.jsxs("span",{className:"text-sm",children:[yae(W),"/"]})]},W))})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-muted)]",children:[d.jsx(Or,{size:12}),d.jsx("span",{className:"font-[var(--font-mono)]",children:n.filePath})]})]})]}),i&&n&&d.jsx(bae,{workflow:n,onClose:()=>s(!1),onSaved:()=>s(!1)})]})}const iP=/^[a-z][a-z0-9-]*$/;function sP(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}const jae=[{value:"step-based",label:At["step-based"].label,icon:eI,color:"text-[var(--color-accent)] bg-blue-500/10 border-blue-500/30",description:At["step-based"].description,bestFor:At["step-based"].bestFor,example:"/create-prd"},{value:"agent-based",label:At["agent-based"].label,icon:pq,color:"text-[var(--color-success)] bg-green-500/10 border-green-500/30",description:At["agent-based"].description,bestFor:At["agent-based"].bestFor,example:"/run-sprint"},{value:"composite",label:At.composite.label,icon:KA,color:"text-purple-400 bg-purple-500/10 border-purple-500/30",description:At.composite.description,bestFor:At.composite.bestFor,example:"/plan → /sprint → /review"}];function Qae({onClose:t,onCreated:e}){const n=tl(),[r,i]=j.useState("pick-type"),[s,l]=j.useState(""),[c,u]=j.useState(""),[f,p]=j.useState("step-based"),[m,O]=j.useState(""),[x,v]=j.useState(""),[S,k]=j.useState(""),[w,N]=j.useState([]),[C,E]=j.useState(!1),[M,R]=j.useState(!1),[_,V]=j.useState("create"),[G,D]=j.useState([]),[L,Z]=j.useState([]),[te,I]=j.useState([]),[B,X]=j.useState(null),[q,K]=j.useState(!1);j.useEffect(()=>{fetch("/api/modules").then(ce=>ce.json()).then(ce=>{const me=ce;D(me.map(ve=>({name:ve.name}))),me.length===1&&k(me[0].name)}).catch(()=>{}),fetch("/api/workflows").then(ce=>ce.json()).then(ce=>{const me=ce,ve=new Set;for(const Ie of me)Ie.phase&&ve.add(Ie.phase);Z(Array.from(ve).sort())}).catch(()=>{}),fetch("/api/agents").then(ce=>ce.json()).then(ce=>I(ce)).catch(()=>{})},[]);const ne=s.length===0||iP.test(s),$=m==="__custom"?x.trim():m,P=s.trim().length>0&&iP.test(s)&&S.length>0,U=j.useCallback(ce=>{var Ie;const me=(Ie=ce.target.files)==null?void 0:Ie[0];if(!me)return;const ve=new FileReader;ve.onload=()=>{const Rt=ve.result.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);if(Rt){const Lt=Rt[1],er=Lt.match(/^name:\s*(.+)$/m),Dr=Lt.match(/^description:\s*"?(.+?)"?$/m),Zn=Lt.match(/^type:\s*(.+)$/m);if(er&&l(er[1].trim()),Dr&&u(Dr[1].trim()),Zn){const yr=Zn[1].trim();(yr==="step-based"||yr==="agent-based"||yr==="composite")&&p(yr)}}else{const Lt=me.name.replace(/\.md$/i,"");l(sP(Lt))}V("create")},ve.readAsText(me)},[]),T=()=>N([...w,{title:"",agent:""}]),J=ce=>N(w.filter((me,ve)=>ve!==ce)),W=(ce,me,ve)=>{N(w.map((Ie,Dt)=>Dt===ce?{...Ie,[me]:ve}:Ie))},re=[];if(P){const ce=$?`_bmad/${S}/workflows/${$}/${s}/`:`_bmad/${S}/workflows/${s}/`;re.push(ce),re.push("├── workflow.md"),f==="step-based"&&w.length>0&&(re.push("├── steps/"),w.forEach((me,ve)=>{const Ie=String(ve+1).padStart(2,"0"),Dt=sP(me.title||"untitled"),Rt=ve===w.length-1?"│ └──":"│ ├──";re.push(`${Rt} step-${Ie}-${Dt}.md`)}))}const oe=async()=>{var ce;if(P){K(!0),X(null);try{const me=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.trim(),description:c.trim(),type:f,phase:$||void 0,module:S,steps:f==="step-based"?w.filter(ve=>ve.title.trim()):void 0})});if(!me.ok){const ve=await me.json();throw new Error(((ce=ve.error)==null?void 0:ce.message)??"Failed to create workflow")}await n.invalidateQueries({queryKey:["workflows"]}),e()}catch(me){X(me instanceof Error?me.message:"Failed to create workflow")}finally{K(!1)}}};return r==="pick-type"?d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),d.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-2xl p-6",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("h2",{className:"text-lg font-bold",children:"New Workflow"}),d.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"What kind of workflow are you building?"}),d.jsx("div",{className:"space-y-3",children:jae.map(ce=>{const me=ce.icon,ve=f===ce.value;return d.jsx("button",{onClick:()=>{p(ce.value),i("form")},className:`w-full text-left p-4 rounded-lg border-2 transition-all ${ve?ce.color:"border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]/50 hover:bg-[var(--color-surface-raised)]"}`,children:d.jsxs("div",{className:"flex items-start gap-4",children:[d.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center shrink-0 ${ve?ce.color:"bg-[var(--color-surface-raised)]"}`,children:d.jsx(me,{size:20})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("p",{className:"font-bold",children:ce.label}),d.jsx(Jm,{size:16,className:"text-[var(--color-muted)]"})]}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-2",children:ce.description}),d.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:ce.bestFor.map(Ie=>d.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)]",children:Ie},Ie))}),d.jsxs("code",{className:"mt-2 inline-block text-xs font-[var(--font-mono)] text-[var(--color-muted)]",children:["e.g. ",ce.example]})]})]})},ce.value)})})]})]}):d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),d.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-2xl p-6 max-h-[85vh] flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>i("pick-type"),className:"text-[var(--color-muted)] hover:text-[var(--color-text)] transition-colors",title:"Back to type selection",children:"←"}),d.jsxs("h2",{className:"text-lg font-bold",children:["New ",f==="step-based"?"Step-based":f==="agent-based"?"Agent-based":"Composite"," Workflow"]})]}),d.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]}),d.jsxs("div",{className:"flex gap-1 mb-4 bg-[var(--color-surface-raised)] rounded-md p-0.5 self-start",children:[d.jsx("button",{onClick:()=>V("create"),className:`px-3 py-1.5 text-sm rounded min-h-[32px] transition-colors ${_==="create"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Create"}),d.jsx("button",{onClick:()=>V("import"),className:`px-3 py-1.5 text-sm rounded min-h-[32px] transition-colors ${_==="import"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Import"})]}),d.jsxs("div",{className:"space-y-4 overflow-y-auto flex-1 pr-1",children:[_==="import"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Upload workflow file"}),d.jsxs("label",{className:"flex items-center justify-center gap-2 w-full px-4 py-6 border-2 border-dashed border-[var(--color-border-subtle)] rounded-lg cursor-pointer hover:border-[var(--color-accent)] transition-colors",children:[d.jsx(tg,{size:16,className:"text-[var(--color-muted)]"}),d.jsx("span",{className:"text-sm text-[var(--color-muted)]",children:"Click to upload a .md workflow file"}),d.jsx("input",{type:"file",accept:".md",onChange:U,className:"hidden"})]})]}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Uploading will parse the file and switch to the Create tab with fields pre-populated. The workflow type is auto-detected from frontmatter."})]}):M?d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold mb-2",children:"Directory Structure Preview"}),d.jsx("pre",{className:"p-4 text-xs font-[var(--font-mono)] bg-[var(--color-surface-raised)] rounded-lg overflow-x-auto whitespace-pre",children:re.join(`
|
|
589
|
+
`)})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Name"}),d.jsx("input",{type:"text",value:s,onChange:ce=>l(ce.target.value),onBlur:()=>E(!0),placeholder:"e.g. create-product-brief",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),C&&!ne&&d.jsx("p",{className:"text-xs text-[var(--color-error)] mt-1",children:"Name must be kebab-case"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Parent Module"}),d.jsxs("select",{value:S,onChange:ce=>k(ce.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[d.jsx("option",{value:"",children:"Select a module..."}),G.map(ce=>d.jsx("option",{value:ce.name,children:ce.name},ce.name))]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Description"}),d.jsx("textarea",{value:c,onChange:ce=>u(ce.target.value),placeholder:"What does this workflow do?",rows:2,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-bold mb-1",children:"Phase (optional)"}),d.jsxs("select",{value:m,onChange:ce=>O(ce.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[d.jsx("option",{value:"",children:"No phase grouping"}),L.map(ce=>d.jsx("option",{value:ce,children:ce},ce)),d.jsx("option",{value:"__custom",children:"Custom..."})]}),m==="__custom"&&d.jsx("input",{type:"text",value:x,onChange:ce=>v(ce.target.value),placeholder:"e.g. 5-deployment",className:"w-full mt-2 px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),f==="step-based"&&d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-bold mb-1",children:["Initial Steps (",w.length,")"]}),d.jsx("div",{className:"space-y-2",children:w.map((ce,me)=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs text-[var(--color-muted)] w-6 text-right shrink-0",children:String(me+1).padStart(2,"0")}),d.jsx("input",{type:"text",value:ce.title,onChange:ve=>W(me,"title",ve.target.value),placeholder:"Step title...",className:"flex-1 px-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),d.jsxs("select",{value:ce.agent,onChange:ve=>W(me,"agent",ve.target.value),className:"w-36 px-2 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[d.jsx("option",{value:"",children:"Agent..."}),te.map(ve=>d.jsx("option",{value:ve.name,children:ve.title||ve.name},ve.id))]}),d.jsx("button",{onClick:()=>J(me),className:"text-[var(--color-muted)] hover:text-[var(--color-error)] shrink-0",children:d.jsx(uo,{size:14})})]},me))}),d.jsxs("button",{onClick:T,className:"mt-2 flex items-center gap-1.5 text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)]",children:[d.jsx(Yt,{size:14})," Add step"]})]})]}),B&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:B})]}),d.jsx("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:M?d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:()=>R(!1),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Back"}),d.jsxs("button",{onClick:oe,disabled:!P||q,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[d.jsx(Yt,{size:14}),q?"Creating...":"Create Workflow"]})]}):d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsx("button",{onClick:()=>R(!0),disabled:!P,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Preview & Create"})]})})]})]})}const aP={"step-based":"border-[var(--color-border-subtle)] text-[var(--color-muted)]","agent-based":"border-purple-400/50 text-purple-400",composite:"border-blue-400/50 text-blue-400"},Cae={"step-based":`${At["step-based"].label}: ${At["step-based"].description}`,"agent-based":`${At["agent-based"].label}: ${At["agent-based"].description}`,composite:`${At.composite.label}: ${At.composite.description}`};function Ec({type:t}){if(!t)return null;const e=t==="step-based"?"Step":t==="agent-based"?"Agent":"Composite";return d.jsx("span",{title:Cae[t],className:`px-2 py-0.5 rounded-full text-xs border cursor-help ${aP[t]??aP["step-based"]}`,children:e})}function Nae(t){return t.replace(/^\d+-/,"").split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Tae(t){const e=new Map;for(const n of t){const r=n.phase??"__ungrouped";e.has(r)||e.set(r,[]),e.get(r).push(n)}return Array.from(e.entries()).sort(([n],[r])=>{if(n==="__ungrouped")return 1;if(r==="__ungrouped")return-1;const i=parseInt(n)||999,s=parseInt(r)||999;return i-s})}function $ae({onClose:t}){const e=[{label:At["step-based"].label,badge:d.jsx(Ec,{type:"step-based"}),icon:d.jsx(Or,{size:20,className:"text-[var(--color-muted)]"}),description:At["step-based"].description,bestFor:At["step-based"].bestFor,example:"/create-prd"},{label:At["agent-based"].label,badge:d.jsx(Ec,{type:"agent-based"}),icon:d.jsx(Tn,{size:20,className:"text-purple-400"}),description:At["agent-based"].description,bestFor:At["agent-based"].bestFor,example:"/run-sprint"},{label:At.composite.label,badge:d.jsx(Ec,{type:"composite"}),icon:d.jsx(yh,{size:20,className:"text-blue-400"}),description:At.composite.description,bestFor:At.composite.bestFor,example:"/bmad-full-pipeline"}];return d.jsxs("div",{className:"mb-6 rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-surface-raised)] overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--color-border-subtle)]",children:[d.jsx("h3",{className:"text-sm font-bold",children:"Understanding Workflow Types"}),d.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)] transition-colors",children:d.jsx(Wt,{size:16})})]}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 divide-y md:divide-y-0 md:divide-x divide-[var(--color-border-subtle)]",children:e.map(n=>d.jsxs("div",{className:"p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[n.icon,d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm font-bold",children:n.label}),n.badge]})]}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] leading-relaxed",children:n.description}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-[var(--color-muted)] mb-1",children:"Best for"}),d.jsx("ul",{className:"space-y-0.5",children:n.bestFor.map(r=>d.jsxs("li",{className:"text-xs text-[var(--color-muted)] flex items-start gap-1.5",children:[d.jsx("span",{className:"text-[var(--color-accent)] mt-0.5 shrink-0",children:"›"}),r]},r))})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-[var(--color-muted)] mb-1",children:"Example invocation"}),d.jsx("code",{className:"text-xs font-[var(--font-mono)] text-[var(--color-accent)] bg-[var(--color-bg)] border border-[var(--color-border-subtle)] px-1.5 py-0.5 rounded",children:n.example})]})]},n.label))})]})}function Eae(){const{data:t,isLoading:e,refetch:n}=XS(),[r,i]=j.useState(!1),[s,l]=j.useState(!1),[c,u]=cs("detail"),[f,p]=j.useState("all"),[m,O]=j.useState(""),x=j.useMemo(()=>{if(!t)return[];const w=new Set;for(const N of t)N.module&&w.add(N.module);return Array.from(w).sort()},[t]),v=j.useMemo(()=>{if(!t)return{};const w={};for(const N of t)N.module&&(w[N.module]=(w[N.module]??0)+1);return w},[t]),S=j.useMemo(()=>{if(!t)return[];let w=t;if(f!=="all"&&(w=w.filter(N=>N.module===f)),m){const N=m.toLowerCase();w=w.filter(C=>C.name.toLowerCase().includes(N)||C.description&&C.description.toLowerCase().includes(N))}return w},[t,f,m]),k=j.useMemo(()=>Tae(S),[S]);return e?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"Workflows"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"Structured sequences of steps that define how agents deliver work across BMAD phases."}),d.jsx("div",{className:"space-y-3",children:[1,2,3].map(w=>d.jsx("div",{className:"h-16 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"},w))})]}):!t||t.length===0?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"Workflows"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"Structured sequences of steps that define how agents deliver work across BMAD phases."}),d.jsx(Ci,{icon:Or,title:"No workflows found",description:"Workflows are structured processes you run in your IDE — like sprint planning, architecture design, or code review. A Step Workflow guides a single agent through phases. An Agent Workflow hands off between multiple specialised agents. Install a module to get pre-built workflows, or create your own.",actions:d.jsxs(d.Fragment,{children:[d.jsx(zt,{to:"/modules",className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Browse Modules"}),d.jsx("button",{onClick:()=>i(!0),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"New Workflow"})]})})]}):d.jsxs("div",{children:[d.jsxs("div",{children:[d.jsx(Jg,{title:"Workflows",count:t.length,modules:x,moduleCounts:v,activeModule:f,onModuleChange:p,search:m,onSearchChange:O,actions:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:()=>l(w=>!w),title:"About workflow types",className:`p-2 rounded-md transition-colors ${s?"text-[var(--color-accent)] bg-[var(--color-surface-raised)]":"text-[var(--color-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-surface-raised)]"}`,children:d.jsx(jq,{size:16})}),d.jsxs("button",{onClick:()=>i(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[d.jsx(Yt,{size:14}),"New Workflow"]})]})}),s&&d.jsx($ae,{onClose:()=>l(!1)}),d.jsx("div",{className:"space-y-6",children:k.map(([w,N])=>d.jsxs("div",{children:[d.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-2 px-1",children:[w==="__ungrouped"?"Ungrouped":Nae(w),d.jsxs("span",{className:"ml-2 font-normal",children:["(",N.length,")"]})]}),d.jsx("div",{className:"space-y-2",children:N.map(C=>d.jsxs("button",{onClick:()=>u(c===C.id?null:C.id),className:`w-full flex items-center justify-between p-4 rounded-lg border transition-colors cursor-pointer text-left ${c===C.id?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Or,{size:18,className:"text-[var(--color-muted)]"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-bold",children:C.name}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] truncate max-w-md",children:C.description})]})]}),d.jsxs("div",{className:"flex items-center gap-3 text-xs text-[var(--color-muted)]",children:[(C.module==="bmm"||C.module==="bmb")&&d.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-amber-500/10 border border-amber-500/30 text-amber-400 text-[10px] font-bold shrink-0",children:[d.jsx(BA,{size:9}),"Reference"]}),d.jsx(Ec,{type:C.type}),d.jsxs("span",{children:[C.stepCount," steps"]}),C.module&&d.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)]",children:C.module})]})]},C.id))})]},w))})]}),c&&d.jsx(sD,{workflowId:c,onClose:()=>u(null)}),r&&d.jsx(Qae,{onClose:()=>i(!1),onCreated:()=>{i(!1),n()}})]})}const Wk=[{key:"project-context",label:"Project Context",phase:"context",match:t=>/^project.?context/i.test(t)},{key:"brainstorming",label:"Brainstorming",phase:"analysis",match:t=>/^brainstorming/i.test(t)},{key:"product-brief",label:"Product Briefs",phase:"analysis",match:t=>/^product.?brief/i.test(t)},{key:"research",label:"Research",phase:"analysis",match:t=>/research/i.test(t)},{key:"prd",label:"Product Requirements",phase:"planning",match:t=>/^prd/i.test(t)},{key:"prfaq",label:"PRFAQ",phase:"planning",match:t=>/^prfaq/i.test(t)},{key:"architecture",label:"Architecture",phase:"solutioning",match:t=>/^architecture/i.test(t)},{key:"epics",label:"Epics",phase:"solutioning",match:t=>/^epic/i.test(t)},{key:"spikes",label:"Spikes",phase:"solutioning",match:t=>/^spike/i.test(t)},{key:"ux",label:"UX Design",phase:"solutioning",match:t=>/^ux.?(spec|design)/i.test(t)},{key:"readiness",label:"Readiness Reports",phase:"solutioning",match:t=>/readiness|implementation.?ready/i.test(t)},{key:"course-correction",label:"Sprint Change Proposals",phase:"solutioning",match:t=>/correct.?course|sprint.?change/i.test(t)},{key:"tech-spec",label:"Tech Specs",phase:"implementation",match:t=>/^(tech.?spec|spec-)/i.test(t)},{key:"stories",label:"User Stories",phase:"implementation",match:t=>/^story-/i.test(t)},{key:"sprint",label:"Sprint Tracking",phase:"implementation",match:t=>/^sprint/i.test(t)},{key:"reviews",label:"Code Reviews",phase:"implementation",match:t=>/review/i.test(t)},{key:"retros",label:"Retrospectives",phase:"implementation",match:t=>/retro/i.test(t)}];function aD(t){for(const e of Wk)if(e.match(t.name))return{phase:e.phase,subType:e.key};return t.path.startsWith("brainstorming/")?{phase:"analysis",subType:"uncategorised"}:t.path.startsWith("planning-artifacts/")?{phase:"planning",subType:"uncategorised"}:t.path.startsWith("implementation-artifacts/")?{phase:"implementation",subType:"uncategorised"}:{phase:"implementation",subType:"uncategorised"}}function Pae(t){var e;return((e=Wk.find(n=>n.key===t))==null?void 0:e.label)??"Other"}const Aae={context:{label:"Project Context",icon:YA},analysis:{label:"Analysis",icon:gI},planning:{label:"Planning",icon:rs},solutioning:{label:"Solutioning",icon:VI},implementation:{label:"Implementation",icon:Tq}},Rae=["context","analysis","planning","solutioning","implementation"];function lD(t){return t.replace(/\.(md|yaml|yml|txt)$/i,"").replace(/-(\d{4}-\d{2}-\d{2})(-\d{4})?$/,"").replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function _ae(t){const e=t.match(/^---\n([\s\S]*?)\n---/);if(!e)return{};const n=e[1],r={},i=O=>{const x=n.match(new RegExp(`^${O}:\\s*(.+)$`,"m"));return x?x[1].trim().replace(/^["']|["']$/g,""):void 0},s=i("workflow");s&&(r.workflow=s);const l=i("agent");l&&(r.agent=l);const c=i("skill");c&&(r.skill=c);const u=i("story");u&&(r.story=u);const f=i("epic");f&&(r.epic=f);const p=i("sprint");p&&(r.sprint=p);const m=i("status");return m&&(r.status=m),r}function Mae({refs:t}){const e=ds(),n=[];t.workflow&&n.push({label:`Workflow: ${t.workflow}`,route:`/workflows?detail=${t.workflow}`,icon:Or,color:"text-purple-400"}),t.agent&&n.push({label:`Agent: ${t.agent}`,route:`/agents/${t.agent}`,icon:Tn,color:"text-[var(--color-accent)]"}),t.skill&&n.push({label:`Skill: ${t.skill}`,route:`/skills?detail=${t.skill}`,icon:Si,color:"text-[var(--color-success)]"});const r=[];return t.status&&r.push(`status: ${t.status}`),t.epic!==void 0&&r.push(`epic ${t.epic}`),t.sprint!==void 0&&r.push(`sprint ${t.sprint}`),t.story!==void 0&&r.push(`story ${t.story}`),n.length===0&&r.length===0?null:d.jsxs("div",{className:"mb-4 p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[d.jsx("p",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-2",children:"From this artifact"}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.map(i=>{const s=i.icon;return d.jsxs("button",{onClick:()=>e(i.route),className:`inline-flex items-center gap-1.5 text-xs px-2 py-1 rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-bg)] transition-colors cursor-pointer ${i.color}`,children:[d.jsx(s,{size:11}),i.label]},i.route)}),r.map(i=>d.jsx("span",{className:"text-xs px-2 py-1 rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:i},i))]})]})}function oD({file:t,isSelected:e,onSelect:n}){const i=new Date(t.modifiedAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});return d.jsxs("button",{onClick:n,className:`w-full flex items-center justify-between px-4 py-2 text-left transition-colors cursor-pointer ${e?"bg-[var(--color-surface-raised)] border-l-2 border-l-[var(--color-accent)] -ml-[2px]":"hover:bg-[var(--color-surface-raised)]"}`,children:[d.jsx("span",{className:`text-xs truncate ${e?"font-bold text-[var(--color-accent)]":"text-[var(--color-text)]"}`,children:lD(t.name)}),d.jsx("span",{className:"text-[10px] text-[var(--color-muted)] shrink-0 ml-4",children:i})]})}function zae({subTypeKey:t,files:e,selectedPath:n,onSelect:r,defaultOpen:i}){const[s,l]=j.useState(i);return d.jsxs("div",{className:"ml-3 border-l border-[var(--color-border-subtle)]",children:[d.jsxs("button",{onClick:()=>l(!s),className:"w-full flex items-center gap-2 px-3 py-1.5 text-left hover:bg-[var(--color-surface-raised)] transition-colors cursor-pointer",children:[s?d.jsx(gr,{size:11,className:"text-[var(--color-muted)] shrink-0"}):d.jsx(yi,{size:11,className:"text-[var(--color-muted)] shrink-0"}),d.jsx("span",{className:"text-xs font-bold text-[var(--color-text)] flex-1",children:Pae(t)}),d.jsx("span",{className:"text-[10px] text-[var(--color-muted)]",children:e.length})]}),s&&d.jsx("div",{className:"ml-3",children:e.slice().sort((c,u)=>new Date(u.modifiedAt).getTime()-new Date(c.modifiedAt).getTime()).map(c=>d.jsx(oD,{file:c,isSelected:n===c.path,onSelect:()=>r(c.path)},c.path))})]})}function Dae({phase:t,files:e,selectedPath:n,onSelect:r,defaultOpen:i}){const[s,l]=j.useState(i),{label:c,icon:u}=Aae[t],f=j.useMemo(()=>{const p=new Map;for(const O of e){const{subType:x}=aD(O);p.has(x)||p.set(x,[]),p.get(x).push(O)}const m=Wk.map(O=>O.key);return[...p.entries()].sort((O,x)=>{const v=m.indexOf(O[0]),S=m.indexOf(x[0]);return(v===-1?999:v)-(S===-1?999:S)})},[e]);return d.jsxs("div",{className:"rounded-lg border border-[var(--color-border-subtle)] overflow-hidden",children:[d.jsxs("button",{onClick:()=>l(!s),className:"w-full flex items-center gap-3 px-4 py-3 bg-[var(--color-surface-raised)] hover:bg-[var(--color-bg)] transition-colors text-left cursor-pointer",children:[s?d.jsx(gr,{size:16,className:"text-[var(--color-muted)] shrink-0"}):d.jsx(yi,{size:16,className:"text-[var(--color-muted)] shrink-0"}),d.jsx(u,{size:16,className:"text-[var(--color-accent)] shrink-0"}),d.jsx("span",{className:"font-bold text-sm flex-1",children:c}),d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:e.length})]}),s&&d.jsx("div",{className:"py-1",children:f.length>1?f.map(([p,m],O)=>d.jsx(zae,{subTypeKey:p,files:m,selectedPath:n,onSelect:r,defaultOpen:O===0},p)):f.length===1?d.jsx("div",{className:"ml-3",children:f[0][1].slice().sort((p,m)=>new Date(m.modifiedAt).getTime()-new Date(p.modifiedAt).getTime()).map(p=>d.jsx(oD,{file:p,isSelected:n===p.path,onSelect:()=>r(p.path)},p.path))}):null})]})}function Lae(){const[t,e]=j.useState([]),[n,r]=j.useState(!0),[i,s]=cs("path"),[l,c]=j.useState(""),[u,f]=j.useState(!1),p=j.useMemo(()=>_ae(l),[l]);cs("category"),j.useEffect(()=>{fetch("/api/outputs").then(S=>S.json()).then(S=>{e(S),r(!1)}).catch(()=>r(!1))},[]),j.useEffect(()=>{if(!i){c("");return}f(!0),fetch(`/api/outputs/${i}`).then(S=>{if(!S.ok)throw new Error("Not found");return S.json()}).then(S=>c(S.content)).catch(()=>c("Failed to load file content.")).finally(()=>f(!1))},[i]);const m=j.useCallback(S=>{s(i===S?null:S)},[i,s]),O=j.useMemo(()=>{const S={context:[],analysis:[],planning:[],solutioning:[],implementation:[]};for(const k of t){if(k.name.startsWith("."))continue;const{phase:w}=aD(k);S[w].push(k)}return S},[t]),x=j.useMemo(()=>Object.values(O).reduce((S,k)=>S+k.length,0),[O]),v=i?i.split("/").pop()??i:"";return n?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"Outputs"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"Artifacts produced by BMAD workflows — grouped by methodology phase."}),d.jsx("div",{className:"space-y-3",children:[1,2,3].map(S=>d.jsx("div",{className:"h-16 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"},S))})]}):x===0?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"Outputs"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"Artifacts produced by BMAD workflows — grouped by methodology phase."}),d.jsx(Ci,{icon:vh,title:"No outputs yet",description:"BMAD outputs are artifacts produced by running workflows — brainstorming sessions, PRDs, architecture docs, sprint plans, and story files. Run a BMAD workflow in your IDE to generate your first output.",actions:d.jsx(zt,{to:"/workflows",className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Browse Workflows"})})]}):d.jsxs("div",{children:[d.jsx("div",{className:"flex items-center justify-between mb-2",children:d.jsxs("h1",{className:"text-2xl font-extrabold",children:["Outputs (",x,")"]})}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"Artifacts produced by BMAD workflows — grouped by methodology phase."}),d.jsx("div",{className:"space-y-3",children:Rae.filter(S=>O[S].length>0).map((S,k)=>d.jsx(Dae,{phase:S,files:O[S],selectedPath:i,onSelect:m,defaultOpen:k===0},S))}),d.jsx(CO,{open:!!i,title:lD(v),onClose:()=>s(null),width:"max(480px, 50vw)",children:u?d.jsx("div",{className:"h-64 rounded bg-[var(--color-surface-raised)] animate-pulse"}):i!=null&&i.endsWith(".csv")?d.jsx(Wg,{content:l}):d.jsxs(d.Fragment,{children:[d.jsx(Mae,{refs:p}),d.jsx("div",{className:"rounded-lg overflow-hidden border border-[var(--color-border-subtle)]",style:{height:"calc(100vh - 200px)"},children:d.jsx(ai,{content:l,filePath:i??"",onChange:()=>{},readOnly:!0})})]})})]})}function Xae({available:t,onClose:e,onAdded:n}){const[r,i]=j.useState(null),[s,l]=j.useState(!1),[c,u]=j.useState(null),f=async()=>{var p;if(r){l(!0),u(null);try{const m=await fetch("/api/ides",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ide:r})}),O=await m.json();if(!m.ok)throw new Error(((p=O.error)==null?void 0:p.message)??"Failed to add IDE");n(r,O.skillsGenerated??{})}catch(m){u(m instanceof Error?m.message:"Failed to add IDE")}finally{l(!1)}}};return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[d.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:e}),d.jsxs("div",{className:"relative w-full max-w-md bg-[var(--color-bg)] rounded-xl border border-[var(--color-border-subtle)] shadow-2xl",children:[d.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[var(--color-border-subtle)]",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Sc,{size:18,className:"text-[var(--color-accent)]"}),d.jsx("h2",{className:"text-lg font-bold",children:"Add IDE"})]}),d.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]}),d.jsxs("div",{className:"px-6 py-5 space-y-3",children:[d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"Select an IDE to configure. Skills from installed modules will be generated automatically."}),t.length===0?d.jsx("p",{className:"text-sm text-[var(--color-muted)] text-center py-4",children:"All supported IDEs are already configured."}):t.map(p=>d.jsxs("button",{onClick:()=>i(p.id),className:`w-full flex items-center gap-3 p-3 rounded-lg border text-left transition-colors ${r===p.id?"border-[var(--color-accent)] bg-[var(--color-surface-raised)]":"border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)]"}`,children:[d.jsx("div",{className:"w-8 h-8 rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] flex items-center justify-center shrink-0",children:d.jsx(Sc,{size:16,className:"text-[var(--color-accent)]"})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-bold",children:p.label}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:p.description})]})]},p.id)),c&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:c})]}),d.jsxs("div",{className:"px-6 py-4 border-t border-[var(--color-border-subtle)] flex justify-end gap-3",children:[d.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsxs("button",{onClick:f,disabled:!r||s,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[s?d.jsx(is,{size:14,className:"animate-spin"}):d.jsx(Yt,{size:14}),s?"Adding...":"Add IDE"]})]})]})]})}const cD={jira:rs,confluence:iI,figma:Mq,github:JA,custom:GA},Wm={jira:"Jira",confluence:"Confluence",figma:"Figma",github:"GitHub",custom:"Custom"},Zae={jira:{cliTool:"jira-cli",parameters:{project:"",board:""},outputPath:"_bmad-output/data/jira/"},confluence:{cliTool:"confluence-cli",parameters:{space:"",label:""},outputPath:"_bmad-output/data/confluence/"},figma:{cliTool:"figma-export",parameters:{fileKey:"",nodeId:""},outputPath:"_bmad-output/data/figma/"},github:{cliTool:"gh",parameters:{repo:"",query:""},outputPath:"_bmad-output/data/github/"},custom:{cliTool:"",parameters:{},outputPath:"_bmad-output/data/"}},lP={configured:"var(--color-accent)",synced:"var(--color-success)",error:"var(--color-error)","not-configured":"var(--color-muted)"};function qae({onClose:t,onCreated:e}){const[n,r]=j.useState("type"),[i,s]=j.useState(null),[l,c]=j.useState(""),[u,f]=j.useState(""),[p,m]=j.useState({}),[O,x]=j.useState(""),[v,S]=j.useState(""),[k,w]=j.useState(null),[N,C]=j.useState(!1);function E(_){s(_);const V=Zae[_];f(V.cliTool),m({...V.parameters}),S(V.outputPath),r("form")}const M=l.trim().length>0&&u.trim().length>0,R=async()=>{var _;if(!(!M||!i)){C(!0),w(null);try{const V=await fetch("/api/datasources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.trim(),type:i,cliTool:u.trim(),parameters:p,outputPath:v.trim()})});if(!V.ok){const G=await V.json();throw new Error(((_=G.error)==null?void 0:_.message)??"Failed to create data source")}e()}catch(V){w(V instanceof Error?V.message:"Failed to create data source")}finally{C(!1)}}};return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),d.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"text-lg font-bold",children:n==="type"?"Add Data Source":`New ${Wm[i]} Source`}),d.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]}),n==="type"&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-4",children:"Choose a data source type:"}),Object.keys(Wm).map(_=>{const V=cD[_];return d.jsxs("button",{onClick:()=>E(_),className:"w-full flex items-center gap-3 p-3 rounded-lg border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors text-left",children:[d.jsx("div",{className:"w-8 h-8 rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] flex items-center justify-center",children:d.jsx(V,{size:16,className:"text-[var(--color-accent)]"})}),d.jsxs("div",{children:[d.jsx("span",{className:"font-bold text-sm",children:Wm[_]}),d.jsxs("p",{className:"text-xs text-[var(--color-muted)]",children:[_==="jira"&&"Import issues and boards from Jira",_==="confluence"&&"Import pages and spaces from Confluence",_==="figma"&&"Export designs from Figma",_==="github"&&"Pull data from GitHub repositories",_==="custom"&&"Configure a custom CLI tool"]})]})]},_)})]}),n==="form"&&i&&d.jsxs("div",{className:"space-y-4",children:[d.jsx("button",{onClick:()=>r("type"),className:"text-xs text-[var(--color-accent)] hover:underline",children:"← Change type"}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),d.jsx("input",{type:"text",value:l,onChange:_=>c(_.target.value),placeholder:"e.g. My Project Board",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"CLI Tool"}),d.jsx("input",{type:"text",value:u,onChange:_=>f(_.target.value),placeholder:"e.g. jira-cli",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),Object.entries(p).map(([_,V])=>d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1 capitalize",children:_}),d.jsx("input",{type:"text",value:V,onChange:G=>m({...p,[_]:G.target.value}),placeholder:`Enter ${_}...`,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]},_)),i==="custom"&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"text",value:O,onChange:_=>x(_.target.value),onKeyDown:_=>{_.key==="Enter"&&O.trim()&&(m({...p,[O.trim()]:""}),x(""))},placeholder:"Parameter name",className:"flex-1 px-2 py-1 text-xs rounded border border-[var(--color-border-subtle)] bg-[var(--color-surface-raised)] focus:border-[var(--color-accent)] focus:outline-none"}),d.jsx("button",{onClick:()=>{O.trim()&&(m({...p,[O.trim()]:""}),x(""))},className:"text-xs text-[var(--color-accent)] hover:underline shrink-0",children:"+ Add"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Output Path"}),d.jsx("input",{type:"text",value:v,onChange:_=>S(_.target.value),placeholder:"_bmad-output/data/",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none font-[var(--font-mono)] text-xs"})]}),k&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:k}),d.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-[var(--color-border-subtle)]",children:[d.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsxs("button",{onClick:R,disabled:!M||N,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[d.jsx(Yt,{size:14}),N?"Creating...":"Create"]})]})]})]})]})}function Iae({command:t,sourceName:e,onClose:n}){const[r,i]=j.useState(!1);function s(){navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})}return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:n}),d.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsxs("h2",{className:"text-lg font-bold",children:["Sync: ",e]}),d.jsx("button",{onClick:n,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-3",children:"Run this command in your terminal to sync data:"}),d.jsxs("div",{className:"relative",children:[d.jsx("pre",{className:"p-4 text-sm font-[var(--font-mono)] bg-[var(--color-surface-raised)] rounded-lg overflow-x-auto whitespace-pre-wrap border border-[var(--color-border-subtle)]",children:t}),d.jsx("button",{onClick:s,className:"absolute top-2 right-2 p-1.5 rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors",title:"Copy to clipboard",children:r?d.jsx(bh,{size:14,className:"text-[var(--color-success)]"}):d.jsx(Eq,{size:14,className:"text-[var(--color-muted)]"})})]}),d.jsx("div",{className:"flex justify-end mt-4",children:d.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Close"})})]})]})}function Bae(){var ne,$;const[t,e]=j.useState(null),[n,r]=j.useState(!0),[i,s]=j.useState(null),[l,c]=j.useState(null),[u,f]=j.useState(!1),[p,m]=j.useState(null),[O,x]=j.useState({}),[v,S]=j.useState(!1),[k,w]=j.useState([]),[N,C]=j.useState(!0),[E,M]=j.useState(!1),[R,_]=j.useState(null),[V,G]=j.useState(null),[D,L]=j.useState(null),Z=j.useCallback(async()=>{try{const U=await(await fetch("/api/datasources")).json();w(U)}catch{}finally{C(!1)}},[]),te=j.useCallback(async()=>{try{const[P,U]=await Promise.all([fetch("/api/ides"),fetch("/api/ides/coverage")]);P.ok&&m(await P.json()),U.ok&&x(await U.json())}catch{}},[]);j.useEffect(()=>{fetch("/api/overview").then(P=>P.json()).then(P=>{e(P),r(!1)}).catch(()=>r(!1)),te()},[te]),j.useEffect(()=>{Z()},[Z]);async function I(P){if(i===P){s(null),c(null);return}s(P),f(!0);try{const U=await fetch(`/api/files/_config/ides/${P}.yaml`);if(U.ok){const T=await U.json();c(T.content)}else c(null)}catch{c(null)}finally{f(!1)}}async function B(P){G(P.id);try{const U=await fetch(`/api/datasources/${encodeURIComponent(P.id)}/sync`,{method:"POST"});if(U.ok){const T=await U.json();_({command:T.command,name:P.name})}}catch{}finally{G(null)}}async function X(P){if(confirm(`Delete data source "${P.name}"?`)){L(P.id);try{(await fetch(`/api/datasources/${encodeURIComponent(P.id)}`,{method:"DELETE"})).ok&&await Z()}catch{}finally{L(null)}}}if(n&&N)return d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"IDE Connections"}),d.jsx(eO,{count:3})]});const q=(p==null?void 0:p.configured.map(P=>P.ide))??(($=(ne=t==null?void 0:t.sections)==null?void 0:ne.ideConfigs)==null?void 0:$.ides)??[],K=q.length+k.length;return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-8",children:[d.jsxs("h1",{className:"text-2xl font-extrabold",children:["IDE Connections (",K,")"]}),d.jsx("div",{className:"flex items-center gap-3",children:p&&p.available.length>0&&d.jsxs("button",{onClick:()=>S(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[d.jsx(Sc,{size:14}),"Add IDE Connection"]})})]}),k.length>0&&d.jsxs("div",{className:"mb-8",children:[d.jsxs("h2",{className:"text-sm font-bold text-[var(--color-muted)] uppercase tracking-wider mb-4",children:["Data Sources (",k.length,")"]}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:k.map(P=>{const U=cD[P.type]??GA,T=lP[P.status]??lP["not-configured"];return d.jsxs("div",{className:"p-4 rounded-lg border bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-all",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[d.jsx("div",{className:"w-8 h-8 rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] flex items-center justify-center",children:d.jsx(U,{size:16,className:"text-[var(--color-accent)]"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"font-bold text-sm block truncate",children:P.name}),d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:Wm[P.type]})]})]}),d.jsxs("div",{className:"flex items-center gap-1.5 mb-3",children:[d.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:T}}),d.jsx("span",{className:"text-xs capitalize",style:{color:T},children:P.status}),P.lastSync&&d.jsxs("span",{className:"text-xs text-[var(--color-muted)] ml-auto",children:["Last sync: ",new Date(P.lastSync).toLocaleDateString()]})]}),d.jsxs("div",{className:"text-xs text-[var(--color-muted)] mb-3 space-y-1",children:[d.jsxs("p",{className:"font-[var(--font-mono)] truncate",title:P.cliTool,children:["Tool: ",P.cliTool||"(not set)"]}),d.jsxs("p",{className:"font-[var(--font-mono)] truncate",title:P.outputPath,children:["Output: ",P.outputPath]})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("button",{onClick:()=>B(P),disabled:V===P.id,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 text-xs rounded-md border border-[var(--color-accent)] text-[var(--color-accent)] hover:bg-[var(--color-accent)] hover:text-white transition-colors disabled:opacity-50",children:[V===P.id?d.jsx(is,{size:12,className:"animate-spin"}):d.jsx(NI,{size:12}),"Sync"]}),d.jsx("button",{onClick:()=>X(P),disabled:D===P.id,className:"flex items-center justify-center gap-1.5 px-3 py-1.5 text-xs rounded-md border border-[var(--color-error)] text-[var(--color-error)] hover:bg-[var(--color-error)] hover:text-white transition-colors disabled:opacity-50",children:d.jsx(uo,{size:12})})]})]},P.id)})})]}),q.length>0&&d.jsxs("div",{className:"mb-8",children:[d.jsxs("h2",{className:"text-sm font-bold text-[var(--color-muted)] uppercase tracking-wider mb-4",children:["IDE Connections (",q.length,")"]}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:q.map(P=>d.jsxs("button",{onClick:()=>I(P),className:`p-4 rounded-lg border text-left transition-all cursor-pointer hover:-translate-y-0.5 hover:shadow-md ${i===P?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[d.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[d.jsx("div",{className:"w-8 h-8 rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] flex items-center justify-center",children:d.jsx(Sc,{size:16,className:"text-[var(--color-accent)]"})}),d.jsx("span",{className:"font-bold text-sm",children:P})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"w-2 h-2 rounded-full bg-[var(--color-success)]"}),d.jsx("span",{className:"text-xs text-[var(--color-success)]",children:"Configured"})]})]},P))})]}),K===0&&d.jsx(Ci,{icon:tR,title:"No IDE connections configured",description:"Configure IDE integrations to enable skill generation and project sync in your BMAD project.",actions:p&&p.available.length>0?d.jsxs("button",{onClick:()=>S(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[d.jsx(Sc,{size:14}),"Add IDE Connection"]}):void 0}),i&&d.jsxs(CO,{open:!0,title:i,onClose:()=>{s(null),c(null)},children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold mb-2",children:"Status"}),d.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[d.jsx(bh,{size:16,className:"text-[var(--color-success)]"}),d.jsx("span",{className:"text-sm",children:"Connected and active"})]})]}),O[i]&&d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold mb-2",children:"Module Coverage"}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] mb-3",children:"Which modules have skills synced to this IDE."}),d.jsxs("div",{className:"space-y-1.5",children:[O[i].length===0&&d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"No modules installed."}),O[i].map(P=>d.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[P.synced?d.jsx(bh,{size:13,className:"text-[var(--color-success)] shrink-0"}):d.jsx(UA,{size:13,className:"text-[var(--color-warning)] shrink-0"}),d.jsx("span",{className:"text-sm font-[var(--font-mono)]",children:P.module})]}),P.synced?d.jsxs("span",{className:"text-xs text-[var(--color-success)]",children:[P.skillCount," skill",P.skillCount!==1?"s":""]}):d.jsx("span",{className:"text-xs text-[var(--color-warning)]",children:"not synced"})]},P.module))]})]}),u&&d.jsx("div",{className:"h-32 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"}),l&&!u&&d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold mb-2",children:"Configuration"}),d.jsx("pre",{className:"p-3 text-xs font-[var(--font-mono)] bg-[var(--color-surface-raised)] rounded-lg overflow-x-auto whitespace-pre-wrap max-h-64 overflow-y-auto",children:l})]}),d.jsx("div",{className:"text-xs text-[var(--color-muted)]",children:d.jsxs("p",{children:["Config file: ",d.jsxs("code",{className:"font-[var(--font-mono)]",children:["_bmad/_config/ides/",i,".yaml"]})]})})]}),E&&d.jsx(qae,{onClose:()=>M(!1),onCreated:()=>{M(!1),Z()}}),R&&d.jsx(Iae,{command:R.command,sourceName:R.name,onClose:()=>_(null)}),v&&p&&d.jsx(Xae,{available:p.available,onClose:()=>S(!1),onAdded:(P,U)=>{S(!1),te(),fetch("/api/overview").then(T=>T.json()).then(T=>e(T)).catch(()=>{})}})]})}const Yae=[{key:"overview",heading:"Project Overview"},{key:"techStack",heading:"Technology Stack"},{key:"codeOrg",heading:"Code Organization"},{key:"planning",heading:"Planning Artifacts"},{key:"rules",heading:"Rules and Conventions"},{key:"modules",heading:"Installed Modules"},{key:"ides",heading:"Configured IDEs"}];function Vae(t){const e=t.toLowerCase();return e.includes("overview")?"overview":e.includes("tech")&&e.includes("stack")?"techStack":e.includes("code")&&e.includes("org")?"codeOrg":e.includes("planning")&&e.includes("artifact")?"planning":e.includes("rule")||e.includes("convention")?"rules":e.includes("module")?"modules":e.includes("ide")||e.includes("configured")?"ides":null}function Uae(t){const e=[],n=t.split(`
|
|
590
|
+
`);let r="",i=[];for(const s of n){const l=s.match(/^###\s+(?:RULE:\s*)?(.+)/);l?(r&&e.push({title:r,body:i.join(`
|
|
591
|
+
`).trim()}),r=l[1],i=[]):r&&i.push(s)}return r&&e.push({title:r,body:i.join(`
|
|
592
|
+
`).trim()}),e}function uD(t){return t.map(e=>`### RULE: ${e.title}
|
|
593
|
+
|
|
594
|
+
${e.body}`).join(`
|
|
595
|
+
|
|
596
|
+
`)}function Wae(t){const e=[],n=t.split(`
|
|
597
|
+
`);let r="",i=[];for(const c of n){const u=c.match(/^##\s+(.+)/);u?((r||i.length>0)&&e.push({heading:r,content:i.join(`
|
|
598
|
+
`).trim()}),r=u[1],i=[]):r?i.push(c):c.match(/^#\s+/)||i.push(c)}(r||i.length>0)&&e.push({heading:r,content:i.join(`
|
|
599
|
+
`).trim()});const s=new Set,l=[];for(const c of e){const u=Vae(c.heading);if(u&&!s.has(u)){s.add(u);const f={key:u,heading:c.heading,content:c.content};u==="rules"&&(f.rules=Uae(c.content)),l.push(f)}else l.push({key:"other",heading:c.heading,content:c.content})}for(const c of Yae)if(!s.has(c.key)){const u={key:c.key,heading:c.heading,content:""};c.key==="rules"&&(u.rules=[]),l.push(u)}return l}function dy(t,e){const n=[`# ${t}`,""];for(const r of e)r.heading&&(n.push(`## ${r.heading}`),n.push(""),r.key==="rules"&&r.rules?n.push(uD(r.rules)):n.push(r.content),n.push(""),n.push("---"),n.push(""));return n.join(`
|
|
600
|
+
`).replace(/\n{3,}/g,`
|
|
601
|
+
|
|
602
|
+
`).trimEnd()+`
|
|
603
|
+
`}function Gae(t){const e=t.match(/^#\s+(.+)/m);return(e==null?void 0:e[1])??"Project Context"}function Fae({configured:t}){return t?d.jsx(WA,{size:14,className:"text-[var(--color-success)] shrink-0"}):d.jsx(Cq,{size:14,className:"text-[var(--color-muted)] shrink-0"})}function Hae({section:t,onChange:e}){var s,l;const[n,r]=j.useState(t.content.length>0||(((s=t.rules)==null?void 0:s.length)??0)>0),i=t.content.trim().length>0||(((l=t.rules)==null?void 0:l.length)??0)>0;return d.jsxs("div",{className:"border border-[var(--color-border-subtle)] rounded-lg overflow-hidden",children:[d.jsxs("button",{onClick:()=>r(!n),className:"w-full flex items-center gap-2 px-4 py-3 bg-[var(--color-surface-raised)] hover:bg-[var(--color-bg)] text-left transition-colors cursor-pointer",children:[n?d.jsx(gr,{size:16,className:"text-[var(--color-muted)]"}):d.jsx(yi,{size:16,className:"text-[var(--color-muted)]"}),d.jsx("span",{className:"font-bold text-sm flex-1",children:t.heading}),d.jsx(Fae,{configured:i}),d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:i?"Configured":"Empty"})]}),n&&d.jsx("div",{className:"px-4 py-3 border-t border-[var(--color-border-subtle)]",children:t.key==="rules"?d.jsx(Kae,{rules:t.rules??[],onChange:c=>e({...t,rules:c,content:uD(c)})}):d.jsx("textarea",{value:t.content,onChange:c=>e({...t,content:c.target.value}),placeholder:`Add content for ${t.heading}...`,className:"w-full min-h-[120px] p-3 text-sm font-[var(--font-mono)] bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-md text-[var(--color-text)] placeholder:text-[var(--color-muted)] focus:outline-none focus:border-[var(--color-accent)] resize-y",rows:Math.max(4,t.content.split(`
|
|
604
|
+
`).length+1)})})]})}function Kae({rules:t,onChange:e}){const n=(s,l,c)=>{const u=[...t];u[s]={...u[s],[l]:c},e(u)},r=s=>e(t.filter((l,c)=>c!==s)),i=()=>e([...t,{title:"",body:""}]);return d.jsxs("div",{className:"space-y-3",children:[t.map((s,l)=>d.jsxs("div",{className:"border border-[var(--color-border-subtle)] rounded-md p-3 space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"text",value:s.title,onChange:c=>n(l,"title",c.target.value),placeholder:"Rule title",className:"flex-1 px-2 py-1.5 text-sm font-bold bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded text-[var(--color-text)] placeholder:text-[var(--color-muted)] focus:outline-none focus:border-[var(--color-accent)]"}),d.jsx("button",{onClick:()=>r(l),className:"p-1.5 text-[var(--color-muted)] hover:text-[var(--color-error)] transition-colors cursor-pointer",title:"Remove rule",children:d.jsx(uo,{size:14})})]}),d.jsx("textarea",{value:s.body,onChange:c=>n(l,"body",c.target.value),placeholder:"Rule description and details...",className:"w-full min-h-[80px] p-2 text-sm font-[var(--font-mono)] bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded text-[var(--color-text)] placeholder:text-[var(--color-muted)] focus:outline-none focus:border-[var(--color-accent)] resize-y",rows:Math.max(3,s.body.split(`
|
|
605
|
+
`).length+1)})]},l)),d.jsxs("button",{onClick:i,className:"flex items-center gap-1.5 px-3 py-2 text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors cursor-pointer",children:[d.jsx(Yt,{size:14}),"Add Rule"]})]})}const Jae=`# Project Context
|
|
606
|
+
|
|
607
|
+
## Project Overview
|
|
608
|
+
|
|
609
|
+
Describe your project here.
|
|
610
|
+
|
|
611
|
+
## Technology Stack
|
|
612
|
+
|
|
613
|
+
List your technologies.
|
|
614
|
+
|
|
615
|
+
## Code Organization
|
|
616
|
+
|
|
617
|
+
\`\`\`
|
|
618
|
+
Describe your code structure here.
|
|
619
|
+
\`\`\`
|
|
620
|
+
|
|
621
|
+
## Rules and Conventions
|
|
622
|
+
|
|
623
|
+
### RULE: Example Rule
|
|
624
|
+
|
|
625
|
+
Describe the rule and its rationale.
|
|
626
|
+
|
|
627
|
+
## Installed Modules
|
|
628
|
+
|
|
629
|
+
| Module | Version | Source |
|
|
630
|
+
|---|---|---|
|
|
631
|
+
| core | — | built-in |
|
|
632
|
+
|
|
633
|
+
## Configured IDEs
|
|
634
|
+
|
|
635
|
+
- (add your IDE here)
|
|
636
|
+
`;function ele(){const[t,e]=j.useState(null),[n,r]=j.useState(!0),[i,s]=j.useState("structured"),[l,c]=j.useState([]),[u,f]=j.useState("Project Context"),[p,m]=j.useState(""),[O,x]=j.useState(!1),[v,S]=j.useState(null),[k,w]=j.useState(""),{notify:N}=co(),C=j.useCallback(G=>{f(Gae(G)),c(Wae(G)),m(G)},[]);j.useEffect(()=>{Promise.allSettled([fetch("/api/outputs/project-context.md").then(G=>{if(!G.ok)throw new Error("Not found");return G.json()}).then(G=>{const D=G;e(D.content),C(D.content)}),fetch("/api/files/core/config.yaml").then(G=>G.ok?G.json():fetch("/api/files/config.yaml").then(D=>{if(!D.ok)throw new Error("Not found");return D.json()})).then(G=>{const D=G;S(D.content),w(D.content)}).catch(()=>{})]).finally(()=>r(!1))},[C]);function E(G,D){const L=[...l];L[G]=D,c(L),m(dy(u,L)),x(!0)}function M(G){m(G),x(!0)}function R(G){i==="raw"&&G!=="raw"&&C(p),i==="structured"&&G!=="structured"&&m(dy(u,l)),s(G)}async function _(){const G=i==="raw"?p:dy(u,l);try{(await fetch("/api/outputs/project-context.md",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:G})})).ok?(e(G),C(G),x(!1),N("success","Project context saved")):N("error","Failed to save project context")}catch{N("error","Failed to save project context")}}function V(){t&&C(t),x(!1)}return n?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Project Settings"}),d.jsx(LS,{className:"h-64"})]}):t===null&&!O?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Project Settings"}),d.jsx(Ci,{icon:YA,title:"No project context found",description:"Create a project-context.md file to help AI agents understand your project's conventions, tech stack, and rules.",actions:d.jsx("button",{onClick:()=>{e(""),C(Jae),x(!0)},className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Create Project Context"})})]}):d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-8",children:[d.jsx("h1",{className:"text-2xl font-extrabold",children:"Project Settings"}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"flex gap-1 bg-[var(--color-surface-raised)] rounded-md p-0.5",children:["structured","raw","preview","config"].map(G=>d.jsx("button",{onClick:()=>R(G),className:`px-3 py-1.5 text-sm rounded min-h-[36px] transition-colors cursor-pointer ${i===G?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:G.charAt(0).toUpperCase()+G.slice(1)},G))}),O&&d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:V,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] text-[var(--color-text)] hover:bg-[var(--color-surface-raised)] transition-colors cursor-pointer",children:"Discard"}),d.jsx("button",{onClick:_,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors cursor-pointer",children:"Save"})]})]})]}),i==="structured"&&d.jsx("div",{className:"space-y-3",children:l.map((G,D)=>d.jsx(Hae,{section:G,onChange:L=>E(D,L)},`${G.key}-${G.heading}`))}),i==="raw"&&d.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-[calc(100vh-12rem)]",children:d.jsx(ai,{content:p,filePath:"_bmad/project-context.md",onChange:M,onSave:_})}),i==="preview"&&d.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] p-6",children:d.jsx("div",{className:"prose prose-sm max-w-none text-[var(--color-text)] prose-headings:text-[var(--color-text)] prose-headings:font-bold prose-h1:text-2xl prose-h2:text-xl prose-h3:text-lg prose-a:text-[var(--color-accent)] prose-strong:text-[var(--color-text)]",children:d.jsx(h3,{remarkPlugins:[M3],children:i==="preview"&&p||""})})}),i==="config"&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[d.jsx(w0,{size:16,className:"text-[var(--color-accent)]"}),d.jsx("h2",{className:"text-sm font-bold",children:"BMAD Configuration"}),d.jsx("span",{className:"text-xs text-[var(--color-muted)] font-[var(--font-mono)]",children:"_bmad/config.yaml"})]}),v!==null?d.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-[500px]",children:d.jsx(ai,{content:k,filePath:"_bmad/config.yaml",onChange:w,onSave:async()=>{try{let G=await fetch("/api/files/core/config.yaml",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:k})});G.ok||(G=await fetch("/api/files/config.yaml",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:k})})),G.ok?(S(k),N("success","Configuration saved")):N("error","Failed to save configuration")}catch{N("error","Failed to save configuration")}}})}):d.jsx("div",{className:"p-4 rounded-lg bg-[var(--color-surface-raised)] text-sm text-[var(--color-muted)]",children:"No config.yaml found in the _bmad/ directory."})]})]})}function tle({moduleName:t,currentVersion:e,currentDescription:n,onClose:r,onSaved:i}){const[s,l]=j.useState(e||"1.0.0"),[c,u]=j.useState(n||""),[f,p]=j.useState(null),[m,O]=j.useState(!1),x=async()=>{var v;O(!0),p(null);try{const S=await fetch(`/api/modules/${encodeURIComponent(t)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:s.trim(),description:c.trim()})});if(!S.ok){const k=await S.json();throw new Error(((v=k.error)==null?void 0:v.message)??"Failed to update module")}i()}catch(S){p(S instanceof Error?S.message:"Failed to update module")}finally{O(!1)}};return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r}),d.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsxs("h2",{className:"text-lg font-bold",children:["Edit Module: ",t]}),d.jsx("button",{onClick:r,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),d.jsx("input",{type:"text",value:t,disabled:!0,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] opacity-50 cursor-not-allowed"}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:"Module name cannot be changed"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Version"}),d.jsx("input",{type:"text",value:s,onChange:v=>l(v.target.value),placeholder:"e.g. 1.0.0",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description (optional)"}),d.jsx("textarea",{value:c,onChange:v=>u(v.target.value),rows:3,placeholder:"What does this module provide?",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),f&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:f})]}),d.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[d.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsxs("button",{onClick:x,disabled:m,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[d.jsx(Bc,{size:14}),m?"Saving...":"Save Changes"]})]})]})]})}function nle({onClose:t}){const[e,n]=j.useState("info"),[r,i]=j.useState(""),[s,l]=j.useState(""),[c,u]=j.useState("1.0.0"),[f,p]=j.useState([]),[m,O]=j.useState([]),[x,v]=j.useState([]),[S,k]=j.useState(!1),[w,N]=j.useState(new Set),[C,E]=j.useState(new Set),[M,R]=j.useState(new Set),[_,V]=j.useState(!1),[G,D]=j.useState(null),L=r.trim().length>0;j.useEffect(()=>{e==="select"&&f.length===0&&m.length===0&&x.length===0&&(k(!0),Promise.all([fetch("/api/agents").then($=>$.json()),fetch("/api/skills").then($=>$.json()),fetch("/api/workflows").then($=>$.json())]).then(([$,P,U])=>{p($),O(P),v(U)}).catch(()=>D("Failed to load entities")).finally(()=>k(!1)))},[e,f.length,m.length,x.length]);const Z=w.size+C.size+M.size,te=j.useMemo(()=>hy(f),[f]),I=j.useMemo(()=>hy(m),[m]),B=j.useMemo(()=>hy(x),[x]);function X($,P,U){const T=new Set($);T.has(U)?T.delete(U):T.add(U),P(T)}function q($,P){P(new Set($.map(U=>U.id)))}function K($){$(new Set)}async function ne(){var $;V(!0),D(null);try{const P=await fetch("/api/packages/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r.trim(),description:s.trim(),version:c.trim(),agents:Array.from(w),skills:Array.from(C),workflows:Array.from(M)})});if(!P.ok){const W=await P.json();throw new Error((($=W.error)==null?void 0:$.message)??"Export failed")}const U=await P.blob(),T=URL.createObjectURL(U),J=document.createElement("a");J.href=T,J.download=`${r.trim()}.tar.gz`,document.body.appendChild(J),J.click(),document.body.removeChild(J),URL.revokeObjectURL(T),t()}catch(P){D(P instanceof Error?P.message:"Export failed")}finally{V(!1)}}return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),d.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-3xl p-6 max-h-[85vh] flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between mb-6",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx($S,{size:20,className:"text-[var(--color-accent)]"}),d.jsx("h2",{className:"text-lg font-bold",children:"Export Package"})]}),d.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]}),d.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[d.jsxs("div",{className:`flex items-center gap-1.5 text-sm ${e==="info"?"text-[var(--color-accent)] font-bold":"text-[var(--color-muted)]"}`,children:[d.jsx("span",{className:"w-5 h-5 rounded-full border flex items-center justify-center text-xs border-current",children:e==="select"?d.jsx(VA,{size:12}):"1"}),"Package Info"]}),d.jsx("div",{className:"w-8 h-px bg-[var(--color-border-subtle)]"}),d.jsxs("div",{className:`flex items-center gap-1.5 text-sm ${e==="select"?"text-[var(--color-accent)] font-bold":"text-[var(--color-muted)]"}`,children:[d.jsx("span",{className:"w-5 h-5 rounded-full border flex items-center justify-center text-xs border-current",children:"2"}),"Select Entities"]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[e==="info"&&d.jsxs("div",{className:"space-y-4 max-w-md",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Package Name *"}),d.jsx("input",{type:"text",value:r,onChange:$=>i($.target.value),placeholder:"my-package",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",autoFocus:!0})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),d.jsx("textarea",{value:s,onChange:$=>l($.target.value),rows:3,placeholder:"What does this package contain?",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Version"}),d.jsx("input",{type:"text",value:c,onChange:$=>u($.target.value),placeholder:"1.0.0",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]})]}),e==="select"&&d.jsx(d.Fragment,{children:S?d.jsx("div",{className:"flex items-center justify-center py-12",children:d.jsx(is,{size:24,className:"animate-spin text-[var(--color-muted)]"})}):d.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[d.jsx(fy,{icon:Tn,label:"Agents",items:f,grouped:te,selected:w,onToggle:$=>X(w,N,$),onSelectAll:()=>q(f,N),onDeselectAll:()=>K(N),getLabel:$=>$.title||$.name}),d.jsx(fy,{icon:Si,label:"Skills",items:m,grouped:I,selected:C,onToggle:$=>X(C,E,$),onSelectAll:()=>q(m,E),onDeselectAll:()=>K(E),getLabel:$=>$.name}),d.jsx(fy,{icon:Or,label:"Workflows",items:x,grouped:B,selected:M,onToggle:$=>X(M,R,$),onSelectAll:()=>q(x,R),onDeselectAll:()=>K(R),getLabel:$=>$.name})]})})]}),G&&d.jsx("p",{className:"text-sm text-[var(--color-error)] mt-4",children:G}),d.jsxs("div",{className:"flex items-center justify-between mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[d.jsx("div",{className:"text-sm text-[var(--color-muted)]",children:e==="select"&&`${Z} entit${Z===1?"y":"ies"} selected`}),d.jsxs("div",{className:"flex gap-3",children:[e==="info"&&d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsx("button",{onClick:()=>n("select"),disabled:!L,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]}),e==="select"&&d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:()=>n("info"),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Back"}),d.jsx("button",{onClick:ne,disabled:Z===0||_,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:_?d.jsxs(d.Fragment,{children:[d.jsx(is,{size:14,className:"animate-spin"}),"Exporting..."]}):d.jsxs(d.Fragment,{children:[d.jsx(eg,{size:14}),"Export Package"]})})]})]})]})]})]})}function hy(t){const e=new Map;for(const n of t){const r=n.module??"unknown";e.has(r)||e.set(r,[]),e.get(r).push(n)}return e}function fy({icon:t,label:e,items:n,grouped:r,selected:i,onToggle:s,onSelectAll:l,onDeselectAll:c,getLabel:u}){const f=n.length>0&&i.size===n.length;return d.jsxs("div",{className:"flex flex-col rounded-lg border border-[var(--color-border-subtle)] overflow-hidden",children:[d.jsx("div",{className:"px-3 py-2 bg-[var(--color-surface-raised)] border-b border-[var(--color-border-subtle)]",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(t,{size:14,className:"text-[var(--color-accent)]"}),d.jsx("span",{className:"text-sm font-bold",children:e}),d.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["(",n.length,")"]})]}),d.jsx("button",{onClick:f?c:l,className:"text-xs text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:f?"Deselect All":"Select All"})]})}),d.jsxs("div",{className:"flex-1 overflow-y-auto max-h-72 p-1",children:[n.length===0&&d.jsx("p",{className:"text-xs text-[var(--color-muted)] text-center py-4",children:"None available"}),Array.from(r.entries()).map(([p,m])=>d.jsxs("div",{children:[r.size>1&&d.jsx("p",{className:"text-[10px] uppercase font-bold text-[var(--color-muted)] px-2 pt-2 pb-1",children:p}),m.map(O=>d.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-[var(--color-surface-raised)] cursor-pointer transition-colors",children:[d.jsx("input",{type:"checkbox",checked:i.has(O.id),onChange:()=>s(O.id),className:"rounded border-[var(--color-border-subtle)] text-[var(--color-accent)] focus:ring-[var(--color-accent)]"}),d.jsx("span",{className:"text-sm truncate",children:u(O)}),r.size<=1&&O.module&&d.jsx("span",{className:"ml-auto text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-muted)] shrink-0",children:O.module})]},O.id))]},p))]})]})}function rle({onClose:t,onInstalled:e,initialSource:n}){const[r,i]=j.useState((n==null?void 0:n.type)??"npm"),[s,l]=j.useState(""),[c,u]=j.useState((n==null?void 0:n.type)==="github"?n.value:""),[f,p]=j.useState(""),[m,O]=j.useState(null),[x,v]=j.useState(null),[S,k]=j.useState({}),[w,N]=j.useState(!1),[C,E]=j.useState(!1),[M,R]=j.useState(null),[_,V]=j.useState(!1),[G,D]=j.useState(null);j.useEffect(()=>{v(null),R(null),k({})},[r]),j.useEffect(()=>{if(n)if(n.prefetchedModuleYaml){const K=n.prefetchedModuleYaml;v({ok:!0,moduleYaml:K,counts:{agents:0,workflows:0,tasks:0},willReplace:!1});const U={};for(const[T,J]of Object.entries(K.variables??{}))U[T]=J.default??"";k(U)}else L(n.value)},[]);const L=async K=>{if(K.trim()){N(!0),R(null),v(null),k({});try{const ne=await fetch("/api/modules/preview-source",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:{type:r,value:K.trim()}})}),$=await ne.json();if(!ne.ok){const T=$.error,J=typeof T=="object"&&T!==null?T.message??"Fetch failed":String(T??"Fetch failed");throw new Error(J)}const P=$;v(P);const U={};for(const[T,J]of Object.entries(P.moduleYaml.variables??{}))U[T]=J.default??"";k(U)}catch(ne){R(ne instanceof Error?ne.message:"Fetch failed")}finally{N(!1)}}},Z=async()=>L(r==="github"?c:f),te=async()=>{E(!0),R(null);try{if(r==="zip"){if(!m)throw new Error("No zip file selected");const K=new FormData;K.append("file",m),K.append("variables",JSON.stringify(S));const $=await(await fetch("/api/modules/install/upload",{method:"POST",body:K})).json();if(!$.ok){const P=$.error;throw new Error(typeof P=="object"&&P!==null?P.message??"Installation failed":String(P??"Installation failed"))}$.skillsGenerated&&D($.skillsGenerated)}else{const $=await(await fetch("/api/modules/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:{type:r,value:(r==="npm"?s:r==="github"?c:f).trim()},variables:S})})).json();if(!$.ok){const P=$.error;throw new Error(typeof P=="object"&&P!==null?P.message??"Installation failed":String(P??"Installation failed"))}$.skillsGenerated&&D($.skillsGenerated)}V(!0),setTimeout(()=>e(),2500)}catch(K){R(K instanceof Error?K.message:"Installation failed")}finally{E(!1)}},I=r==="github"&&c.trim().length>0||r==="local"&&f.trim().length>0,B=C||_?!1:r==="npm"?s.trim().length>0:r==="zip"?m!==null:x!==null,X=x!=null&&x.willReplace?"Replace":"Install",q=[{id:"npm",label:"npm"},{id:"github",label:"GitHub"},{id:"local",label:"Local path"},{id:"zip",label:"Upload zip"}];return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),d.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"text-lg font-bold",children:"Install Module"}),d.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]}),d.jsx("div",{className:"flex border-b border-[var(--color-border-subtle)] mb-4",children:q.map(K=>d.jsx("button",{onClick:()=>i(K.id),className:["px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",r===K.id?"border-[var(--color-accent)] text-[var(--color-accent)]":"border-transparent text-[var(--color-muted)] hover:text-[var(--color-text)]"].join(" "),children:K.label},K.id))}),d.jsxs("div",{className:"space-y-4",children:[r==="npm"&&d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"npm Package Name"}),d.jsx("input",{type:"text",value:s,onChange:K=>l(K.target.value),onKeyDown:K=>{K.key==="Enter"&&B&&!C&&te()},placeholder:"e.g. bmad-builder",disabled:C||_,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none disabled:opacity-50"}),d.jsxs("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:["The package must contain a ",d.jsx("code",{className:"font-[var(--font-mono)]",children:"_bmad/"})," directory with module content."]})]}),r==="github"&&d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"GitHub Source"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",value:c,onChange:K=>u(K.target.value),placeholder:"owner/repo or full GitHub URL",disabled:w||C||_,className:"flex-1 px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none disabled:opacity-50"}),d.jsxs("button",{onClick:Z,disabled:!I||w||C||_,className:"px-3 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[w?d.jsx(is,{size:14,className:"animate-spin"}):null,w?"Fetching...":"Fetch"]})]})]}),r==="local"&&d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Local Path"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",value:f,onChange:K=>p(K.target.value),placeholder:"/absolute/path/to/module or relative/path",disabled:w||C||_,className:"flex-1 px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none disabled:opacity-50"}),d.jsxs("button",{onClick:Z,disabled:!I||w||C||_,className:"px-3 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[w?d.jsx(is,{size:14,className:"animate-spin"}):null,w?"Fetching...":"Fetch"]})]})]}),r==="zip"&&d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Module Zip File"}),d.jsx("input",{type:"file",accept:".zip",onChange:K=>{var ne;return O(((ne=K.target.files)==null?void 0:ne[0])??null)},disabled:C||_,className:"w-full text-sm text-[var(--color-muted)] file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border file:border-[var(--color-border-subtle)] file:text-sm file:bg-[var(--color-surface-raised)] file:text-[var(--color-text)] hover:file:bg-[var(--color-bg)] disabled:opacity-50"}),m&&d.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:m.name})]}),x&&d.jsxs("div",{className:"rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-surface-raised)] p-4 space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm font-bold",children:x.moduleYaml.name??x.moduleYaml.code}),x.moduleYaml.version&&d.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["v",x.moduleYaml.version]})]}),x.moduleYaml.description&&d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:x.moduleYaml.description}),d.jsxs("div",{className:"flex gap-4 text-xs text-[var(--color-muted)]",children:[d.jsxs("span",{children:[x.counts.agents," agent",x.counts.agents!==1?"s":""]}),d.jsxs("span",{children:[x.counts.workflows," workflow",x.counts.workflows!==1?"s":""]}),d.jsxs("span",{children:[x.counts.tasks," task",x.counts.tasks!==1?"s":""]})]})]}),(x==null?void 0:x.willReplace)&&d.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-[var(--color-warning)]/10 border border-[var(--color-warning)]/30",children:[d.jsx(Us,{size:16,className:"text-[var(--color-warning)] mt-0.5 shrink-0"}),d.jsxs("p",{className:"text-xs text-[var(--color-warning)]",children:["This will replace the existing installation of"," ",d.jsx("strong",{children:x.moduleYaml.name??x.moduleYaml.code}),x.moduleYaml.version?` v${x.moduleYaml.version}`:"",". The previous version will be recoverable from snapshot history."]})]}),(x==null?void 0:x.collisions)&&x.collisions.length>0&&d.jsxs("div",{className:"rounded-lg bg-[var(--color-warning)]/10 border border-[var(--color-warning)]/30 overflow-hidden",children:[d.jsxs("div",{className:"flex items-start gap-2 p-3",children:[d.jsx(Us,{size:16,className:"text-[var(--color-warning)] mt-0.5 shrink-0"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-bold text-[var(--color-warning)]",children:"Entity name collisions detected"}),d.jsxs("p",{className:"text-xs text-[var(--color-warning)] mt-0.5",children:[x.collisions.length," ",x.collisions.length===1?"entity":"entities"," in this module share names with existing entities from other modules. Installing will not remove the existing entities — both will coexist."]})]})]}),d.jsx("div",{className:"border-t border-[var(--color-warning)]/20 divide-y divide-[var(--color-warning)]/10",children:x.collisions.map((K,ne)=>d.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-[10px] uppercase font-bold text-[var(--color-warning)]/70 w-12 shrink-0",children:K.type}),d.jsx("code",{className:"text-xs font-[var(--font-mono)] text-[var(--color-text)]",children:K.name})]}),d.jsxs("span",{className:"text-[11px] text-[var(--color-muted)]",children:["also in ",d.jsx("strong",{children:K.existingModule})]})]},ne))})]}),x&&Object.keys(x.moduleYaml.variables??{}).length>0&&d.jsxs("div",{className:"space-y-3",children:[d.jsx("p",{className:"text-sm font-bold",children:"Module Variables"}),Object.entries(x.moduleYaml.variables).map(([K,ne])=>d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium mb-1 text-[var(--color-muted)]",children:K}),d.jsx("input",{type:"text",value:S[K]??"",onChange:$=>k(P=>({...P,[K]:$.target.value})),placeholder:ne.prompt,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]},K))]}),C&&d.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[d.jsx(is,{size:16,className:"text-[var(--color-accent)] animate-spin"}),d.jsx("span",{className:"text-sm",children:"Installing module..."})]}),_&&d.jsxs("div",{className:"rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-success)] overflow-hidden",children:[d.jsxs("div",{className:"flex items-center gap-2 p-3",children:[d.jsx(bh,{size:16,className:"text-[var(--color-success)]"}),d.jsx("span",{className:"text-sm font-bold text-[var(--color-success)]",children:"Installed successfully"})]}),G&&Object.keys(G).length>0&&d.jsxs("div",{className:"px-3 pb-3 pt-0 space-y-1 border-t border-[var(--color-success)]/20",children:[d.jsx("p",{className:"text-[11px] font-bold uppercase tracking-wider text-[var(--color-muted)] mt-2",children:"Skills synced to IDEs"}),Object.entries(G).map(([K,ne])=>d.jsxs("div",{className:"flex items-center justify-between text-xs",children:[d.jsx("span",{className:"font-[var(--font-mono)] text-[var(--color-text)]",children:K}),d.jsxs("span",{className:"text-[var(--color-success)] font-bold",children:[ne," skill",ne!==1?"s":""]})]},K))]}),G&&Object.keys(G).length===0&&d.jsx("div",{className:"px-3 pb-3 border-t border-[var(--color-success)]/20",children:d.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-2",children:"No IDEs configured — skills were not generated. Add an IDE from the Connections page."})})]}),M&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:M})]}),d.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[d.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:_?"Close":"Cancel"}),!_&&d.jsxs("button",{onClick:te,disabled:!B,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[d.jsx(eg,{size:14}),C?"Installing...":X]})]})]})]})}var wm={exports:{}},py,oP;function NO(){if(oP)return py;oP=1;const t="2.0.0",e=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,i=e-6;return py={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},py}var my,cP;function TO(){if(cP)return my;cP=1;var t={};return my=typeof process=="object"&&t&&t.NODE_DEBUG&&/\bsemver\b/i.test(t.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{},my}var uP;function $f(){return uP||(uP=1,(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=NO(),s=TO();e=t.exports={};const l=e.re=[],c=e.safeRe=[],u=e.src=[],f=e.safeSrc=[],p=e.t={};let m=0;const O="[a-zA-Z0-9-]",x=[["\\s",1],["\\d",i],[O,r]],v=k=>{for(const[w,N]of x)k=k.split(`${w}*`).join(`${w}{0,${N}}`).split(`${w}+`).join(`${w}{1,${N}}`);return k},S=(k,w,N)=>{const C=v(w),E=m++;s(k,E,w),p[k]=E,u[E]=w,f[E]=C,l[E]=new RegExp(w,N?"g":void 0),c[E]=new RegExp(C,N?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*"),S("NUMERICIDENTIFIERLOOSE","\\d+"),S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${O}*`),S("MAINVERSION",`(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})`),S("MAINVERSIONLOOSE",`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASEIDENTIFIER",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIER]})`),S("PRERELEASEIDENTIFIERLOOSE",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASE",`(?:-(${u[p.PRERELEASEIDENTIFIER]}(?:\\.${u[p.PRERELEASEIDENTIFIER]})*))`),S("PRERELEASELOOSE",`(?:-?(${u[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[p.PRERELEASEIDENTIFIERLOOSE]})*))`),S("BUILDIDENTIFIER",`${O}+`),S("BUILD",`(?:\\+(${u[p.BUILDIDENTIFIER]}(?:\\.${u[p.BUILDIDENTIFIER]})*))`),S("FULLPLAIN",`v?${u[p.MAINVERSION]}${u[p.PRERELEASE]}?${u[p.BUILD]}?`),S("FULL",`^${u[p.FULLPLAIN]}$`),S("LOOSEPLAIN",`[v=\\s]*${u[p.MAINVERSIONLOOSE]}${u[p.PRERELEASELOOSE]}?${u[p.BUILD]}?`),S("LOOSE",`^${u[p.LOOSEPLAIN]}$`),S("GTLT","((?:<|>)?=?)"),S("XRANGEIDENTIFIERLOOSE",`${u[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),S("XRANGEIDENTIFIER",`${u[p.NUMERICIDENTIFIER]}|x|X|\\*`),S("XRANGEPLAIN",`[v=\\s]*(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:${u[p.PRERELEASE]})?${u[p.BUILD]}?)?)?`),S("XRANGEPLAINLOOSE",`[v=\\s]*(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:${u[p.PRERELEASELOOSE]})?${u[p.BUILD]}?)?)?`),S("XRANGE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAIN]}$`),S("XRANGELOOSE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAINLOOSE]}$`),S("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),S("COERCE",`${u[p.COERCEPLAIN]}(?:$|[^\\d])`),S("COERCEFULL",u[p.COERCEPLAIN]+`(?:${u[p.PRERELEASE]})?(?:${u[p.BUILD]})?(?:$|[^\\d])`),S("COERCERTL",u[p.COERCE],!0),S("COERCERTLFULL",u[p.COERCEFULL],!0),S("LONETILDE","(?:~>?)"),S("TILDETRIM",`(\\s*)${u[p.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",S("TILDE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAIN]}$`),S("TILDELOOSE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAINLOOSE]}$`),S("LONECARET","(?:\\^)"),S("CARETTRIM",`(\\s*)${u[p.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",S("CARET",`^${u[p.LONECARET]}${u[p.XRANGEPLAIN]}$`),S("CARETLOOSE",`^${u[p.LONECARET]}${u[p.XRANGEPLAINLOOSE]}$`),S("COMPARATORLOOSE",`^${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]})$|^$`),S("COMPARATOR",`^${u[p.GTLT]}\\s*(${u[p.FULLPLAIN]})$|^$`),S("COMPARATORTRIM",`(\\s*)${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]}|${u[p.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",S("HYPHENRANGE",`^\\s*(${u[p.XRANGEPLAIN]})\\s+-\\s+(${u[p.XRANGEPLAIN]})\\s*$`),S("HYPHENRANGELOOSE",`^\\s*(${u[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[p.XRANGEPLAINLOOSE]})\\s*$`),S("STAR","(<|>)?=?\\s*\\*"),S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(wm,wm.exports)),wm.exports}var gy,dP;function Gk(){if(dP)return gy;dP=1;const t=Object.freeze({loose:!0}),e=Object.freeze({});return gy=r=>r?typeof r!="object"?t:r:e,gy}var Oy,hP;function dD(){if(hP)return Oy;hP=1;const t=/^[0-9]+$/,e=(r,i)=>{if(typeof r=="number"&&typeof i=="number")return r===i?0:r<i?-1:1;const s=t.test(r),l=t.test(i);return s&&l&&(r=+r,i=+i),r===i?0:s&&!l?-1:l&&!s?1:r<i?-1:1};return Oy={compareIdentifiers:e,rcompareIdentifiers:(r,i)=>e(i,r)},Oy}var xy,fP;function Jn(){if(fP)return xy;fP=1;const t=TO(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:n}=NO(),{safeRe:r,t:i}=$f(),s=Gk(),{compareIdentifiers:l}=dD();class c{constructor(f,p){if(p=s(p),f instanceof c){if(f.loose===!!p.loose&&f.includePrerelease===!!p.includePrerelease)return f;f=f.version}else if(typeof f!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof f}".`);if(f.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",f,p),this.options=p,this.loose=!!p.loose,this.includePrerelease=!!p.includePrerelease;const m=f.trim().match(p.loose?r[i.LOOSE]:r[i.FULL]);if(!m)throw new TypeError(`Invalid Version: ${f}`);if(this.raw=f,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(O=>{if(/^[0-9]+$/.test(O)){const x=+O;if(x>=0&&x<n)return x}return O}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(f){if(t("SemVer.compare",this.version,this.options,f),!(f instanceof c)){if(typeof f=="string"&&f===this.version)return 0;f=new c(f,this.options)}return f.version===this.version?0:this.compareMain(f)||this.comparePre(f)}compareMain(f){return f instanceof c||(f=new c(f,this.options)),this.major<f.major?-1:this.major>f.major?1:this.minor<f.minor?-1:this.minor>f.minor?1:this.patch<f.patch?-1:this.patch>f.patch?1:0}comparePre(f){if(f instanceof c||(f=new c(f,this.options)),this.prerelease.length&&!f.prerelease.length)return-1;if(!this.prerelease.length&&f.prerelease.length)return 1;if(!this.prerelease.length&&!f.prerelease.length)return 0;let p=0;do{const m=this.prerelease[p],O=f.prerelease[p];if(t("prerelease compare",p,m,O),m===void 0&&O===void 0)return 0;if(O===void 0)return 1;if(m===void 0)return-1;if(m===O)continue;return l(m,O)}while(++p)}compareBuild(f){f instanceof c||(f=new c(f,this.options));let p=0;do{const m=this.build[p],O=f.build[p];if(t("build compare",p,m,O),m===void 0&&O===void 0)return 0;if(O===void 0)return 1;if(m===void 0)return-1;if(m===O)continue;return l(m,O)}while(++p)}inc(f,p,m){if(f.startsWith("pre")){if(!p&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(p){const O=`-${p}`.match(this.options.loose?r[i.PRERELEASELOOSE]:r[i.PRERELEASE]);if(!O||O[1]!==p)throw new Error(`invalid identifier: ${p}`)}}switch(f){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",p,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",p,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",p,m),this.inc("pre",p,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",p,m),this.inc("pre",p,m);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const O=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[O];else{let x=this.prerelease.length;for(;--x>=0;)typeof this.prerelease[x]=="number"&&(this.prerelease[x]++,x=-2);if(x===-1){if(p===this.prerelease.join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(O)}}if(p){let x=[p,O];m===!1&&(x=[p]),l(this.prerelease[0],p)===0?isNaN(this.prerelease[1])&&(this.prerelease=x):this.prerelease=x}break}default:throw new Error(`invalid increment argument: ${f}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return xy=c,xy}var by,pP;function Qu(){if(pP)return by;pP=1;const t=Jn();return by=(n,r,i=!1)=>{if(n instanceof t)return n;try{return new t(n,r)}catch(s){if(!i)return null;throw s}},by}var vy,mP;function ile(){if(mP)return vy;mP=1;const t=Qu();return vy=(n,r)=>{const i=t(n,r);return i?i.version:null},vy}var yy,gP;function sle(){if(gP)return yy;gP=1;const t=Qu();return yy=(n,r)=>{const i=t(n.trim().replace(/^[=v]+/,""),r);return i?i.version:null},yy}var Sy,OP;function ale(){if(OP)return Sy;OP=1;const t=Jn();return Sy=(n,r,i,s,l)=>{typeof i=="string"&&(l=s,s=i,i=void 0);try{return new t(n instanceof t?n.version:n,i).inc(r,s,l).version}catch{return null}},Sy}var wy,xP;function lle(){if(xP)return wy;xP=1;const t=Qu();return wy=(n,r)=>{const i=t(n,null,!0),s=t(r,null,!0),l=i.compare(s);if(l===0)return null;const c=l>0,u=c?i:s,f=c?s:i,p=!!u.prerelease.length;if(!!f.prerelease.length&&!p){if(!f.patch&&!f.minor)return"major";if(f.compareMain(u)===0)return f.minor&&!f.patch?"minor":"patch"}const O=p?"pre":"";return i.major!==s.major?O+"major":i.minor!==s.minor?O+"minor":i.patch!==s.patch?O+"patch":"prerelease"},wy}var ky,bP;function ole(){if(bP)return ky;bP=1;const t=Jn();return ky=(n,r)=>new t(n,r).major,ky}var jy,vP;function cle(){if(vP)return jy;vP=1;const t=Jn();return jy=(n,r)=>new t(n,r).minor,jy}var Qy,yP;function ule(){if(yP)return Qy;yP=1;const t=Jn();return Qy=(n,r)=>new t(n,r).patch,Qy}var Cy,SP;function dle(){if(SP)return Cy;SP=1;const t=Qu();return Cy=(n,r)=>{const i=t(n,r);return i&&i.prerelease.length?i.prerelease:null},Cy}var Ny,wP;function Ei(){if(wP)return Ny;wP=1;const t=Jn();return Ny=(n,r,i)=>new t(n,i).compare(new t(r,i)),Ny}var Ty,kP;function hle(){if(kP)return Ty;kP=1;const t=Ei();return Ty=(n,r,i)=>t(r,n,i),Ty}var $y,jP;function fle(){if(jP)return $y;jP=1;const t=Ei();return $y=(n,r)=>t(n,r,!0),$y}var Ey,QP;function Fk(){if(QP)return Ey;QP=1;const t=Jn();return Ey=(n,r,i)=>{const s=new t(n,i),l=new t(r,i);return s.compare(l)||s.compareBuild(l)},Ey}var Py,CP;function ple(){if(CP)return Py;CP=1;const t=Fk();return Py=(n,r)=>n.sort((i,s)=>t(i,s,r)),Py}var Ay,NP;function mle(){if(NP)return Ay;NP=1;const t=Fk();return Ay=(n,r)=>n.sort((i,s)=>t(s,i,r)),Ay}var Ry,TP;function $O(){if(TP)return Ry;TP=1;const t=Ei();return Ry=(n,r,i)=>t(n,r,i)>0,Ry}var _y,$P;function Hk(){if($P)return _y;$P=1;const t=Ei();return _y=(n,r,i)=>t(n,r,i)<0,_y}var My,EP;function hD(){if(EP)return My;EP=1;const t=Ei();return My=(n,r,i)=>t(n,r,i)===0,My}var zy,PP;function fD(){if(PP)return zy;PP=1;const t=Ei();return zy=(n,r,i)=>t(n,r,i)!==0,zy}var Dy,AP;function Kk(){if(AP)return Dy;AP=1;const t=Ei();return Dy=(n,r,i)=>t(n,r,i)>=0,Dy}var Ly,RP;function Jk(){if(RP)return Ly;RP=1;const t=Ei();return Ly=(n,r,i)=>t(n,r,i)<=0,Ly}var Xy,_P;function pD(){if(_P)return Xy;_P=1;const t=hD(),e=fD(),n=$O(),r=Kk(),i=Hk(),s=Jk();return Xy=(c,u,f,p)=>{switch(u){case"===":return typeof c=="object"&&(c=c.version),typeof f=="object"&&(f=f.version),c===f;case"!==":return typeof c=="object"&&(c=c.version),typeof f=="object"&&(f=f.version),c!==f;case"":case"=":case"==":return t(c,f,p);case"!=":return e(c,f,p);case">":return n(c,f,p);case">=":return r(c,f,p);case"<":return i(c,f,p);case"<=":return s(c,f,p);default:throw new TypeError(`Invalid operator: ${u}`)}},Xy}var Zy,MP;function gle(){if(MP)return Zy;MP=1;const t=Jn(),e=Qu(),{safeRe:n,t:r}=$f();return Zy=(s,l)=>{if(s instanceof t)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;l=l||{};let c=null;if(!l.rtl)c=s.match(l.includePrerelease?n[r.COERCEFULL]:n[r.COERCE]);else{const x=l.includePrerelease?n[r.COERCERTLFULL]:n[r.COERCERTL];let v;for(;(v=x.exec(s))&&(!c||c.index+c[0].length!==s.length);)(!c||v.index+v[0].length!==c.index+c[0].length)&&(c=v),x.lastIndex=v.index+v[1].length+v[2].length;x.lastIndex=-1}if(c===null)return null;const u=c[2],f=c[3]||"0",p=c[4]||"0",m=l.includePrerelease&&c[5]?`-${c[5]}`:"",O=l.includePrerelease&&c[6]?`+${c[6]}`:"";return e(`${u}.${f}.${p}${m}${O}`,l)},Zy}var qy,zP;function Ole(){if(zP)return qy;zP=1;class t{constructor(){this.max=1e3,this.map=new Map}get(n){const r=this.map.get(n);if(r!==void 0)return this.map.delete(n),this.map.set(n,r),r}delete(n){return this.map.delete(n)}set(n,r){if(!this.delete(n)&&r!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(n,r)}return this}}return qy=t,qy}var Iy,DP;function Pi(){if(DP)return Iy;DP=1;const t=/\s+/g;class e{constructor(B,X){if(X=i(X),B instanceof e)return B.loose===!!X.loose&&B.includePrerelease===!!X.includePrerelease?B:new e(B.raw,X);if(B instanceof s)return this.raw=B.value,this.set=[[B]],this.formatted=void 0,this;if(this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease,this.raw=B.trim().replace(t," "),this.set=this.raw.split("||").map(q=>this.parseRange(q.trim())).filter(q=>q.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const q=this.set[0];if(this.set=this.set.filter(K=>!S(K[0])),this.set.length===0)this.set=[q];else if(this.set.length>1){for(const K of this.set)if(K.length===1&&k(K[0])){this.set=[K];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let B=0;B<this.set.length;B++){B>0&&(this.formatted+="||");const X=this.set[B];for(let q=0;q<X.length;q++)q>0&&(this.formatted+=" "),this.formatted+=X[q].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(B){const q=((this.options.includePrerelease&&x)|(this.options.loose&&v))+":"+B,K=r.get(q);if(K)return K;const ne=this.options.loose,$=ne?u[f.HYPHENRANGELOOSE]:u[f.HYPHENRANGE];B=B.replace($,Z(this.options.includePrerelease)),l("hyphen replace",B),B=B.replace(u[f.COMPARATORTRIM],p),l("comparator trim",B),B=B.replace(u[f.TILDETRIM],m),l("tilde trim",B),B=B.replace(u[f.CARETTRIM],O),l("caret trim",B);let P=B.split(" ").map(W=>N(W,this.options)).join(" ").split(/\s+/).map(W=>L(W,this.options));ne&&(P=P.filter(W=>(l("loose invalid filter",W,this.options),!!W.match(u[f.COMPARATORLOOSE])))),l("range list",P);const U=new Map,T=P.map(W=>new s(W,this.options));for(const W of T){if(S(W))return[W];U.set(W.value,W)}U.size>1&&U.has("")&&U.delete("");const J=[...U.values()];return r.set(q,J),J}intersects(B,X){if(!(B instanceof e))throw new TypeError("a Range is required");return this.set.some(q=>w(q,X)&&B.set.some(K=>w(K,X)&&q.every(ne=>K.every($=>ne.intersects($,X)))))}test(B){if(!B)return!1;if(typeof B=="string")try{B=new c(B,this.options)}catch{return!1}for(let X=0;X<this.set.length;X++)if(te(this.set[X],B,this.options))return!0;return!1}}Iy=e;const n=Ole(),r=new n,i=Gk(),s=EO(),l=TO(),c=Jn(),{safeRe:u,t:f,comparatorTrimReplace:p,tildeTrimReplace:m,caretTrimReplace:O}=$f(),{FLAG_INCLUDE_PRERELEASE:x,FLAG_LOOSE:v}=NO(),S=I=>I.value==="<0.0.0-0",k=I=>I.value==="",w=(I,B)=>{let X=!0;const q=I.slice();let K=q.pop();for(;X&&q.length;)X=q.every(ne=>K.intersects(ne,B)),K=q.pop();return X},N=(I,B)=>(I=I.replace(u[f.BUILD],""),l("comp",I,B),I=R(I,B),l("caret",I),I=E(I,B),l("tildes",I),I=V(I,B),l("xrange",I),I=D(I,B),l("stars",I),I),C=I=>!I||I.toLowerCase()==="x"||I==="*",E=(I,B)=>I.trim().split(/\s+/).map(X=>M(X,B)).join(" "),M=(I,B)=>{const X=B.loose?u[f.TILDELOOSE]:u[f.TILDE];return I.replace(X,(q,K,ne,$,P)=>{l("tilde",I,q,K,ne,$,P);let U;return C(K)?U="":C(ne)?U=`>=${K}.0.0 <${+K+1}.0.0-0`:C($)?U=`>=${K}.${ne}.0 <${K}.${+ne+1}.0-0`:P?(l("replaceTilde pr",P),U=`>=${K}.${ne}.${$}-${P} <${K}.${+ne+1}.0-0`):U=`>=${K}.${ne}.${$} <${K}.${+ne+1}.0-0`,l("tilde return",U),U})},R=(I,B)=>I.trim().split(/\s+/).map(X=>_(X,B)).join(" "),_=(I,B)=>{l("caret",I,B);const X=B.loose?u[f.CARETLOOSE]:u[f.CARET],q=B.includePrerelease?"-0":"";return I.replace(X,(K,ne,$,P,U)=>{l("caret",I,K,ne,$,P,U);let T;return C(ne)?T="":C($)?T=`>=${ne}.0.0${q} <${+ne+1}.0.0-0`:C(P)?ne==="0"?T=`>=${ne}.${$}.0${q} <${ne}.${+$+1}.0-0`:T=`>=${ne}.${$}.0${q} <${+ne+1}.0.0-0`:U?(l("replaceCaret pr",U),ne==="0"?$==="0"?T=`>=${ne}.${$}.${P}-${U} <${ne}.${$}.${+P+1}-0`:T=`>=${ne}.${$}.${P}-${U} <${ne}.${+$+1}.0-0`:T=`>=${ne}.${$}.${P}-${U} <${+ne+1}.0.0-0`):(l("no pr"),ne==="0"?$==="0"?T=`>=${ne}.${$}.${P}${q} <${ne}.${$}.${+P+1}-0`:T=`>=${ne}.${$}.${P}${q} <${ne}.${+$+1}.0-0`:T=`>=${ne}.${$}.${P} <${+ne+1}.0.0-0`),l("caret return",T),T})},V=(I,B)=>(l("replaceXRanges",I,B),I.split(/\s+/).map(X=>G(X,B)).join(" ")),G=(I,B)=>{I=I.trim();const X=B.loose?u[f.XRANGELOOSE]:u[f.XRANGE];return I.replace(X,(q,K,ne,$,P,U)=>{l("xRange",I,q,K,ne,$,P,U);const T=C(ne),J=T||C($),W=J||C(P),re=W;return K==="="&&re&&(K=""),U=B.includePrerelease?"-0":"",T?K===">"||K==="<"?q="<0.0.0-0":q="*":K&&re?(J&&($=0),P=0,K===">"?(K=">=",J?(ne=+ne+1,$=0,P=0):($=+$+1,P=0)):K==="<="&&(K="<",J?ne=+ne+1:$=+$+1),K==="<"&&(U="-0"),q=`${K+ne}.${$}.${P}${U}`):J?q=`>=${ne}.0.0${U} <${+ne+1}.0.0-0`:W&&(q=`>=${ne}.${$}.0${U} <${ne}.${+$+1}.0-0`),l("xRange return",q),q})},D=(I,B)=>(l("replaceStars",I,B),I.trim().replace(u[f.STAR],"")),L=(I,B)=>(l("replaceGTE0",I,B),I.trim().replace(u[B.includePrerelease?f.GTE0PRE:f.GTE0],"")),Z=I=>(B,X,q,K,ne,$,P,U,T,J,W,re)=>(C(q)?X="":C(K)?X=`>=${q}.0.0${I?"-0":""}`:C(ne)?X=`>=${q}.${K}.0${I?"-0":""}`:$?X=`>=${X}`:X=`>=${X}${I?"-0":""}`,C(T)?U="":C(J)?U=`<${+T+1}.0.0-0`:C(W)?U=`<${T}.${+J+1}.0-0`:re?U=`<=${T}.${J}.${W}-${re}`:I?U=`<${T}.${J}.${+W+1}-0`:U=`<=${U}`,`${X} ${U}`.trim()),te=(I,B,X)=>{for(let q=0;q<I.length;q++)if(!I[q].test(B))return!1;if(B.prerelease.length&&!X.includePrerelease){for(let q=0;q<I.length;q++)if(l(I[q].semver),I[q].semver!==s.ANY&&I[q].semver.prerelease.length>0){const K=I[q].semver;if(K.major===B.major&&K.minor===B.minor&&K.patch===B.patch)return!0}return!1}return!0};return Iy}var By,LP;function EO(){if(LP)return By;LP=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(p,m){if(m=n(m),p instanceof e){if(p.loose===!!m.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),l("comparator",p,m),this.options=m,this.loose=!!m.loose,this.parse(p),this.semver===t?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(p){const m=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],O=p.match(m);if(!O)throw new TypeError(`Invalid comparator: ${p}`);this.operator=O[1]!==void 0?O[1]:"",this.operator==="="&&(this.operator=""),O[2]?this.semver=new c(O[2],this.options.loose):this.semver=t}toString(){return this.value}test(p){if(l("Comparator.test",p,this.options.loose),this.semver===t||p===t)return!0;if(typeof p=="string")try{p=new c(p,this.options)}catch{return!1}return s(p,this.operator,this.semver,this.options)}intersects(p,m){if(!(p instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(p.value,m).test(this.value):p.operator===""?p.value===""?!0:new u(this.value,m).test(p.semver):(m=n(m),m.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||p.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&p.operator.startsWith(">")||this.operator.startsWith("<")&&p.operator.startsWith("<")||this.semver.version===p.semver.version&&this.operator.includes("=")&&p.operator.includes("=")||s(this.semver,"<",p.semver,m)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||s(this.semver,">",p.semver,m)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}By=e;const n=Gk(),{safeRe:r,t:i}=$f(),s=pD(),l=TO(),c=Jn(),u=Pi();return By}var Yy,XP;function PO(){if(XP)return Yy;XP=1;const t=Pi();return Yy=(n,r,i)=>{try{r=new t(r,i)}catch{return!1}return r.test(n)},Yy}var Vy,ZP;function xle(){if(ZP)return Vy;ZP=1;const t=Pi();return Vy=(n,r)=>new t(n,r).set.map(i=>i.map(s=>s.value).join(" ").trim().split(" ")),Vy}var Uy,qP;function ble(){if(qP)return Uy;qP=1;const t=Jn(),e=Pi();return Uy=(r,i,s)=>{let l=null,c=null,u=null;try{u=new e(i,s)}catch{return null}return r.forEach(f=>{u.test(f)&&(!l||c.compare(f)===-1)&&(l=f,c=new t(l,s))}),l},Uy}var Wy,IP;function vle(){if(IP)return Wy;IP=1;const t=Jn(),e=Pi();return Wy=(r,i,s)=>{let l=null,c=null,u=null;try{u=new e(i,s)}catch{return null}return r.forEach(f=>{u.test(f)&&(!l||c.compare(f)===1)&&(l=f,c=new t(l,s))}),l},Wy}var Gy,BP;function yle(){if(BP)return Gy;BP=1;const t=Jn(),e=Pi(),n=$O();return Gy=(i,s)=>{i=new e(i,s);let l=new t("0.0.0");if(i.test(l)||(l=new t("0.0.0-0"),i.test(l)))return l;l=null;for(let c=0;c<i.set.length;++c){const u=i.set[c];let f=null;u.forEach(p=>{const m=new t(p.semver.version);switch(p.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!f||n(m,f))&&(f=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${p.operator}`)}}),f&&(!l||n(l,f))&&(l=f)}return l&&i.test(l)?l:null},Gy}var Fy,YP;function Sle(){if(YP)return Fy;YP=1;const t=Pi();return Fy=(n,r)=>{try{return new t(n,r).range||"*"}catch{return null}},Fy}var Hy,VP;function e2(){if(VP)return Hy;VP=1;const t=Jn(),e=EO(),{ANY:n}=e,r=Pi(),i=PO(),s=$O(),l=Hk(),c=Jk(),u=Kk();return Hy=(p,m,O,x)=>{p=new t(p,x),m=new r(m,x);let v,S,k,w,N;switch(O){case">":v=s,S=c,k=l,w=">",N=">=";break;case"<":v=l,S=u,k=s,w="<",N="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(p,m,x))return!1;for(let C=0;C<m.set.length;++C){const E=m.set[C];let M=null,R=null;if(E.forEach(_=>{_.semver===n&&(_=new e(">=0.0.0")),M=M||_,R=R||_,v(_.semver,M.semver,x)?M=_:k(_.semver,R.semver,x)&&(R=_)}),M.operator===w||M.operator===N||(!R.operator||R.operator===w)&&S(p,R.semver))return!1;if(R.operator===N&&k(p,R.semver))return!1}return!0},Hy}var Ky,UP;function wle(){if(UP)return Ky;UP=1;const t=e2();return Ky=(n,r,i)=>t(n,r,">",i),Ky}var Jy,WP;function kle(){if(WP)return Jy;WP=1;const t=e2();return Jy=(n,r,i)=>t(n,r,"<",i),Jy}var e0,GP;function jle(){if(GP)return e0;GP=1;const t=Pi();return e0=(n,r,i)=>(n=new t(n,i),r=new t(r,i),n.intersects(r,i)),e0}var t0,FP;function Qle(){if(FP)return t0;FP=1;const t=PO(),e=Ei();return t0=(n,r,i)=>{const s=[];let l=null,c=null;const u=n.sort((O,x)=>e(O,x,i));for(const O of u)t(O,r,i)?(c=O,l||(l=O)):(c&&s.push([l,c]),c=null,l=null);l&&s.push([l,null]);const f=[];for(const[O,x]of s)O===x?f.push(O):!x&&O===u[0]?f.push("*"):x?O===u[0]?f.push(`<=${x}`):f.push(`${O} - ${x}`):f.push(`>=${O}`);const p=f.join(" || "),m=typeof r.raw=="string"?r.raw:String(r);return p.length<m.length?p:r},t0}var n0,HP;function Cle(){if(HP)return n0;HP=1;const t=Pi(),e=EO(),{ANY:n}=e,r=PO(),i=Ei(),s=(m,O,x={})=>{if(m===O)return!0;m=new t(m,x),O=new t(O,x);let v=!1;e:for(const S of m.set){for(const k of O.set){const w=u(S,k,x);if(v=v||w!==null,w)continue e}if(v)return!1}return!0},l=[new e(">=0.0.0-0")],c=[new e(">=0.0.0")],u=(m,O,x)=>{if(m===O)return!0;if(m.length===1&&m[0].semver===n){if(O.length===1&&O[0].semver===n)return!0;x.includePrerelease?m=l:m=c}if(O.length===1&&O[0].semver===n){if(x.includePrerelease)return!0;O=c}const v=new Set;let S,k;for(const V of m)V.operator===">"||V.operator===">="?S=f(S,V,x):V.operator==="<"||V.operator==="<="?k=p(k,V,x):v.add(V.semver);if(v.size>1)return null;let w;if(S&&k){if(w=i(S.semver,k.semver,x),w>0)return null;if(w===0&&(S.operator!==">="||k.operator!=="<="))return null}for(const V of v){if(S&&!r(V,String(S),x)||k&&!r(V,String(k),x))return null;for(const G of O)if(!r(V,String(G),x))return!1;return!0}let N,C,E,M,R=k&&!x.includePrerelease&&k.semver.prerelease.length?k.semver:!1,_=S&&!x.includePrerelease&&S.semver.prerelease.length?S.semver:!1;R&&R.prerelease.length===1&&k.operator==="<"&&R.prerelease[0]===0&&(R=!1);for(const V of O){if(M=M||V.operator===">"||V.operator===">=",E=E||V.operator==="<"||V.operator==="<=",S){if(_&&V.semver.prerelease&&V.semver.prerelease.length&&V.semver.major===_.major&&V.semver.minor===_.minor&&V.semver.patch===_.patch&&(_=!1),V.operator===">"||V.operator===">="){if(N=f(S,V,x),N===V&&N!==S)return!1}else if(S.operator===">="&&!r(S.semver,String(V),x))return!1}if(k){if(R&&V.semver.prerelease&&V.semver.prerelease.length&&V.semver.major===R.major&&V.semver.minor===R.minor&&V.semver.patch===R.patch&&(R=!1),V.operator==="<"||V.operator==="<="){if(C=p(k,V,x),C===V&&C!==k)return!1}else if(k.operator==="<="&&!r(k.semver,String(V),x))return!1}if(!V.operator&&(k||S)&&w!==0)return!1}return!(S&&E&&!k&&w!==0||k&&M&&!S&&w!==0||_||R)},f=(m,O,x)=>{if(!m)return O;const v=i(m.semver,O.semver,x);return v>0?m:v<0||O.operator===">"&&m.operator===">="?O:m},p=(m,O,x)=>{if(!m)return O;const v=i(m.semver,O.semver,x);return v<0?m:v>0||O.operator==="<"&&m.operator==="<="?O:m};return n0=s,n0}var r0,KP;function Nle(){if(KP)return r0;KP=1;const t=$f(),e=NO(),n=Jn(),r=dD(),i=Qu(),s=ile(),l=sle(),c=ale(),u=lle(),f=ole(),p=cle(),m=ule(),O=dle(),x=Ei(),v=hle(),S=fle(),k=Fk(),w=ple(),N=mle(),C=$O(),E=Hk(),M=hD(),R=fD(),_=Kk(),V=Jk(),G=pD(),D=gle(),L=EO(),Z=Pi(),te=PO(),I=xle(),B=ble(),X=vle(),q=yle(),K=Sle(),ne=e2(),$=wle(),P=kle(),U=jle(),T=Qle(),J=Cle();return r0={parse:i,valid:s,clean:l,inc:c,diff:u,major:f,minor:p,patch:m,prerelease:O,compare:x,rcompare:v,compareLoose:S,compareBuild:k,sort:w,rsort:N,gt:C,lt:E,eq:M,neq:R,gte:_,lte:V,cmp:G,coerce:D,Comparator:L,Range:Z,satisfies:te,toComparators:I,maxSatisfying:B,minSatisfying:X,minVersion:q,validRange:K,outside:ne,gtr:$,ltr:P,intersects:U,simplifyRange:T,subset:J,SemVer:n,re:t.re,src:t.src,tokens:t.t,SEMVER_SPEC_VERSION:e.SEMVER_SPEC_VERSION,RELEASE_TYPES:e.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers},r0}var Tle=Nle();const _d=Gg(Tle);function $le({installedModules:t,onInstall:e}){const[n,r]=j.useState(null),[i,s]=j.useState(!0),[l,c]=j.useState(!0),[u,f]=j.useState(!1),[p,m]=j.useState(""),[O,x]=j.useState(null),v=async()=>{c(!0),x(null);try{const N=await(await fetch("/api/registry")).json();if(!N.ok){s(N.configured??!1),r(null);return}s(!0),r(N.index??null)}catch(w){x(w instanceof Error?w.message:"Failed to load registry")}finally{c(!1)}},S=async()=>{f(!0);try{const N=await(await fetch("/api/registry/refresh",{method:"POST"})).json();N.ok&&N.index&&r(N.index)}finally{f(!1)}};if(j.useEffect(()=>{v()},[]),l)return d.jsx("div",{className:"text-sm text-[var(--color-muted)] py-8 text-center",children:"Loading registry..."});if(!i)return d.jsxs("div",{className:"p-8 text-center",children:[d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-4",children:"No registry configured. Configure one in Settings → Module Registry to browse shared modules from your team."}),d.jsx("a",{href:"/settings",className:"text-[var(--color-accent)] underline text-sm",children:"Configure registry"})]});if(O)return d.jsx("p",{className:"text-sm text-[var(--color-error)] py-4",children:O});if(!n)return null;const k=n.modules.filter(w=>{if(!p.trim())return!0;const N=p.trim().toLowerCase();return w.name.toLowerCase().includes(N)||w.description.toLowerCase().includes(N)||(w.tags??[]).some(C=>C.toLowerCase().includes(N))});return d.jsxs("div",{children:[n.indexYamlError&&d.jsxs("div",{className:"mb-3 p-2 bg-yellow-500/10 border border-yellow-500/30 rounded text-sm flex items-center gap-2 text-[var(--color-text)]",children:[d.jsx(Us,{size:14,className:"text-yellow-500 shrink-0"}),d.jsxs("span",{children:["Registry index file has errors — showing all modules alphabetically. (",n.indexYamlError,")"]})]}),d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx(hs,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),d.jsx("input",{value:p,onChange:w=>m(w.target.value),placeholder:"Search registry...",className:"w-full pl-7 pr-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] outline-none focus:border-[var(--color-accent)]"})]}),d.jsxs("button",{onClick:()=>void S(),disabled:u,className:"px-3 py-1.5 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] flex items-center gap-1.5 transition-colors",children:[d.jsx(ES,{size:14,className:u?"animate-spin":""}),"Refresh"]})]}),d.jsxs("p",{className:"text-xs text-[var(--color-muted)] mb-3",children:["Last synced: ",new Date(n.fetchedAt).toLocaleString()," · ",n.modules.length," module",n.modules.length===1?"":"s"]}),k.length===0?d.jsx("p",{className:"text-sm text-[var(--color-muted)] text-center py-8",children:"No modules match your search."}):d.jsx("div",{className:"space-y-2",children:k.map(w=>d.jsx(Ele,{module:w,installedModules:t,onInstall:e,index:n},w.code))})]})}function Ele({module:t,installedModules:e,onInstall:n,index:r}){const i=e.find(f=>f.name===t.code),l=i&&_d.valid(i.version)&&_d.valid(t.version)?_d.gt(t.version,i.version):!1,c=i&&(!_d.valid(i.version)||!_d.valid(t.version)),u=`${r.owner}/${r.repo}/${t.code}@${r.branch}`;return d.jsx("div",{className:"p-3 rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx("h3",{className:"font-bold text-sm",children:t.name}),d.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["v",t.version]}),t.status&&d.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${t.status==="stable"?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:t.status})]}),t.description&&d.jsx("p",{className:"text-sm text-[var(--color-muted)] mt-1 line-clamp-2",children:t.description}),d.jsxs("div",{className:"flex gap-3 text-xs text-[var(--color-muted)] mt-2",children:[d.jsxs("span",{children:[t.agentCount," agent",t.agentCount===1?"":"s"]}),d.jsxs("span",{children:[t.workflowCount," workflow",t.workflowCount===1?"":"s"]}),d.jsxs("span",{children:[t.taskCount," task",t.taskCount===1?"":"s"]})]}),t.tags&&t.tags.length>0&&d.jsx("div",{className:"flex gap-1 mt-2 flex-wrap",children:t.tags.map(f=>d.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:f},f))})]}),d.jsx("div",{className:"shrink-0",children:i&&!l?d.jsxs("span",{className:"flex items-center gap-1 text-sm text-[var(--color-success)] whitespace-nowrap",children:[d.jsx(bh,{size:14}),"Installed v",i.version,c&&d.jsx("span",{title:`Update detection requires both versions to be valid semver. Installed: "${i.version}", registry: "${t.version}". Compare manually.`,className:"ml-1 text-[var(--color-muted)] cursor-help",children:"ⓘ"})]}):l?d.jsxs("button",{onClick:()=>n({type:"github",value:u,prefetchedModuleYaml:t.rawModuleYaml}),className:"px-3 py-1.5 text-sm rounded-md bg-yellow-500 text-white flex items-center gap-1.5 hover:bg-yellow-600 transition-colors whitespace-nowrap",children:[d.jsx(Sq,{size:14}),"Update to v",t.version]}):d.jsx("button",{onClick:()=>n({type:"github",value:u,prefetchedModuleYaml:t.rawModuleYaml}),className:"px-3 py-1.5 text-sm rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Install"})})]})})}function Ple(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Ale({moduleName:t,onClose:e,onRemoved:n}){const[r,i]=j.useState(null),[s,l]=j.useState(null),[c,u]=j.useState(!1),[f,p]=j.useState(null);j.useEffect(()=>{fetch(`/api/modules/${encodeURIComponent(t)}/remove-preview`).then(async v=>{const S=await v.json();if(!v.ok){const k=S==null?void 0:S.error;throw new Error(typeof k=="object"&&k!==null?k.message??"Failed to load preview":String(k??"Failed to load preview"))}i(S)}).catch(v=>{l(v instanceof Error?v.message:"Failed to load preview")})},[t]);const m=async()=>{u(!0),p(null);try{const v=await fetch(`/api/modules/${encodeURIComponent(t)}`,{method:"DELETE"});if(!v.ok){const S=await v.json(),k=S==null?void 0:S.error;throw new Error(typeof k=="object"&&k!==null?k.message??"Failed to remove module":String(k??"Failed to remove module"))}n()}catch(v){p(v instanceof Error?v.message:"Failed to remove module")}finally{u(!1)}},O=r!==null&&r.moduleFiles.count===0&&Object.values(r.ideSkills).every(v=>v.length===0)&&r.preservedDirectories.length===0&&r.crossReferences.length===0,x=r?Object.values(r.ideSkills).reduce((v,S)=>v+S.length,0):0;return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),d.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg max-h-[80vh] flex flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2 p-6 pb-4 border-b border-[var(--color-border-subtle)]",children:[d.jsx(Us,{size:20,className:"text-[var(--color-error)] shrink-0"}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsxs("h2",{className:"text-lg font-bold",children:['Remove module "',t,'"',r!=null&&r.module.version?` v${r.module.version}`:"","?"]})}),d.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)] shrink-0",children:d.jsx(Wt,{size:18})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:[s&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:s}),!r&&!s&&d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"Loading preview..."}),r&&d.jsxs(d.Fragment,{children:[r.externalInstallerWarning&&d.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[d.jsx(eR,{size:16,className:"text-[var(--color-muted)] mt-0.5 shrink-0"}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:r.externalInstallerWarning})]}),O?d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"No files found on disk for this module. Removing will only clear the entry from manifest.yaml."}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-bold mb-2",children:"This will be removed:"}),d.jsxs("ul",{className:"space-y-1 text-sm text-[var(--color-muted)]",children:[r.moduleFiles.count>0&&d.jsxs("li",{children:["Module files: ",r.moduleFiles.count," file",r.moduleFiles.count!==1?"s":""," ","(",Ple(r.moduleFiles.totalBytes),")"]}),x>0&&Object.entries(r.ideSkills).map(([v,S])=>S.length>0?d.jsxs("li",{children:["IDE skills (",v,"): ",S.length," launcher",S.length!==1?"s":"",d.jsx("ul",{className:"ml-4 mt-1 space-y-0.5",children:S.map(k=>d.jsx("li",{className:"text-xs font-mono",children:k},k))})]},v):null),d.jsx("li",{children:"Manifest entry"})]})]}),r.preservedDirectories.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-bold mb-2",children:"This will be preserved:"}),d.jsx("ul",{className:"space-y-1 text-sm text-[var(--color-muted)]",children:r.preservedDirectories.map(v=>d.jsx("li",{className:"font-mono text-xs",children:v.path},v.path))})]}),r.crossReferences.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-bold text-[var(--color-warning)] mb-2",children:"Warnings:"}),d.jsx("ul",{className:"space-y-1 text-sm text-[var(--color-muted)]",children:r.crossReferences.map((v,S)=>d.jsxs("li",{children:[d.jsx("span",{className:"font-medium",children:v.sourceModule})," / ",d.jsx("span",{className:"font-mono text-xs",children:v.sourceEntity})," references this module via ",d.jsx("span",{className:"font-mono text-xs",children:v.fieldPath})]},S))}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-2 italic",children:r.crossReferenceScopeNotice})]})]}),r.removalBlocked&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:r.removalBlocked.reason}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Recoverable from snapshot history."})]}),f&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:f})]}),d.jsxs("div",{className:"flex justify-end gap-3 p-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[d.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsxs("button",{onClick:m,disabled:c||!r||!!r.removalBlocked||!!s,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-error)] text-white hover:opacity-90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[d.jsx(uo,{size:14}),c?"Removing...":"Remove"]})]})]})]})}function JP({onClose:t,onCreated:e}){const[n,r]=j.useState(""),[i,s]=j.useState("1.0.0"),[l,c]=j.useState(null),[u,f]=j.useState(!1),p=/^[a-z][a-z0-9-]*$/.test(n),m=async()=>{var O;if(p){f(!0),c(null);try{const x=await fetch("/api/modules",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n,version:i})});if(!x.ok){const v=await x.json();throw new Error(((O=v.error)==null?void 0:O.message)??"Failed to create module")}e()}catch(x){c(x instanceof Error?x.message:"Failed to create module")}finally{f(!1)}}};return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),d.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"create-module-title",className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[d.jsx("h2",{id:"create-module-title",className:"text-lg font-bold mb-4",children:"Create Module"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),d.jsx("input",{type:"text",value:n,onChange:O=>r(O.target.value),placeholder:"my-module",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),n&&!p&&d.jsx("p",{className:"text-xs text-[var(--color-error)] mt-1",children:"Lowercase alphanumeric and hyphens only, must start with a letter"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-bold mb-1",children:"Version"}),d.jsx("input",{type:"text",value:i,onChange:O=>s(O.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),n&&p&&d.jsxs("div",{className:"text-xs text-[var(--color-muted)] p-3 rounded-md bg-[var(--color-surface-raised)]",children:[d.jsx("p",{className:"font-bold mb-1",children:"Will create:"}),d.jsx("pre",{className:"font-[var(--font-mono)]",children:`_bmad/${n}/
|
|
637
|
+
├── config.yaml
|
|
638
|
+
├── agents/
|
|
639
|
+
├── skills/
|
|
640
|
+
└── workflows/`})]}),l&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:l})]}),d.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[d.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsxs("button",{onClick:m,disabled:!p||u,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[d.jsx(Yt,{size:14}),u?"Creating...":"Create"]})]})]})]})}function Rle({moduleName:t,entityType:e,onClose:n,onCreated:r}){const[i,s]=j.useState(""),[l,c]=j.useState(null),[u,f]=j.useState(!1),p=/^[a-z][a-z0-9-]*$/.test(i),m=e==="skill"?"Skill":"Workflow",O=async()=>{var x;if(p){f(!0),c(null);try{const v=await fetch(`/api/modules/${encodeURIComponent(t)}/entities`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e,name:i})});if(!v.ok){const S=await v.json();throw new Error(((x=S.error)==null?void 0:x.message)??`Failed to create ${e}`)}r()}catch(v){c(v instanceof Error?v.message:`Failed to create ${e}`)}finally{f(!1)}}};return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:n}),d.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[d.jsxs("h2",{className:"text-lg font-bold mb-4",children:["Create ",m]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-bold mb-1",children:[m," Name"]}),d.jsx("input",{type:"text",value:i,onChange:x=>s(x.target.value),placeholder:`my-${e}`,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),i&&!p&&d.jsx("p",{className:"text-xs text-[var(--color-error)] mt-1",children:"Lowercase alphanumeric and hyphens only, must start with a letter"})]}),i&&p&&d.jsxs("div",{className:"text-xs text-[var(--color-muted)] p-3 rounded-md bg-[var(--color-surface-raised)]",children:[d.jsx("p",{className:"font-bold mb-1",children:"Will create:"}),d.jsx("code",{className:"font-[var(--font-mono)]",children:e==="skill"?`_bmad/${t}/skills/${i}/SKILL.md`:`_bmad/${t}/workflows/${i}/workflow.md`})]}),l&&d.jsx("p",{className:"text-sm text-[var(--color-error)]",children:l})]}),d.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[d.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),d.jsxs("button",{onClick:O,disabled:!p||u,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[d.jsx(Yt,{size:14}),u?"Creating...":`Create ${m}`]})]})]})]})}function _le({manifest:t,onClose:e}){const n=["# Module Export Manifest",`module: ${t.module}`,`version: ${t.version}`,`source: ${t.source}`,`exportDate: ${t.exportDate}`,`totalEntities: ${t.totalEntities}`,"entities:"," agents:",` count: ${t.entities.agents.count}`," names:",...t.entities.agents.names.map(r=>` - ${r}`)," skills:",` count: ${t.entities.skills.count}`," names:",...t.entities.skills.names.map(r=>` - ${r}`)," workflows:",` count: ${t.entities.workflows.count}`," names:",...t.entities.workflows.names.map(r=>` - ${r}`),"",`# ${t.note}`].join(`
|
|
641
|
+
`);return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),d.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsxs("h2",{className:"text-lg font-bold",children:["Export Manifest: ",t.module]}),d.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex gap-4 text-sm",children:[d.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-[var(--color-surface-raised)]",children:[d.jsx(Tn,{size:14,className:"text-[var(--color-accent)]"}),d.jsxs("span",{children:[t.entities.agents.count," agents"]})]}),d.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-[var(--color-surface-raised)]",children:[d.jsx(Si,{size:14,className:"text-[var(--color-accent)]"}),d.jsxs("span",{children:[t.entities.skills.count," skills"]})]}),d.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-[var(--color-surface-raised)]",children:[d.jsx(Or,{size:14,className:"text-[var(--color-accent)]"}),d.jsxs("span",{children:[t.entities.workflows.count," workflows"]})]})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold mb-2",children:"module-manifest.yaml"}),d.jsx("pre",{className:"p-4 text-xs font-[var(--font-mono)] bg-[var(--color-surface-raised)] rounded-lg overflow-x-auto whitespace-pre-wrap max-h-72 overflow-y-auto border border-[var(--color-border-subtle)]",children:n})]}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Full file bundling and archive download is a future enhancement. This manifest provides a summary of module contents."})]}),d.jsx("div",{className:"flex justify-end gap-3 mt-6",children:d.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Close"})})]})]})}function Mle(t){const e=t.name.toLowerCase();return e==="skill.md"||e.endsWith("-skill.md")||e.endsWith("_skill.md")?"skill":e==="workflow.md"?"workflow":"agent"}async function zle(t){const n=(await t.text()).match(/^---\n([\s\S]*?)\n---/);if(n){const r=n[1].toLowerCase();if(r.includes("category:")&&(r.includes("skill")||r.includes("best_for:")))return"skill"}return Mle(t)}function i0({icon:t,label:e,items:n}){const[r,i]=j.useState(!1);return n.length===0?null:d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>i(!r),className:"flex items-center gap-2 w-full text-left py-2",children:[r?d.jsx(gr,{size:14,className:"text-[var(--color-muted)]"}):d.jsx(yi,{size:14,className:"text-[var(--color-muted)]"}),d.jsx(t,{size:14,className:"text-[var(--color-accent)]"}),d.jsx("span",{className:"text-sm font-bold",children:e}),d.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["(",n.length,")"]})]}),r&&d.jsx("div",{className:"ml-7 space-y-1 mb-2",children:n.map(s=>d.jsx(zt,{to:s.to,className:"block text-sm text-[var(--color-accent)] hover:underline py-0.5",children:s.name},s.id))})]})}function Dle(){const t=ds(),[e,n]=j.useState([]),[r,i]=j.useState(!0),[s,l]=cs("detail"),[c,u]=j.useState(!1),[f,p]=j.useState(!1),[m,O]=j.useState(),[x,v]=cs("tab"),S=x==="registry"?"registry":"installed",[k,w]=j.useState(!1),[N,C]=j.useState(null),[E,M]=j.useState(null),[R,_]=j.useState([]),[V,G]=j.useState(null),[D,L]=j.useState(!1),[Z,te]=j.useState(null),I=j.useRef(null),[B,X]=j.useState(null),[q,K]=j.useState(!1),[ne,$]=j.useState(null),{notify:P}=co(),U=j.useCallback(async oe=>{var ce;$(oe);try{const me=await fetch(`/api/modules/${encodeURIComponent(oe)}/regenerate-skills`,{method:"POST"}),ve=await me.json();if(!me.ok||!ve.ok){const Lt=((ce=ve==null?void 0:ve.error)==null?void 0:ce.message)??(ve==null?void 0:ve.error)??"Failed to regenerate IDE skills";throw new Error(Lt)}const Ie=ve.regenerated??{},Dt=Object.values(Ie).reduce((Lt,er)=>Lt+er,0),Rt=Object.keys(Ie).length;Rt===0?P("info",`No IDE skills generated for "${oe}"`,"No IDEs are configured in manifest.yaml `ides:` — add `claude-code` or `antigravity` and try again."):P("success",`Regenerated ${Dt} skill${Dt===1?"":"s"} across ${Rt} IDE${Rt===1?"":"s"}`)}catch(me){P("error",`Failed to regenerate IDE skills for "${oe}"`,me instanceof Error?me.message:String(me))}finally{$(null)}},[P]),T=j.useCallback(async()=>{try{const ce=await(await fetch("/api/modules")).json();n(ce)}catch{}finally{i(!1)}},[]);j.useEffect(()=>{fetch("/api/teams").then(oe=>oe.json()).then(oe=>_(oe)).catch(()=>{})},[]),j.useEffect(()=>{T()},[T]);const J=j.useCallback(async(oe,ce)=>{te(null);let me=0,ve=0;for(const Ie of Array.from(oe)){if(!Ie.name.endsWith(".md")){ve++;continue}try{const Dt=await Ie.text(),Rt=await zle(Ie),Lt=Ie.name.replace(/\.md$/i,"");(await fetch(`/api/modules/${encodeURIComponent(ce)}/entities`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:Rt,name:Lt,content:Dt})})).ok?me++:ve++}catch{ve++}}me>0&&await T(),ve>0?te(`Uploaded ${me} file(s), ${ve} failed`):te(`Uploaded ${me} file(s) successfully`),setTimeout(()=>te(null),4e3)},[T]),W=j.useCallback(async oe=>{K(!0);try{const ce=await fetch(`/api/modules/${encodeURIComponent(oe)}/export`,{method:"POST"});if(!ce.ok)throw new Error("Export failed");const me=await ce.json();X(me)}catch{te("Export failed"),setTimeout(()=>te(null),3e3)}finally{K(!1)}},[]);if(r)return d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Modules"}),d.jsx(eO,{count:3})]});if(e.length===0)return d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Modules"}),d.jsx(Ci,{icon:$S,title:"No modules installed",description:"Modules contain agents, skills, and workflows. Install a module or create a new one to get started.",actions:d.jsxs("button",{onClick:()=>u(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[d.jsx(Yt,{size:14}),"Create Module"]})}),c&&d.jsx(JP,{onClose:()=>u(!1),onCreated:()=>{u(!1),T()}})]});const re=s?e.find(oe=>oe.name===s):null;return d.jsxs("div",{children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-8",children:[d.jsxs("h1",{className:"text-2xl font-extrabold",children:["Modules (",e.length,")"]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("button",{onClick:()=>w(!0),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors flex items-center gap-1.5",children:[d.jsx(tg,{size:14}),"Export Package"]}),d.jsxs("button",{onClick:()=>p(!0),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors flex items-center gap-1.5",children:[d.jsx(eg,{size:14}),"Install Module"]}),d.jsxs("button",{onClick:()=>u(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[d.jsx(Yt,{size:14}),"Create Module"]})]})]}),d.jsxs("div",{className:"flex border-b border-[var(--color-border-subtle)] mb-4",children:[d.jsx("button",{onClick:()=>v("installed"),className:`px-4 py-2 text-sm font-medium transition-colors ${S==="installed"?"border-b-2 border-[var(--color-accent)] text-[var(--color-text)]":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Installed"}),d.jsx("button",{onClick:()=>v("registry"),className:`px-4 py-2 text-sm font-medium transition-colors ${S==="registry"?"border-b-2 border-[var(--color-accent)] text-[var(--color-text)]":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Registry"})]}),S==="registry"&&d.jsx($le,{installedModules:e,onInstall:oe=>{O(oe),p(!0)}}),S==="installed"&&(e.length===0?d.jsxs("div",{className:"py-16 text-center text-sm text-[var(--color-muted)]",children:["No modules installed. Use ",d.jsx("strong",{children:"Install Module"})," or ",d.jsx("strong",{children:"Create Module"})," to get started."]}):d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(oe=>{const ce=s===oe.name,me=oe.name.slice(0,2).toUpperCase(),ve=oe.agentCount+oe.skillCount+oe.workflowCount,Dt={github:"bg-green-500/10 text-green-400",npm:"bg-red-500/10 text-red-400",local:"bg-yellow-500/10 text-yellow-400","built-in":"bg-blue-500/10 text-[var(--color-accent)]"}[oe.source]??"bg-[var(--color-surface-raised)] text-[var(--color-muted)]";return d.jsxs("button",{onClick:()=>l(ce?null:oe.name),className:`group rounded-xl border text-left transition-all cursor-pointer overflow-hidden hover:-translate-y-0.5 hover:shadow-lg ${ce?"border-[var(--color-accent)] shadow-md shadow-[var(--color-accent)]/10":"border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]/60"}`,children:[d.jsx("div",{className:"px-4 pt-4 pb-3 bg-[var(--color-surface-raised)]",children:d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:"w-11 h-11 rounded-xl bg-gradient-to-br from-[var(--color-accent)]/20 to-[var(--color-accent)]/5 border border-[var(--color-accent)]/20 flex items-center justify-center shrink-0",children:d.jsx("span",{className:"text-sm font-extrabold text-[var(--color-accent)]",children:me})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"font-extrabold text-sm truncate",children:oe.name}),d.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[d.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["v",oe.version]}),d.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-bold uppercase ${Dt}`,children:oe.source})]})]})]})}),d.jsx("div",{className:"px-4 py-3 bg-[var(--color-bg)] border-t border-[var(--color-border-subtle)]",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex gap-3 text-xs text-[var(--color-muted)]",children:[oe.agentCount>0&&d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(Tn,{size:11,className:"text-[var(--color-accent)]"}),oe.agentCount]}),oe.skillCount>0&&d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(Si,{size:11,className:"text-[var(--color-success)]"}),oe.skillCount]}),oe.workflowCount>0&&d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(Or,{size:11,className:"text-purple-400"}),oe.workflowCount]})]}),d.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[ve," ",ve===1?"entity":"entities"]})]})})]},oe.name)})}))]}),re&&d.jsxs("div",{className:"slide-over-backdrop",children:[d.jsx("div",{className:"slide-over-bg",onClick:()=>l(null)}),d.jsxs("aside",{className:"slide-over-panel",style:{width:"max(400px, 40vw)"},children:[d.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-bold",children:re.name}),d.jsxs("p",{className:"text-xs text-[var(--color-muted)]",children:[re.source," · v",re.version]})]}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d.jsx("button",{onClick:()=>M(re.name),className:"text-[var(--color-muted)] hover:text-[var(--color-accent)] transition-colors",title:"Edit Module",children:d.jsx(Kl,{size:16})}),d.jsx("button",{onClick:()=>l(null),className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:d.jsx(Wt,{size:18})})]})]}),d.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto",style:{maxHeight:"calc(100vh - 80px)"},children:[d.jsx(i0,{icon:Tn,label:"Agents",items:(re.agents??[]).map(oe=>({id:oe.id,name:oe.title||oe.name,to:`/agents/${oe.id}`}))}),d.jsx(i0,{icon:Si,label:"Skills",items:(re.skills??[]).map(oe=>({id:oe.id,name:oe.name,to:`/skills?detail=${oe.id}`}))}),d.jsx(i0,{icon:Or,label:"Workflows",items:(re.workflows??[]).map(oe=>({id:oe.id,name:oe.name,to:`/workflows?detail=${oe.id}`}))}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold mb-3",children:"Add Entities"}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("button",{onClick:()=>t("/agents"),className:"w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors text-left",children:[d.jsx(Yt,{size:14,className:"text-[var(--color-accent)]"}),d.jsx(Tn,{size:14}),"Add Agent",d.jsx("span",{className:"ml-auto text-xs text-[var(--color-muted)]",children:"via Agents page"})]}),d.jsxs("button",{onClick:()=>G("skill"),className:"w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors text-left",children:[d.jsx(Yt,{size:14,className:"text-[var(--color-accent)]"}),d.jsx(Si,{size:14}),"Add Skill"]}),d.jsxs("button",{onClick:()=>G("workflow"),className:"w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors text-left",children:[d.jsx(Yt,{size:14,className:"text-[var(--color-accent)]"}),d.jsx(Or,{size:14}),"Add Workflow"]})]})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold mb-3",children:"Upload Entities"}),d.jsxs("div",{className:`relative border-2 border-dashed rounded-lg p-6 text-center transition-colors ${D?"border-[var(--color-accent)] bg-[var(--color-accent)]/10":"border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,onDragOver:oe=>{oe.preventDefault(),L(!0)},onDragLeave:()=>L(!1),onDrop:oe=>{oe.preventDefault(),L(!1),oe.dataTransfer.files.length>0&&J(oe.dataTransfer.files,re.name)},onClick:()=>{var oe;return(oe=I.current)==null?void 0:oe.click()},children:[d.jsx("input",{ref:I,type:"file",accept:".md",multiple:!0,className:"hidden",onChange:oe=>{oe.target.files&&oe.target.files.length>0&&(J(oe.target.files,re.name),oe.target.value="")}}),d.jsx(tg,{size:24,className:`mx-auto mb-2 ${D?"text-[var(--color-accent)]":"text-[var(--color-muted)]"}`}),d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"Drop .md files here or click to upload"}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:"Auto-detects: SKILL.md → skills, workflow.md → workflows, others → agents"})]}),Z&&d.jsxs("p",{className:"text-xs mt-2 text-[var(--color-accent)]",children:[d.jsx(rs,{size:12,className:"inline mr-1"}),Z]})]}),(()=>{const oe=R.filter(ce=>ce.module===re.name);return oe.length===0?null:d.jsxs("div",{children:[d.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Teams (",oe.length,")"]}),d.jsx("div",{className:"space-y-2",children:oe.map(ce=>d.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[d.jsxs("span",{className:"flex items-center gap-2 text-sm",children:[ce.icon?d.jsx("span",{className:"text-sm leading-none",children:ce.icon}):d.jsx(Kg,{size:14,className:"text-[var(--color-accent)]"}),ce.name]}),d.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[ce.memberCount," members"]})]},ce.id))})]})})(),d.jsxs("div",{className:"text-xs text-[var(--color-muted)]",children:[d.jsxs("p",{children:["Module directory: ",d.jsxs("code",{className:"font-[var(--font-mono)]",children:["_bmad/",re.name,"/"]})]}),re.npmPackage&&d.jsxs("p",{className:"mt-1",children:["npm: ",d.jsx("code",{className:"font-[var(--font-mono)]",children:re.npmPackage})]})]}),d.jsxs("button",{onClick:()=>W(re.name),disabled:q,className:"w-full flex items-center justify-center gap-2 px-4 py-2 text-sm rounded-md border border-[var(--color-accent)] text-[var(--color-accent)] hover:bg-[var(--color-accent)] hover:text-white transition-colors disabled:opacity-50",children:[d.jsx(eg,{size:14}),q?"Exporting...":"Export Module"]}),d.jsxs("button",{onClick:()=>U(re.name),disabled:ne===re.name,title:"Regenerate IDE skill launchers from the current module contents",className:"w-full flex items-center justify-center gap-2 px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] text-[var(--color-muted)] hover:text-[var(--color-text)] hover:border-[var(--color-accent)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[ne===re.name?d.jsx(is,{size:14,className:"animate-spin"}):d.jsx(ES,{size:14}),ne===re.name?"Regenerating...":"Regenerate IDE Skills"]}),re.source!=="built-in"&&d.jsxs("button",{onClick:()=>C(re),className:"w-full flex items-center justify-center gap-2 px-4 py-2 text-sm rounded-md border border-[var(--color-error)] text-[var(--color-error)] hover:bg-[var(--color-error)] hover:text-white transition-colors",children:[d.jsx(uo,{size:14}),"Remove Module"]})]})]})]}),c&&d.jsx(JP,{onClose:()=>u(!1),onCreated:()=>{u(!1),T()}}),N&&d.jsx(Ale,{moduleName:N.name,onClose:()=>C(null),onRemoved:()=>{C(null),l(null),T()}}),V&&re&&d.jsx(Rle,{moduleName:re.name,entityType:V,onClose:()=>G(null),onCreated:()=>{G(null),T()}}),B&&d.jsx(_le,{manifest:B,onClose:()=>X(null)}),E&&re&&d.jsx(tle,{moduleName:re.name,currentVersion:re.version,onClose:()=>M(null),onSaved:()=>{M(null),T()}}),f&&d.jsx(rle,{onClose:()=>{p(!1),O(void 0)},onInstalled:()=>{p(!1),O(void 0),T()},initialSource:m}),k&&d.jsx(nle,{onClose:()=>w(!1)})]})}function Gm(t){const e=t.lastIndexOf("/_bmad/");return e>=0?t.slice(e+7):t}function Lle(t){return/\.(md|yaml|yml)$/i.test(t)}function Xle(t){var n;switch((n=t.split(".").pop())==null?void 0:n.toLowerCase()){case"md":return rs;case"yaml":case"yml":return Yq;case"json":return Dq;case"ts":case"tsx":case"js":case"jsx":return Xq;case"png":case"jpg":case"jpeg":case"svg":case"gif":case"webp":return uI;case"csv":return BI;default:return Uq}}function mD({node:t,depth:e=0,selectedPath:n,onSelect:r}){var f;const[i,s]=j.useState(e<2),l=()=>{t.type==="directory"?s(!i):r(t.path)},c=Gm(t.path),u=t.type==="file"&&(n===t.path||n===c);return d.jsxs("div",{children:[d.jsxs("button",{onClick:l,className:`w-full text-left flex items-center gap-1.5 px-2 py-1.5 text-sm rounded transition-colors ${u?"bg-[var(--color-surface-raised)] text-[var(--color-accent)] font-bold":"hover:bg-[var(--color-surface-raised)]"} cursor-pointer`,style:{paddingLeft:`${e*16+8}px`},children:[t.type==="directory"?d.jsxs(d.Fragment,{children:[i?d.jsx(gr,{size:12,className:"text-[var(--color-muted)] shrink-0"}):d.jsx(yi,{size:12,className:"text-[var(--color-muted)] shrink-0"}),d.jsx(Hq,{size:14,className:i?"text-[var(--color-accent)]":"text-[var(--color-muted)]"})]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"w-3"}),(()=>{const p=Xle(t.name);return d.jsx(p,{size:14,className:u?"text-[var(--color-accent)]":"text-[var(--color-muted)]"})})()]}),d.jsx("span",{className:"truncate",children:t.name}),t.type==="file"&&t.size!==void 0&&d.jsx("span",{className:"ml-auto text-xs text-[var(--color-muted)] shrink-0",children:t.size>1024?`${(t.size/1024).toFixed(1)}K`:`${t.size}B`})]}),i&&((f=t.children)==null?void 0:f.map(p=>d.jsx(mD,{node:p,depth:e+1,selectedPath:n,onSelect:r},p.path)))]})}function Zle(){const[t,e]=j.useState([]),[n,r]=j.useState(!0),[i,s]=cs("path"),[l,c]=j.useState(""),[u,f]=j.useState(""),[p,m]=j.useState(!1),[O,x]=j.useState(!1),{notify:v}=co(),S=l!==u;j.useEffect(()=>{fetch("/api/files").then(E=>E.json()).then(E=>{e(E),r(!1)}).catch(()=>r(!1))},[]),j.useEffect(()=>{if(!i){c(""),f("");return}m(!0);const E=Gm(i);fetch(`/api/files/${E}`).then(M=>{if(!M.ok)throw new Error("Not found");return M.json()}).then(M=>{c(M.content),f(M.content)}).catch(()=>{c("Failed to load file content."),f("Failed to load file content.")}).finally(()=>m(!1))},[i]);const k=j.useCallback(E=>{const M=Gm(E);s(i===E||i===M?null:E)},[i,s]),w=j.useCallback(async()=>{if(!i||O)return;x(!0);const E=Gm(i);try{const M=await fetch(`/api/files/${E}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:l})});if(!M.ok){const R=await M.json();throw new Error(R.error??"Save failed")}f(l),v("success",`Saved ${E.split("/").pop()}`)}catch(M){v("error",`Failed to save: ${M instanceof Error?M.message:"Unknown error"}`)}finally{x(!1)}},[i,l,O,v]),N=i?i.split("/").pop()??i:"",C=i?Lle(i):!1;return n?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Files"}),d.jsx("div",{className:"h-64 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"})]}):t.length===0?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Files"}),d.jsx(Ci,{icon:HA,title:"No BMAD files",description:"No _bmad/ directory detected."})]}):d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Files"}),d.jsx("div",{className:"border border-[var(--color-border-subtle)] rounded-lg overflow-hidden overflow-y-auto",style:{maxHeight:"calc(100vh - 10rem)"},children:d.jsx("div",{className:"py-1",children:t.map(E=>d.jsx(mD,{node:E,selectedPath:i,onSelect:k},E.path))})}),d.jsx(CO,{open:!!i,title:N,onClose:()=>s(null),width:"max(480px, 50vw)",actions:C?d.jsxs("button",{onClick:w,disabled:!S||O,className:`flex items-center gap-1.5 px-3 py-1.5 text-xs font-bold rounded-md transition-colors ${S&&!O?"bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)]":"bg-[var(--color-surface-raised)] text-[var(--color-muted)] cursor-not-allowed"}`,title:S?"Save (⌘S)":"No unsaved changes",children:[O?d.jsx(is,{size:12,className:"animate-spin"}):d.jsx(Bc,{size:12}),O?"Saving…":S?"Save":"Saved"]}):void 0,children:p?d.jsx("div",{className:"h-64 rounded bg-[var(--color-surface-raised)] animate-pulse"}):i!=null&&i.endsWith(".csv")?d.jsx(Wg,{content:l}):d.jsx("div",{className:"rounded-lg overflow-hidden border border-[var(--color-border-subtle)]",style:{height:"calc(100vh - 140px)"},children:d.jsx(ai,{content:l,filePath:i??"",onChange:c,onSave:w,readOnly:!C})})})]})}function qle(){const t=Sh(te=>te.theme),e=Sh(te=>te.setTheme),{notify:n}=co(),[,r]=j.useState({port:4040,theme:"dark"}),[i,s]=j.useState(!0),[l,c]=j.useState("4040"),[u,f]=j.useState(!1),[p,m]=j.useState(!1),[O,x]=j.useState(""),[v,S]=j.useState("main"),[k,w]=j.useState(!1),[N,C]=j.useState(!1),[E,M]=j.useState("info"),[R,_]=j.useState(!1);j.useEffect(()=>{fetch("/api/settings").then(te=>te.json()).then(te=>{const I=te;r(I),c(String(I.port??4040)),I.registry&&(x(I.registry.repo??""),S(I.registry.branch??"main")),I.logging&&(C(I.logging.enabled??!1),M(I.logging.level??"info")),s(!1)}).catch(()=>s(!1))},[]);function V(){const te=iR();e(te),f(!0)}function G(te){c(te),f(!0)}async function D(){m(!0);const te=parseInt(l,10);if(isNaN(te)||te<1024||te>65535){n("error","Port must be between 1024 and 65535"),m(!1);return}try{(await fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:te,theme:t})})).ok?(r({port:te,theme:t}),f(!1),n("success","Settings saved")):n("error","Failed to save settings")}catch{n("error","Failed to save settings")}finally{m(!1)}}async function L(){w(!0);try{(await fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({registry:{repo:O.trim(),branch:v.trim()||"main"}})})).ok?n("success","Registry settings saved"):n("error","Failed to save registry settings")}catch{n("error","Failed to save registry settings")}finally{w(!1)}}async function Z(){_(!0);try{(await fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({logging:{enabled:N,level:E}})})).ok?n("success","Logging settings saved — restart the server to apply"):n("error","Failed to save logging settings")}catch{n("error","Failed to save logging settings")}finally{_(!1)}}return i?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Settings"}),d.jsx("div",{className:"h-32 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"})]}):d.jsxs("div",{className:"max-w-2xl",children:[d.jsxs("div",{className:"flex items-center justify-between mb-8",children:[d.jsx("h1",{className:"text-2xl font-extrabold",children:"Settings"}),d.jsx("button",{onClick:D,disabled:!u||p,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:p?"Saving...":"Save"})]}),d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"text-lg font-bold mb-4",children:"Studio"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-bold",children:"Theme"}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Toggle between dark and light mode"})]}),d.jsx("button",{onClick:V,className:"px-3 py-1.5 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-bg)] transition-colors",children:t==="dark"?"Switch to Light":"Switch to Dark"})]}),d.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-bold",children:"Port"}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Server port (requires restart)"})]}),d.jsx("input",{type:"number",value:l,onChange:te=>G(te.target.value),min:1024,max:65535,className:"w-24 px-3 py-1.5 text-sm text-right rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-text)] font-[var(--font-mono)] outline-none focus:border-[var(--color-accent)]"})]})]})]}),d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"text-lg font-bold mb-4",children:"Module Registry"}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-sm text-[var(--color-muted)] px-4",children:"Configure a GitHub repo as your team's module registry. Browse and install shared modules from the Registry tab on the Modules page."}),d.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-bold",children:"Repository"}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"GitHub repo in owner/repo format"})]}),d.jsx("input",{type:"text",value:O,onChange:te=>x(te.target.value),placeholder:"owner/repo",className:"w-56 px-3 py-1.5 text-sm rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-text)] font-[var(--font-mono)] outline-none focus:border-[var(--color-accent)]"})]}),d.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-bold",children:"Branch"}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Default: main"})]}),d.jsx("input",{type:"text",value:v,onChange:te=>S(te.target.value),placeholder:"main",className:"w-32 px-3 py-1.5 text-sm rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-text)] font-[var(--font-mono)] outline-none focus:border-[var(--color-accent)]"})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx("button",{onClick:L,disabled:!O.trim()||k,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:k?"Saving...":"Save"})})]})]}),d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"text-lg font-bold mb-4",children:"Logging"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-sm text-[var(--color-muted)] px-4",children:["Write server logs to ",d.jsx("code",{className:"font-[var(--font-mono)]",children:".bmad-studio/logs/studio.log"})," in your project. Useful for debugging install failures and module errors. Changes take effect after restarting the server."]}),d.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-bold",children:"Enable file logging"}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Append all server logs to the log file"})]}),d.jsx("button",{onClick:()=>C(!N),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${N?"bg-[var(--color-accent)]":"bg-[var(--color-border-subtle)]"}`,role:"switch","aria-checked":N,children:d.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${N?"translate-x-6":"translate-x-1"}`})})]}),d.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-bold",children:"Log level"}),d.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Minimum severity to log"})]}),d.jsxs("select",{value:E,onChange:te=>M(te.target.value),disabled:!N,className:"px-3 py-1.5 text-sm rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-text)] outline-none focus:border-[var(--color-accent)] disabled:opacity-50 disabled:cursor-not-allowed",children:[d.jsx("option",{value:"trace",children:"trace (very verbose)"}),d.jsx("option",{value:"debug",children:"debug"}),d.jsx("option",{value:"info",children:"info (recommended)"}),d.jsx("option",{value:"warn",children:"warn"}),d.jsx("option",{value:"error",children:"error only"})]})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx("button",{onClick:Z,disabled:R,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:R?"Saving...":"Save"})})]})]}),d.jsxs("section",{children:[d.jsx("h2",{className:"text-lg font-bold mb-4",children:"Project"}),d.jsx("div",{className:"p-4 rounded-lg bg-[var(--color-surface-raised)]",children:d.jsxs("p",{className:"text-sm text-[var(--color-muted)]",children:["Project settings are configured via ",d.jsx("code",{className:"font-[var(--font-mono)]",children:"_bmad/config.yaml"})]})})]})]})}const Ile="1.0.0";function km({href:t,icon:e,title:n,description:r}){return d.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"flex items-start gap-3 p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors",children:[d.jsx(e,{size:18,className:"text-[var(--color-accent)] shrink-0 mt-0.5"}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-sm font-bold",children:n}),d.jsx(FA,{size:10,className:"text-[var(--color-muted)]"})]}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-0.5",children:r})]})]})}const Ble=[{q:"What is BMAD?",a:"BMAD (Build Manage Architect Deploy) is an agentic engineering framework that defines AI agents, skills, and workflows as structured markdown files. It provides a method for orchestrating AI agents in software delivery workflows."},{q:"What does BMAD Studio do?",a:"Studio is the configuration and visibility layer for BMAD projects. It reads and writes the same markdown and YAML files that BMAD uses — no database, no hidden state. You can browse agents, visualize workflows, manage skills, and configure your project through a web interface."},{q:"Does Studio execute agents or workflows?",a:"No. Studio configures and visualizes. Your IDE (Claude Code, Cursor, Windsurf, etc.) remains the execution environment. Studio helps you understand and manage the setup; the IDE runs the agents."},{q:"What BMAD version is supported?",a:"Studio targets BMAD v6+. It reads the BMAD version from your project config and warns if the version is unsupported."},{q:"How do I install Studio?",a:"Run `npx bmad-studio` from your BMAD project root. It starts a local server and opens in your browser. No global install required."},{q:"Where does Studio store its data?",a:"Studio reads directly from your _bmad/ directory. Studio-only runtime data (drafts, sync config) lives in .bmad-studio/ which can be deleted at any time with zero impact on your project."},{q:"Can I use Studio without a BMAD project?",a:"Studio will start in setup mode and guide you through initializing a BMAD structure. However, most features require an existing BMAD project to be useful."},{q:"Is my data sent anywhere?",a:"No. Studio runs entirely locally. There are no analytics, no telemetry, and no external network requests. All data stays on your machine."}];function Yle(){return d.jsxs("div",{className:"max-w-2xl",children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"About BMAD Studio"}),d.jsxs("p",{className:"text-sm text-[var(--color-muted)] mb-8",children:["Version ",Ile]}),d.jsxs("div",{className:"mb-8",children:[d.jsx("p",{className:"text-sm leading-relaxed",children:"BMAD Studio is the visual administration layer for the BMAD ecosystem. It gives you a dashboard for your project's AI agents, skills, workflows, teams, and outputs — letting you browse, configure, and manage everything through a browser UI while your IDE handles execution."}),d.jsx("p",{className:"text-sm leading-relaxed mt-3 text-[var(--color-muted)]",children:"Studio reads and writes BMAD's existing text files directly — no database, no hidden state. Install modules from the registry to extend your toolkit, switch between projects instantly, and track sprint progress from the home dashboard."})]}),d.jsxs("div",{className:"mb-8",children:[d.jsx("h2",{className:"text-sm font-bold mb-3",children:"Links"}),d.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[d.jsx(km,{href:"https://github.com/jwhiteside/bmad-studio",icon:JA,title:"GitHub Repository",description:"Source code, issues, and releases"}),d.jsx(km,{href:"https://github.com/bmadcode/BMAD-METHOD",icon:TS,title:"BMAD Method",description:"The agentic engineering framework"}),d.jsx(km,{href:"https://github.com/jwhiteside/bmad-studio/blob/main/CONTRIBUTING.md",icon:oI,title:"Contributing",description:"How to report bugs and submit PRs"}),d.jsx(km,{href:"https://github.com/jwhiteside/bmad-studio/blob/main/LICENSE",icon:MI,title:"MIT License",description:"Free and open-source software"})]})]}),d.jsxs("div",{className:"mb-8",children:[d.jsx("h2",{className:"text-sm font-bold mb-3",children:"Frequently Asked Questions"}),d.jsx("div",{className:"space-y-4",children:Ble.map((t,e)=>d.jsxs("div",{className:"p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[d.jsx("p",{className:"text-sm font-bold mb-1.5",children:t.q}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] leading-relaxed",children:t.a})]},e))})]}),d.jsxs("div",{className:"mb-8",children:[d.jsx("h2",{className:"text-sm font-bold mb-3",children:"Built With"}),d.jsx("div",{className:"flex flex-wrap gap-2",children:["React 18","Fastify 5","TypeScript","Tailwind CSS","Vite","CodeMirror 6","shadcn/ui"].map(t=>d.jsx("span",{className:"text-xs px-2.5 py-1 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:t},t))})]}),d.jsx("div",{className:"text-xs text-[var(--color-muted)] border-t border-[var(--color-border-subtle)] pt-4",children:d.jsxs("p",{children:["Made by ",d.jsx("a",{href:"https://github.com/jwhiteside",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--color-accent)] hover:underline",children:"Jonathan Whiteside"}),". Licensed under the MIT License."]})})]})}const Vle=[{key:"all",label:"All"},{key:"1-analysis",label:"Analysis"},{key:"2-planning",label:"Planning"},{key:"3-solutioning",label:"Solutioning"},{key:"4-implementation",label:"Implementation"},{key:"anytime",label:"Anytime"}];function Ule(t){if(t==="anytime")return"Anytime";if(t==="0-learning")return"Learning";const e=t.replace(/^\d+-/,"");return e.charAt(0).toUpperCase()+e.slice(1)}function Wle(){const[t,e]=j.useState([]),[n,r]=j.useState(!0),[i,s]=j.useState("all"),[l,c]=j.useState("all"),[u,f]=j.useState(""),[p,m]=j.useState([]);j.useEffect(()=>{fetch("/api/commands").then(v=>v.json()).then(v=>{e(v),r(!1)}).catch(()=>r(!1)),fetch("/api/overview").then(v=>v.json()).then(v=>{var S,k;m(((k=(S=v==null?void 0:v.sections)==null?void 0:S.ideConfigs)==null?void 0:k.ides)??[])}).catch(()=>{})},[]);const O=j.useMemo(()=>{const v=new Set;for(const S of t)S.module&&v.add(S.module);return Array.from(v).sort()},[t]),x=j.useMemo(()=>{let v=t;if(i!=="all"&&(v=v.filter(S=>S.phase===i)),l!=="all"&&(v=v.filter(S=>S.module===l)),u){const S=u.toLowerCase();v=v.filter(k=>k.name.toLowerCase().includes(S)||k.code.toLowerCase().includes(S)||k.description.toLowerCase().includes(S)||k.agentDisplayName.toLowerCase().includes(S))}return v},[t,i,l,u]);return n?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"Agent Triggers"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"Short codes used within active agent sessions to invoke workflows and actions."}),d.jsx("div",{className:"space-y-3",children:[1,2,3,4,5].map(v=>d.jsx("div",{className:"h-12 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"},v))})]}):t.length===0?d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"Agent Triggers"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"Short codes used within active agent sessions to invoke workflows and actions."}),d.jsx(Ci,{icon:TS,title:"No agent triggers found",description:"Agent triggers are short codes used within an active agent session (e.g. CP, DS, SP). They're populated from bmad-help.csv files in your installed modules. Install a module to populate this list.",actions:d.jsx(zt,{to:"/modules",className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Browse Modules"})})]}):d.jsxs("div",{children:[p.length>0?d.jsx("div",{className:"mb-6 rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-surface-raised)] p-4",children:d.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[d.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"IDE Sync"}),p.map(v=>d.jsxs("span",{className:"flex items-center gap-1.5 text-xs",children:[d.jsx(Sc,{size:12,className:"text-[var(--color-muted)]"}),d.jsx("span",{className:"font-bold",children:v}),d.jsx("span",{className:"w-2 h-2 rounded-full bg-[var(--color-success)]",title:"Triggers synced"})]},v))]}),d.jsx(zt,{to:"/connections",className:"text-xs text-[var(--color-accent)] hover:underline shrink-0",children:"Manage IDEs →"})]})}):d.jsxs("div",{className:"mb-6 flex items-start gap-3 rounded-lg border border-[var(--color-warning)]/30 bg-[var(--color-warning)]/5 p-4",children:[d.jsx(Us,{size:16,className:"text-[var(--color-warning)] shrink-0 mt-0.5"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-bold text-[var(--color-text)]",children:"No IDEs configured"}),d.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-0.5",children:"Configure an IDE connection so these agent triggers are available in your editor."})]}),d.jsx(zt,{to:"/connections",className:"text-xs text-[var(--color-accent)] hover:underline shrink-0",children:"Configure →"})]}),d.jsxs("div",{className:"mb-6",children:[d.jsxs("div",{className:"flex items-center gap-4 flex-wrap mb-2",children:[d.jsxs("h1",{className:"text-2xl font-extrabold shrink-0",children:["Agent Triggers (",t.length,")"]}),O.length>0&&d.jsxs("div",{className:"flex gap-1 flex-wrap",children:[d.jsx("button",{onClick:()=>c("all"),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${l==="all"?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"All"}),O.map(v=>d.jsx("button",{onClick:()=>c(v),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${l===v?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:v},v))]}),d.jsx("div",{className:"flex items-center gap-3 ml-auto shrink-0",children:d.jsxs("div",{className:"relative",children:[d.jsx(hs,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),d.jsx("input",{type:"text",placeholder:"Search triggers...",value:u,onChange:v=>f(v.target.value),className:"pl-9 pr-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-text)] placeholder:text-[var(--color-muted)] outline-none focus:border-[var(--color-accent)] w-64"})]})})]}),d.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-6",children:"Short codes used within active agent sessions to invoke workflows and actions."}),d.jsx("div",{className:"flex gap-1 flex-wrap mt-4",children:Vle.map(v=>d.jsx("button",{onClick:()=>s(v.key),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${i===v.key?"bg-[var(--color-accent)] text-white font-bold":"bg-[var(--color-surface-raised)] text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:v.label},v.key))}),x.length!==t.length&&d.jsxs("p",{className:"text-xs text-[var(--color-muted)] mt-3",children:["Showing ",x.length," of ",t.length," triggers"]})]}),d.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--color-border-subtle)]",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"bg-[var(--color-surface-raised)] border-b border-[var(--color-border-subtle)]",children:[d.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Code"}),d.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Name"}),d.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Phase"}),d.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Agent"}),d.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Required"}),d.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Description"})]})}),d.jsx("tbody",{children:x.map(v=>{var k,w;const S=((w=(k=v.agentTitle)==null?void 0:k.match(new RegExp("\\p{Emoji_Presentation}","u")))==null?void 0:w[0])??"";return d.jsxs("tr",{className:`border-b border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors ${v.required?"bg-[var(--color-accent)]/3":""}`,children:[d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:`font-[var(--font-mono)] font-bold ${v.required?"text-[var(--color-accent)]":""}`,children:v.code})}),d.jsx("td",{className:"px-4 py-3 font-bold",children:v.name}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:Ule(v.phase)})}),d.jsx("td",{className:"px-4 py-3",children:v.agentDisplayName&&d.jsxs("span",{className:"flex items-center gap-1.5",children:[S&&d.jsx("span",{className:"text-sm leading-none",role:"img",children:S}),d.jsx("span",{className:"text-[var(--color-text)]",children:v.agentDisplayName})]})}),d.jsx("td",{className:"px-4 py-3",children:v.required?d.jsx("span",{className:"text-xs font-bold text-[var(--color-accent)]",children:"Required"}):d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:"Optional"})}),d.jsx("td",{className:"px-4 py-3 text-[var(--color-muted)] max-w-md",children:d.jsx("span",{className:"line-clamp-2",children:v.description})})]},`${v.code}-${v.module}`)})})]})}),x.length===0&&d.jsx("div",{className:"text-center py-12 text-[var(--color-muted)]",children:d.jsx("p",{className:"text-sm",children:"No triggers match your filters."})})]})}function Gle(){const t=ds(),{data:e,isLoading:n}=lR(),{data:r,isLoading:i}=Zw(),{data:s,isLoading:l}=XS(),{data:c,isLoading:u}=ZS(),[f,p]=cs("skill"),[m,O]=cs("workflow"),[x,v]=j.useState("all"),[S,k]=j.useState("all"),[w,N]=j.useState(""),C=n||i||l||u,E=j.useMemo(()=>{const L=[];for(const Z of e??[])L.push({kind:"agent",id:Z.id,name:Z.name,title:Z.title,icon:Z.icon,description:Z.role,module:Z.module,invoke:`/${Z.name}`});for(const Z of r??[])L.push({kind:"skill",id:Z.id,name:Z.name,description:Z.description,module:Z.module,invoke:`/${Z.id}`});for(const Z of s??[])L.push({kind:"workflow",id:Z.id,name:Z.name,description:Z.description??"",module:Z.module,invoke:Z.id});for(const Z of c??[])L.push({kind:"team",id:Z.id,name:Z.name,icon:Z.icon,description:Z.description,module:Z.module,invoke:Z.name});return L},[e,r,s,c]),M=j.useMemo(()=>{const L=new Set;for(const Z of E)Z.module&&L.add(Z.module);return Array.from(L).sort()},[E]),R=j.useMemo(()=>{const L=w.toLowerCase();return E.filter(Z=>x!=="all"&&Z.kind!==x||S!=="all"&&Z.module!==S?!1:L?Z.name.toLowerCase().includes(L)||(Z.title??"").toLowerCase().includes(L)||Z.description.toLowerCase().includes(L):!0)},[E,x,S,w]),_=j.useMemo(()=>{const L=w.toLowerCase();return E.filter(Z=>S!=="all"&&Z.module!==S?!1:L?Z.name.toLowerCase().includes(L)||(Z.title??"").toLowerCase().includes(L)||Z.description.toLowerCase().includes(L):!0)},[E,S,w]),V=j.useMemo(()=>({all:_.length,agent:_.filter(L=>L.kind==="agent").length,skill:_.filter(L=>L.kind==="skill").length,workflow:_.filter(L=>L.kind==="workflow").length,team:_.filter(L=>L.kind==="team").length}),[_]);function G(L){L.kind==="agent"?t(`/agents/${L.id}`):L.kind==="skill"?p(L.id):L.kind==="team"?t(`/teams/${L.id}`):O(L.id)}const D={agent:{label:"Agent",colorClass:"text-[var(--color-accent)] bg-blue-500/10",Icon:Tn},skill:{label:"Skill",colorClass:"text-[var(--color-success)] bg-green-500/10",Icon:Si},workflow:{label:"Workflow",colorClass:"text-purple-400 bg-purple-500/10",Icon:Or},team:{label:"Team",colorClass:"text-amber-400 bg-amber-500/10",Icon:Kg}};return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[d.jsx(yh,{size:22,className:"text-[var(--color-accent)]"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-extrabold",children:"Toolkit"}),d.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"Browse all agents, skills, workflows, and teams across your installed modules."})]})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-6",children:[d.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[d.jsx(hs,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),d.jsx("input",{type:"text",value:w,onChange:L=>N(L.target.value),placeholder:"Filter...",className:"w-full pl-8 pr-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),d.jsx("div",{className:"flex gap-1 bg-[var(--color-surface-raised)] rounded-md p-0.5",children:["all","agent","skill","workflow","team"].map(L=>d.jsx("button",{onClick:()=>v(L),className:`px-3 py-1.5 text-sm rounded transition-colors ${x===L?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:L==="all"?`All (${V.all})`:L==="agent"?`Agents (${V.agent})`:L==="skill"?`Skills (${V.skill})`:L==="workflow"?`Workflows (${V.workflow})`:`Teams (${V.team})`},L))}),M.length>0&&d.jsxs("select",{value:S,onChange:L=>k(L.target.value),className:"px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-text)] focus:border-[var(--color-accent)] focus:outline-none",children:[d.jsx("option",{value:"all",children:"All modules"}),M.map(L=>d.jsx("option",{value:L,children:L},L))]})]}),C?d.jsx(cR,{count:8}):R.length===0?d.jsx("div",{className:"py-16 text-center text-sm text-[var(--color-muted)]",children:"No items match the current filters"}):d.jsx(DS,{children:R.map(L=>{const Z=D[L.kind],te=Z.Icon;return d.jsxs(PS,{onClick:()=>G(L),children:[d.jsx(RS,{icon:d.jsx(AS,{emoji:L.icon,fallbackIcon:d.jsx(te,{size:16})}),title:L.title||L.name,subtitle:L.title?L.name:void 0}),d.jsx(_S,{children:d.jsx(MS,{text:L.description})}),d.jsx(zS,{left:d.jsx("code",{className:"text-xs font-[var(--font-mono)] text-[var(--color-accent)] bg-[var(--color-bg)] border border-[var(--color-border-subtle)] px-1.5 py-0.5 rounded truncate max-w-[60%]",children:L.invoke}),right:d.jsxs("div",{className:"flex items-center gap-1.5",children:[L.module&&d.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:L.module}),d.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded font-bold uppercase ${Z.colorClass}`,children:Z.label})]})})]},`${L.kind}-${L.id}`)})}),f&&d.jsx(iD,{skillId:f,onClose:()=>p(null)}),m&&d.jsx(sD,{workflowId:m,onClose:()=>O(null)})]})}const Fle=new I6({defaultOptions:{queries:{staleTime:3e4,retry:1}}});function Hle(){return d.jsx(B6,{client:Fle,children:d.jsx(rq,{children:d.jsx(o6,{children:d.jsx(zZ,{children:d.jsxs(gn,{element:d.jsx(SB,{}),children:[d.jsx(gn,{index:!0,element:d.jsx(EB,{})}),d.jsx(gn,{path:"agents",element:d.jsx(_B,{})}),d.jsx(gn,{path:"agents/:id",element:d.jsx(lae,{})}),d.jsx(gn,{path:"agents/:id/override",element:d.jsx(oae,{})}),d.jsx(gn,{path:"teams",element:d.jsx(hae,{})}),d.jsx(gn,{path:"skills",element:d.jsx(xae,{})}),d.jsx(gn,{path:"workflows",element:d.jsx(Eae,{})}),d.jsx(gn,{path:"outputs",element:d.jsx(Lae,{})}),d.jsx(gn,{path:"connections",element:d.jsx(Bae,{})}),d.jsx(gn,{path:"workspace",element:d.jsx(ele,{})}),d.jsx(gn,{path:"modules",element:d.jsx(Dle,{})}),d.jsx(gn,{path:"files",element:d.jsx(Zle,{})}),d.jsx(gn,{path:"toolkit",element:d.jsx(Gle,{})}),d.jsx(gn,{path:"commands",element:d.jsx(Wle,{})}),d.jsx(gn,{path:"settings",element:d.jsx(qle,{})}),d.jsx(gn,{path:"about",element:d.jsx(Yle,{})})]})})})})})}rR(eB());zX.createRoot(document.getElementById("root")).render(d.jsx(j.StrictMode,{children:d.jsx(Hle,{})}));
|